From ebee3d00395d2dcf6137edf82f864c2e3a62657e Mon Sep 17 00:00:00 2001 From: nhauge Date: Wed, 20 Jun 2007 03:29:05 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v200706190000'. --- assembly/features/org.eclipse.jpt.sdk/.cvsignore | 4 - assembly/features/org.eclipse.jpt.sdk/.project | 17 - .../features/org.eclipse.jpt.sdk/build.properties | 15 - .../org.eclipse.jpt.sdk/eclipse_update_120.jpg | Bin 21695 -> 0 bytes assembly/features/org.eclipse.jpt.sdk/epl-v10.html | 328 - .../org.eclipse.jpt.sdk/feature.properties | 145 - assembly/features/org.eclipse.jpt.sdk/feature.xml | 38 - assembly/features/org.eclipse.jpt.sdk/license.html | 98 - assembly/features/org.eclipse.jpt.tests/.cvsignore | 2 - assembly/features/org.eclipse.jpt.tests/.project | 17 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../org.eclipse.jpt.tests/build.properties | 5 - .../org.eclipse.jpt.tests/eclipse_update_120.jpg | Bin 21695 -> 0 bytes .../features/org.eclipse.jpt.tests/epl-v10.html | 328 - .../org.eclipse.jpt.tests/feature.properties | 145 - .../features/org.eclipse.jpt.tests/feature.xml | 28 - .../features/org.eclipse.jpt.tests/license.html | 98 - assembly/features/org.eclipse.jpt/.cvsignore | 2 - assembly/features/org.eclipse.jpt/.project | 17 - assembly/features/org.eclipse.jpt/build.properties | 16 - .../org.eclipse.jpt/eclipse_update_120.jpg | Bin 21695 -> 0 bytes assembly/features/org.eclipse.jpt/epl-v10.html | 328 - .../features/org.eclipse.jpt/feature.properties | 144 - assembly/features/org.eclipse.jpt/feature.xml | 38 - assembly/features/org.eclipse.jpt/license.html | 93 - assembly/plugins/org.eclipse.jpt/.cvsignore | 3 - assembly/plugins/org.eclipse.jpt/.project | 22 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../plugins/org.eclipse.jpt/META-INF/MANIFEST.MF | 7 - assembly/plugins/org.eclipse.jpt/about.html | 34 - assembly/plugins/org.eclipse.jpt/about.ini | 44 - assembly/plugins/org.eclipse.jpt/about.mappings | 6 - assembly/plugins/org.eclipse.jpt/about.properties | 24 - assembly/plugins/org.eclipse.jpt/build.properties | 19 - assembly/plugins/org.eclipse.jpt/component.xml | 12 - assembly/plugins/org.eclipse.jpt/eclipse32.gif | Bin 1706 -> 0 bytes assembly/plugins/org.eclipse.jpt/eclipse32.png | Bin 4594 -> 0 bytes assembly/plugins/org.eclipse.jpt/plugin.properties | 13 - .../org.eclipse.jpt.tests.feature/.project | 17 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../org.eclipse.jpt.tests.feature/build.properties | 10 - .../eclipse_update_120.jpg | Bin 21695 -> 0 bytes .../org.eclipse.jpt.tests.feature/epl-v10.html | 328 - .../feature.properties | 145 - .../org.eclipse.jpt.tests.feature/feature.xml | 32 - .../org.eclipse.jpt.tests.feature/license.html | 98 - jpa/features/org.eclipse.jpt_sdk.feature/.project | 17 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../org.eclipse.jpt_sdk.feature/build.properties | 9 - .../eclipse_update_120.jpg | Bin 21695 -> 0 bytes .../org.eclipse.jpt_sdk.feature/epl-v10.html | 328 - .../org.eclipse.jpt_sdk.feature/feature.properties | 140 - .../org.eclipse.jpt_sdk.feature/feature.xml | 28 - .../org.eclipse.jpt_sdk.feature/license.html | 98 - jpa/plugins/org.eclipse.jpt.core/.classpath | 8 - jpa/plugins/org.eclipse.jpt.core/.cvsignore | 2 - jpa/plugins/org.eclipse.jpt.core/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 12 - .../org.eclipse.jpt.core/META-INF/MANIFEST.MF | 57 - jpa/plugins/org.eclipse.jpt.core/about.html | 34 - jpa/plugins/org.eclipse.jpt.core/build.properties | 23 - jpa/plugins/org.eclipse.jpt.core/component.xml | 1 - .../model/DaliEmfFormatter.xml | 264 - jpa/plugins/org.eclipse.jpt.core/model/core.ecore | 577 -- .../org.eclipse.jpt.core/model/coreModels.genmodel | 694 -- jpa/plugins/org.eclipse.jpt.core/model/java.ecore | 88 - .../org.eclipse.jpt.core/model/javaModel.ecore | 353 - .../org.eclipse.jpt.core/model/javaModel.genmodel | 173 - jpa/plugins/org.eclipse.jpt.core/model/orm.ecore | 282 - .../org.eclipse.jpt.core/model/persistence.ecore | 70 - jpa/plugins/org.eclipse.jpt.core/plugin.properties | 39 - jpa/plugins/org.eclipse.jpt.core/plugin.xml | 186 - .../property_files/jpa_core.properties | 21 - .../property_files/jpa_validation.properties | 66 - .../org.eclipse.jpt.core/schema/jpaPlatform.exsd | 122 - .../org/eclipse/jpt/core/internal/AccessType.java | 241 - .../jpt/core/internal/IAttributeMapping.java | 71 - .../eclipse/jpt/core/internal/IJpaContentNode.java | 49 - .../jpt/core/internal/IJpaCoreConstants.java | 28 - .../eclipse/jpt/core/internal/IJpaDataSource.java | 37 - .../org/eclipse/jpt/core/internal/IJpaEObject.java | 39 - .../org/eclipse/jpt/core/internal/IJpaFile.java | 56 - .../jpt/core/internal/IJpaFileContentProvider.java | 40 - .../org/eclipse/jpt/core/internal/IJpaModel.java | 40 - .../eclipse/jpt/core/internal/IJpaPlatform.java | 148 - .../org/eclipse/jpt/core/internal/IJpaProject.java | 137 - .../jpt/core/internal/IJpaRootContentNode.java | 64 - .../jpt/core/internal/IJpaSourceObject.java | 32 - .../eclipse/jpt/core/internal/IMappingKeys.java | 30 - .../jpt/core/internal/IPersistentAttribute.java | 117 - .../eclipse/jpt/core/internal/IPersistentType.java | 119 - .../org/eclipse/jpt/core/internal/ITextRange.java | 109 - .../eclipse/jpt/core/internal/ITypeMapping.java | 135 - .../org/eclipse/jpt/core/internal/IXmlEObject.java | 24 - .../eclipse/jpt/core/internal/JpaCoreFactory.java | 209 - .../eclipse/jpt/core/internal/JpaCorePackage.java | 1819 ---- .../eclipse/jpt/core/internal/JpaDataSource.java | 276 - .../org/eclipse/jpt/core/internal/JpaEObject.java | 143 - .../src/org/eclipse/jpt/core/internal/JpaFile.java | 337 - .../jpt/core/internal/JpaFileContentRegistry.java | 65 - .../org/eclipse/jpt/core/internal/JpaModel.java | 264 - .../eclipse/jpt/core/internal/JpaModelManager.java | 551 - .../jpt/core/internal/JpaPlatformRegistry.java | 190 - .../org/eclipse/jpt/core/internal/JpaProject.java | 793 -- .../core/internal/JpaProjectAdapterFactory.java | 42 - .../eclipse/jpt/core/internal/JptCoreMessages.java | 47 - .../eclipse/jpt/core/internal/JptCorePlugin.java | 138 - .../eclipse/jpt/core/internal/NullTypeMapping.java | 265 - .../eclipse/jpt/core/internal/SimpleTextRange.java | 82 - .../org/eclipse/jpt/core/internal/XmlEObject.java | 287 - .../content/java/IJavaAttributeMapping.java | 50 - .../java/IJavaAttributeMappingProvider.java | 30 - .../internal/content/java/IJavaContentNodes.java | 24 - .../internal/content/java/IJavaTypeMapping.java | 44 - .../content/java/IJavaTypeMappingProvider.java | 27 - .../core/internal/content/java/JavaEObject.java | 127 - .../content/java/JavaJpaFileContentProvider.java | 37 - .../content/java/JavaPersistentAttribute.java | 649 -- .../internal/content/java/JavaPersistentType.java | 939 -- .../internal/content/java/JpaCompilationUnit.java | 454 - .../core/internal/content/java/JpaJavaFactory.java | 139 - .../core/internal/content/java/JpaJavaPackage.java | 787 -- .../content/java/mappings/AbstractJavaColumn.java | 695 -- .../content/java/mappings/AbstractJavaTable.java | 1114 --- .../java/mappings/IntAnnotationElementAdapter.java | 100 - .../core/internal/content/java/mappings/JPA.java | 294 - .../content/java/mappings/JavaAbstractQuery.java | 631 -- .../java/mappings/JavaAssociationOverride.java | 506 - .../java/mappings/JavaAttributeMapping.java | 170 - .../java/mappings/JavaAttributeOverride.java | 268 - .../internal/content/java/mappings/JavaBasic.java | 938 -- .../content/java/mappings/JavaBasicProvider.java | 228 - .../content/java/mappings/JavaCascade.java | 583 -- .../internal/content/java/mappings/JavaColumn.java | 453 - .../java/mappings/JavaDiscriminatorColumn.java | 451 - .../content/java/mappings/JavaEmbeddable.java | 64 - .../java/mappings/JavaEmbeddableProvider.java | 54 - .../content/java/mappings/JavaEmbedded.java | 577 -- .../content/java/mappings/JavaEmbeddedId.java | 64 - .../java/mappings/JavaEmbeddedIdProvider.java | 59 - .../java/mappings/JavaEmbeddedProvider.java | 73 - .../internal/content/java/mappings/JavaEntity.java | 3000 ------ .../content/java/mappings/JavaEntityProvider.java | 54 - .../content/java/mappings/JavaGeneratedValue.java | 347 - .../content/java/mappings/JavaGenerator.java | 570 -- .../internal/content/java/mappings/JavaId.java | 767 -- .../content/java/mappings/JavaIdProvider.java | 59 - .../content/java/mappings/JavaJoinColumn.java | 517 - .../content/java/mappings/JavaJoinTable.java | 822 -- .../content/java/mappings/JavaManyToMany.java | 98 - .../java/mappings/JavaManyToManyProvider.java | 59 - .../content/java/mappings/JavaManyToOne.java | 95 - .../java/mappings/JavaManyToOneProvider.java | 59 - .../java/mappings/JavaMappedSuperclass.java | 330 - .../mappings/JavaMappedSuperclassProvider.java | 54 - .../mappings/JavaMultiRelationshipMapping.java | 811 -- .../content/java/mappings/JavaNamedColumn.java | 528 - .../java/mappings/JavaNamedNativeQuery.java | 354 - .../content/java/mappings/JavaNamedQuery.java | 76 - .../java/mappings/JavaNullAttributeMapping.java | 57 - .../mappings/JavaNullAttributeMappingProvider.java | 60 - .../content/java/mappings/JavaNullTypeMapping.java | 62 - .../java/mappings/JavaNullTypeMappingProvider.java | 55 - .../content/java/mappings/JavaOneToMany.java | 98 - .../java/mappings/JavaOneToManyProvider.java | 59 - .../content/java/mappings/JavaOneToOne.java | 328 - .../java/mappings/JavaOneToOneProvider.java | 59 - .../content/java/mappings/JavaOverride.java | 331 - .../java/mappings/JavaPrimaryKeyJoinColumn.java | 474 - .../content/java/mappings/JavaQueryHint.java | 384 - .../java/mappings/JavaRelationshipMapping.java | 687 -- .../content/java/mappings/JavaSecondaryTable.java | 553 - .../java/mappings/JavaSequenceGenerator.java | 348 - .../mappings/JavaSingleRelationshipMapping.java | 686 -- .../internal/content/java/mappings/JavaTable.java | 88 - .../content/java/mappings/JavaTableGenerator.java | 1350 --- .../content/java/mappings/JavaTransient.java | 59 - .../java/mappings/JavaTransientProvider.java | 59 - .../content/java/mappings/JavaTypeMapping.java | 264 - .../java/mappings/JavaUniqueConstraint.java | 369 - .../content/java/mappings/JavaVersion.java | 396 - .../content/java/mappings/JavaVersionProvider.java | 59 - .../java/mappings/JpaJavaMappingsFactory.java | 499 - .../java/mappings/JpaJavaMappingsPackage.java | 5109 ---------- .../util/JpaJavaMappingsAdapterFactory.java | 1944 ---- .../java/mappings/util/JpaJavaMappingsSwitch.java | 2541 ----- .../content/java/util/JpaJavaAdapterFactory.java | 404 - .../internal/content/java/util/JpaJavaSwitch.java | 444 - .../internal/content/orm/AbstractXmlColumn.java | 921 -- .../content/orm/AbstractXmlNamedColumn.java | 476 - .../internal/content/orm/AbstractXmlQuery.java | 353 - .../internal/content/orm/AbstractXmlTable.java | 984 -- .../core/internal/content/orm/EntityMappings.java | 76 - .../internal/content/orm/EntityMappingsForXml.java | 84 - .../content/orm/EntityMappingsInternal.java | 1681 ---- .../content/orm/IXmlAttributeMappingProvider.java | 17 - .../internal/content/orm/IXmlColumnMapping.java | 73 - .../internal/content/orm/IXmlContentNodes.java | 26 - .../content/orm/IXmlTypeMappingProvider.java | 18 - .../jpt/core/internal/content/orm/OrmFactory.java | 698 -- .../jpt/core/internal/content/orm/OrmInit.java | 56 - .../jpt/core/internal/content/orm/OrmPackage.java | 10017 ------------------- .../content/orm/OrmXmlJpaFileContentProvider.java | 100 - .../core/internal/content/orm/OrmXmlResource.java | 20 - .../content/orm/PersistenceUnitDefaults.java | 143 - .../content/orm/PersistenceUnitDefaultsForXml.java | 143 - .../orm/PersistenceUnitDefaultsInternal.java | 951 -- .../content/orm/PersistenceUnitMetadata.java | 74 - .../content/orm/PersistenceUnitMetadataForXml.java | 85 - .../orm/PersistenceUnitMetadataInternal.java | 533 - .../content/orm/XmlAssociationOverride.java | 281 - .../internal/content/orm/XmlAttributeMapping.java | 379 - .../internal/content/orm/XmlAttributeOverride.java | 327 - .../jpt/core/internal/content/orm/XmlBasic.java | 704 -- .../internal/content/orm/XmlBasicProvider.java | 40 - .../jpt/core/internal/content/orm/XmlCascade.java | 488 - .../jpt/core/internal/content/orm/XmlColumn.java | 662 -- .../content/orm/XmlDiscriminatorColumn.java | 519 - .../core/internal/content/orm/XmlEmbeddable.java | 80 - .../content/orm/XmlEmbeddableProvider.java | 25 - .../jpt/core/internal/content/orm/XmlEmbedded.java | 381 - .../core/internal/content/orm/XmlEmbeddedId.java | 65 - .../content/orm/XmlEmbeddedIdProvider.java | 40 - .../internal/content/orm/XmlEmbeddedProvider.java | 40 - .../jpt/core/internal/content/orm/XmlEntity.java | 65 - .../core/internal/content/orm/XmlEntityForXml.java | 138 - .../internal/content/orm/XmlEntityInternal.java | 2177 ---- .../internal/content/orm/XmlEntityProvider.java | 24 - .../internal/content/orm/XmlGeneratedValue.java | 297 - .../core/internal/content/orm/XmlGenerator.java | 490 - .../jpt/core/internal/content/orm/XmlId.java | 682 -- .../jpt/core/internal/content/orm/XmlIdClass.java | 214 - .../core/internal/content/orm/XmlIdProvider.java | 40 - .../core/internal/content/orm/XmlInheritance.java | 214 - .../core/internal/content/orm/XmlJoinColumn.java | 457 - .../core/internal/content/orm/XmlJoinTable.java | 511 - .../core/internal/content/orm/XmlManyToMany.java | 68 - .../content/orm/XmlManyToManyProvider.java | 40 - .../core/internal/content/orm/XmlManyToOne.java | 66 - .../internal/content/orm/XmlManyToOneProvider.java | 41 - .../jpt/core/internal/content/orm/XmlMapKey.java | 209 - .../internal/content/orm/XmlMappedSuperclass.java | 422 - .../content/orm/XmlMappedSuperclassProvider.java | 24 - .../content/orm/XmlMultiRelationshipMapping.java | 24 - .../orm/XmlMultiRelationshipMappingForXml.java | 83 - .../orm/XmlMultiRelationshipMappingInternal.java | 846 -- .../internal/content/orm/XmlNamedNativeQuery.java | 281 - .../core/internal/content/orm/XmlNamedQuery.java | 45 - .../content/orm/XmlNullAttributeMapping.java | 58 - .../core/internal/content/orm/XmlOneToMany.java | 66 - .../internal/content/orm/XmlOneToManyProvider.java | 40 - .../jpt/core/internal/content/orm/XmlOneToOne.java | 263 - .../internal/content/orm/XmlOneToOneProvider.java | 40 - .../jpt/core/internal/content/orm/XmlOverride.java | 232 - .../content/orm/XmlPersistentAttribute.java | 365 - .../internal/content/orm/XmlPersistentType.java | 1025 -- .../content/orm/XmlPrimaryKeyJoinColumn.java | 431 - .../core/internal/content/orm/XmlQueryHint.java | 281 - .../content/orm/XmlRelationshipMapping.java | 582 -- .../internal/content/orm/XmlRootContentNode.java | 351 - .../internal/content/orm/XmlSecondaryTable.java | 286 - .../internal/content/orm/XmlSequenceGenerator.java | 281 - .../content/orm/XmlSingleRelationshipMapping.java | 483 - .../jpt/core/internal/content/orm/XmlTable.java | 70 - .../internal/content/orm/XmlTableGenerator.java | 1070 -- .../core/internal/content/orm/XmlTransient.java | 60 - .../internal/content/orm/XmlTransientProvider.java | 40 - .../core/internal/content/orm/XmlTypeMapping.java | 683 -- .../internal/content/orm/XmlUniqueConstraint.java | 193 - .../jpt/core/internal/content/orm/XmlVersion.java | 387 - .../internal/content/orm/XmlVersionProvider.java | 40 - .../orm/resource/AbstractColumnTranslator.java | 71 - .../orm/resource/AbstractTableTranslator.java | 59 - .../orm/resource/AccessTypeElementTranslator.java | 58 - .../resource/AssociationOverrideTranslator.java | 86 - .../resource/AssociationOverridesTranslator.java | 74 - .../orm/resource/AttributeMappingTranslator.java | 50 - .../orm/resource/AttributeMappingsTranslator.java | 139 - .../orm/resource/AttributeNameTranslator.java | 27 - .../orm/resource/AttributeOverrideTranslator.java | 70 - .../orm/resource/AttributeOverridesTranslator.java | 75 - .../content/orm/resource/BasicTranslator.java | 83 - .../orm/resource/BooleanEnumeratorTranslator.java | 23 - .../content/orm/resource/CascadeTranslator.java | 75 - .../content/orm/resource/ColumnTranslator.java | 68 - .../content/orm/resource/DebugTranslator.java | 431 - .../resource/DiscriminatorColumnTranslator.java | 58 - .../content/orm/resource/EmbeddableTranslator.java | 45 - .../content/orm/resource/EmbeddedIdTranslator.java | 41 - .../content/orm/resource/EmbeddedTranslator.java | 57 - .../orm/resource/EmptyTagBooleanTranslator.java | 52 - .../orm/resource/EntityMappingsTranslator.java | 116 - .../content/orm/resource/EntityTranslator.java | 189 - .../resource/EnumeratedTypeElementTranslator.java | 58 - .../content/orm/resource/EnumeratorTranslator.java | 42 - .../orm/resource/GeneratedValueTranslator.java | 60 - .../content/orm/resource/GeneratorTranslator.java | 52 - .../content/orm/resource/IdClassTranslator.java | 52 - .../content/orm/resource/IdTranslator.java | 70 - .../orm/resource/InheritanceTranslator.java | 52 - .../content/orm/resource/JoinColumnTranslator.java | 54 - .../content/orm/resource/JoinTableTranslator.java | 87 - .../content/orm/resource/ManyToManyTranslator.java | 44 - .../content/orm/resource/ManyToOneTranslator.java | 39 - .../content/orm/resource/MapKeyTranslator.java | 53 - .../orm/resource/MappedSuperclassTranslator.java | 58 - .../resource/MultiObjectDependencyTranslator.java | 67 - .../orm/resource/MultiRelationshipTranslator.java | 48 - .../orm/resource/NamedNativeQueryTranslator.java | 77 - .../content/orm/resource/NamedQueryTranslator.java | 67 - .../content/orm/resource/OneToManyTranslator.java | 43 - .../content/orm/resource/OneToOneTranslator.java | 47 - .../content/orm/resource/OrderByTranslator.java | 20 - .../content/orm/resource/OrmXmlMapper.java | 181 - .../orm/resource/OrmXmlResourceFactory.java | 59 - .../content/orm/resource/OrmXmlResourceImpl.java | 86 - .../PersistenceUnitDefaultsTranslator.java | 100 - .../PersistenceUnitMetadataTranslator.java | 84 - .../resource/PrimaryKeyJoinColumnTranslator.java | 49 - .../content/orm/resource/QueryHintTranslator.java | 63 - .../orm/resource/RelationshipTranslator.java | 33 - .../orm/resource/SecondaryTableTranslator.java | 74 - .../orm/resource/SecondaryTablesTranslator.java | 93 - .../orm/resource/SequenceGeneratorTranslator.java | 42 - .../orm/resource/SingleRelationshipTranslator.java | 59 - .../orm/resource/TableGeneratorTranslator.java | 72 - .../content/orm/resource/TableTranslator.java | 52 - .../resource/TemporalTypeElementTranslator.java | 58 - .../content/orm/resource/TransientTranslator.java | 36 - .../orm/resource/TypeJavaClassTranslator.java | 28 - .../orm/resource/TypeMappingTranslator.java | 64 - .../orm/resource/TypeMappingsTranslator.java | 107 - .../orm/resource/UniqueConstraintTranslator.java | 55 - .../content/orm/resource/VersionTranslator.java | 36 - .../content/orm/util/OrmAdapterFactory.java | 2384 ----- .../core/internal/content/orm/util/OrmSwitch.java | 3244 ------ .../internal/content/persistence/JavaClassRef.java | 208 - .../content/persistence/MappingFileRef.java | 219 - .../internal/content/persistence/Persistence.java | 348 - .../content/persistence/PersistenceFactory.java | 278 - .../content/persistence/PersistenceInit.java | 55 - .../content/persistence/PersistencePackage.java | 1378 --- .../content/persistence/PersistenceUnit.java | 877 -- .../PersistenceUnitTransactionType.java | 210 - .../PersistenceXmlJpaFileContentProvider.java | 102 - .../persistence/PersistenceXmlRootContentNode.java | 358 - .../internal/content/persistence/Properties.java | 157 - .../internal/content/persistence/Property.java | 237 - .../persistence/resource/BooleanTranslator.java | 32 - .../resource/IPersistenceXmlContentNodes.java | 17 - .../resource/JavaClassRefTranslator.java | 43 - .../resource/MappingFileTranslator.java | 43 - .../persistence/resource/PersistenceResource.java | 75 - .../resource/PersistenceTranslator.java | 143 - .../persistence/resource/PersistenceXMLMapper.java | 38 - .../resource/PersistenceXmlResourceFactory.java | 58 - .../resource/TransactionTypeTranslator.java | 36 - .../util/PersistenceAdapterFactory.java | 384 - .../persistence/util/PersistenceSwitch.java | 455 - .../jpt/core/internal/emfutility/DOMUtilities.java | 24 - .../facet/IJpaFacetDataModelProperties.java | 56 - .../internal/facet/JpaFacetDataModelProvider.java | 195 - .../internal/facet/JpaFacetInstallDelegate.java | 79 - .../facet/JpaFacetPostInstallDelegate.java | 141 - .../internal/facet/JpaFacetUninstallDelegate.java | 52 - .../jpt/core/internal/facet/JpaFacetUtils.java | 139 - .../core/internal/jdtutility/ASTNodeTextRange.java | 81 - .../jdtutility/AbstractAnnotationAdapter.java | 169 - .../AbstractDeclarationAnnotationAdapter.java | 148 - .../jdtutility/AbstractExpressionConverter.java | 54 - ...AbstractNestedDeclarationAnnotationAdapter.java | 420 - .../internal/jdtutility/AnnotationAdapter.java | 72 - .../jdtutility/AnnotationEditFormatter.java | 155 - .../jdtutility/AnnotationElementAdapter.java | 78 - .../jpt/core/internal/jdtutility/Attribute.java | 52 - .../jdtutility/AttributeAnnotationTools.java | 216 - .../jdtutility/BooleanAnnotationAdapter.java | 77 - .../BooleanStringExpressionConverter.java | 55 - .../CharacterStringExpressionConverter.java | 57 - ...inationIndexedDeclarationAnnotationAdapter.java | 490 - ...versionDeclarationAnnotationElementAdapter.java | 115 - .../jdtutility/DeclarationAnnotationAdapter.java | 64 - .../DeclarationAnnotationElementAdapter.java | 49 - ...umArrayDeclarationAnnotationElementAdapter.java | 130 - .../EnumDeclarationAnnotationElementAdapter.java | 104 - .../internal/jdtutility/ExpressionConverter.java | 37 - ...ressionDeclarationAnnotationElementAdapter.java | 359 - .../core/internal/jdtutility/FieldAttribute.java | 88 - .../jdtutility/IndexedAnnotationAdapter.java | 28 - .../IndexedDeclarationAnnotationAdapter.java | 28 - .../jpt/core/internal/jdtutility/JDTTools.java | 215 - .../jpt/core/internal/jdtutility/Member.java | 416 - .../jdtutility/MemberAnnotationAdapter.java | 24 - .../jdtutility/MemberAnnotationElementAdapter.java | 103 - .../jdtutility/MemberIndexedAnnotationAdapter.java | 70 - .../core/internal/jdtutility/MethodAttribute.java | 94 - .../internal/jdtutility/ModifiedDeclaration.java | 442 - .../jdtutility/NameStringExpressionConverter.java | 58 - .../NestedDeclarationAnnotationAdapter.java | 93 - .../NestedIndexedDeclarationAnnotationAdapter.java | 331 - .../NullDeclarationAnnotationAdapter.java | 80 - .../NullDeclarationAnnotationElementAdapter.java | 58 - .../jdtutility/NullExpressionConverter.java | 56 - .../NumberStringExpressionConverter.java | 55 - .../PrimitiveTypeStringExpressionConverter.java | 62 - .../ShortCircuitAnnotationElementAdapter.java | 109 - .../ShortCircuitArrayAnnotationElementAdapter.java | 40 - .../jdtutility/SimpleBooleanAnnotationAdapter.java | 85 - .../SimpleDeclarationAnnotationAdapter.java | 64 - .../SimpleTypeStringExpressionConverter.java | 64 - .../jdtutility/StringArrayExpressionConverter.java | 71 - .../jdtutility/StringExpressionConverter.java | 56 - .../eclipse/jpt/core/internal/jdtutility/Type.java | 75 - .../jpt/core/internal/mappings/CascadeType.java | 343 - .../internal/mappings/DefaultEagerFetchType.java | 265 - .../internal/mappings/DefaultFalseBoolean.java | 264 - .../internal/mappings/DefaultLazyFetchType.java | 265 - .../core/internal/mappings/DefaultTrueBoolean.java | 264 - .../core/internal/mappings/DiscriminatorType.java | 303 - .../jpt/core/internal/mappings/EnumType.java | 266 - .../jpt/core/internal/mappings/GenerationType.java | 331 - .../core/internal/mappings/IAbstractColumn.java | 211 - .../internal/mappings/IAbstractJoinColumn.java | 126 - .../internal/mappings/IAssociationOverride.java | 154 - .../core/internal/mappings/IAttributeOverride.java | 44 - .../eclipse/jpt/core/internal/mappings/IBasic.java | 193 - .../jpt/core/internal/mappings/ICascade.java | 162 - .../jpt/core/internal/mappings/IColumn.java | 119 - .../jpt/core/internal/mappings/IColumnMapping.java | 37 - .../internal/mappings/IDiscriminatorColumn.java | 157 - .../jpt/core/internal/mappings/IEmbeddable.java | 25 - .../jpt/core/internal/mappings/IEmbedded.java | 146 - .../jpt/core/internal/mappings/IEmbeddedId.java | 25 - .../jpt/core/internal/mappings/IEntity.java | 686 -- .../core/internal/mappings/IGeneratedValue.java | 93 - .../jpt/core/internal/mappings/IGenerator.java | 177 - .../eclipse/jpt/core/internal/mappings/IId.java | 163 - .../jpt/core/internal/mappings/IJoinColumn.java | 59 - .../jpt/core/internal/mappings/IJoinTable.java | 292 - .../jpt/core/internal/mappings/IManyToMany.java | 23 - .../jpt/core/internal/mappings/IManyToOne.java | 23 - .../core/internal/mappings/IMappedSuperclass.java | 57 - .../mappings/IMultiRelationshipMapping.java | 179 - .../jpt/core/internal/mappings/INamedColumn.java | 175 - .../core/internal/mappings/INamedNativeQuery.java | 84 - .../jpt/core/internal/mappings/INamedQuery.java | 25 - .../core/internal/mappings/INonOwningMapping.java | 65 - .../jpt/core/internal/mappings/IOneToMany.java | 23 - .../jpt/core/internal/mappings/IOneToOne.java | 24 - .../jpt/core/internal/mappings/IOverride.java | 80 - .../internal/mappings/IPrimaryKeyJoinColumn.java | 23 - .../eclipse/jpt/core/internal/mappings/IQuery.java | 104 - .../jpt/core/internal/mappings/IQueryHint.java | 84 - .../internal/mappings/IRelationshipMapping.java | 163 - .../core/internal/mappings/ISecondaryTable.java | 130 - .../core/internal/mappings/ISequenceGenerator.java | 87 - .../mappings/ISingleRelationshipMapping.java | 211 - .../eclipse/jpt/core/internal/mappings/ITable.java | 286 - .../core/internal/mappings/ITableGenerator.java | 428 - .../jpt/core/internal/mappings/ITransient.java | 25 - .../core/internal/mappings/IUniqueConstraint.java | 57 - .../jpt/core/internal/mappings/IVersion.java | 76 - .../core/internal/mappings/InheritanceType.java | 303 - .../internal/mappings/JpaCoreMappingsFactory.java | 373 - .../internal/mappings/JpaCoreMappingsPackage.java | 8741 ---------------- .../jpt/core/internal/mappings/OrderingType.java | 240 - .../mappings/RelationshipMappingTools.java | 42 - .../jpt/core/internal/mappings/TemporalType.java | 296 - .../util/JpaCoreMappingsAdapterFactory.java | 1004 -- .../mappings/util/JpaCoreMappingsSwitch.java | 1383 --- .../platform/AbstractJoinColumnContext.java | 56 - .../platform/AssociationOverrideContext.java | 130 - .../platform/AttributeOverrideContext.java | 145 - .../jpt/core/internal/platform/BaseContext.java | 59 - .../core/internal/platform/BaseJpaPlatform.java | 213 - .../internal/platform/BaseJpaProjectContext.java | 391 - .../jpt/core/internal/platform/ColumnContext.java | 32 - .../core/internal/platform/DefaultsContext.java | 30 - .../internal/platform/GeneratorRepository.java | 53 - .../jpt/core/internal/platform/IContext.java | 24 - .../internal/platform/IGeneratorRepository.java | 29 - .../internal/platform/JavaAttributeContext.java | 147 - .../core/internal/platform/JavaBasicContext.java | 73 - .../internal/platform/JavaEmbeddableContext.java | 18 - .../internal/platform/JavaEmbeddedContext.java | 85 - .../internal/platform/JavaEmbeddedIdContext.java | 25 - .../core/internal/platform/JavaEntityContext.java | 295 - .../jpt/core/internal/platform/JavaIdContext.java | 117 - .../internal/platform/JavaManyToManyContext.java | 18 - .../internal/platform/JavaManyToOneContext.java | 30 - .../platform/JavaMappedSuperclassContext.java | 21 - .../JavaMultiRelationshipMappingContext.java | 223 - .../platform/JavaNullAttributeMappingContext.java | 25 - .../platform/JavaNullTypeMappingContext.java | 24 - .../internal/platform/JavaOneToManyContext.java | 29 - .../internal/platform/JavaOneToOneContext.java | 94 - .../platform/JavaPersistentAttributeContext.java | 115 - .../platform/JavaRelationshipMappingContext.java | 51 - .../JavaSingleRelationshipMappingContext.java | 142 - .../internal/platform/JavaTransientContext.java | 25 - .../core/internal/platform/JavaTypeContext.java | 92 - .../core/internal/platform/JavaVersionContext.java | 73 - .../core/internal/platform/JoinColumnContext.java | 137 - .../core/internal/platform/JoinTableContext.java | 176 - .../core/internal/platform/MappingFileContext.java | 168 - .../internal/platform/NullGeneratorRepository.java | 41 - .../internal/platform/PersistenceUnitContext.java | 549 - .../platform/PrimaryKeyJoinColumnContext.java | 64 - .../internal/platform/SecondaryTableContext.java | 106 - .../jpt/core/internal/platform/TableContext.java | 81 - .../jpt/core/internal/platform/TypeContext.java | 20 - .../internal/platform/XmlAttributeContext.java | 185 - .../platform/XmlAttributeOverrideContext.java | 78 - .../core/internal/platform/XmlBasicContext.java | 124 - .../internal/platform/XmlEmbeddableContext.java | 18 - .../core/internal/platform/XmlEmbeddedContext.java | 132 - .../internal/platform/XmlEmbeddedIdContext.java | 21 - .../core/internal/platform/XmlEntityContext.java | 411 - .../jpt/core/internal/platform/XmlIdContext.java | 178 - .../internal/platform/XmlManyToManyContext.java | 22 - .../internal/platform/XmlManyToOneContext.java | 24 - .../platform/XmlMappedSuperclassContext.java | 19 - .../XmlMultiRelationshipMappingContext.java | 142 - .../platform/XmlNullAttributeMappingContext.java | 19 - .../internal/platform/XmlOneToManyContext.java | 29 - .../core/internal/platform/XmlOneToOneContext.java | 96 - .../platform/XmlRelationshipMappingContext.java | 80 - .../XmlSingleRelationshipMappingContext.java | 154 - .../internal/platform/XmlTransientContext.java | 22 - .../jpt/core/internal/platform/XmlTypeContext.java | 391 - .../core/internal/platform/XmlVersionContext.java | 129 - .../internal/platform/generic/GenericPlatform.java | 18 - .../internal/prefs/JpaPreferenceConstants.java | 17 - .../internal/prefs/JpaPreferenceInitializer.java | 32 - .../core/internal/synch/SynchronizeClassesJob.java | 191 - .../core/internal/util/JpaCoreAdapterFactory.java | 524 - .../jpt/core/internal/util/JpaCoreSwitch.java | 675 -- .../validation/IJpaValidationMessages.java | 127 - .../jpt/core/internal/validation/JpaHelper.java | 38 - .../internal/validation/JpaValidationMessages.java | 52 - .../jpt/core/internal/validation/JpaValidator.java | 54 - jpa/plugins/org.eclipse.jpt.db.ui/.classpath | 7 - jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore | 3 - jpa/plugins/org.eclipse.jpt.db.ui/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF | 14 - jpa/plugins/org.eclipse.jpt.db.ui/about.html | 34 - jpa/plugins/org.eclipse.jpt.db.ui/build.properties | 17 - jpa/plugins/org.eclipse.jpt.db.ui/component.xml | 1 - .../org.eclipse.jpt.db.ui/plugin.properties | 25 - .../org/eclipse/jpt/db/ui/internal/DTPUiTools.java | 99 - jpa/plugins/org.eclipse.jpt.db/.classpath | 7 - jpa/plugins/org.eclipse.jpt.db/.cvsignore | 3 - jpa/plugins/org.eclipse.jpt.db/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../org.eclipse.jpt.db/META-INF/MANIFEST.MF | 15 - jpa/plugins/org.eclipse.jpt.db/about.html | 34 - jpa/plugins/org.eclipse.jpt.db/build.properties | 19 - jpa/plugins/org.eclipse.jpt.db/component.xml | 1 - jpa/plugins/org.eclipse.jpt.db/plugin.properties | 25 - .../src/org/eclipse/jpt/db/internal/Catalog.java | 108 - .../src/org/eclipse/jpt/db/internal/Column.java | 162 - .../org/eclipse/jpt/db/internal/Connection.java | 66 - .../jpt/db/internal/ConnectionListener.java | 31 - .../eclipse/jpt/db/internal/ConnectionProfile.java | 257 - .../db/internal/ConnectionProfileRepository.java | 253 - .../db/internal/DTPConnectionProfileWrapper.java | 245 - .../jpt/db/internal/DTPConnectionWrapper.java | 170 - .../jpt/db/internal/DTPDatabaseWrapper.java | 229 - .../src/org/eclipse/jpt/db/internal/DTPTools.java | 212 - .../org/eclipse/jpt/db/internal/DTPWrapper.java | 52 - .../src/org/eclipse/jpt/db/internal/Database.java | 229 - .../org/eclipse/jpt/db/internal/ForeignKey.java | 337 - .../org/eclipse/jpt/db/internal/JptDbPlugin.java | 64 - .../eclipse/jpt/db/internal/NullConnection.java | 81 - .../jpt/db/internal/NullConnectionProfile.java | 187 - .../org/eclipse/jpt/db/internal/NullDatabase.java | 109 - .../eclipse/jpt/db/internal/ProfileListener.java | 35 - .../src/org/eclipse/jpt/db/internal/Schema.java | 299 - .../src/org/eclipse/jpt/db/internal/Sequence.java | 74 - .../src/org/eclipse/jpt/db/internal/Table.java | 359 - jpa/plugins/org.eclipse.jpt.doc.user/.project | 22 - .../org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF | 8 - jpa/plugins/org.eclipse.jpt.doc.user/about.html | 48 - .../org.eclipse.jpt.doc.user/build.properties | 102 - .../cheatsheets/add_persistence.xml | 63 - .../cheatsheets/create_entity.xml | 44 - .../cheatsheets/map_entity.xml | 88 - .../org.eclipse.jpt.doc.user/concept_mapping.htm | 51 - .../concept_persistence.htm | 46 - jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm | 65 - .../org.eclipse.jpt.doc.user/concepts001.htm | 48 - .../org.eclipse.jpt.doc.user/concepts002.htm | 50 - .../org.eclipse.jpt.doc.user/concepts003.htm | 51 - jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml | 422 - .../dcommon/css/blafdoc.css | 21 - .../org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm | 11 - .../org.eclipse.jpt.doc.user/getting_started.htm | 54 - .../getting_started001.htm | 65 - .../getting_started002.htm | 59 - .../getting_started003.htm | 90 - .../getting_started004.htm | 111 - .../getting_started005.htm | 140 - .../getting_started006.htm | 48 - .../getting_started007.htm | 215 - .../getting_started008.htm | 52 - .../getting_started009.htm | 68 - .../getting_started010.htm | 63 - .../getting_started011.htm | 85 - .../getting_started012.htm | 60 - .../getting_started013.htm | 64 - .../getting_started014.htm | 132 - .../getting_started015.htm | 133 - .../getting_started016.htm | 89 - .../getting_started017.htm | 71 - .../getting_started018.htm | 89 - .../getting_started019.htm | 67 - .../img/address_java_open.png | Bin 5702 -> 0 bytes .../img/address_jpa_details.png | Bin 8558 -> 0 bytes .../img/address_jpa_structure.png | Bin 4099 -> 0 bytes .../img/button_jpa_perspective.png | Bin 318 -> 0 bytes .../img/database_explorer.png | Bin 4645 -> 0 bytes .../img/details_entitymappings.png | Bin 5647 -> 0 bytes .../img/edit_join_column_dialog.png | Bin 10049 -> 0 bytes .../org.eclipse.jpt.doc.user/img/error_sample.png | Bin 13762 -> 0 bytes .../img/generate_entities.png | Bin 6223 -> 0 bytes .../img/icon_11mapping.png | Bin 244 -> 0 bytes .../img/icon_1mmapping.png | Bin 303 -> 0 bytes .../img/icon_basicmapping.png | Bin 476 -> 0 bytes .../img/icon_embeddable.png | Bin 354 -> 0 bytes .../img/icon_embeddedidmapping.png | Bin 213 -> 0 bytes .../img/icon_embeddedmapping.png | Bin 400 -> 0 bytes .../img/icon_idmapping.png | Bin 521 -> 0 bytes .../img/icon_m1mapping.png | Bin 301 -> 0 bytes .../img/icon_mmmapping.png | Bin 255 -> 0 bytes .../img/icon_nonpersistent.png | Bin 210 -> 0 bytes .../img/icon_persistent.png | Bin 649 -> 0 bytes .../img/icon_superclass.png | Bin 632 -> 0 bytes .../img/icon_transientmapping.png | Bin 224 -> 0 bytes .../img/icon_versionmapping.png | Bin 443 -> 0 bytes .../img/inheritance_join.png | Bin 11615 -> 0 bytes .../img/inheritance_single.png | Bin 3359 -> 0 bytes .../img/inheritance_tab.png | Bin 4236 -> 0 bytes .../img/java_editor_address.png | Bin 7823 -> 0 bytes .../img/jpa_details_employee.png | Bin 8587 -> 0 bytes .../img/jpa_facet_dialog.png | Bin 14095 -> 0 bytes .../img/new_jpa_project_dialog.png | Bin 23157 -> 0 bytes .../org.eclipse.jpt.doc.user/img/new_project_2.png | Bin 7208 -> 0 bytes .../org.eclipse.jpt.doc.user/img/ngrelc.png | Bin 667 -> 0 bytes .../org.eclipse.jpt.doc.user/img/ngrelr.png | Bin 615 -> 0 bytes .../org.eclipse.jpt.doc.user/img/ngrelt.png | Bin 568 -> 0 bytes .../img/open_persistence_editor.png | Bin 12962 -> 0 bytes .../img/persistence_outline_address.png | Bin 7215 -> 0 bytes .../img/persistence_outline_empid.png | Bin 6734 -> 0 bytes .../img/persistence_outline_entity.png | Bin 2090 -> 0 bytes .../img/persistence_outline_fields.png | Bin 4307 -> 0 bytes .../img/persistence_outline_fname.png | Bin 6658 -> 0 bytes .../img/persistence_outline_owner.png | Bin 6409 -> 0 bytes .../img/persistence_outline_phone.png | Bin 7292 -> 0 bytes .../img/persistence_outline_version.png | Bin 6923 -> 0 bytes .../img/persistence_outline_view.png | Bin 8746 -> 0 bytes .../img/persistence_perspective.png | Bin 43141 -> 0 bytes .../img/persistence_view_address.png | Bin 8600 -> 0 bytes .../img/persistence_view_addressid.png | Bin 9705 -> 0 bytes .../img/persistence_view_embedded.png | Bin 8080 -> 0 bytes .../img/persistence_view_empid.png | Bin 6545 -> 0 bytes .../img/persistence_view_empid_pk.png | Bin 12188 -> 0 bytes .../img/persistence_view_employee.png | Bin 8850 -> 0 bytes .../img/persistence_view_entity.png | Bin 8013 -> 0 bytes .../img/persistence_view_firstname.png | Bin 8892 -> 0 bytes .../img/persistence_view_manytoone.png | Bin 11009 -> 0 bytes .../img/persistence_view_mappedsprc.png | Bin 8293 -> 0 bytes .../img/persistence_view_onetomany.png | Bin 17395 -> 0 bytes .../img/persistence_view_onetoone.png | Bin 9280 -> 0 bytes .../img/persistence_view_version.png | Bin 7852 -> 0 bytes .../img/persistence_xml_editor.png | Bin 2899 -> 0 bytes .../img/properties_persistence.png | Bin 19758 -> 0 bytes .../img/quickstart_project.png | Bin 9094 -> 0 bytes .../img/secondary_tables.png | Bin 1750 -> 0 bytes .../img/synchornize_classes.png | Bin 16378 -> 0 bytes .../org.eclipse.jpt.doc.user/img/table_entity.png | Bin 9169 -> 0 bytes .../img/tutorial_object_model.png | Bin 7632 -> 0 bytes jpa/plugins/org.eclipse.jpt.doc.user/index.xml | 546 - jpa/plugins/org.eclipse.jpt.doc.user/legal.htm | 45 - .../org.eclipse.jpt.doc.user/plugin.properties | 24 - jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml | 37 - .../org.eclipse.jpt.doc.user/ref_details_orm.htm | 52 - .../org.eclipse.jpt.doc.user/ref_jpa_facet.htm | 91 - .../ref_mapping_general.htm | 213 - .../ref_new_jpa_project.htm | 91 - .../ref_new_jpa_project_wizard.htm | 54 - .../ref_persistence_map_view.htm | 57 - .../ref_persistence_outline.htm | 55 - .../ref_persistence_perspective.htm | 65 - .../ref_persistence_prop_view.htm | 54 - .../org.eclipse.jpt.doc.user/ref_primary_key.htm | 144 - .../ref_project_properties.htm | 80 - jpa/plugins/org.eclipse.jpt.doc.user/reference.htm | 65 - .../org.eclipse.jpt.doc.user/reference001.htm | 48 - .../org.eclipse.jpt.doc.user/reference002.htm | 57 - .../org.eclipse.jpt.doc.user/reference003.htm | 115 - .../org.eclipse.jpt.doc.user/reference004.htm | 53 - .../org.eclipse.jpt.doc.user/reference005.htm | 108 - .../org.eclipse.jpt.doc.user/reference006.htm | 84 - .../org.eclipse.jpt.doc.user/reference007.htm | 73 - .../org.eclipse.jpt.doc.user/reference008.htm | 100 - .../org.eclipse.jpt.doc.user/reference009.htm | 102 - .../org.eclipse.jpt.doc.user/reference010.htm | 48 - .../org.eclipse.jpt.doc.user/reference011.htm | 51 - .../org.eclipse.jpt.doc.user/reference012.htm | 71 - .../org.eclipse.jpt.doc.user/reference013.htm | 51 - .../org.eclipse.jpt.doc.user/reference014.htm | 116 - .../org.eclipse.jpt.doc.user/reference015.htm | 65 - .../org.eclipse.jpt.doc.user/reference016.htm | 44 - .../org.eclipse.jpt.doc.user/reference017.htm | 58 - .../task_add_persistence.htm | 65 - .../task_additonal_tables.htm | 79 - .../task_create_new_project.htm | 103 - .../task_generate_entities.htm | 74 - .../org.eclipse.jpt.doc.user/task_inheritance.htm | 143 - .../org.eclipse.jpt.doc.user/task_manage_orm.htm | 69 - .../task_manage_persistence.htm | 69 - .../org.eclipse.jpt.doc.user/task_mapping.htm | 78 - jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm | 74 - jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm | 67 - jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm | 67 - jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm | 68 - jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm | 81 - jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm | 72 - jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm | 86 - jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm | 206 - jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm | 120 - jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm | 94 - jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm | 176 - jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm | 179 - jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm | 134 - jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm | 169 - jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm | 141 - jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm | 72 - jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm | 135 - jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm | 74 - jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm | 59 - jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm | 98 - jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm | 55 - jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm | 89 - .../org.eclipse.jpt.doc.user/tips_and_tricks.htm | 71 - jpa/plugins/org.eclipse.jpt.doc.user/toc.xml | 117 - jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm | 53 - .../org.eclipse.jpt.doc.user/whats_new001.htm | 54 - .../org.eclipse.jpt.doc.user/whats_new002.htm | 57 - .../org.eclipse.jpt.doc.user/whats_new003.htm | 56 - jpa/plugins/org.eclipse.jpt.gen/.classpath | 7 - jpa/plugins/org.eclipse.jpt.gen/.cvsignore | 3 - jpa/plugins/org.eclipse.jpt.gen/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../org.eclipse.jpt.gen/META-INF/MANIFEST.MF | 15 - jpa/plugins/org.eclipse.jpt.gen/about.html | 34 - jpa/plugins/org.eclipse.jpt.gen/build.properties | 16 - jpa/plugins/org.eclipse.jpt.gen/component.xml | 1 - jpa/plugins/org.eclipse.jpt.gen/plugin.properties | 24 - .../eclipse/jpt/gen/internal/EntityGenerator.java | 1437 --- .../src/org/eclipse/jpt/gen/internal/GenScope.java | 175 - .../src/org/eclipse/jpt/gen/internal/GenTable.java | 342 - .../jpt/gen/internal/ManyToManyRelation.java | 104 - .../jpt/gen/internal/ManyToOneRelation.java | 61 - .../jpt/gen/internal/OneToManyRelation.java | 37 - .../eclipse/jpt/gen/internal/PackageGenerator.java | 91 - jpa/plugins/org.eclipse.jpt.ui/.classpath | 13 - jpa/plugins/org.eclipse.jpt.ui/.cvsignore | 1 - jpa/plugins/org.eclipse.jpt.ui/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../org.eclipse.jpt.ui/META-INF/MANIFEST.MF | 58 - jpa/plugins/org.eclipse.jpt.ui/about.html | 34 - jpa/plugins/org.eclipse.jpt.ui/build.properties | 21 - jpa/plugins/org.eclipse.jpt.ui/component.xml | 1 - .../icons/full/dtool16/new_jpaproject_wiz.gif | Bin 372 -> 0 bytes .../icons/full/etool16/jpa_facet.gif | Bin 896 -> 0 bytes .../icons/full/etool16/new_jpaproject_wiz.gif | Bin 991 -> 0 bytes .../icons/full/eview16/jpa_details.gif | Bin 953 -> 0 bytes .../icons/full/eview16/jpa_perspective.gif | Bin 896 -> 0 bytes .../icons/full/eview16/jpa_structure.gif | Bin 900 -> 0 bytes .../org.eclipse.jpt.ui/icons/full/obj16/basic.gif | Bin 897 -> 0 bytes .../icons/full/obj16/embeddable.gif | Bin 1003 -> 0 bytes .../icons/full/obj16/embedded-id.gif | Bin 953 -> 0 bytes .../icons/full/obj16/embedded.gif | Bin 905 -> 0 bytes .../icons/full/obj16/entity-mappings.gif | Bin 974 -> 0 bytes .../org.eclipse.jpt.ui/icons/full/obj16/entity.gif | Bin 1010 -> 0 bytes .../org.eclipse.jpt.ui/icons/full/obj16/id.gif | Bin 938 -> 0 bytes .../icons/full/obj16/many-to-many.gif | Bin 328 -> 0 bytes .../icons/full/obj16/many-to-one.gif | Bin 307 -> 0 bytes .../icons/full/obj16/mapped-superclass.gif | Bin 1005 -> 0 bytes .../icons/full/obj16/null-attribute-mapping.gif | Bin 911 -> 0 bytes .../icons/full/obj16/null-type-mapping.gif | Bin 586 -> 0 bytes .../icons/full/obj16/one-to-many.gif | Bin 306 -> 0 bytes .../icons/full/obj16/one-to-one.gif | Bin 283 -> 0 bytes .../icons/full/obj16/persistence-unit.gif | Bin 931 -> 0 bytes .../icons/full/obj16/persistence.gif | Bin 961 -> 0 bytes .../icons/full/obj16/transient.gif | Bin 892 -> 0 bytes .../icons/full/obj16/version.gif | Bin 321 -> 0 bytes .../icons/full/wizban/jpa_facet_wizban.gif | Bin 3485 -> 0 bytes jpa/plugins/org.eclipse.jpt.ui/plugin.properties | 50 - jpa/plugins/org.eclipse.jpt.ui/plugin.xml | 314 - .../property_files/jpt_ui.properties | 79 - .../property_files/jpt_ui_mappings.properties | 185 - .../property_files/jpt_ui_xml.properties | 36 - .../org.eclipse.jpt.ui/schema/jpaPlatform.exsd | 119 - .../eclipse/jpt/ui/internal/BaseJpaPlatformUi.java | 69 - .../jpt/ui/internal/IJpaHelpContextIds.java | 109 - .../eclipse/jpt/ui/internal/IJpaPlatformUi.java | 28 - .../ui/internal/JpaCompletionProposalComputer.java | 123 - .../org/eclipse/jpt/ui/internal/JptUiIcons.java | 16 - .../org/eclipse/jpt/ui/internal/JptUiMessages.java | 151 - .../org/eclipse/jpt/ui/internal/JptUiPlugin.java | 63 - .../eclipse/jpt/ui/internal/PlatformRegistry.java | 156 - .../actions/AddPersistentAttributeToXmlAction.java | 40 - .../AddPersistentAttributeToXmlAndMapAction.java | 39 - .../internal/actions/AddPersistentClassAction.java | 49 - .../jpt/ui/internal/actions/GenerateDDLAction.java | 35 - .../internal/actions/GenerateEntitiesAction.java | 34 - .../actions/PersistentAttributeActionFilter.java | 52 - .../jpt/ui/internal/actions/ProjectAction.java | 97 - .../RemovePersistentAttributeFromXmlAction.java | 42 - .../actions/RemovePersistentClassAction.java | 44 - .../internal/actions/SynchronizeClassesAction.java | 39 - .../XmlPersistentAttributeActionFilter.java | 49 - .../jpt/ui/internal/details/BaseJpaComposite.java | 47 - .../jpt/ui/internal/details/BaseJpaController.java | 108 - .../ui/internal/details/BaseJpaDetailsPage.java | 63 - .../jpt/ui/internal/details/IJpaComposite.java | 22 - .../jpt/ui/internal/details/IJpaDetailsPage.java | 28 - .../ui/internal/details/IJpaDetailsProvider.java | 27 - .../jpt/ui/internal/details/PageBookManager.java | 167 - .../details/PersistentAttributeDetailsPage.java | 397 - .../details/PersistentTypeDetailsPage.java | 292 - .../AddPersistentAttributeToXmlAndMapDialog.java | 193 - .../internal/dialogs/AddPersistentClassDialog.java | 279 - .../jpt/ui/internal/generic/EntitiesGenerator.java | 290 - .../jpt/ui/internal/generic/GenericPlatformUi.java | 38 - .../java/details/IAttributeMappingUiProvider.java | 46 - .../java/details/ITypeMappingUiProvider.java | 43 - .../internal/java/details/JavaDetailsProvider.java | 45 - .../JavaPersistentAttributeDetailsPage.java | 52 - .../details/JavaPersistentTypeDetailsPage.java | 53 - .../properties/BasicMappingUiProvider.java | 53 - .../properties/DefaultBasicMappingUiProvider.java | 52 - .../DefaultEmbeddedMappingUiProvider.java | 52 - .../mappings/properties/EmbeddableUiProvider.java | 35 - .../properties/EmbeddedIdMappingUiProvider.java | 53 - .../properties/EmbeddedMappingUiProvider.java | 53 - .../java/mappings/properties/EntityUiProvider.java | 35 - .../mappings/properties/IdMappingUiProvider.java | 52 - .../properties/ManyToManyMappingUiProvider.java | 52 - .../properties/ManyToOneMappingUiProvider.java | 52 - .../properties/MappedSuperclassUiProvider.java | 34 - .../properties/NullAttributeMappingUiProvider.java | 75 - .../properties/NullTypeMappingUiProvider.java | 59 - .../properties/OneToManyMappingUiProvider.java | 52 - .../properties/OneToOneMappingUiProvider.java | 53 - .../properties/TransientMappingUiProvider.java | 53 - .../properties/VersionMappingUiProvider.java | 53 - .../structure/JavaCompilationUnitItemProvider.java | 40 - .../JavaPersistentAttributeItemProvider.java | 101 - .../structure/JavaPersistentTypeItemProvider.java | 98 - .../java/structure/JavaStructureProvider.java | 38 - .../JpaCoreJavaItemProviderAdapterFactory.java | 176 - .../jpt/ui/internal/jface/NullLabelProvider.java | 43 - .../ui/internal/jface/NullTreeContentProvider.java | 44 - .../ui/internal/mappings/JptUiMappingsImages.java | 59 - .../internal/mappings/JptUiMappingsMessages.java | 205 - .../mappings/details/AbstractJoinColumnDialog.java | 183 - .../internal/mappings/details/BasicComposite.java | 357 - .../mappings/details/CascadeComposite.java | 378 - .../ui/internal/mappings/details/CatalogCombo.java | 304 - .../internal/mappings/details/ColumnComposite.java | 567 -- .../internal/mappings/details/CommonWidgets.java | 260 - .../mappings/details/EmbeddableComposite.java | 125 - .../EmbeddedAttributeOverridesComposite.java | 338 - .../mappings/details/EmbeddedComposite.java | 71 - .../mappings/details/EmbeddedIdComposite.java | 43 - .../internal/mappings/details/EntityComposite.java | 339 - .../internal/mappings/details/EntityNameCombo.java | 165 - .../internal/mappings/details/EnumComboViewer.java | 207 - .../mappings/details/GeneratedValueComposite.java | 288 - .../mappings/details/GeneratorComposite.java | 167 - .../ui/internal/mappings/details/IdComposite.java | 459 - .../mappings/details/InheritanceComposite.java | 620 -- .../mappings/details/InverseJoinColumnDialog.java | 81 - .../mappings/details/JoinColumnComposite.java | 428 - .../mappings/details/JoinColumnDialog.java | 209 - .../JoinColumnInAssociationOverrideDialog.java | 62 - .../details/JoinColumnInJoinTableDialog.java | 45 - .../JoinColumnInRelationshipMappingDialog.java | 56 - .../mappings/details/JoinColumnsComposite.java | 348 - .../mappings/details/JoinTableComposite.java | 473 - .../ui/internal/mappings/details/LobCheckBox.java | 128 - .../mappings/details/ManyToManyComposite.java | 184 - .../mappings/details/ManyToOneComposite.java | 193 - .../internal/mappings/details/MappedByCombo.java | 159 - .../details/MappedSuperclassComposite.java | 125 - .../mappings/details/OneToManyComposite.java | 187 - .../mappings/details/OneToOneComposite.java | 206 - .../mappings/details/OrderingComposite.java | 309 - .../mappings/details/OverridesComposite.java | 501 - .../details/PrimaryKeyJoinColumnDialog.java | 37 - ...PrimaryKeyJoinColumnInSecondaryTableDialog.java | 37 - .../details/PrimaryKeyJoinColumnsComposite.java | 399 - ...aryKeyJoinColumnsInSecondaryTableComposite.java | 407 - .../ui/internal/mappings/details/SchemaCombo.java | 327 - .../mappings/details/SecondaryTableDialog.java | 247 - .../mappings/details/SecondaryTablesComposite.java | 382 - .../details/SequenceGeneratorComposite.java | 185 - .../mappings/details/StringWithDefaultChooser.java | 274 - .../ui/internal/mappings/details/TableCombo.java | 338 - .../internal/mappings/details/TableComposite.java | 129 - .../mappings/details/TableGeneratorComposite.java | 535 - .../mappings/details/TargetEntityChooser.java | 223 - .../mappings/details/TransientComposite.java | 43 - .../mappings/details/VersionComposite.java | 165 - .../perspective/JpaPerspectiveFactory.java | 78 - .../jpt/ui/internal/prefs/JpaPreferencePage.java | 204 - .../internal/properties/DataModelPropertyPage.java | 309 - .../properties/JpaProjectPropertiesPage.java | 392 - .../selection/AbstractSelectionParticipant.java | 20 - .../ui/internal/selection/ISelectionManager.java | 45 - .../internal/selection/ISelectionParticipant.java | 38 - .../selection/JpaDetailsSelectionParticipant.java | 41 - .../JpaStructureSelectionParticipant.java | 56 - .../jpt/ui/internal/selection/Selection.java | 70 - .../jpt/ui/internal/selection/SelectionEvent.java | 64 - .../ui/internal/selection/SelectionManager.java | 264 - .../selection/SelectionManagerFactory.java | 103 - .../selection/SelectionParticipantFactory.java | 50 - .../selection/TextEditorSelectionParticipant.java | 164 - .../internal/structure/IJpaStructureProvider.java | 31 - .../org/eclipse/jpt/ui/internal/util/SWTUtil.java | 28 - .../jpt/ui/internal/util/TableLayoutComposite.java | 191 - .../jpt/ui/internal/views/AbstractJpaView.java | 82 - .../jpt/ui/internal/views/JpaDetailsView.java | 167 - .../jpt/ui/internal/views/JpaStructureView.java | 223 - .../jpt/ui/internal/widgets/CComboViewer.java | 151 - .../ui/internal/widgets/ScrolledPageContent.java | 62 - .../wizards/DatabaseReconnectWizardPage.java | 361 - .../internal/wizards/GenerateEntitiesWizard.java | 169 - .../wizards/GenerateEntitiesWizardPage.java | 539 - .../ui/internal/wizards/JpaFacetWizardPage.java | 528 - .../internal/wizards/NewJpaProjectFirstPage.java | 24 - .../ui/internal/wizards/NewJpaProjectWizard.java | 53 - .../jpt/ui/internal/xml/JptUiXmlMessages.java | 51 - .../xml/details/AccessTypeComboViewer.java | 186 - .../xml/details/CascadePersistCheckBox.java | 128 - .../jpt/ui/internal/xml/details/CommonWidgets.java | 80 - .../xml/details/MetaDataCompleteComboViewer.java | 155 - .../details/PersistenceUnitMetadataSection.java | 285 - .../internal/xml/details/XmlDetailsProvider.java | 47 - .../xml/details/XmlEntityMappingsDetailsPage.java | 274 - .../xml/details/XmlJavaAttributeChooser.java | 133 - .../internal/xml/details/XmlJavaClassChooser.java | 249 - .../XmlMappingMetadataCompleteCheckBox.java | 128 - .../ui/internal/xml/details/XmlPackageChooser.java | 255 - .../details/XmlPersistentAttributeDetailsPage.java | 173 - .../xml/details/XmlPersistentTypeDetailsPage.java | 171 - .../xml/structure/EntityMappingsItemProvider.java | 73 - .../JpaCoreXmlItemProviderAdapterFactory.java | 197 - .../XmlPersistentAttributeItemProvider.java | 116 - .../structure/XmlPersistentTypeItemProvider.java | 96 - .../structure/XmlRootContentNodeItemProvider.java | 55 - .../xml/structure/XmlStructureProvider.java | 36 - jpa/plugins/org.eclipse.jpt.utility/.classpath | 12 - jpa/plugins/org.eclipse.jpt.utility/.cvsignore | 3 - jpa/plugins/org.eclipse.jpt.utility/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../org.eclipse.jpt.utility/META-INF/MANIFEST.MF | 10 - jpa/plugins/org.eclipse.jpt.utility/about.html | 34 - .../org.eclipse.jpt.utility/build.properties | 17 - jpa/plugins/org.eclipse.jpt.utility/component.xml | 1 - .../org.eclipse.jpt.utility/plugin.properties | 24 - .../src/org/eclipse/jpt/utility/internal/Bag.java | 49 - .../org/eclipse/jpt/utility/internal/BitTools.java | 70 - .../eclipse/jpt/utility/internal/ClassTools.java | 1505 --- .../eclipse/jpt/utility/internal/Classpath.java | 910 -- .../jpt/utility/internal/CollectionTools.java | 2417 ----- .../eclipse/jpt/utility/internal/FileTools.java | 1006 -- .../org/eclipse/jpt/utility/internal/Filter.java | 46 - .../org/eclipse/jpt/utility/internal/HashBag.java | 733 -- .../jpt/utility/internal/IndentingPrintWriter.java | 148 - .../eclipse/jpt/utility/internal/JDBCTools.java | 348 - .../org/eclipse/jpt/utility/internal/JDBCType.java | 167 - .../org/eclipse/jpt/utility/internal/JavaType.java | 232 - .../eclipse/jpt/utility/internal/NameTools.java | 305 - .../org/eclipse/jpt/utility/internal/Range.java | 87 - .../jpt/utility/internal/ReverseComparator.java | 41 - .../eclipse/jpt/utility/internal/SimpleFilter.java | 106 - .../eclipse/jpt/utility/internal/StringTools.java | 2101 ---- .../eclipse/jpt/utility/internal/Transformer.java | 48 - .../jpt/utility/internal/XMLStringEncoder.java | 182 - .../utility/internal/iterators/ArrayIterator.java | 72 - .../internal/iterators/ArrayListIterator.java | 78 - .../utility/internal/iterators/ChainIterator.java | 124 - .../utility/internal/iterators/CloneIterator.java | 144 - .../internal/iterators/CloneListIterator.java | 229 - .../internal/iterators/CompositeIterator.java | 118 - .../internal/iterators/CompositeListIterator.java | 194 - .../internal/iterators/EmptyEnumeration.java | 55 - .../utility/internal/iterators/EmptyIterator.java | 59 - .../internal/iterators/EmptyListIterator.java | 83 - .../internal/iterators/EnumerationIterator.java | 50 - .../internal/iterators/FilteringIterator.java | 130 - .../utility/internal/iterators/GraphIterator.java | 223 - .../internal/iterators/IteratorEnumeration.java | 47 - .../internal/iterators/PeekableIterator.java | 100 - .../internal/iterators/ReadOnlyIterator.java | 61 - .../internal/iterators/ReadOnlyListIterator.java | 93 - .../internal/iterators/ResultSetIterator.java | 154 - .../internal/iterators/SingleElementIterator.java | 63 - .../iterators/SingleElementListIterator.java | 94 - .../internal/iterators/TransformationIterator.java | 80 - .../iterators/TransformationListIterator.java | 108 - .../utility/internal/iterators/TreeIterator.java | 175 - jpa/tests/org.eclipse.jpt.core.tests/.classpath | 13 - jpa/tests/org.eclipse.jpt.core.tests/.cvsignore | 1 - jpa/tests/org.eclipse.jpt.core.tests/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 25 - jpa/tests/org.eclipse.jpt.core.tests/about.html | 34 - .../org.eclipse.jpt.core.tests/build.properties | 19 - .../org.eclipse.jpt.core.tests/plugin.properties | 22 - .../jpt/core/tests/internal/JptCoreTests.java | 38 - .../jpt/core/tests/internal/ProjectUtility.java | 91 - .../content/java/mappings/JavaEntityTests.java | 52 - .../content/java/mappings/JpaJavaTestCase.java | 62 - .../mappings/JptCoreContentJavaMappingsTests.java | 28 - .../internal/jdtutility/AnnotationTestCase.java | 429 - ...onIndexedDeclarationAnnotationAdapterTests.java | 728 -- .../tests/internal/jdtutility/JDTToolsTests.java | 164 - .../jdtutility/JptCoreJdtUtilityTests.java | 34 - .../MemberAnnotationElementAdapterTests.java | 615 -- .../NestedDeclarationAnnotationAdapterTests.java | 763 -- ...edIndexedDeclarationAnnotationAdapterTests.java | 2209 ---- .../SimpleDeclarationAnnotationAdapterTests.java | 204 - .../core/tests/internal/jdtutility/TypeTests.java | 67 - .../tests/internal/model/JptCoreModelTests.java | 27 - .../internal/model/ModelInitializationTests.java | 90 - .../internal/platform/BaseJpaPlatformTests.java | 81 - .../internal/platform/JptCorePlatformTests.java | 28 - .../internal/projects/TestFacetedProject.java | 48 - .../tests/internal/projects/TestJavaProject.java | 148 - .../tests/internal/projects/TestJpaProject.java | 60 - .../internal/projects/TestPlatformProject.java | 195 - jpa/tests/org.eclipse.jpt.core.tests/test.xml | 44 - jpa/tests/org.eclipse.jpt.db.tests/.classpath | 7 - jpa/tests/org.eclipse.jpt.db.tests/.cvsignore | 1 - jpa/tests/org.eclipse.jpt.db.tests/.project | 28 - .../org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF | 16 - .../org.eclipse.jpt.db.tests/build.properties | 15 - .../config/derby101.properties | 30 - .../config/oracle10g.properties | 29 - .../config/oracle9i.properties | 29 - .../config/sqlserver2005.properties | 30 - .../org.eclipse.jpt.db.tests/plugin.properties | 25 - .../eclipse/jpt/db/tests/internal/JptDbTests.java | 39 - .../jpt/db/tests/internal/JptDbTestsPlugin.java | 54 - .../tests/internal/platforms/AllPlatformTests.java | 42 - .../tests/internal/platforms/DTPPlatformTests.java | 385 - .../db/tests/internal/platforms/Derby101Tests.java | 64 - .../tests/internal/platforms/Oracle10gTests.java | 60 - .../db/tests/internal/platforms/Oracle9iTests.java | 60 - .../internal/platforms/SQLServer2005Tests.java | 64 - jpa/tests/org.eclipse.jpt.utility.tests/.classpath | 7 - jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore | 1 - jpa/tests/org.eclipse.jpt.utility.tests/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 12 - jpa/tests/org.eclipse.jpt.utility.tests/about.html | 34 - .../org.eclipse.jpt.utility.tests/build.properties | 16 - .../plugin.properties | 24 - .../jpt/utility/tests/internal/BitToolsTests.java | 59 - .../utility/tests/internal/ClassToolsTests.java | 548 - .../jpt/utility/tests/internal/ClasspathTests.java | 289 - .../tests/internal/CollectionToolsTests.java | 1972 ---- .../jpt/utility/tests/internal/FileToolsTests.java | 594 -- .../jpt/utility/tests/internal/HashBagTests.java | 448 - .../tests/internal/IndentingPrintWriterTests.java | 107 - .../jpt/utility/tests/internal/JDBCTypeTests.java | 66 - .../jpt/utility/tests/internal/JavaTypeTests.java | 250 - .../utility/tests/internal/JptUtilityTests.java | 49 - .../jpt/utility/tests/internal/NameToolsTests.java | 214 - .../jpt/utility/tests/internal/RangeTests.java | 74 - .../tests/internal/ReverseComparatorTests.java | 101 - .../utility/tests/internal/StringToolsTests.java | 833 -- .../jpt/utility/tests/internal/TestTools.java | 161 - .../tests/internal/XMLStringEncoderTests.java | 135 - .../internal/iterators/ArrayIteratorTests.java | 126 - .../internal/iterators/ArrayListIteratorTests.java | 150 - .../internal/iterators/ChainIteratorTests.java | 119 - .../internal/iterators/CloneIteratorTests.java | 252 - .../internal/iterators/CloneListIteratorTests.java | 408 - .../internal/iterators/CompositeIteratorTests.java | 334 - .../iterators/CompositeListIteratorTests.java | 404 - .../internal/iterators/EmptyEnumerationTests.java | 53 - .../internal/iterators/EmptyIteratorTests.java | 63 - .../internal/iterators/EmptyListIteratorTests.java | 127 - .../iterators/EnumerationIteratorTests.java | 119 - .../internal/iterators/FilteringIteratorTests.java | 285 - .../internal/iterators/GraphIteratorTests.java | 183 - .../iterators/IteratorEnumerationTests.java | 98 - .../iterators/JptUtilityIteratorsTests.java | 53 - .../internal/iterators/PeekableIteratorTests.java | 140 - .../internal/iterators/ReadOnlyIteratorTests.java | 118 - .../iterators/ReadOnlyListIteratorTests.java | 203 - .../iterators/SingleElementIteratorTests.java | 71 - .../iterators/SingleElementListIteratorTests.java | 111 - .../iterators/TransformationIteratorTests.java | 216 - .../iterators/TransformationListIteratorTests.java | 306 - .../internal/iterators/TreeIteratorTests.java | 197 - jpa/tests/org.eclipse.jpt.utility.tests/test.xml | 44 - 1123 files changed, 209466 deletions(-) delete mode 100644 assembly/features/org.eclipse.jpt.sdk/.cvsignore delete mode 100644 assembly/features/org.eclipse.jpt.sdk/.project delete mode 100644 assembly/features/org.eclipse.jpt.sdk/build.properties delete mode 100644 assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg delete mode 100644 assembly/features/org.eclipse.jpt.sdk/epl-v10.html delete mode 100644 assembly/features/org.eclipse.jpt.sdk/feature.properties delete mode 100644 assembly/features/org.eclipse.jpt.sdk/feature.xml delete mode 100644 assembly/features/org.eclipse.jpt.sdk/license.html delete mode 100644 assembly/features/org.eclipse.jpt.tests/.cvsignore delete mode 100644 assembly/features/org.eclipse.jpt.tests/.project delete mode 100644 assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs delete mode 100644 assembly/features/org.eclipse.jpt.tests/build.properties delete mode 100644 assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg delete mode 100644 assembly/features/org.eclipse.jpt.tests/epl-v10.html delete mode 100644 assembly/features/org.eclipse.jpt.tests/feature.properties delete mode 100644 assembly/features/org.eclipse.jpt.tests/feature.xml delete mode 100644 assembly/features/org.eclipse.jpt.tests/license.html delete mode 100644 assembly/features/org.eclipse.jpt/.cvsignore delete mode 100644 assembly/features/org.eclipse.jpt/.project delete mode 100644 assembly/features/org.eclipse.jpt/build.properties delete mode 100644 assembly/features/org.eclipse.jpt/eclipse_update_120.jpg delete mode 100644 assembly/features/org.eclipse.jpt/epl-v10.html delete mode 100644 assembly/features/org.eclipse.jpt/feature.properties delete mode 100644 assembly/features/org.eclipse.jpt/feature.xml delete mode 100644 assembly/features/org.eclipse.jpt/license.html delete mode 100644 assembly/plugins/org.eclipse.jpt/.cvsignore delete mode 100644 assembly/plugins/org.eclipse.jpt/.project delete mode 100644 assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs delete mode 100644 assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF delete mode 100644 assembly/plugins/org.eclipse.jpt/about.html delete mode 100644 assembly/plugins/org.eclipse.jpt/about.ini delete mode 100644 assembly/plugins/org.eclipse.jpt/about.mappings delete mode 100644 assembly/plugins/org.eclipse.jpt/about.properties delete mode 100644 assembly/plugins/org.eclipse.jpt/build.properties delete mode 100644 assembly/plugins/org.eclipse.jpt/component.xml delete mode 100644 assembly/plugins/org.eclipse.jpt/eclipse32.gif delete mode 100644 assembly/plugins/org.eclipse.jpt/eclipse32.png delete mode 100644 assembly/plugins/org.eclipse.jpt/plugin.properties delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/.project delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/build.properties delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/feature.properties delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/feature.xml delete mode 100644 jpa/features/org.eclipse.jpt.tests.feature/license.html delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/.project delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/build.properties delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/feature.properties delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/feature.xml delete mode 100644 jpa/features/org.eclipse.jpt_sdk.feature/license.html delete mode 100644 jpa/plugins/org.eclipse.jpt.core/.classpath delete mode 100644 jpa/plugins/org.eclipse.jpt.core/.cvsignore delete mode 100644 jpa/plugins/org.eclipse.jpt.core/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.core/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.core/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.core/component.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/core.ecore delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/java.ecore delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/javaModel.ecore delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/javaModel.genmodel delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/orm.ecore delete mode 100644 jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore delete mode 100644 jpa/plugins/org.eclipse.jpt.core/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.core/plugin.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AccessType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaContentNode.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaCoreConstants.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaEObject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFile.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFileContentProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaModel.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaRootContentNode.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaSourceObject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IMappingKeys.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITextRange.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITypeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IXmlEObject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCoreFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaEObject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFile.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFileContentRegistry.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModel.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCorePlugin.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/NullTypeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlEObject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMappingProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaContentNodes.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMappingProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaEObject.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaJpaFileContentProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/IntAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JPA.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAbstractQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAssociationOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasicProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaDiscriminatorColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddableProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedIdProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntityProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGeneratedValue.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaIdProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToManyProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOneProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclassProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedNativeQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMappingProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMappingProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToManyProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOneProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaPrimaryKeyJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaQueryHint.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSequenceGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSingleRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransient.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransientProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTypeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersion.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersionProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaSwitch.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappings.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsForXml.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsInternal.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlAttributeMappingProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlColumnMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlContentNodes.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlTypeMappingProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmInit.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlResource.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaults.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsForXml.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsInternal.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadata.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataForXml.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataInternal.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAssociationOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasicProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddableProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedIdProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntity.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityForXml.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGeneratedValue.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlInheritance.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToMany.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToManyProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOneProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMapKey.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclassProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedNativeQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNullAttributeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToMany.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToManyProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOneProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlQueryHint.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRootContentNode.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSequenceGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSingleRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransient.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransientProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTypeMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersion.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersionProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractColumnTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AccessTypeElementTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverrideTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverridesTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingsTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeNameTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverrideTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverridesTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BasicTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BooleanEnumeratorTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ColumnTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DebugTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddableTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedIdTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmptyTagBooleanTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityMappingsTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratedTypeElementTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratorTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratedValueTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratorTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdClassTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/InheritanceTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinColumnTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinTableTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToOneTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MapKeyTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiObjectDependencyTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedNativeQueryTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedQueryTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToOneTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceImpl.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitDefaultsTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitMetadataTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PrimaryKeyJoinColumnTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/QueryHintTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTableTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTablesTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SequenceGeneratorTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SingleRelationshipTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableGeneratorTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TemporalTypeElementTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TransientTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeJavaClassTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingsTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/VersionTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/MappingFileRef.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Persistence.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceInit.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistencePackage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnit.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnitTransactionType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlRootContentNode.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Properties.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Property.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/BooleanTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/IPersistenceXmlContentNodes.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/JavaClassRefTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/MappingFileTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceResource.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXMLMapper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXmlResourceFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/TransactionTypeTranslator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceSwitch.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/IJpaFacetDataModelProperties.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AttributeAnnotationTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanStringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberStringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultEagerFetchType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultFalseBoolean.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultLazyFetchType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultTrueBoolean.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DiscriminatorType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/EnumType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/GenerationType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAssociationOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAttributeOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IBasic.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumnMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IDiscriminatorColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbedded.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddedId.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEntity.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGeneratedValue.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IId.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToMany.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToOne.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMappedSuperclass.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedNativeQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToMany.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToOne.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOverride.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IPrimaryKeyJoinColumn.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQuery.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQueryHint.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISequenceGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISingleRelationshipMapping.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITransient.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IVersion.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/InheritanceType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/OrderingType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/RelationshipMappingTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/TemporalType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AbstractJoinColumnContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AssociationOverrideContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AttributeOverrideContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaPlatform.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaProjectContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/ColumnContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/DefaultsContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GeneratorRepository.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IGeneratorRepository.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaAttributeContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaBasicContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddableContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedIdContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaIdContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToManyContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToOneContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMappedSuperclassContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullAttributeMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullTypeMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToManyContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToOneContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaPersistentAttributeContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaRelationshipMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaSingleRelationshipMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTransientContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTypeContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaVersionContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinColumnContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinTableContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/MappingFileContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/NullGeneratorRepository.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PersistenceUnitContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PrimaryKeyJoinColumnContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/SecondaryTableContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TableContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TypeContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeOverrideContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlBasicContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddableContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedIdContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlIdContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToManyContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToOneContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMappedSuperclassContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlNullAttributeMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToManyContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToOneContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlRelationshipMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlSingleRelationshipMappingContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTransientContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlVersionContext.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/generic/GenericPlatform.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreSwitch.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/IJpaValidationMessages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/.classpath delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/component.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/.classpath delete mode 100644 jpa/plugins/org.eclipse.jpt.db/.cvsignore delete mode 100644 jpa/plugins/org.eclipse.jpt.db/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.db/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.db/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.db/component.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.db/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java delete mode 100644 jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/index.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/legal.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/toc.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/.classpath delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/.cvsignore delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/component.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java delete mode 100644 jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/.classpath delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/.cvsignore delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/component.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/plugin.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/.classpath delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/.cvsignore delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/.project delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/about.html delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/build.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/component.xml delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/plugin.properties delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java delete mode 100644 jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/.classpath delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/.cvsignore delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/.project delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/about.html delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/build.properties delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/plugin.properties delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java delete mode 100644 jpa/tests/org.eclipse.jpt.core.tests/test.xml delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/.classpath delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/.cvsignore delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/.project delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/build.properties delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/plugin.properties delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/.classpath delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/.project delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/about.html delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/build.properties delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java delete mode 100644 jpa/tests/org.eclipse.jpt.utility.tests/test.xml diff --git a/assembly/features/org.eclipse.jpt.sdk/.cvsignore b/assembly/features/org.eclipse.jpt.sdk/.cvsignore deleted file mode 100644 index bc2abf75c1..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -*.bin.dist.zip -build.xml -features -plugins diff --git a/assembly/features/org.eclipse.jpt.sdk/.project b/assembly/features/org.eclipse.jpt.sdk/.project deleted file mode 100644 index 821d453136..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.jpt.sdk - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/assembly/features/org.eclipse.jpt.sdk/build.properties b/assembly/features/org.eclipse.jpt.sdk/build.properties deleted file mode 100644 index 7200939aca..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -bin.includes = feature.xml,\ - eclipse_update_120.jpg,\ - epl-v10.html,\ - license.html,\ - feature.properties diff --git a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg deleted file mode 100644 index bfdf708ad6..0000000000 Binary files a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg and /dev/null differ diff --git a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html b/assembly/features/org.eclipse.jpt.sdk/epl-v10.html deleted file mode 100644 index ed4b196655..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -
- -

Eclipse Public License - v 1.0 -

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) -in the case of the initial Contributor, the initial code and documentation -distributed under this Agreement, and
-b) in the case of each subsequent Contributor:

- -

i) -changes to the Program, and

- -

ii) -additions to the Program;

- -

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.

- -

"Contributor" means any person or -entity that distributes the Program.

- -

"Licensed Patents " 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.

- -

"Program" means the Contributions -distributed in accordance with this Agreement.

- -

"Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to 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.

- -

b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, 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.

- -

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.

- -

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.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -

- -

a) -it complies with the terms and conditions of this Agreement; and

- -

b) -its license agreement:

- -

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;

- -

ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;

- -

iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and

- -

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.

- -

When the Program is made available in source -code form:

- -

a) -it must be made available under this Agreement; and

- -

b) a -copy of this Agreement must be included with each copy of the Program.

- -

Contributors may not remove or alter any -copyright notices contained within the Program.

- -

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.

- -

4. COMMERCIAL DISTRIBUTION

- -

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 ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") 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.

- -

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.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" 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.

- -

6. DISCLAIMER OF LIABILITY

- -

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.

- -

7. GENERAL

- -

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.

- -

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.

- -

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.

- -

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.

- -

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.

- -

 

- -
- - - - \ No newline at end of file diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.properties b/assembly/features/org.eclipse.jpt.sdk/feature.properties deleted file mode 100644 index abb0c88d62..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/feature.properties +++ /dev/null @@ -1,145 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Dali Java Persistence API (JPA) project SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site - -# "description" property - description of the feature -description=Dali Java Persistence API (JPA) project SDK - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2006 Oracle Corporation.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html\n\ -\n\ -Contributors:\n\ - Oracle - initial API and implementation\n -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\ -June 06, 2007\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\ -is provided to you under the terms and conditions of the Eclipse Public\n\ -License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ - - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.xml b/assembly/features/org.eclipse.jpt.sdk/feature.xml deleted file mode 100644 index 4b10e054bb..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/feature.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - %description - - - - %license - - - - %copyright - - - - - - - - - - - - diff --git a/assembly/features/org.eclipse.jpt.sdk/license.html b/assembly/features/org.eclipse.jpt.sdk/license.html deleted file mode 100644 index 76abfb4621..0000000000 --- a/assembly/features/org.eclipse.jpt.sdk/license.html +++ /dev/null @@ -1,98 +0,0 @@ - - -Eclipse.org Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

June 06, 2007

-

Usage Of Content

-

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION -AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF -THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE -TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED -BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED -BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE -AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY -APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU -MAY NOT USE THE CONTENT.

-

Applicable Licenses

-

Unless otherwise indicated, all Content made available by the Eclipse -Foundation is provided to you under the terms and conditions of the Eclipse -Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this -Content and is also available at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

-

Content includes, but is not limited to, source code, object code, -documentation and other files maintained in the Eclipse.org CVS repository -("Repository") in CVS modules ("Modules") and made available as downloadable -archives ("Downloads").

-

Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments -("Fragments"), and features ("Features"). A Feature is a bundle of one or more -Plug-ins and/or Fragments and associated material. Files named "feature.xml" may -contain a list of the names and version numbers of the Plug-ins and/or Fragments -associated with a Feature. Plug-ins and Fragments are located in directories -named "plugins" and Features are located in directories named "features".

-

Features may also include other Features ("Included Features"). Files named -"feature.xml" may contain a list of the names and version numbers of Included -Features.

-

The terms and conditions governing Plug-ins and Fragments should be contained -in files named "about.html" ("Abouts"). The terms and conditions governing -Features and Included Features should be contained in files named "license.html" -("Feature Licenses"). Abouts and Feature Licenses may be located in any -directory of a Download or Module including, but not limited to the following -locations:

- -

Note: if a Feature made available by the Eclipse Foundation is installed -using the Eclipse Update Manager, you must agree to a license ("Feature Update -License") during the installation process. If the Feature contains Included -Features, the Feature Update License should either provide you with the terms -and conditions governing the Included Features or inform you where you can -locate them. Feature Update Licenses may be found in the "license" property of -files named "feature.properties". Such Abouts, Feature Licenses and Feature -Update Licenses contain the terms and conditions (or references to such terms -and conditions) that govern your use of the associated Content in that -directory.

-

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):

- -

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.

-

Cryptography

-

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.

diff --git a/assembly/features/org.eclipse.jpt.tests/.cvsignore b/assembly/features/org.eclipse.jpt.tests/.cvsignore deleted file mode 100644 index d9e4340782..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -*.bin.dist.zip -build.xml diff --git a/assembly/features/org.eclipse.jpt.tests/.project b/assembly/features/org.eclipse.jpt.tests/.project deleted file mode 100644 index 3d1dde631a..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.jpt.tests - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs b/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 17acb651a8..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:11:05 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/assembly/features/org.eclipse.jpt.tests/build.properties b/assembly/features/org.eclipse.jpt.tests/build.properties deleted file mode 100644 index 7f47694aab..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -bin.includes = feature.xml,\ - eclipse_update_120.jpg,\ - epl-v10.html,\ - license.html,\ - feature.properties diff --git a/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg deleted file mode 100644 index bfdf708ad6..0000000000 Binary files a/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg and /dev/null differ diff --git a/assembly/features/org.eclipse.jpt.tests/epl-v10.html b/assembly/features/org.eclipse.jpt.tests/epl-v10.html deleted file mode 100644 index ed4b196655..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/epl-v10.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -
- -

Eclipse Public License - v 1.0 -

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) -in the case of the initial Contributor, the initial code and documentation -distributed under this Agreement, and
-b) in the case of each subsequent Contributor:

- -

i) -changes to the Program, and

- -

ii) -additions to the Program;

- -

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.

- -

"Contributor" means any person or -entity that distributes the Program.

- -

"Licensed Patents " 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.

- -

"Program" means the Contributions -distributed in accordance with this Agreement.

- -

"Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to 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.

- -

b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, 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.

- -

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.

- -

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.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -

- -

a) -it complies with the terms and conditions of this Agreement; and

- -

b) -its license agreement:

- -

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;

- -

ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;

- -

iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and

- -

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.

- -

When the Program is made available in source -code form:

- -

a) -it must be made available under this Agreement; and

- -

b) a -copy of this Agreement must be included with each copy of the Program.

- -

Contributors may not remove or alter any -copyright notices contained within the Program.

- -

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.

- -

4. COMMERCIAL DISTRIBUTION

- -

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 ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") 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.

- -

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.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" 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.

- -

6. DISCLAIMER OF LIABILITY

- -

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.

- -

7. GENERAL

- -

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.

- -

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.

- -

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.

- -

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.

- -

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.

- -

 

- -
- - - - \ No newline at end of file diff --git a/assembly/features/org.eclipse.jpt.tests/feature.properties b/assembly/features/org.eclipse.jpt.tests/feature.properties deleted file mode 100644 index 6b58fe6a33..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/feature.properties +++ /dev/null @@ -1,145 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Dali Java Persistence API (JPA) project Tests - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site - -# "description" property - description of the feature -description=Dali Java Persistence API (JPA) project Tests - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2006 Oracle Corporation.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html\n\ -\n\ -Contributors:\n\ - Oracle - initial API and implementation\n -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\ -June 06, 2007\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\ -is provided to you under the terms and conditions of the Eclipse Public\n\ -License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ - - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/assembly/features/org.eclipse.jpt.tests/feature.xml b/assembly/features/org.eclipse.jpt.tests/feature.xml deleted file mode 100644 index e445c4c153..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/feature.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - %description - - - - %license - - - - %copyright - - - - - - - - - diff --git a/assembly/features/org.eclipse.jpt.tests/license.html b/assembly/features/org.eclipse.jpt.tests/license.html deleted file mode 100644 index 56445985d9..0000000000 --- a/assembly/features/org.eclipse.jpt.tests/license.html +++ /dev/null @@ -1,98 +0,0 @@ - - -Eclipse.org Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

June 06, 2007

-

Usage Of Content

-

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION -AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF -THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE -TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED -BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED -BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE -AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY -APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU -MAY NOT USE THE CONTENT.

-

Applicable Licenses

-

Unless otherwise indicated, all Content made available by the Eclipse -Foundation is provided to you under the terms and conditions of the Eclipse -Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this -Content and is also available at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

-

Content includes, but is not limited to, source code, object code, -documentation and other files maintained in the Eclipse.org CVS repository -("Repository") in CVS modules ("Modules") and made available as downloadable -archives ("Downloads").

-

Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments -("Fragments"), and features ("Features"). A Feature is a bundle of one or more -Plug-ins and/or Fragments and associated material. Files named "feature.xml" may -contain a list of the names and version numbers of the Plug-ins and/or Fragments -associated with a Feature. Plug-ins and Fragments are located in directories -named "plugins" and Features are located in directories named "features".

-

Features may also include other Features ("Included Features"). Files named -"feature.xml" may contain a list of the names and version numbers of Included -Features.

-

The terms and conditions governing Plug-ins and Fragments should be contained -in files named "about.html" ("Abouts"). The terms and conditions governing -Features and Included Features should be contained in files named "license.html" -("Feature Licenses"). Abouts and Feature Licenses may be located in any -directory of a Download or Module including, but not limited to the following -locations:

- -

Note: if a Feature made available by the Eclipse Foundation is installed -using the Eclipse Update Manager, you must agree to a license ("Feature Update -License") during the installation process. If the Feature contains Included -Features, the Feature Update License should either provide you with the terms -and conditions governing the Included Features or inform you where you can -locate them. Feature Update Licenses may be found in the "license" property of -files named "feature.properties". Such Abouts, Feature Licenses and Feature -Update Licenses contain the terms and conditions (or references to such terms -and conditions) that govern your use of the associated Content in that -directory.

-

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):

- -

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.

-

Cryptography

-

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.

diff --git a/assembly/features/org.eclipse.jpt/.cvsignore b/assembly/features/org.eclipse.jpt/.cvsignore deleted file mode 100644 index d9e4340782..0000000000 --- a/assembly/features/org.eclipse.jpt/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -*.bin.dist.zip -build.xml diff --git a/assembly/features/org.eclipse.jpt/.project b/assembly/features/org.eclipse.jpt/.project deleted file mode 100644 index b7aaec2f54..0000000000 --- a/assembly/features/org.eclipse.jpt/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.jpt - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/assembly/features/org.eclipse.jpt/build.properties b/assembly/features/org.eclipse.jpt/build.properties deleted file mode 100644 index 470b4bcb63..0000000000 --- a/assembly/features/org.eclipse.jpt/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -bin.includes = feature.xml,\ - eclipse_update_120.jpg,\ - epl-v10.html,\ - license.html,\ - feature.properties - \ No newline at end of file diff --git a/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg deleted file mode 100644 index bfdf708ad6..0000000000 Binary files a/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg and /dev/null differ diff --git a/assembly/features/org.eclipse.jpt/epl-v10.html b/assembly/features/org.eclipse.jpt/epl-v10.html deleted file mode 100644 index ed4b196655..0000000000 --- a/assembly/features/org.eclipse.jpt/epl-v10.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -
- -

Eclipse Public License - v 1.0 -

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) -in the case of the initial Contributor, the initial code and documentation -distributed under this Agreement, and
-b) in the case of each subsequent Contributor:

- -

i) -changes to the Program, and

- -

ii) -additions to the Program;

- -

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.

- -

"Contributor" means any person or -entity that distributes the Program.

- -

"Licensed Patents " 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.

- -

"Program" means the Contributions -distributed in accordance with this Agreement.

- -

"Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to 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.

- -

b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, 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.

- -

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.

- -

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.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -

- -

a) -it complies with the terms and conditions of this Agreement; and

- -

b) -its license agreement:

- -

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;

- -

ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;

- -

iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and

- -

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.

- -

When the Program is made available in source -code form:

- -

a) -it must be made available under this Agreement; and

- -

b) a -copy of this Agreement must be included with each copy of the Program.

- -

Contributors may not remove or alter any -copyright notices contained within the Program.

- -

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.

- -

4. COMMERCIAL DISTRIBUTION

- -

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 ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") 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.

- -

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.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" 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.

- -

6. DISCLAIMER OF LIABILITY

- -

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.

- -

7. GENERAL

- -

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.

- -

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.

- -

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.

- -

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.

- -

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.

- -

 

- -
- - - - \ No newline at end of file diff --git a/assembly/features/org.eclipse.jpt/feature.properties b/assembly/features/org.eclipse.jpt/feature.properties deleted file mode 100644 index 0ae42bbb56..0000000000 --- a/assembly/features/org.eclipse.jpt/feature.properties +++ /dev/null @@ -1,144 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Java Persistence API Tools - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site - -# "description" property - description of the feature -description=Java Persistence API Tools - Runtime - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2006 Oracle Corporation.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html\n\ -\n\ -Contributors:\n\ - Oracle - initial API and implementation\n -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\ -March 17, 2005\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\ -is provided to you under the terms and conditions of the Eclipse Public\n\ -License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/assembly/features/org.eclipse.jpt/feature.xml b/assembly/features/org.eclipse.jpt/feature.xml deleted file mode 100644 index fdae5614e9..0000000000 --- a/assembly/features/org.eclipse.jpt/feature.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - %description - - - - %license - - - - %copyright - - - - - - - - - - - - diff --git a/assembly/features/org.eclipse.jpt/license.html b/assembly/features/org.eclipse.jpt/license.html deleted file mode 100644 index 2347060ef3..0000000000 --- a/assembly/features/org.eclipse.jpt/license.html +++ /dev/null @@ -1,93 +0,0 @@ - - -Eclipse.org Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

January 28, 2005

-

Usage Of Content

-

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION -AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF -THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE -TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED -BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED -BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE -AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY -APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU -MAY NOT USE THE CONTENT.

-

Applicable Licenses

-

Unless otherwise indicated, all Content made available by the Eclipse -Foundation is provided to you under the terms and conditions of the Eclipse -Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this -Content and is also available at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

-

Content includes, but is not limited to, source code, object code, -documentation and other files maintained in the Eclipse.org CVS repository -("Repository") in CVS modules ("Modules") and made available as downloadable -archives ("Downloads").

-

Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments -("Fragments"), and features ("Features"). A Feature is a bundle of one or more -Plug-ins and/or Fragments and associated material. Files named "feature.xml" may -contain a list of the names and version numbers of the Plug-ins and/or Fragments -associated with a Feature. Plug-ins and Fragments are located in directories -named "plugins" and Features are located in directories named "features".

-

Features may also include other Features ("Included Features"). Files named -"feature.xml" may contain a list of the names and version numbers of Included -Features.

-

The terms and conditions governing Plug-ins and Fragments should be contained -in files named "about.html" ("Abouts"). The terms and conditions governing -Features and Included Features should be contained in files named "license.html" -("Feature Licenses"). Abouts and Feature Licenses may be located in any -directory of a Download or Module including, but not limited to the following -locations:

- -

Note: if a Feature made available by the Eclipse Foundation is installed -using the Eclipse Update Manager, you must agree to a license ("Feature Update -License") during the installation process. If the Feature contains Included -Features, the Feature Update License should either provide you with the terms -and conditions governing the Included Features or inform you where you can -locate them. Feature Update Licenses may be found in the "license" property of -files named "feature.properties". Such Abouts, Feature Licenses and Feature -Update Licenses contain the terms and conditions (or references to such terms -and conditions) that govern your use of the associated Content in that -directory.

-

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):

- -

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.

-

Cryptography

-

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.

diff --git a/assembly/plugins/org.eclipse.jpt/.cvsignore b/assembly/plugins/org.eclipse.jpt/.cvsignore deleted file mode 100644 index e4254b18e0..0000000000 --- a/assembly/plugins/org.eclipse.jpt/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -temp.folder -build.xml diff --git a/assembly/plugins/org.eclipse.jpt/.project b/assembly/plugins/org.eclipse.jpt/.project deleted file mode 100644 index f51b04cc90..0000000000 --- a/assembly/plugins/org.eclipse.jpt/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.eclipse.jpt - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs b/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 4aec29d1cd..0000000000 --- a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:10:09 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF b/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF deleted file mode 100644 index 5ac613eda7..0000000000 --- a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.jpt; singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Localization: plugin -Bundle-Vendor: %providerName diff --git a/assembly/plugins/org.eclipse.jpt/about.html b/assembly/plugins/org.eclipse.jpt/about.html deleted file mode 100644 index ca606b1bb5..0000000000 --- a/assembly/plugins/org.eclipse.jpt/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

About This Content

- -

June 06, 2007

- -

License

- -

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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

- -

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 -http://www.eclipse.org/.

- - - \ No newline at end of file diff --git a/assembly/plugins/org.eclipse.jpt/about.ini b/assembly/plugins/org.eclipse.jpt/about.ini deleted file mode 100644 index 588a325a8f..0000000000 --- a/assembly/plugins/org.eclipse.jpt/about.ini +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### - -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=eclipse32.gif - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -# optional - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional - -# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page -# optional -tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm - - diff --git a/assembly/plugins/org.eclipse.jpt/about.mappings b/assembly/plugins/org.eclipse.jpt/about.mappings deleted file mode 100644 index bddaab4310..0000000000 --- a/assembly/plugins/org.eclipse.jpt/about.mappings +++ /dev/null @@ -1,6 +0,0 @@ -# about.mappings -# contains fill-ins for about.properties -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file does not need to be translated. - -0=@build@ \ No newline at end of file diff --git a/assembly/plugins/org.eclipse.jpt/about.properties b/assembly/plugins/org.eclipse.jpt/about.properties deleted file mode 100644 index 159bfceeba..0000000000 --- a/assembly/plugins/org.eclipse.jpt/about.properties +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### - -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. - -blurb=Java Persistence API Tools\n\ -\n\ -Version: {featureVersion}\n\ -Build id: {0}\n\ -\n\ -(c) Copyright Eclipse contributors and others 2006. All rights reserved.\n\ -Visit http://www.eclipse.org/webtools diff --git a/assembly/plugins/org.eclipse.jpt/build.properties b/assembly/plugins/org.eclipse.jpt/build.properties deleted file mode 100644 index 0ccfb0ebb8..0000000000 --- a/assembly/plugins/org.eclipse.jpt/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -bin.includes = META-INF/,\ - about.ini,\ - about.html,\ - about.mappings,\ - about.properties,\ - eclipse32.gif,\ - eclipse32.png,\ - plugin.properties,\ - component.xml diff --git a/assembly/plugins/org.eclipse.jpt/component.xml b/assembly/plugins/org.eclipse.jpt/component.xml deleted file mode 100644 index 11f133f65a..0000000000 --- a/assembly/plugins/org.eclipse.jpt/component.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.gif b/assembly/plugins/org.eclipse.jpt/eclipse32.gif deleted file mode 100644 index e6ad7ccd75..0000000000 Binary files a/assembly/plugins/org.eclipse.jpt/eclipse32.gif and /dev/null differ diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.png b/assembly/plugins/org.eclipse.jpt/eclipse32.png deleted file mode 100644 index 568fac1d05..0000000000 Binary files a/assembly/plugins/org.eclipse.jpt/eclipse32.png and /dev/null differ diff --git a/assembly/plugins/org.eclipse.jpt/plugin.properties b/assembly/plugins/org.eclipse.jpt/plugin.properties deleted file mode 100644 index f45a08d54e..0000000000 --- a/assembly/plugins/org.eclipse.jpt/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### - -pluginName = Java Persistence API Tools -providerName = Eclipse.org diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.project b/jpa/features/org.eclipse.jpt.tests.feature/.project deleted file mode 100644 index 91760f21b4..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.jpt.tests.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 235b84ae83..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:11:17 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/features/org.eclipse.jpt.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.tests.feature/build.properties deleted file mode 100644 index d6a4dce096..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = feature.xml,\ - eclipse_update_120.jpg,\ - epl-v10.html,\ - license.html,\ - feature.properties -src.includes = license.html,\ - feature.xml,\ - epl-v10.html,\ - eclipse_update_120.jpg,\ - build.properties diff --git a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg deleted file mode 100644 index bfdf708ad6..0000000000 Binary files a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg and /dev/null differ diff --git a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html deleted file mode 100644 index ed4b196655..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -
- -

Eclipse Public License - v 1.0 -

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) -in the case of the initial Contributor, the initial code and documentation -distributed under this Agreement, and
-b) in the case of each subsequent Contributor:

- -

i) -changes to the Program, and

- -

ii) -additions to the Program;

- -

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.

- -

"Contributor" means any person or -entity that distributes the Program.

- -

"Licensed Patents " 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.

- -

"Program" means the Contributions -distributed in accordance with this Agreement.

- -

"Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to 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.

- -

b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, 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.

- -

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.

- -

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.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -

- -

a) -it complies with the terms and conditions of this Agreement; and

- -

b) -its license agreement:

- -

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;

- -

ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;

- -

iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and

- -

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.

- -

When the Program is made available in source -code form:

- -

a) -it must be made available under this Agreement; and

- -

b) a -copy of this Agreement must be included with each copy of the Program.

- -

Contributors may not remove or alter any -copyright notices contained within the Program.

- -

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.

- -

4. COMMERCIAL DISTRIBUTION

- -

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 ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") 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.

- -

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.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" 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.

- -

6. DISCLAIMER OF LIABILITY

- -

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.

- -

7. GENERAL

- -

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.

- -

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.

- -

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.

- -

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.

- -

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.

- -

 

- -
- - - - \ No newline at end of file diff --git a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.tests.feature/feature.properties deleted file mode 100644 index 33ec536d55..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties +++ /dev/null @@ -1,145 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -# TOREVIEW - updateSiteName -updateSiteName=Web Tools Platform (WTP) Updates - -# "description" property - description of the feature -description=Dali Java Persistence API (JPA) Tools - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2006 Oracle Corporation.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html\n\ -\n\ -Contributors:\n\ - Oracle - initial API and implementation\n -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\ -June 06, 2007\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\ -is provided to you under the terms and conditions of the Eclipse Public\n\ -License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ - - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.tests.feature/feature.xml deleted file mode 100644 index 2034cacec4..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - %description - - - - %license - - - - %copyright - - - - - - - diff --git a/jpa/features/org.eclipse.jpt.tests.feature/license.html b/jpa/features/org.eclipse.jpt.tests.feature/license.html deleted file mode 100644 index 56445985d9..0000000000 --- a/jpa/features/org.eclipse.jpt.tests.feature/license.html +++ /dev/null @@ -1,98 +0,0 @@ - - -Eclipse.org Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

June 06, 2007

-

Usage Of Content

-

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION -AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF -THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE -TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED -BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED -BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE -AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY -APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU -MAY NOT USE THE CONTENT.

-

Applicable Licenses

-

Unless otherwise indicated, all Content made available by the Eclipse -Foundation is provided to you under the terms and conditions of the Eclipse -Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this -Content and is also available at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

-

Content includes, but is not limited to, source code, object code, -documentation and other files maintained in the Eclipse.org CVS repository -("Repository") in CVS modules ("Modules") and made available as downloadable -archives ("Downloads").

-

Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments -("Fragments"), and features ("Features"). A Feature is a bundle of one or more -Plug-ins and/or Fragments and associated material. Files named "feature.xml" may -contain a list of the names and version numbers of the Plug-ins and/or Fragments -associated with a Feature. Plug-ins and Fragments are located in directories -named "plugins" and Features are located in directories named "features".

-

Features may also include other Features ("Included Features"). Files named -"feature.xml" may contain a list of the names and version numbers of Included -Features.

-

The terms and conditions governing Plug-ins and Fragments should be contained -in files named "about.html" ("Abouts"). The terms and conditions governing -Features and Included Features should be contained in files named "license.html" -("Feature Licenses"). Abouts and Feature Licenses may be located in any -directory of a Download or Module including, but not limited to the following -locations:

-
    -
  • The top-level (root) directory -
  • Plug-in and Fragment directories -
  • Subdirectories of the directory named "src" of certain Plug-ins -
  • Feature directories
-

Note: if a Feature made available by the Eclipse Foundation is installed -using the Eclipse Update Manager, you must agree to a license ("Feature Update -License") during the installation process. If the Feature contains Included -Features, the Feature Update License should either provide you with the terms -and conditions governing the Included Features or inform you where you can -locate them. Feature Update Licenses may be found in the "license" property of -files named "feature.properties". Such Abouts, Feature Licenses and Feature -Update Licenses contain the terms and conditions (or references to such terms -and conditions) that govern your use of the associated Content in that -directory.

-

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):

- -

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.

-

Cryptography

-

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.

diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.project b/jpa/features/org.eclipse.jpt_sdk.feature/.project deleted file mode 100644 index 33da750336..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.jpt_sdk.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 6cc7d4b4cd..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:09:59 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt_sdk.feature/build.properties deleted file mode 100644 index 28724c6843..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -bin.includes = feature.xml,\ - license.html,\ - feature.properties,\ - epl-v10.html,\ - eclipse_update_120.jpg - -src.includes = build.properties - -generate.feature@org.eclipse.jpt.feature.source=org.eclipse.jpt.feature diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg deleted file mode 100644 index bfdf708ad6..0000000000 Binary files a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg and /dev/null differ diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html b/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html deleted file mode 100644 index ed4b196655..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -
- -

Eclipse Public License - v 1.0 -

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) -in the case of the initial Contributor, the initial code and documentation -distributed under this Agreement, and
-b) in the case of each subsequent Contributor:

- -

i) -changes to the Program, and

- -

ii) -additions to the Program;

- -

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.

- -

"Contributor" means any person or -entity that distributes the Program.

- -

"Licensed Patents " 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.

- -

"Program" means the Contributions -distributed in accordance with this Agreement.

- -

"Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to 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.

- -

b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, 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.

- -

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.

- -

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.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -

- -

a) -it complies with the terms and conditions of this Agreement; and

- -

b) -its license agreement:

- -

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;

- -

ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;

- -

iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and

- -

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.

- -

When the Program is made available in source -code form:

- -

a) -it must be made available under this Agreement; and

- -

b) a -copy of this Agreement must be included with each copy of the Program.

- -

Contributors may not remove or alter any -copyright notices contained within the Program.

- -

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.

- -

4. COMMERCIAL DISTRIBUTION

- -

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 ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") 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.

- -

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.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" 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.

- -

6. DISCLAIMER OF LIABILITY

- -

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.

- -

7. GENERAL

- -

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.

- -

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.

- -

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.

- -

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.

- -

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.

- -

 

- -
- - - - \ No newline at end of file diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties deleted file mode 100644 index a14204ac5e..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties +++ /dev/null @@ -1,140 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### - -# "featureName" property - name of the feature -featureName=Java Persistence API Tools Plug-in SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site - -# "description" property - description of the feature -description=Source code zips for JPA Tools - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2006-07 Oracle Corporation.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html\n\ -\n\ -Contributors:\n\ - Oracle - initial API and implementation\n -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\ -June 06, 2007\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\ -is provided to you under the terms and conditions of the Eclipse Public\n\ -License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ - - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml deleted file mode 100644 index 78f3de1519..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - %description - - - - %copyright - - - - %license - - - - - - - diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/license.html b/jpa/features/org.eclipse.jpt_sdk.feature/license.html deleted file mode 100644 index fc77372d46..0000000000 --- a/jpa/features/org.eclipse.jpt_sdk.feature/license.html +++ /dev/null @@ -1,98 +0,0 @@ - - -Eclipse.org Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

June 06, 2007

-

Usage Of Content

-

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION -AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF -THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE -TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED -BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED -BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE -AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY -APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU -MAY NOT USE THE CONTENT.

-

Applicable Licenses

-

Unless otherwise indicated, all Content made available by the Eclipse -Foundation is provided to you under the terms and conditions of the Eclipse -Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this -Content and is also available at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

-

Content includes, but is not limited to, source code, object code, -documentation and other files maintained in the Eclipse.org CVS repository -("Repository") in CVS modules ("Modules") and made available as downloadable -archives ("Downloads").

-

Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments -("Fragments"), and features ("Features"). A Feature is a bundle of one or more -Plug-ins and/or Fragments and associated material. Files named "feature.xml" may -contain a list of the names and version numbers of the Plug-ins and/or Fragments -associated with a Feature. Plug-ins and Fragments are located in directories -named "plugins" and Features are located in directories named "features".

-

Features may also include other Features ("Included Features"). Files named -"feature.xml" may contain a list of the names and version numbers of Included -Features.

-

The terms and conditions governing Plug-ins and Fragments should be contained -in files named "about.html" ("Abouts"). The terms and conditions governing -Features and Included Features should be contained in files named "license.html" -("Feature Licenses"). Abouts and Feature Licenses may be located in any -directory of a Download or Module including, but not limited to the following -locations:

-
    -
  • The top-level (root) directory -
  • Plug-in and Fragment directories -
  • Subdirectories of the directory named "src" of certain Plug-ins -
  • Feature directories
-

Note: if a Feature made available by the Eclipse Foundation is installed -using the Eclipse Update Manager, you must agree to a license ("Feature Update -License") during the installation process. If the Feature contains Included -Features, the Feature Update License should either provide you with the terms -and conditions governing the Included Features or inform you where you can -locate them. Feature Update Licenses may be found in the "license" property of -files named "feature.properties". Such Abouts, Feature Licenses and Feature -Update Licenses contain the terms and conditions (or references to such terms -and conditions) that govern your use of the associated Content in that -directory.

-

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):

- -

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.

-

Cryptography

-

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.

diff --git a/jpa/plugins/org.eclipse.jpt.core/.classpath b/jpa/plugins/org.eclipse.jpt.core/.classpath deleted file mode 100644 index 8f257414e6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/.cvsignore b/jpa/plugins/org.eclipse.jpt.core/.cvsignore deleted file mode 100644 index 60463af3fc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -build.xml diff --git a/jpa/plugins/org.eclipse.jpt.core/.project b/jpa/plugins/org.eclipse.jpt.core/.project deleted file mode 100644 index 6ab3035c3c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index a8d148b02f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:09:44 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 00070b73fb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Sun Nov 12 15:24:36 EST 2006 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF deleted file mode 100644 index 3a5fa1af19..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,57 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.core;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.jpt.core.internal.JptCorePlugin -Bundle-ClassPath: . -Bundle-Localization: plugin -Eclipse-LazyStart: true -Require-Bundle: org.eclipse.core.commands, - org.eclipse.core.expressions, - org.eclipse.core.filebuffers, - org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.emf.ecore, - org.eclipse.emf.ecore.xmi, - org.eclipse.jdt.core, - org.eclipse.jem, - org.eclipse.jem.util, - org.eclipse.jem.workbench, - org.eclipse.jpt.db, - org.eclipse.jpt.utility, - org.eclipse.jst.j2ee, - org.eclipse.jst.j2ee.core, - org.eclipse.text, - org.eclipse.wst.common.emf, - org.eclipse.wst.common.frameworks, - org.eclipse.wst.common.modulecore, - org.eclipse.wst.common.project.facet.core, - org.eclipse.wst.sse.core, - org.eclipse.wst.validation, - org.eclipse.wst.xml.core, - org.eclipse.xsd -Export-Package: org.eclipse.jpt.core.internal; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.java; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.java.mappings; x-friends:="org.eclipse.jpt.ui, org.eclipse.jpt.gen", - org.eclipse.jpt.core.internal.content.java.mappings.util; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.java.util; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.orm; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.orm.resource; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.orm.util; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.persistence; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.persistence.resource; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.content.persistence.util; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.emfutility; x-internal:=true, - org.eclipse.jpt.core.internal.facet; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.jdtutility; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.mappings; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.mappings.util; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.platform; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.platform.generic; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.prefs; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.synch; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.util; x-friends:="org.eclipse.jpt.ui", - org.eclipse.jpt.core.internal.validation; x-friends:="org.eclipse.jpt.ui" -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/jpa/plugins/org.eclipse.jpt.core/about.html b/jpa/plugins/org.eclipse.jpt.core/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

About This Content

- -

June 06, 2007

- -

License

- -

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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

- -

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 -http://www.eclipse.org/.

- - - diff --git a/jpa/plugins/org.eclipse.jpt.core/build.properties b/jpa/plugins/org.eclipse.jpt.core/build.properties deleted file mode 100644 index 1db25e376d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -javacSource=1.5 -javacTarget=1.5 -source.. = src/,\ - property_files/ -output.. = bin/ -bin.includes = .,\ - model/,\ - META-INF/,\ - about.html,\ - plugin.xml,\ - plugin.properties -jars.compile.order = . -src.includes = model/ diff --git a/jpa/plugins/org.eclipse.jpt.core/component.xml b/jpa/plugins/org.eclipse.jpt.core/component.xml deleted file mode 100644 index 2311024fcd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/component.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml b/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml deleted file mode 100644 index a8ed2dd9e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore deleted file mode 100644 index 5187cee0c4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore +++ /dev/null @@ -1,577 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel deleted file mode 100644 index 13b24dc6e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel +++ /dev/null @@ -1,694 +0,0 @@ - - - core.ecore - java.ecore - orm.ecore - persistence.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore b/jpa/plugins/org.eclipse.jpt.core/model/java.ecore deleted file mode 100644 index 7c3425fe7a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/javaModel.ecore b/jpa/plugins/org.eclipse.jpt.core/model/javaModel.ecore deleted file mode 100644 index 87cfd4f59e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/javaModel.ecore +++ /dev/null @@ -1,353 +0,0 @@ - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - -
- - - - -
- - - - - -
- - - - -
- - - - -
- - - - - -
- - - - -
- - - - - - -
- - - - -
- - - - - -
- - - - -
- - - - -
- - - - - - -
- - - - - -
- - - - -
- - - - - -
- - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - -
- - - - -
- - - - -
- - - - - -
- - - - -
- - - - - -
- - - - -
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - -
- - - - - -
- - - -
- - - - -
- - - - -
- - - - -
- - - - - - - - -
- - - - -
- - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/javaModel.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/javaModel.genmodel deleted file mode 100644 index f21ce09e58..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/javaModel.genmodel +++ /dev/null @@ -1,173 +0,0 @@ - - - javaModel.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore deleted file mode 100644 index f6cafd0a04..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore b/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore deleted file mode 100644 index b26c36781e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.core/plugin.properties deleted file mode 100644 index b7fb3b7d62..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/plugin.properties +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence API Tools - Core -providerName = Eclipse.org - -JPA_PLATFORM="JPA Platform" -JPA_PROBLEM_MARKER=JPA Problem Marker -JPA_FILE_CONTENT=JPA File Content - -GENERIC_PLATFORM_LABEL=Generic - -JPA_FACET_LABEL=Java Persistence -JPA_FACET_DESCRIPTION=Adds support for writing persistent meta-data using Java Persistence Architecture. -JPA_PRESET_LABEL=Utility JPA project with Java 5.0 -JPA_TEMPLATE_LABEL=JPA Project -JPA_VALIDATOR=JPA Validator - -ORM_XML_CONTENT = ORM XML Content -PERSISTENCE_XML_CONTENT = Persistence XML Content diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.core/plugin.xml deleted file mode 100644 index 8531a3d26e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/plugin.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Only allowing file names of orm.xml. Extenders will have to specify a different file name. - Limitation with WTP translators for registering files names instead of content types - - - Only allowing file names of persistence.xml. - - - - - - - - - - - - - - - - - - - - - - - - %JPA_FACET_DESCRIPTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties deleted file mode 100644 index f1e4174b06..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties +++ /dev/null @@ -1,21 +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 -############################################################################### - -VALIDATE_PLATFORM_NOT_SPECIFIED=Platform must be specified -VALIDATE_CONNECTION_NOT_SPECIFIED=Connection must be specified -VALIDATE_CONNECTION_NOT_CONNECTED=Connection must be active to get data source specific help and validation. -VALIDATE_RUNTIME_NOT_SPECIFIED=There is no server runtime associated with this project to provide a JPA implementation -VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30=The server runtime selected does not support EJB 3.0, so it likely does not provide a JPA implementation -VALIDATE_LIBRARY_NOT_SPECIFIED=No JPA implementation library specified -SYNCHRONIZE_CLASSES_JOB=Synchronizing classes -SYNCHRONIZING_CLASSES_TASK=Synchronizing classes ... -INVALID_PERSISTENCE_XML_CONTENT=Invalid persistence.xml content -ERROR_WRITING_FILE=Could not write to persistence.xml \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties deleted file mode 100644 index 106f77e1b0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### - -PROJECT_NO_CONNECTION=No connection specified for project. No data-specific validation will be performed. -PROJECT_INACTIVE_CONNECTION=Connection \"{0}\" is not active. No validation will be done against the data source. -PROJECT_NO_PERSISTENCE_XML=No persistence.xml file in project -PROJECT_MULTIPLE_PERSISTENCE_XML=Multiple persistence.xml files in project -PERSISTENCE_XML_INVALID_CONTENT=Invalid content (no root node) -PERSISTENCE_NO_PERSISTENCE_UNIT=No persistence unit defined -PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS=Multiple persistence units defined -PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE=Unspecified mapping file -PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE=Mapping file \"{0}\" cannot be resolved -PERSISTENCE_UNIT_INVALID_MAPPING_FILE=Mapping file \"{0}\" does not have ORM content -PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE=Duplicate mapping file \"{0}\" -PERSISTENCE_UNIT_UNSPECIFIED_CLASS=Unspecified class -PERSISTENCE_UNIT_NONEXISTENT_CLASS=Class \"{0}\" cannot be resolved -PERSISTENCE_UNIT_INVALID_CLASS=Class \"{0}\" is not annotated as a persistent class -PERSISTENCE_UNIT_DUPLICATE_CLASS=Duplicate class \"{0}\" -ENTITY_MAPPINGS_MULTIPLE_METADATA=Metadata for persistence unit \"{0}\" specified in multiple mapping files -PERSISTENT_TYPE_UNSPECIFIED_CONTEXT=This mapped class is not contained in any persistence unit -PERSISTENT_TYPE_UNSPECIFIED_CLASS=Unspecified class -PERSISTENT_TYPE_UNRESOLVED_CLASS=Class \"{0}\" cannot be resolved -ENTITY_NO_ID=Entity \"{0}\" has no Id or EmbeddedId -PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Unspecified name -PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=Attribute \"{0}\" in class \"{1}\" cannot be resolved -PERSISTENT_ATTRIBUTE_INVALID_MAPPING=Attribute \"{0}\" has invalid mapping type in this context -PERSISTENT_ATTRIBUTE_FINAL_FIELD=The java field for attribute \"{0}\" is final -PERSISTENT_ATTRIBUTE_PUBLIC_FIELD=The java field for attribute \"{0}\" is public -MAPPING_UNRESOLVED_MAPPED_BY=Cannot resolve attribute named \"{0}\" -MAPPING_INVALID_MAPPED_BY=Attribute named \"{0}\" has invalid mapping for this relationship -MAPPING_MAPPED_BY_WITH_JOIN_TABLE=Cannot specify join table if this attribute is mapped by another attribute -MAPPING_MAPPED_BY_ON_BOTH_SIDES=Relationship must have an owner -TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for table \"{1}\" -TABLE_UNRESOLVED_NAME=Table \"{0}\" cannot be resolved -SECONDARY_TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for secondary table \"{1}\" -SECONDARY_TABLE_UNRESOLVED_NAME=Secondary table \"{0}\" cannot be resolved -JOIN_TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for join table \"{1}\" -VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA=In virtual attribute \"{0}\", schema \"{1}\" cannot be resolved for join table \"{2}\" -JOIN_TABLE_UNRESOLVED_NAME=Join table \"{0}\" cannot be resolved -VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME=In virtual attribute \"{0}\",, join table \"{1}\" cannot be resolved -COLUMN_UNRESOLVED_TABLE=Table \"{0}\" for column \"{1}\" cannot be resolved -VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE=In virtual attribute \"{0}\", table \"{1}\" for column \"{2}\" cannot be resolved -VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE=In virtual attribute override \"{0}\", table \"{1}\" for column \"{2}\" cannot be resolved -COLUMN_UNRESOLVED_NAME=Column \"{0}\" cannot be resolved -VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=In virtual attribute \"{0}\", column \"{1}\" cannot be resolved -VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In virtual attribute override \"{0}\", column \"{1}\" cannot be resolved -JOIN_COLUMN_UNRESOLVED_TABLE=Table \"{0}\" for join column \"{1}\" cannot be resolved -VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE=In virtual attribute \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved -VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE=In virtual association override \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved -JOIN_COLUMN_UNRESOLVED_NAME=Join column \"{0}\" cannot be resolved -VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=In virtual attribute \"{0}\", join column \"{1}\" cannot be resolved -VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=In virtual association override \"{0}\", join column \"{1}\" cannot be resolved -JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=Referenced column \"{0}\" in join column \"{1}\" cannot be resolved -VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In virtual attribute \"{0}\", referenced column \"{1}\" in join column \"{2}\" cannot be resolved -VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In virtual association override \"{0}\", referenced column \"{1}\" in join column \"{2}\" cannot be resolved -GENERATED_VALUE_UNRESOLVED_GENERATOR=No generator named \"{0}\" is defined in the persistence unit -PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Primary key join column \"{0}\" cannot be resolved -PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced Column \"{0}\" in primary key join column \"{1}\" cannot be resolved diff --git a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd b/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd deleted file mode 100644 index dbdb3ec6f5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An translatable string representation of the platform. - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AccessType.java deleted file mode 100644 index a21c66d681..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AccessType.java +++ /dev/null @@ -1,241 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import static org.eclipse.jpt.core.internal.AccessType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.AccessType.FIELD_VALUE; -import static org.eclipse.jpt.core.internal.AccessType.PROPERTY_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Access Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getAccessType() - * @model - * @generated - */ -public enum AccessType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default"), - /** - * The 'PROPERTY' literal object. - * - * - * @see #PROPERTY_VALUE - * @generated - * @ordered - */ - PROPERTY(1, "PROPERTY", "Property"), - /** - * The 'FIELD' literal object. - * - * - * @see #FIELD_VALUE - * @generated - * @ordered - */ - FIELD(2, "FIELD", "Field"); - /** - * The 'Default' literal value. - * - *

- * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

- * - * @see #DEFAULT - * @model name="Default" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'PROPERTY' literal value. - * - *

- * If the meaning of 'PROPERTY' literal object isn't clear, - * there really should be more of a description here... - *

- * - * @see #PROPERTY - * @model literal="Property" - * @generated - * @ordered - */ - public static final int PROPERTY_VALUE = 1; - - /** - * The 'FIELD' literal value. - * - *

- * If the meaning of 'FIELD' literal object isn't clear, - * there really should be more of a description here... - *

- * - * @see #FIELD - * @model literal="Field" - * @generated - * @ordered - */ - public static final int FIELD_VALUE = 2; - - /** - * An array of all the 'Access Type' enumerators. - * - * - * @generated - */ - private static final AccessType[] VALUES_ARRAY = new AccessType[] { - DEFAULT, PROPERTY, FIELD, - }; - - /** - * A public read-only list of all the 'Access Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Access Type' literal with the specified literal value. - * - * - * @generated - */ - public static AccessType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - AccessType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Access Type' literal with the specified name. - * - * - * @generated - */ - public static AccessType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - AccessType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Access Type' literal with the specified integer value. - * - * - * @generated - */ - public static AccessType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case PROPERTY_VALUE : - return PROPERTY; - case FIELD_VALUE : - return FIELD; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private AccessType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } -} //AccessType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java deleted file mode 100644 index 0cf331549b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -/** - * - * A representation of the model object 'IAttribute Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIAttributeMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IAttributeMapping extends IJpaSourceObject -{ - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - IPersistentAttribute getPersistentAttribute(); - - /** - * - * - * @model kind="operation" - * @generated - */ - boolean isDefault(); - - /** - * Return a unique key for the IPersistentAttributeMapping. If this is defined in - * an extension they should be equal. - */ - String getKey(); - - /** - * If the mapping is for a primary key column, return the column's name, - * otherwise return null. - */ - String primaryKeyColumnName(); - - /** - * Return the mapping for the attribute mapping's attribute's type. - */ - ITypeMapping typeMapping(); - - /** - * Return whether the "attribute" mapping can be overridden. - */ - boolean isOverridableAttributeMapping(); - - /** - * Return whether the "association" mapping can be overridden. - */ - boolean isOverridableAssociationMapping(); - - /** - * Return whether the "attribute" mapping is for an ID. - */ - boolean isIdMapping(); -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaContentNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaContentNode.java deleted file mode 100644 index 5d83c12bbf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaContentNode.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -/** - * - * A representation of the model object 'IJpa Content Node'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaContentNode() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaContentNode extends IJpaSourceObject -{ - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - IJpaFile getJpaFile(); - - /** - * Return a unique identifier for all of this class of content nodes - */ - Object getId(); - - /** - * Return the text range for this contentNode. This is the all-inclusive - * text range to be used for finding a particular content node given a source location. - */ - ITextRange fullTextRange(); - - /** - * Return the text range to be used for selection. This is the text you want selected - * when selecting the object in the editor. StructureView uses this for selection - * from the structure to the source editor. - */ - ITextRange selectionTextRange(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaCoreConstants.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaCoreConstants.java deleted file mode 100644 index 6d10115e7c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaCoreConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal; - -public interface IJpaCoreConstants -{ - /** - * Configuration option - */ - public static final String JPA_PLATFORM = JptCorePlugin.PLUGIN_ID + ".platform"; //$NON-NLS-1$ - - /** - * Configuration option - */ - public static final String DATA_SOURCE_CONNECTION_NAME = JptCorePlugin.PLUGIN_ID + ".dataSource.connectionName"; //$NON-NLS-1$ - - /** - * Configuration option - */ - public static final String DISCOVER_ANNOTATED_CLASSES = JptCorePlugin.PLUGIN_ID + ".discoverAnnotatedClasses"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java deleted file mode 100644 index a267a8fbb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.jpt.db.internal.Connection; - -/** - * - * A representation of the model object 'IJpa Data Source'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaDataSource() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaDataSource extends IJpaEObject -{ - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated - */ - String getConnectionProfileName(); - - void setConnectionProfileName(String newConnectionProfileName); - - Connection getConnection(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaEObject.java deleted file mode 100644 index 80a2aaad5f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaEObject.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'IPersistence Element'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaEObject() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaEObject extends EObject -{ - /** - * - * - * @model kind="operation" - * @generated - */ - IJpaProject getJpaProject(); - - /** - * Return the resource that most directly contains this object - */ - IResource getResource(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFile.java deleted file mode 100644 index f55343b043..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFile.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IFile; - -/** - * - * A representation of the model object 'IPersistence File'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaFile() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaFile extends IJpaEObject -{ - /** - * - *

- * If the meaning of the 'Content' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @model kind="operation" - * @generated - */ - IJpaRootContentNode getContent(); - - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - String getContentId(); - - /** - * Return the IFile associated with this JPA file - */ - IFile getFile(); - - /** - * Return the content node corresponding to the given offset in the source. - * This may (and often will) be null. - */ - IJpaContentNode getContentNode(int offset); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFileContentProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFileContentProvider.java deleted file mode 100644 index 75b5650ad2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFileContentProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IFile; - -/** - * A JpaProject corresponds to an IProject and containts of JpaFiles. - * A JpaFile corresponds to a file resource in the project and contains - * an IJpaRootContentNode. Specify an IJpaFileContentProvider for each - * file contentType to be included in the JpaProject. - * - * See IJpaPlatform - * - */ -public interface IJpaFileContentProvider -{ - /** - * Create the IJpaRootContentNode for the given IFile. - * This will be set on the corresponding JpaFile in the JpaProject. - * The file passed in will have a contentType that matches - * the one returned by the contentType() method. - */ - IJpaRootContentNode buildRootContent(IFile file); - - /** - * Return the contentType of the file to be included in the JpaProject. - * This contentType should correspond to one specified through the - * org.eclipse.core.runtime.contentTypes extension point. - * @return - */ - String contentType(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaModel.java deleted file mode 100644 index 890d84a482..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaModel.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Iterator; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'IJpa Model'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaModel() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaModel extends EObject -{ - /** - * Returns the IJpaProject corresponding to the given IProject. - * Returns null if unable to associate the given IProject - * with an IJpaProject. - */ - IJpaProject getJpaProject(IProject project) throws CoreException; - - /** - * Returns a (non-modifiable) Iterator on all the IJpaProjects in the model. - */ - Iterator jpaProjects(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java deleted file mode 100644 index bb58e2c118..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This program and the - * accompanying materials are made available under the terms of the Eclipse - * Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.platform.IContext; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * This interface is to be implemented by a JPA vendor to provide extensions to - * the core JPA model. The core JPA model will provide functinality for JPA - * spec annotations in java and the orm.xml mapping file. - * The org.eclipse.jpt.core.genericPlatform extension supplies - * IJpaFileContentProvider for those file types. As another vendor option you - * will have to supply those IJpaFileContentProviders as well or different ones - * as necessary. - * - * See the org.eclipse.jpt.core.jpaPlatform extension point - */ -public interface IJpaPlatform -{ - /** - * Get the ID for this platform - */ - String getId(); - - /** - * Set the ID for this platform - * - * ************* - * * IMPORTANT * For INTERNAL use only!! - * ************* - */ - void setId(String theId); - - /** - * Get the IJpaProject for this platform - */ - IJpaProject getProject(); - - /** - * Set the IJpaProject on this platform - */ - void setProject(IJpaProject jpaProject); - - // ********** Persistence Unit ******************************************** - boolean containsPersistenceUnitNamed(String name); - - PersistenceUnit persistenceUnitNamed(String name); - - Iterator persistenceUnits(); - - int persistenceUnitSize(); - - // ********** Persistent Types ******************************************** - /** - * Return all persistent types for the persistence unit with the given name - */ - Iterator persistentTypes(String persistenceUnitName); - - // ************************************************************************ - /** - * Get the valid persistence XML files from the project - */ - Iterator validPersistenceXmlFiles(); - - /** - * Return a collection of IJpaFileContentProviders. These will be used to - * determine which files will be read from an IProject based on contentType. - * These contentProviders should have unique contentTypes. - * @return - */ - Collection jpaFileContentProviders(); - - /** - * Build a project context to be used when resynching the intra-model - * references and creating validation problems. - * The JPA model containment hierarchy is inappropriate to use as a context - * for defaults because it is based on the IJpaProject containing files. - * The defaults context for the jpa model is based on the persistence.xml - * and the mapping files and classes it contains. - * - * @see refreshDefaults(Object) - * @return - */ - IContext buildProjectContext(); - - /** - * Build a type context to be used when resynching the intra-model - * references and creating validation problems. - * The JPA model containment hierarchy is inappropriate to use as a context - * for defaults because it is based on the IJpaProject containing files. - * The defaults context for the jpa model is based on the persistence.xml - * and the mapping files and classes it contains. - * - * @see refreshDefaults(Object) - * @return - */ - IContext buildJavaTypeContext(IContext parentContext, IJavaTypeMapping typeMapping); - - /** - * Build an attribute context to be used when resynching the intra-model - * references and creating validation problems. - * The JPA model containment hierarchy is inappropriate to use as a context - * for defaults because it is based on the IJpaProject containing files. - * The defaults context for the jpa model is based on the persistence.xml - * and the mapping files and classes it contains. - * - * @see refreshDefaults(Object) - * @return - */ - IContext buildJavaAttributeContext(IContext parentContext, IJavaAttributeMapping attributeMapping); - - /** - * Resynchronize intra-model connections given the context hierarchy the - * IJpaPlatform built in buildContextHierarchy(). - * This will be called each time an update to the jpa model occurs. If an - * update occurs while the resynch() job is in process, another resynch() - * will be started upon completion. - * @param contextHierarchy - */ - void resynch(IContext contextHierarchy); - - /** - * Adds validation messages to the growing list of messages - */ - void addToMessages(List messages); - /** - * Returns the IGeneratorRepository for the persistence unit of the - * given IPersistentType. A NullGeneratorRepository should be returned - * if the IPersistentType is not part of a persistence unit - * @param persistentType - * @return - */ - // IGeneratorRepository generatorRepository(IPersistentType persistentType); -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java deleted file mode 100644 index 6b9a224adf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Collection; -import java.util.Iterator; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * - * A representation of the model object 'IJpa Project'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaProject() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaProject extends IJpaEObject -{ - /** - * Return the IProject associated with this JPA project - */ - IProject getProject(); - - /** - * Return the IJavaProject associated with the JPA project - */ - IJavaProject getJavaProject(); - - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - IJpaModel getModel(); - - IJpaPlatform getPlatform(); - - /** - * - * - * @model platformIdRequired="true" platformIdOrdered="false" - * @generated - */ - void setPlatform(String platformId); - - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - IJpaDataSource getDataSource(); - - /** - * - * - * @model connectionProfileNameUnique="false" connectionProfileNameRequired="true" connectionProfileNameOrdered="false" - * @generated - */ - void setDataSource(String connectionProfileName); - - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - boolean isDiscoverAnnotatedClasses(); - - /** - * - * - * @model discoverAnnotatedClassesUnique="false" discoverAnnotatedClassesRequired="true" discoverAnnotatedClassesOrdered="false" - * @generated - */ - void setDiscoverAnnotatedClasses(boolean discoverAnnotatedClasses); - - /** - * Return the root "deploy path" for this project. - * - * Web projects return "WEB-INF/classes". - * All other projects simply return "". - */ - String rootDeployLocation(); - - /** - * Returns the IJpaFile corresponding to the given IFile. - * Returns null if unable to associate the given IFile - * with an IJpaFile. - */ - IJpaFile getJpaFile(IFile file) throws CoreException; - - /** - * Return a Collection of IJpaFiles for the given contentType. - * The contentType should match that given in the IJpaFileContentProvider - */ - Collection jpaFiles(String contentType); - - /** - * Returns a (non-modifiable) Iterator on all the IJpaFiles in the project. - */ - Iterator jpaFiles(); - - /** - * Return a JavaPersistentType for the IType, if it exists, null otherwise. - */ - JavaPersistentType findJavaPersistentType(IType type); - - /** - * Reconnect the model together, recalculating default values as needed - */ - void resynch(); - - /** - * Returns all the validation messages for this project - */ - Iterator validationMessages(); - - ConnectionProfile connectionProfile(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaRootContentNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaRootContentNode.java deleted file mode 100644 index 3666fd7d3c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaRootContentNode.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.jdt.core.ElementChangedEvent; - -/** - * - * A representation of the model object 'IJpa Root Content Node'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.IJpaRootContentNode#getJpaFile Jpa File}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaRootContentNode() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaRootContentNode extends IJpaContentNode -{ - /** - * Returns the value of the 'Jpa File' container reference. - * The default value is "". - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}'. - * - *

- * If the meaning of the 'Jpa File' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Jpa File' container reference. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaRootContentNode_JpaFile() - * @see org.eclipse.jpt.core.internal.JpaFile#getContent - * @model opposite="content" changeable="false" - * @generated - */ - IJpaFile getJpaFile(); - - /** - * Return the content node corresponding to the given offset in the source. - * This may (and often will) be null. - */ - IJpaContentNode getContentNode(int offset); - - /** - * Handle java change as befits this file content - */ - void handleJavaElementChangedEvent(ElementChangedEvent event); - - /** - * Dispose before removed from model - */ - void dispose(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaSourceObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaSourceObject.java deleted file mode 100644 index 3b8d70b049..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaSourceObject.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal; - -/** - * A JPA object that can be mapped to a source location, contained within a - * JPA file. - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaSourceObject() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJpaSourceObject extends IJpaEObject -{ - /** - * Return the JPA file containing this object. - */ - IJpaFile getJpaFile(); - - /** - * Return the text range to be used for validation. This is the source - * range that will be highlighted for a validation error. - */ - ITextRange validationTextRange(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IMappingKeys.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IMappingKeys.java deleted file mode 100644 index bf7fb60ab0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IMappingKeys.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -public interface IMappingKeys -{ - String ENTITY_TYPE_MAPPING_KEY = "entity"; - String MAPPED_SUPERCLASS_TYPE_MAPPING_KEY = "mappedSuperclass"; - String EMBEDDABLE_TYPE_MAPPING_KEY = "embeddable"; - String NULL_TYPE_MAPPING_KEY = null; - - String BASIC_ATTRIBUTE_MAPPING_KEY = "basic"; - String ID_ATTRIBUTE_MAPPING_KEY = "id"; - String VERSION_ATTRIBUTE_MAPPING_KEY = "version"; - String ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY = "oneToOne"; - String ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY = "oneToMany"; - String MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY = "manyToOne"; - String MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY = "manyToMany"; - String EMBEDDED_ATTRIBUTE_MAPPING_KEY = "embedded"; - String EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY = "embeddedId"; - String TRANSIENT_ATTRIBUTE_MAPPING_KEY = "transient"; - String NULL_ATTRIBUTE_MAPPING_KEY = null; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java deleted file mode 100644 index 88bbd80811..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Iterator; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; - -/** - * - * A representation of the model object 'IPersistent Attribute'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.IPersistentAttribute#getMapping Mapping}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IPersistentAttribute extends IJpaContentNode -{ - /** - * Returns the value of the 'Mapping' reference. - * - * - * @return the value of the 'Mapping' reference. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute_Mapping() - * @model resolveProxies="false" required="true" transient="true" changeable="false" volatile="true" derived="true" - * @generated - */ - IAttributeMapping getMapping(); - - /** - * - * - * @model required="true" - * @generated - */ - ITypeMapping typeMapping(); - - /** - * - * - * @model kind="operation" required="true" - * @generated - */ - String getName(); - - /** - * - * Return the key for the attribute's mapping. - * The key may be for either the "specified" mapping or, if the "specified" - * mapping is missing, the "default" mapping. - * - * @model required="true" - * @generated - */ - String mappingKey(); - - /** - * - * Return the key for the attribute's "default" mapping. - * - * @model required="true" - * @generated - */ - String defaultMappingKey(); - - /** - * Clients should call this method to set the attribute's mapping. - * Passing in a null key will cause the "specified" mapping to be - * cleared and the attribute's mapping to be its "default" mapping. - */ - void setSpecifiedMappingKey(String key); - - /** - * Return all the attribute's mapping keys. - */ - Iterator candidateMappingKeys(); - - /** - * Return the attribute's Java attribute. - */ - Attribute getAttribute(); - - /** - * If the attribute is mapped to a primary key column, return the - * column's name, otherwise return null. - */ - String primaryKeyColumnName(); - - /** - * Return whether the attribute's "attribute" mapping can be overridden. - */ - boolean isOverridableAttribute(); - - /** - * Return whether the attribute's "association" mapping can be overridden. - */ - boolean isOverridableAssociation(); - - /** - * Return whether the attribute's "attribute" mapping is for an ID. - */ - boolean isIdAttribute(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentType.java deleted file mode 100644 index 1b8cfb5523..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentType.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Iterator; -import org.eclipse.jdt.core.IType; - -/** - * - * A representation of the model object 'IPersistent Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.IPersistentType#getMappingKey Mapping Key}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentType() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IPersistentType extends IJpaContentNode -{ - /** - * Returns the value of the 'Mapping Key' attribute. - * - *

- * If the meaning of the 'Mapping Key' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Mapping Key' attribute. - * @see #setMappingKey(String) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentType_MappingKey() - * @model required="true" - * @generated - */ - String getMappingKey(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.IPersistentType#getMappingKey Mapping Key}' attribute. - * - * - * @param value the new value of the 'Mapping Key' attribute. - * @see #getMappingKey() - * @generated - */ - void setMappingKey(String value); - - /** - * Returns an iterator on all mapping keys that are available for this type. - */ - Iterator candidateMappingKeys(); - - /** - * - *

- * If the meaning of the 'Mapping' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @model kind="operation" required="true" - * @generated - */ - ITypeMapping getMapping(); - - /** - * Return the parent IPersistentType from the inheritance hierarchy. - * If the java inheritance parent is not a IPersistentType then continue - * up the hierarchy. Return null if this persistentType is the root - * persistent type. - * @model - * @generated - */ - IPersistentType parentPersistentType(); - - /** - * Return a read-only iterator of the contained IPersistentAttributes - */ - Iterator attributes(); - - Iterator attributeNames(); - - /** - * Return a read-only iterator of the all the IPersistentAttributes - * in the hierarchy - */ - Iterator allAttributes(); - - Iterator allAttributeNames(); - - /** - * Return the attribute named attributeName if - * it exists locally on this type - */ - IPersistentAttribute attributeNamed(String attributeName); - - /** - * Resolve and return the attribute named attributeName if it - * is distinct and exists within the context of this type - */ - IPersistentAttribute resolveAttribute(String attributeName); - - Iterator inheritanceHierarchy(); - - /** - * Return the corresponding JDT IType, if it resolves to a single IType - */ - IType findJdtType(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITextRange.java deleted file mode 100644 index 127438a635..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITextRange.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -/** - * A text range defines the offset into, length of, and line of a piece - * of text. - *

- * This interface is not intended to be implemented by clients. - *

- */ -public interface ITextRange { - - /** - * Returns the offset of the text. - * - * @return the offset of the text - */ - int getOffset(); - - /** - * Return the length of the text. - */ - int getLength(); - - /** - * Return whether the range includes the character at the specified index. - */ - boolean includes(int index); - - /** - * Return whether the range touches an insertion cursor at the - * specified index. - */ - boolean touches(int index); - - /** - * Return the line number of the text. - */ - int getLineNumber(); - - /** - * Return true if the offsets and lengths are the same. - */ - boolean equals(Object obj); - - /** - * Return a hash code that corresponds to the #equals() contract. - */ - int hashCode(); - - - /** - * Empty implementation of text range. - */ - final class Empty implements ITextRange { - public static final ITextRange INSTANCE = new Empty(); - public static ITextRange instance() { - return INSTANCE; - } - // ensure single instance - private Empty() { - super(); - } - public int getOffset() { - return 0; - } - public int getLength() { - return 0; - } - public boolean includes(int index) { - return false; - } - public boolean touches(int index) { - return index == 0; // ??? - } - public int getLineNumber() { - return 0; - } - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if ( ! (o instanceof ITextRange)) { - return false; - } - ITextRange r = (ITextRange) o; - return (r.getOffset() == 0) - && (r.getLength() == 0); - } - @Override - public int hashCode() { - return 0; - } - @Override - public String toString() { - return "ITextRange.Empty"; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITypeMapping.java deleted file mode 100644 index cbc352aca4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITypeMapping.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Iterator; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'I Type Mapping'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.ITypeMapping#getName Name}
  • - *
  • {@link org.eclipse.jpt.core.internal.ITypeMapping#getTableName Table Name}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getITypeMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ITypeMapping extends IJpaSourceObject -{ - /** - * Return a unique key for the ITypeMapping. If this is defined in - * an extension they should be equal. - * @return - */ - String getKey(); - - IPersistentType getPersistentType(); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getITypeMapping_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getName(); - - /** - * Returns the value of the 'Table Name' attribute. - * - *

- * If the meaning of the 'Table Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table Name' attribute. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getITypeMapping_TableName() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getTableName(); - - /** - * Return the type mapping's "associated" tables, which includes the - * primary table and the collection of secondary tables. - */ - Iterator associatedTables(); - - /** - * Return the type mapping's "associated" tables, which includes the - * primary table and the collection of secondary tables, as well as all - * inherited "associated" tables. - */ - Iterator associatedTablesIncludingInherited(); - - /** - * Return the names of the type mapping's "associated" tables, - * which includes the primary table and the collection of secondary - * tables, as well as the names of all the inherited "associated" tables. - */ - Iterator associatedTableNamesIncludingInherited(); - - /** - * return the resolved primary db table - */ - Table primaryDbTable(); - - Schema dbSchema(); - - /** - * return the resolved associated db table with the passed in name - */ - Table dbTable(String tableName); - - /** - * Return whether the specified table is invalid for any annotations - * associated with the type mapping. - */ - boolean tableNameIsInvalid(String tableName); - - /** - * Return an Iterator of attribute names. The attributes must be BasicMappings or IdMappings - * found in any MappedSuperclass in the inheritance hierarchy - */ - Iterator overridableAttributeNames(); - - /** - * Return an Iterator of attribute names. The attributes must be OneToOneMappings or ManyToOneMappings - * found in any MappedSuperclass in the inheritance hierarchy - */ - Iterator overridableAssociationNames(); - - Iterator allOverridableAttributeNames(); - - Iterator allOverridableAssociationNames(); - - /** - * Return whether the given attribute mapping key is valid for this particular - * type mapping - * (for example, id's are not valid for an embeddable type mapping) - */ - boolean attributeMappingKeyAllowed(String attributeMappingKey); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IXmlEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IXmlEObject.java deleted file mode 100644 index 9e10d438d8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IXmlEObject.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal; - -/** - * - * A representation of the model object 'IXml EObject'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIXmlEObject() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IXmlEObject extends IJpaEObject, IJpaSourceObject -{ - boolean isAllFeaturesUnset(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCoreFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCoreFactory.java deleted file mode 100644 index d5c378240e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCoreFactory.java +++ /dev/null @@ -1,209 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -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; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage - * @generated - */ -public class JpaCoreFactory extends EFactoryImpl -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final JpaCoreFactory eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static JpaCoreFactory init() { - try { - JpaCoreFactory theJpaCoreFactory = (JpaCoreFactory) EPackage.Registry.INSTANCE.getEFactory("jpt.core.xmi"); - if (theJpaCoreFactory != null) { - return theJpaCoreFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new JpaCoreFactory(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public JpaCoreFactory() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case JpaCorePackage.JPA_MODEL : - return createJpaModel(); - case JpaCorePackage.JPA_PROJECT : - return createJpaProject(); - case JpaCorePackage.JPA_DATA_SOURCE : - return createJpaDataSource(); - case JpaCorePackage.JPA_FILE : - return createJpaFile(); - case JpaCorePackage.NULL_TYPE_MAPPING : - return createNullTypeMapping(); - default : - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case JpaCorePackage.ACCESS_TYPE : - return createAccessTypeFromString(eDataType, initialValue); - default : - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case JpaCorePackage.ACCESS_TYPE : - return convertAccessTypeToString(eDataType, instanceValue); - default : - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public JpaModel createJpaModel() { - JpaModel jpaModel = new JpaModel(); - return jpaModel; - } - - /** - * - * - * @generated - */ - public JpaProject createJpaProject() { - JpaProject jpaProject = new JpaProject(); - return jpaProject; - } - - /** - * - * - * @generated - */ - public JpaDataSource createJpaDataSource() { - JpaDataSource jpaDataSource = new JpaDataSource(); - return jpaDataSource; - } - - /** - * - * - * @generated - */ - public JpaFile createJpaFile() { - JpaFile jpaFile = new JpaFile(); - return jpaFile; - } - - /** - * - * - * @generated - */ - public NullTypeMapping createNullTypeMapping() { - NullTypeMapping nullTypeMapping = new NullTypeMapping(); - return nullTypeMapping; - } - - /** - * - * - * @generated - */ - public AccessType createAccessTypeFromString(EDataType eDataType, String initialValue) { - AccessType result = AccessType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertAccessTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public JpaCorePackage getJpaCorePackage() { - return (JpaCorePackage) getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static JpaCorePackage getPackage() { - return JpaCorePackage.eINSTANCE; - } -} //JpaCoreFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java deleted file mode 100644 index 0ff0f2c762..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java +++ /dev/null @@ -1,1819 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.jpt.core.internal.JpaCoreFactory - * @model kind="package" - * @generated - */ -public class JpaCorePackage extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "internal"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "jpt.core.xmi"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "jpt.core"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final JpaCorePackage eINSTANCE = org.eclipse.jpt.core.internal.JpaCorePackage.init(); - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaModel IJpa Model}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaModel - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaModel() - * @generated - */ - public static final int IJPA_MODEL = 0; - - /** - * The number of structural features of the 'IJpa Model' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_MODEL_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaEObject() - * @generated - */ - public static final int IJPA_EOBJECT = 2; - - /** - * The number of structural features of the 'IJpa EObject' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_EOBJECT_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaEObject() - * @generated - */ - public static final int JPA_EOBJECT = 3; - - /** - * The number of structural features of the 'Jpa EObject' class. - * - * - * @generated - * @ordered - */ - public static final int JPA_EOBJECT_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.JpaModel Jpa Model}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaModel - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaModel() - * @generated - */ - public static final int JPA_MODEL = 1; - - /** - * The feature id for the 'Projects' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JPA_MODEL__PROJECTS = JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Jpa Model' class. - * - * - * @generated - * @ordered - */ - public static final int JPA_MODEL_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaProject IJpa Project}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaProject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaProject() - * @generated - */ - public static final int IJPA_PROJECT = 4; - - /** - * The number of structural features of the 'IJpa Project' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_PROJECT_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.JpaProject Jpa Project}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaProject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject() - * @generated - */ - public static final int JPA_PROJECT = 5; - - /** - * The feature id for the 'Platform' reference. - * - * - * @generated - * @ordered - */ - public static final int JPA_PROJECT__PLATFORM = JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Data Source' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JPA_PROJECT__DATA_SOURCE = JPA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Discover Annotated Classes' attribute. - * - * - * @generated - * @ordered - */ - public static final int JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES = JPA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Files' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JPA_PROJECT__FILES = JPA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Jpa Project' class. - * - * - * @generated - * @ordered - */ - public static final int JPA_PROJECT_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaPlatform IJpa Platform}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaPlatform - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaPlatform() - * @generated - */ - public static final int IJPA_PLATFORM = 6; - - /** - * The number of structural features of the 'IJpa Platform' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_PLATFORM_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaDataSource IJpa Data Source}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaDataSource - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaDataSource() - * @generated - */ - public static final int IJPA_DATA_SOURCE = 7; - - /** - * The number of structural features of the 'IJpa Data Source' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_DATA_SOURCE_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.JpaDataSource Jpa Data Source}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaDataSource - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaDataSource() - * @generated - */ - public static final int JPA_DATA_SOURCE = 8; - - /** - * The feature id for the 'Connection Profile Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME = JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Jpa Data Source' class. - * - * - * @generated - * @ordered - */ - public static final int JPA_DATA_SOURCE_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaFile IJpa File}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaFile - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaFile() - * @generated - */ - public static final int IJPA_FILE = 9; - - /** - * The number of structural features of the 'IJpa File' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_FILE_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.JpaFile Jpa File}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaFile - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaFile() - * @generated - */ - public static final int JPA_FILE = 10; - - /** - * The feature id for the 'Content Id' attribute. - * - * - * @generated - * @ordered - */ - public static final int JPA_FILE__CONTENT_ID = JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Content' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JPA_FILE__CONTENT = JPA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Jpa File' class. - * - * - * @generated - * @ordered - */ - public static final int JPA_FILE_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaSourceObject() - * @generated - */ - public static final int IJPA_SOURCE_OBJECT = 11; - - /** - * The number of structural features of the 'IJpa Source Object' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_SOURCE_OBJECT_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IXmlEObject IXml EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.IXmlEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIXmlEObject() - * @generated - */ - public static final int IXML_EOBJECT = 12; - - /** - * The number of structural features of the 'IXml EObject' class. - * - * - * @generated - * @ordered - */ - public static final int IXML_EOBJECT_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.XmlEObject Xml EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.XmlEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject() - * @generated - */ - public static final int XML_EOBJECT = 13; - - /** - * The number of structural features of the 'Xml EObject' class. - * - * - * @generated - * @ordered - */ - public static final int XML_EOBJECT_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaContentNode() - * @generated - */ - public static final int IJPA_CONTENT_NODE = 14; - - /** - * The number of structural features of the 'IJpa Content Node' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_CONTENT_NODE_FEATURE_COUNT = IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaRootContentNode() - * @generated - */ - public static final int IJPA_ROOT_CONTENT_NODE = 15; - - /** - * The feature id for the 'Jpa File' container reference. - * - * - * @generated - * @ordered - */ - public static final int IJPA_ROOT_CONTENT_NODE__JPA_FILE = IJPA_CONTENT_NODE_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IJpa Root Content Node' class. - * - * - * @generated - * @ordered - */ - public static final int IJPA_ROOT_CONTENT_NODE_FEATURE_COUNT = IJPA_CONTENT_NODE_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IPersistentType IPersistent Type}' class. - * - * - * @see org.eclipse.jpt.core.internal.IPersistentType - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentType() - * @generated - */ - public static final int IPERSISTENT_TYPE = 16; - - /** - * The feature id for the 'Mapping Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPERSISTENT_TYPE__MAPPING_KEY = IJPA_CONTENT_NODE_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IPersistent Type' class. - * - * - * @generated - * @ordered - */ - public static final int IPERSISTENT_TYPE_FEATURE_COUNT = IJPA_CONTENT_NODE_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getITypeMapping() - * @generated - */ - public static final int ITYPE_MAPPING = 17; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITYPE_MAPPING__NAME = IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITYPE_MAPPING__TABLE_NAME = IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'IType Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int ITYPE_MAPPING_FEATURE_COUNT = IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.NullTypeMapping Null Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.NullTypeMapping - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getNullTypeMapping() - * @generated - */ - public static final int NULL_TYPE_MAPPING = 18; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int NULL_TYPE_MAPPING__NAME = JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int NULL_TYPE_MAPPING__TABLE_NAME = JPA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Null Type Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int NULL_TYPE_MAPPING_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IPersistentAttribute IPersistent Attribute}' class. - * - * - * @see org.eclipse.jpt.core.internal.IPersistentAttribute - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute() - * @generated - */ - public static final int IPERSISTENT_ATTRIBUTE = 19; - - /** - * The feature id for the 'Mapping' reference. - * - * - * @generated - * @ordered - */ - public static final int IPERSISTENT_ATTRIBUTE__MAPPING = IJPA_CONTENT_NODE_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IPersistent Attribute' class. - * - * - * @generated - * @ordered - */ - public static final int IPERSISTENT_ATTRIBUTE_FEATURE_COUNT = IJPA_CONTENT_NODE_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIAttributeMapping() - * @generated - */ - public static final int IATTRIBUTE_MAPPING = 20; - - /** - * The number of structural features of the 'IAttribute Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int IATTRIBUTE_MAPPING_FEATURE_COUNT = IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.AccessType Access Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.AccessType - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getAccessType() - * @generated - */ - public static final int ACCESS_TYPE = 21; - - /** - * - * - * @generated - */ - private EClass iJpaModelEClass = null; - - /** - * - * - * @generated - */ - private EClass jpaModelEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaEObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass jpaEObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaProjectEClass = null; - - /** - * - * - * @generated - */ - private EClass jpaProjectEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaPlatformEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaDataSourceEClass = null; - - /** - * - * - * @generated - */ - private EClass jpaDataSourceEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaFileEClass = null; - - /** - * - * - * @generated - */ - private EClass jpaFileEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaSourceObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass iXmlEObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaContentNodeEClass = null; - - /** - * - * - * @generated - */ - private EClass iJpaRootContentNodeEClass = null; - - /** - * - * - * @generated - */ - private EClass iPersistentTypeEClass = null; - - /** - * - * - * @generated - */ - private EClass iTypeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass nullTypeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iPersistentAttributeEClass = null; - - /** - * - * - * @generated - */ - private EClass iAttributeMappingEClass = null; - - /** - * - * - * @generated - */ - private EEnum accessTypeEEnum = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

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. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.jpt.core.internal.JpaCorePackage#eNS_URI - * @see #init() - * @generated - */ - private JpaCorePackage() { - super(eNS_URI, JpaCoreFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static JpaCorePackage init() { - if (isInited) - return (JpaCorePackage) EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI); - // Obtain or create and register package - JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new JpaCorePackage()); - isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - // Obtain or create and register interdependencies - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE); - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE); - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) instanceof JpaJavaMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) : JpaJavaMappingsPackage.eINSTANCE); - OrmPackage theOrmPackage = (OrmPackage) (EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE); - PersistencePackage thePersistencePackage = (PersistencePackage) (EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE); - // Create package meta-data objects - theJpaCorePackage.createPackageContents(); - theJpaCoreMappingsPackage.createPackageContents(); - theJpaJavaPackage.createPackageContents(); - theJpaJavaMappingsPackage.createPackageContents(); - theOrmPackage.createPackageContents(); - thePersistencePackage.createPackageContents(); - // Initialize created meta-data - theJpaCorePackage.initializePackageContents(); - theJpaCoreMappingsPackage.initializePackageContents(); - theJpaJavaPackage.initializePackageContents(); - theJpaJavaMappingsPackage.initializePackageContents(); - theOrmPackage.initializePackageContents(); - thePersistencePackage.initializePackageContents(); - // Mark meta-data to indicate it can't be changed - theJpaCorePackage.freeze(); - return theJpaCorePackage; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaModel IJpa Model}'. - * - * - * @return the meta object for class 'IJpa Model'. - * @see org.eclipse.jpt.core.internal.IJpaModel - * @generated - */ - public EClass getIJpaModel() { - return iJpaModelEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.JpaModel Jpa Model}'. - * - * - * @return the meta object for class 'Jpa Model'. - * @see org.eclipse.jpt.core.internal.JpaModel - * @generated - */ - public EClass getJpaModel() { - return jpaModelEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.JpaModel#getProjects Projects}'. - * - * - * @return the meta object for the containment reference list 'Projects'. - * @see org.eclipse.jpt.core.internal.JpaModel#getProjects() - * @see #getJpaModel() - * @generated - */ - public EReference getJpaModel_Projects() { - return (EReference) jpaModelEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * - * @return the meta object for class 'IJpa EObject'. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public EClass getIJpaEObject() { - return iJpaEObjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}'. - * - * - * @return the meta object for class 'Jpa EObject'. - * @see org.eclipse.jpt.core.internal.JpaEObject - * @generated - */ - public EClass getJpaEObject() { - return jpaEObjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaProject IJpa Project}'. - * - * - * @return the meta object for class 'IJpa Project'. - * @see org.eclipse.jpt.core.internal.IJpaProject - * @generated - */ - public EClass getIJpaProject() { - return iJpaProjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.JpaProject Jpa Project}'. - * - * - * @return the meta object for class 'Jpa Project'. - * @see org.eclipse.jpt.core.internal.JpaProject - * @generated - */ - public EClass getJpaProject() { - return jpaProjectEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.JpaProject#getPlatform Platform}'. - * - * - * @return the meta object for the reference 'Platform'. - * @see org.eclipse.jpt.core.internal.JpaProject#getPlatform() - * @see #getJpaProject() - * @generated - */ - public EReference getJpaProject_Platform() { - return (EReference) jpaProjectEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.JpaProject#getDataSource Data Source}'. - * - * - * @return the meta object for the containment reference 'Data Source'. - * @see org.eclipse.jpt.core.internal.JpaProject#getDataSource() - * @see #getJpaProject() - * @generated - */ - public EReference getJpaProject_DataSource() { - return (EReference) jpaProjectEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.JpaProject#isDiscoverAnnotatedClasses Discover Annotated Classes}'. - * - * - * @return the meta object for the attribute 'Discover Annotated Classes'. - * @see org.eclipse.jpt.core.internal.JpaProject#isDiscoverAnnotatedClasses() - * @see #getJpaProject() - * @generated - */ - public EAttribute getJpaProject_DiscoverAnnotatedClasses() { - return (EAttribute) jpaProjectEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.JpaProject#getFiles Files}'. - * - * - * @return the meta object for the containment reference list 'Files'. - * @see org.eclipse.jpt.core.internal.JpaProject#getFiles() - * @see #getJpaProject() - * @generated - */ - public EReference getJpaProject_Files() { - return (EReference) jpaProjectEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaPlatform IJpa Platform}'. - * - * - * @return the meta object for class 'IJpa Platform'. - * @see org.eclipse.jpt.core.internal.IJpaPlatform - * @generated - */ - public EClass getIJpaPlatform() { - return iJpaPlatformEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaDataSource IJpa Data Source}'. - * - * - * @return the meta object for class 'IJpa Data Source'. - * @see org.eclipse.jpt.core.internal.IJpaDataSource - * @generated - */ - public EClass getIJpaDataSource() { - return iJpaDataSourceEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.JpaDataSource Jpa Data Source}'. - * - * - * @return the meta object for class 'Jpa Data Source'. - * @see org.eclipse.jpt.core.internal.JpaDataSource - * @generated - */ - public EClass getJpaDataSource() { - return jpaDataSourceEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.JpaDataSource#getConnectionProfileName Connection Profile Name}'. - * - * - * @return the meta object for the attribute 'Connection Profile Name'. - * @see org.eclipse.jpt.core.internal.JpaDataSource#getConnectionProfileName() - * @see #getJpaDataSource() - * @generated - */ - public EAttribute getJpaDataSource_ConnectionProfileName() { - return (EAttribute) jpaDataSourceEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaFile IJpa File}'. - * - * - * @return the meta object for class 'IJpa File'. - * @see org.eclipse.jpt.core.internal.IJpaFile - * @generated - */ - public EClass getIJpaFile() { - return iJpaFileEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.JpaFile Jpa File}'. - * - * - * @return the meta object for class 'Jpa File'. - * @see org.eclipse.jpt.core.internal.JpaFile - * @generated - */ - public EClass getJpaFile() { - return jpaFileEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.JpaFile#getContentId Content Id}'. - * - * - * @return the meta object for the attribute 'Content Id'. - * @see org.eclipse.jpt.core.internal.JpaFile#getContentId() - * @see #getJpaFile() - * @generated - */ - public EAttribute getJpaFile_ContentId() { - return (EAttribute) jpaFileEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}'. - * - * - * @return the meta object for the containment reference 'Content'. - * @see org.eclipse.jpt.core.internal.JpaFile#getContent() - * @see #getJpaFile() - * @generated - */ - public EReference getJpaFile_Content() { - return (EReference) jpaFileEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * - * @return the meta object for class 'IJpa Source Object'. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public EClass getIJpaSourceObject() { - return iJpaSourceObjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IXmlEObject IXml EObject}'. - * - * - * @return the meta object for class 'IXml EObject'. - * @see org.eclipse.jpt.core.internal.IXmlEObject - * @generated - */ - public EClass getIXmlEObject() { - return iXmlEObjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.XmlEObject Xml EObject}'. - * - * - * @return the meta object for class 'Xml EObject'. - * @see org.eclipse.jpt.core.internal.XmlEObject - * @generated - */ - public EClass getXmlEObject() { - return xmlEObjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}'. - * - * - * @return the meta object for class 'IJpa Content Node'. - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @generated - */ - public EClass getIJpaContentNode() { - return iJpaContentNodeEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}'. - * - * - * @return the meta object for class 'IJpa Root Content Node'. - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @generated - */ - public EClass getIJpaRootContentNode() { - return iJpaRootContentNodeEClass; - } - - /** - * Returns the meta object for the container reference '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode#getJpaFile Jpa File}'. - * - * - * @return the meta object for the container reference 'Jpa File'. - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode#getJpaFile() - * @see #getIJpaRootContentNode() - * @generated - */ - public EReference getIJpaRootContentNode_JpaFile() { - return (EReference) iJpaRootContentNodeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IPersistentType IPersistent Type}'. - * - * - * @return the meta object for class 'IPersistent Type'. - * @see org.eclipse.jpt.core.internal.IPersistentType - * @generated - */ - public EClass getIPersistentType() { - return iPersistentTypeEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.IPersistentType#getMappingKey Mapping Key}'. - * - * - * @return the meta object for the attribute 'Mapping Key'. - * @see org.eclipse.jpt.core.internal.IPersistentType#getMappingKey() - * @see #getIPersistentType() - * @generated - */ - public EAttribute getIPersistentType_MappingKey() { - return (EAttribute) iPersistentTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}'. - * - * - * @return the meta object for class 'IType Mapping'. - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @generated - */ - public EClass getITypeMapping() { - return iTypeMappingEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.ITypeMapping#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.ITypeMapping#getName() - * @see #getITypeMapping() - * @generated - */ - public EAttribute getITypeMapping_Name() { - return (EAttribute) iTypeMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.ITypeMapping#getTableName Table Name}'. - * - * - * @return the meta object for the attribute 'Table Name'. - * @see org.eclipse.jpt.core.internal.ITypeMapping#getTableName() - * @see #getITypeMapping() - * @generated - */ - public EAttribute getITypeMapping_TableName() { - return (EAttribute) iTypeMappingEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.NullTypeMapping Null Type Mapping}'. - * - * - * @return the meta object for class 'Null Type Mapping'. - * @see org.eclipse.jpt.core.internal.NullTypeMapping - * @generated - */ - public EClass getNullTypeMapping() { - return nullTypeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IPersistentAttribute IPersistent Attribute}'. - * - * - * @return the meta object for class 'IPersistent Attribute'. - * @see org.eclipse.jpt.core.internal.IPersistentAttribute - * @generated - */ - public EClass getIPersistentAttribute() { - return iPersistentAttributeEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.IPersistentAttribute#getMapping Mapping}'. - * - * - * @return the meta object for the reference 'Mapping'. - * @see org.eclipse.jpt.core.internal.IPersistentAttribute#getMapping() - * @see #getIPersistentAttribute() - * @generated - */ - public EReference getIPersistentAttribute_Mapping() { - return (EReference) iPersistentAttributeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}'. - * - * - * @return the meta object for class 'IAttribute Mapping'. - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @generated - */ - public EClass getIAttributeMapping() { - return iAttributeMappingEClass; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.AccessType Access Type}'. - * - * - * @return the meta object for enum 'Access Type'. - * @see org.eclipse.jpt.core.internal.AccessType - * @generated - */ - public EEnum getAccessType() { - return accessTypeEEnum; - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public JpaCoreFactory getJpaCoreFactory() { - return (JpaCoreFactory) getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - // Create classes and their features - iJpaModelEClass = createEClass(IJPA_MODEL); - jpaModelEClass = createEClass(JPA_MODEL); - createEReference(jpaModelEClass, JPA_MODEL__PROJECTS); - iJpaEObjectEClass = createEClass(IJPA_EOBJECT); - jpaEObjectEClass = createEClass(JPA_EOBJECT); - iJpaProjectEClass = createEClass(IJPA_PROJECT); - jpaProjectEClass = createEClass(JPA_PROJECT); - createEReference(jpaProjectEClass, JPA_PROJECT__PLATFORM); - createEReference(jpaProjectEClass, JPA_PROJECT__DATA_SOURCE); - createEAttribute(jpaProjectEClass, JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES); - createEReference(jpaProjectEClass, JPA_PROJECT__FILES); - iJpaPlatformEClass = createEClass(IJPA_PLATFORM); - iJpaDataSourceEClass = createEClass(IJPA_DATA_SOURCE); - jpaDataSourceEClass = createEClass(JPA_DATA_SOURCE); - createEAttribute(jpaDataSourceEClass, JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME); - iJpaFileEClass = createEClass(IJPA_FILE); - jpaFileEClass = createEClass(JPA_FILE); - createEAttribute(jpaFileEClass, JPA_FILE__CONTENT_ID); - createEReference(jpaFileEClass, JPA_FILE__CONTENT); - iJpaSourceObjectEClass = createEClass(IJPA_SOURCE_OBJECT); - iXmlEObjectEClass = createEClass(IXML_EOBJECT); - xmlEObjectEClass = createEClass(XML_EOBJECT); - iJpaContentNodeEClass = createEClass(IJPA_CONTENT_NODE); - iJpaRootContentNodeEClass = createEClass(IJPA_ROOT_CONTENT_NODE); - createEReference(iJpaRootContentNodeEClass, IJPA_ROOT_CONTENT_NODE__JPA_FILE); - iPersistentTypeEClass = createEClass(IPERSISTENT_TYPE); - createEAttribute(iPersistentTypeEClass, IPERSISTENT_TYPE__MAPPING_KEY); - iTypeMappingEClass = createEClass(ITYPE_MAPPING); - createEAttribute(iTypeMappingEClass, ITYPE_MAPPING__NAME); - createEAttribute(iTypeMappingEClass, ITYPE_MAPPING__TABLE_NAME); - nullTypeMappingEClass = createEClass(NULL_TYPE_MAPPING); - iPersistentAttributeEClass = createEClass(IPERSISTENT_ATTRIBUTE); - createEReference(iPersistentAttributeEClass, IPERSISTENT_ATTRIBUTE__MAPPING); - iAttributeMappingEClass = createEClass(IATTRIBUTE_MAPPING); - // Create enums - accessTypeEEnum = createEEnum(ACCESS_TYPE); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - // Obtain other dependent packages - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI); - EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - // Add subpackages - getESubpackages().add(theJpaCoreMappingsPackage); - // Create type parameters - // Set bounds for type parameters - // Add supertypes to classes - jpaModelEClass.getESuperTypes().add(this.getJpaEObject()); - jpaModelEClass.getESuperTypes().add(this.getIJpaModel()); - jpaEObjectEClass.getESuperTypes().add(this.getIJpaEObject()); - iJpaProjectEClass.getESuperTypes().add(this.getIJpaEObject()); - jpaProjectEClass.getESuperTypes().add(this.getJpaEObject()); - jpaProjectEClass.getESuperTypes().add(this.getIJpaProject()); - iJpaDataSourceEClass.getESuperTypes().add(this.getIJpaEObject()); - jpaDataSourceEClass.getESuperTypes().add(this.getJpaEObject()); - jpaDataSourceEClass.getESuperTypes().add(this.getIJpaDataSource()); - iJpaFileEClass.getESuperTypes().add(this.getIJpaEObject()); - jpaFileEClass.getESuperTypes().add(this.getJpaEObject()); - jpaFileEClass.getESuperTypes().add(this.getIJpaFile()); - iJpaSourceObjectEClass.getESuperTypes().add(this.getIJpaEObject()); - iXmlEObjectEClass.getESuperTypes().add(this.getIJpaEObject()); - iXmlEObjectEClass.getESuperTypes().add(this.getIJpaSourceObject()); - xmlEObjectEClass.getESuperTypes().add(this.getJpaEObject()); - xmlEObjectEClass.getESuperTypes().add(this.getIXmlEObject()); - iJpaContentNodeEClass.getESuperTypes().add(this.getIJpaSourceObject()); - iJpaRootContentNodeEClass.getESuperTypes().add(this.getIJpaContentNode()); - iPersistentTypeEClass.getESuperTypes().add(this.getIJpaContentNode()); - iTypeMappingEClass.getESuperTypes().add(this.getIJpaSourceObject()); - nullTypeMappingEClass.getESuperTypes().add(this.getJpaEObject()); - nullTypeMappingEClass.getESuperTypes().add(this.getITypeMapping()); - nullTypeMappingEClass.getESuperTypes().add(this.getIJpaSourceObject()); - iPersistentAttributeEClass.getESuperTypes().add(this.getIJpaContentNode()); - iAttributeMappingEClass.getESuperTypes().add(this.getIJpaSourceObject()); - // Initialize classes and features; add operations and parameters - initEClass(iJpaModelEClass, IJpaModel.class, "IJpaModel", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(jpaModelEClass, JpaModel.class, "JpaModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJpaModel_Projects(), this.getIJpaProject(), null, "projects", null, 0, -1, JpaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iJpaEObjectEClass, IJpaEObject.class, "IJpaEObject", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJpaEObjectEClass, this.getIJpaProject(), "getJpaProject", 0, 1); - initEClass(jpaEObjectEClass, JpaEObject.class, "JpaEObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iJpaProjectEClass, IJpaProject.class, "IJpaProject", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJpaProjectEClass, this.getIJpaModel(), "getModel", 1, 1); - addEOperation(iJpaProjectEClass, this.getIJpaPlatform(), "getPlatform", 1, 1); - EOperation op = addEOperation(iJpaProjectEClass, null, "setPlatform"); - addEParameter(op, theEcorePackage.getEString(), "platformId", 1, 1); - addEOperation(iJpaProjectEClass, this.getIJpaDataSource(), "getDataSource", 1, 1); - op = addEOperation(iJpaProjectEClass, null, "setDataSource"); - addEParameter(op, theEcorePackage.getEString(), "connectionProfileName", 1, 1); - addEOperation(iJpaProjectEClass, theEcorePackage.getEBoolean(), "isDiscoverAnnotatedClasses", 1, 1); - op = addEOperation(iJpaProjectEClass, null, "setDiscoverAnnotatedClasses"); - addEParameter(op, theEcorePackage.getEBoolean(), "discoverAnnotatedClasses", 1, 1); - initEClass(jpaProjectEClass, JpaProject.class, "JpaProject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJpaProject_Platform(), this.getIJpaPlatform(), null, "platform", null, 1, 1, JpaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJpaProject_DataSource(), this.getIJpaDataSource(), null, "dataSource", null, 0, 1, JpaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJpaProject_DiscoverAnnotatedClasses(), theEcorePackage.getEBoolean(), "discoverAnnotatedClasses", "false", 1, 1, JpaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJpaProject_Files(), this.getIJpaFile(), null, "files", null, 0, -1, JpaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iJpaPlatformEClass, IJpaPlatform.class, "IJpaPlatform", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iJpaDataSourceEClass, IJpaDataSource.class, "IJpaDataSource", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJpaDataSourceEClass, theEcorePackage.getEString(), "getConnectionProfileName", 1, 1); - initEClass(jpaDataSourceEClass, JpaDataSource.class, "JpaDataSource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJpaDataSource_ConnectionProfileName(), ecorePackage.getEString(), "connectionProfileName", null, 1, 1, JpaDataSource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEClass(iJpaFileEClass, IJpaFile.class, "IJpaFile", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJpaFileEClass, ecorePackage.getEString(), "getContentId", 1, 1); - addEOperation(iJpaFileEClass, this.getIJpaRootContentNode(), "getContent", 0, 1); - initEClass(jpaFileEClass, JpaFile.class, "JpaFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJpaFile_ContentId(), ecorePackage.getEString(), "contentId", null, 1, 1, JpaFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getJpaFile_Content(), this.getIJpaRootContentNode(), this.getIJpaRootContentNode_JpaFile(), "content", null, 0, 1, JpaFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iJpaSourceObjectEClass, IJpaSourceObject.class, "IJpaSourceObject", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJpaSourceObjectEClass, this.getIJpaFile(), "getJpaFile", 0, 1); - initEClass(iXmlEObjectEClass, IXmlEObject.class, "IXmlEObject", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlEObjectEClass, XmlEObject.class, "XmlEObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iJpaContentNodeEClass, IJpaContentNode.class, "IJpaContentNode", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJpaContentNodeEClass, this.getIJpaFile(), "getJpaFile", 1, 1); - initEClass(iJpaRootContentNodeEClass, IJpaRootContentNode.class, "IJpaRootContentNode", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIJpaRootContentNode_JpaFile(), this.getIJpaFile(), this.getJpaFile_Content(), "jpaFile", "", 0, 1, IJpaRootContentNode.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iPersistentTypeEClass, IPersistentType.class, "IPersistentType", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIPersistentType_MappingKey(), ecorePackage.getEString(), "mappingKey", null, 1, 1, IPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - addEOperation(iPersistentTypeEClass, this.getITypeMapping(), "getMapping", 1, 1); - addEOperation(iPersistentTypeEClass, this.getIPersistentType(), "parentPersistentType", 0, 1); - initEClass(iTypeMappingEClass, ITypeMapping.class, "ITypeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getITypeMapping_Name(), ecorePackage.getEString(), "name", null, 0, 1, ITypeMapping.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITypeMapping_TableName(), ecorePackage.getEString(), "tableName", null, 0, 1, ITypeMapping.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - addEOperation(iTypeMappingEClass, this.getIPersistentType(), "getPersistentType", 1, 1); - initEClass(nullTypeMappingEClass, NullTypeMapping.class, "NullTypeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iPersistentAttributeEClass, IPersistentAttribute.class, "IPersistentAttribute", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIPersistentAttribute_Mapping(), this.getIAttributeMapping(), null, "mapping", null, 1, 1, IPersistentAttribute.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - addEOperation(iPersistentAttributeEClass, this.getITypeMapping(), "typeMapping", 1, 1); - addEOperation(iPersistentAttributeEClass, theEcorePackage.getEString(), "getName", 1, 1); - addEOperation(iPersistentAttributeEClass, ecorePackage.getEString(), "mappingKey", 1, 1); - addEOperation(iPersistentAttributeEClass, ecorePackage.getEString(), "defaultMappingKey", 1, 1); - initEClass(iAttributeMappingEClass, IAttributeMapping.class, "IAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iAttributeMappingEClass, this.getIPersistentAttribute(), "getPersistentAttribute", 1, 1); - addEOperation(iAttributeMappingEClass, theEcorePackage.getEBoolean(), "isDefault", 0, 1); - // Initialize enums and add enum literals - initEEnum(accessTypeEEnum, AccessType.class, "AccessType"); - addEEnumLiteral(accessTypeEEnum, AccessType.DEFAULT); - addEEnumLiteral(accessTypeEEnum, AccessType.PROPERTY); - addEEnumLiteral(accessTypeEEnum, AccessType.FIELD); - // Create resource - createResource(eNS_URI); - } - - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaModel IJpa Model}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaModel - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaModel() - * @generated - */ - public static final EClass IJPA_MODEL = eINSTANCE.getIJpaModel(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.JpaModel Jpa Model}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaModel - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaModel() - * @generated - */ - public static final EClass JPA_MODEL = eINSTANCE.getJpaModel(); - - /** - * The meta object literal for the 'Projects' containment reference list feature. - * - * - * @generated - */ - public static final EReference JPA_MODEL__PROJECTS = eINSTANCE.getJpaModel_Projects(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaEObject() - * @generated - */ - public static final EClass IJPA_EOBJECT = eINSTANCE.getIJpaEObject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaEObject() - * @generated - */ - public static final EClass JPA_EOBJECT = eINSTANCE.getJpaEObject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaProject IJpa Project}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaProject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaProject() - * @generated - */ - public static final EClass IJPA_PROJECT = eINSTANCE.getIJpaProject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.JpaProject Jpa Project}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaProject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject() - * @generated - */ - public static final EClass JPA_PROJECT = eINSTANCE.getJpaProject(); - - /** - * The meta object literal for the 'Platform' reference feature. - * - * - * @generated - */ - public static final EReference JPA_PROJECT__PLATFORM = eINSTANCE.getJpaProject_Platform(); - - /** - * The meta object literal for the 'Data Source' containment reference feature. - * - * - * @generated - */ - public static final EReference JPA_PROJECT__DATA_SOURCE = eINSTANCE.getJpaProject_DataSource(); - - /** - * The meta object literal for the 'Discover Annotated Classes' attribute feature. - * - * - * @generated - */ - public static final EAttribute JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES = eINSTANCE.getJpaProject_DiscoverAnnotatedClasses(); - - /** - * The meta object literal for the 'Files' containment reference list feature. - * - * - * @generated - */ - public static final EReference JPA_PROJECT__FILES = eINSTANCE.getJpaProject_Files(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaPlatform IJpa Platform}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaPlatform - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaPlatform() - * @generated - */ - public static final EClass IJPA_PLATFORM = eINSTANCE.getIJpaPlatform(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaDataSource IJpa Data Source}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaDataSource - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaDataSource() - * @generated - */ - public static final EClass IJPA_DATA_SOURCE = eINSTANCE.getIJpaDataSource(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.JpaDataSource Jpa Data Source}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaDataSource - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaDataSource() - * @generated - */ - public static final EClass JPA_DATA_SOURCE = eINSTANCE.getJpaDataSource(); - - /** - * The meta object literal for the 'Connection Profile Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME = eINSTANCE.getJpaDataSource_ConnectionProfileName(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaFile IJpa File}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaFile - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaFile() - * @generated - */ - public static final EClass IJPA_FILE = eINSTANCE.getIJpaFile(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.JpaFile Jpa File}' class. - * - * - * @see org.eclipse.jpt.core.internal.JpaFile - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaFile() - * @generated - */ - public static final EClass JPA_FILE = eINSTANCE.getJpaFile(); - - /** - * The meta object literal for the 'Content Id' attribute feature. - * - * - * @generated - */ - public static final EAttribute JPA_FILE__CONTENT_ID = eINSTANCE.getJpaFile_ContentId(); - - /** - * The meta object literal for the 'Content' containment reference feature. - * - * - * @generated - */ - public static final EReference JPA_FILE__CONTENT = eINSTANCE.getJpaFile_Content(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaSourceObject() - * @generated - */ - public static final EClass IJPA_SOURCE_OBJECT = eINSTANCE.getIJpaSourceObject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IXmlEObject IXml EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.IXmlEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIXmlEObject() - * @generated - */ - public static final EClass IXML_EOBJECT = eINSTANCE.getIXmlEObject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.XmlEObject Xml EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.XmlEObject - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject() - * @generated - */ - public static final EClass XML_EOBJECT = eINSTANCE.getXmlEObject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaContentNode() - * @generated - */ - public static final EClass IJPA_CONTENT_NODE = eINSTANCE.getIJpaContentNode(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIJpaRootContentNode() - * @generated - */ - public static final EClass IJPA_ROOT_CONTENT_NODE = eINSTANCE.getIJpaRootContentNode(); - - /** - * The meta object literal for the 'Jpa File' container reference feature. - * - * - * @generated - */ - public static final EReference IJPA_ROOT_CONTENT_NODE__JPA_FILE = eINSTANCE.getIJpaRootContentNode_JpaFile(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IPersistentType IPersistent Type}' class. - * - * - * @see org.eclipse.jpt.core.internal.IPersistentType - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentType() - * @generated - */ - public static final EClass IPERSISTENT_TYPE = eINSTANCE.getIPersistentType(); - - /** - * The meta object literal for the 'Mapping Key' attribute feature. - * - * - * @generated - */ - public static final EAttribute IPERSISTENT_TYPE__MAPPING_KEY = eINSTANCE.getIPersistentType_MappingKey(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getITypeMapping() - * @generated - */ - public static final EClass ITYPE_MAPPING = eINSTANCE.getITypeMapping(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITYPE_MAPPING__NAME = eINSTANCE.getITypeMapping_Name(); - - /** - * The meta object literal for the 'Table Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITYPE_MAPPING__TABLE_NAME = eINSTANCE.getITypeMapping_TableName(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.NullTypeMapping Null Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.NullTypeMapping - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getNullTypeMapping() - * @generated - */ - public static final EClass NULL_TYPE_MAPPING = eINSTANCE.getNullTypeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IPersistentAttribute IPersistent Attribute}' class. - * - * - * @see org.eclipse.jpt.core.internal.IPersistentAttribute - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute() - * @generated - */ - public static final EClass IPERSISTENT_ATTRIBUTE = eINSTANCE.getIPersistentAttribute(); - - /** - * The meta object literal for the 'Mapping' reference feature. - * - * - * @generated - */ - public static final EReference IPERSISTENT_ATTRIBUTE__MAPPING = eINSTANCE.getIPersistentAttribute_Mapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIAttributeMapping() - * @generated - */ - public static final EClass IATTRIBUTE_MAPPING = eINSTANCE.getIAttributeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.AccessType Access Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.AccessType - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getAccessType() - * @generated - */ - public static final EEnum ACCESS_TYPE = eINSTANCE.getAccessType(); - } -} //JpaCorePackage diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java deleted file mode 100644 index 39f3e91c43..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java +++ /dev/null @@ -1,276 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.ProfileListener; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'Jpa Data Source'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.JpaDataSource#getConnectionProfileName Connection Profile Name}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaDataSource() - * @model kind="class" - * @generated - */ -public class JpaDataSource extends JpaEObject implements IJpaDataSource -{ - /** - * The default value of the '{@link #getConnectionProfileName() Connection Profile Name}' attribute. - * - * - * @see #getConnectionProfileName() - * @generated - * @ordered - */ - protected static final String CONNECTION_PROFILE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConnectionProfileName() Connection Profile Name}' attribute. - * - * - * @see #getConnectionProfileName() - * @generated - * @ordered - */ - protected String connectionProfileName = CONNECTION_PROFILE_NAME_EDEFAULT; - - private transient ConnectionProfile connectionProfile; - - private ProfileListener profileListener; - - private ConnectionListener connectionListener; - - /** - * - * - * @generated NOT - */ - protected JpaDataSource() { - super(); - profileListener = buildProfileListener(); - ConnectionProfileRepository.instance().addProfileListener(profileListener); - connectionListener = buildConnectionListener(); - } - - private ProfileListener buildProfileListener() { - return new ProfileListener() { - public void profileAdded(ConnectionProfile profile) { - if (profile.getName().equals(connectionProfileName)) { - setConnectionProfile(profile); - } - } - - public void profileChanged(ConnectionProfile profile) { - if (profile == connectionProfile && !profile.getName().equals(connectionProfileName)) { - setConnectionProfileName(profile.getName()); - } - } - - public void profileDeleted(String profileName) { - if (profileName.equals(connectionProfileName)) { - setConnectionProfile(null); - } - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - public void opened(Connection connection) { - getProject().resynch(); - } - - public void aboutToClose(Connection connection) {} - - public boolean okToClose(Connection connection) { - return true; - } - - public void closed(Connection connection) { - getProject().resynch(); - } - - public void modified(Connection connection) {} - - public void databaseChanged(Connection connection, Database database) {} - - public void schemaChanged(Connection connection, Schema schema) {} - - public void tableChanged(Connection connection, Table table) {} - }; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.JPA_DATA_SOURCE; - } - - public IJpaProject getProject() { - return (IJpaProject) eContainer(); - } - - /** - * Returns the value of the 'Connection Profile Name' attribute. - * - *

- * If the meaning of the 'Connection Profile Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Connection Profile Name' attribute. - * @see #setConnectionProfileName(String) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaDataSource_ConnectionProfileName() - * @model unique="false" required="true" ordered="false" - * @generated - */ - public String getConnectionProfileName() { - return connectionProfileName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.JpaDataSource#getConnectionProfileName Connection Profile Name}' attribute. - * - * - * @param value the new value of the 'Connection Profile Name' attribute. - * @see #getConnectionProfileName() - * @generated - */ - public void setConnectionProfileNameGen(String newConnectionProfileName) { - String oldConnectionProfileName = connectionProfileName; - connectionProfileName = newConnectionProfileName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME, oldConnectionProfileName, connectionProfileName)); - } - - public void setConnectionProfileName(String newConnectionProfileName) { - ConnectionProfile oldConnectionProfile = connectionProfile; - setConnectionProfileNameGen(newConnectionProfileName); - ConnectionProfile newConnectionProfile = ConnectionProfileRepository.instance().profileNamed(newConnectionProfileName); - if (oldConnectionProfile != newConnectionProfile) { - setConnectionProfile(newConnectionProfile); - } - } - - public ConnectionProfile getConnectionProfile() { - return connectionProfile; - } - - private void setConnectionProfile(ConnectionProfile profile) { - if (connectionProfile != null) { - connectionProfile.removeConnectionListener(connectionListener); - } - connectionProfile = profile; - if (connectionProfile != null) { - connectionProfile.addConnectionListener(connectionListener); - } - getProject().resynch(); - } - - public Connection getConnection() { - return ConnectionProfileRepository.instance().getConnectionWithProfileNamed(getConnectionProfileName()); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaCorePackage.JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME : - return getConnectionProfileName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaCorePackage.JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME : - setConnectionProfileName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME : - setConnectionProfileName(CONNECTION_PROFILE_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_DATA_SOURCE__CONNECTION_PROFILE_NAME : - return CONNECTION_PROFILE_NAME_EDEFAULT == null ? connectionProfileName != null : !CONNECTION_PROFILE_NAME_EDEFAULT.equals(connectionProfileName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (connectionProfileName: "); - result.append(connectionProfileName); - result.append(')'); - return result.toString(); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaEObject.java deleted file mode 100644 index 76fbadc818..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaEObject.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Map; -import java.util.Set; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; - -/** - * - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaEObject() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JpaEObject extends EObjectImpl implements IJpaEObject -{ - /** - * Sets of "insignificant" feature ids, keyed by class. - * This is built up lazily, as the objects are modified. - */ - private static final Map, Set> insignificantFeatureIdSets = new Hashtable, Set>(); - - /** - * - * - * @generated - */ - protected JpaEObject() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.JPA_EOBJECT; - } - - public IJpaProject getJpaProject() { - IJpaEObject container = (IJpaEObject) this.eContainer(); - return (container == null) ? null : container.getJpaProject(); - } - - public IResource getResource() { - return this.getJpaProject().getProject(); - } - - public ConnectionProfile connectionProfile() { - return this.getJpaProject().connectionProfile(); - } - - public Database database() { - return this.connectionProfile().getDatabase(); - } - - public boolean isConnected() { - ConnectionProfile cp = this.connectionProfile(); - return (cp != null) && cp.isConnected(); - } - - // ********** change notification ********** - /** - * override to prevent notification when the object's state is unchanged - */ - @Override - public void eNotify(Notification notification) { - if (!notification.isTouch()) { - super.eNotify(notification); - this.featureChanged(notification.getFeatureID(this.getClass())); - } - } - - protected void featureChanged(int featureId) { - if (this.featureIsSignificant(featureId)) { - IJpaProject project = this.getJpaProject(); - // check that the model is fully initialized - if (project != null) { - project.resynch(); - } - } - } - - protected boolean featureIsSignificant(int featureId) { - return !this.featureIsInsignificant(featureId); - } - - protected boolean featureIsInsignificant(int featureId) { - return this.insignificantFeatureIds().contains(featureId); - } - - /** - * Return a set of the object's "insignificant" feature ids. - * These are the EMF features that, when they change, will NOT cause the - * object (or its containing tree) to be resynched, i.e. defaults calculated. - * If you need instance-based calculation of your "insignificant" aspects, - * override this method. If class-based calculation is sufficient, - * override #addInsignificantFeatureIdsTo(Set). - */ - protected Set insignificantFeatureIds() { - synchronized (insignificantFeatureIdSets) { - Set insignificantFeatureIds = insignificantFeatureIdSets.get(this.getClass()); - if (insignificantFeatureIds == null) { - insignificantFeatureIds = new HashSet(); - this.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIdSets.put(this.getClass(), insignificantFeatureIds); - } - return insignificantFeatureIds; - } - } - - /** - * Add the object's "insignificant" feature ids to the specified set. - * These are the EMF features that, when they change, will NOT cause the - * object (or its containing tree) to be resynched, i.e. defaults calculated. - * If class-based calculation of your "insignificant" features is sufficient, - * override this method. If you need instance-based calculation, - * override #insignificantFeatureIds(). - */ - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - // when you override this method, don't forget to include: - // super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFile.java deleted file mode 100644 index 6e7da34f66..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFile.java +++ /dev/null @@ -1,337 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.ElementChangedEvent; - -/** - * - * A representation of the model object 'Persistence File'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.JpaFile#getContentId Content Id}
  • - *
  • {@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaFile() - * @model kind="class" - * @generated - */ -public class JpaFile extends JpaEObject implements IJpaFile -{ - /** - * The default value of the '{@link #getContentId() Content Id}' attribute. - * - * - * @see #getContentId() - * @generated - * @ordered - */ - protected static final String CONTENT_ID_EDEFAULT = null; - - /** - * The cached value of the '{@link #getContentId() Content Id}' attribute. - * - * - * @see #getContentId() - * @generated - * @ordered - */ - protected String contentId = CONTENT_ID_EDEFAULT; - - /** - * The cached value of the '{@link #getContent() Content}' containment reference. - * - * - * @see #getContent() - * @generated - * @ordered - */ - protected IJpaRootContentNode content; - - /** - * The IFile associated with this JPA file - */ - protected IFile file; - - /** - * - * - * @generated - */ - protected JpaFile() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.JPA_FILE; - } - - /** - * Returns the value of the 'Content Id' attribute. - * - *

- * If the meaning of the 'Content Id' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Content Id' attribute. - * @see #setContentId(String) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaFile_ContentId() - * @model required="true" - * @generated - */ - public String getContentId() { - return contentId; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.JpaFile#getContentId Content Id}' attribute. - * - * - * @param value the new value of the 'Content Id' attribute. - * @see #getContentId() - * @generated - */ - public void setContentId(String newContentId) { - String oldContentId = contentId; - contentId = newContentId; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_FILE__CONTENT_ID, oldContentId, contentId)); - } - - /** - * Returns the value of the 'Content' containment reference. - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode#getJpaFile Jpa File}'. - * - *

- * If the meaning of the 'Content' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Content' containment reference. - * @see #setContent(IJpaRootContentNode) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaFile_Content() - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode#getJpaFile - * @model opposite="jpaFile" containment="true" - * @generated - */ - public IJpaRootContentNode getContent() { - return content; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetContent(IJpaRootContentNode newContent, NotificationChain msgs) { - IJpaRootContentNode oldContent = content; - content = newContent; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_FILE__CONTENT, oldContent, newContent); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}' containment reference. - * - * - * @param value the new value of the 'Content' containment reference. - * @see #getContent() - * @generated - */ - public void setContent(IJpaRootContentNode newContent) { - if (newContent != content) { - NotificationChain msgs = null; - if (content != null) - msgs = ((InternalEObject) content).eInverseRemove(this, JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE, IJpaRootContentNode.class, msgs); - if (newContent != null) - msgs = ((InternalEObject) newContent).eInverseAdd(this, JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE, IJpaRootContentNode.class, msgs); - msgs = basicSetContent(newContent, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_FILE__CONTENT, newContent, newContent)); - } - - /** - * @see IJpaFile#getFile() - */ - public IFile getFile() { - return file; - } - - void setFile(IFile theFile) { - file = theFile; - } - - /** - * INTERNAL ONLY - * Dispose of file before it is removed - */ - void dispose() { - getContent().dispose(); - } - - /** - * INTERNAL ONLY - * Handle java element change event. - */ - void handleEvent(ElementChangedEvent event) { - getContent().handleJavaElementChangedEvent(event); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaCorePackage.JPA_FILE__CONTENT : - if (content != null) - msgs = ((InternalEObject) content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaCorePackage.JPA_FILE__CONTENT, null, msgs); - return basicSetContent((IJpaRootContentNode) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaCorePackage.JPA_FILE__CONTENT : - return basicSetContent(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaCorePackage.JPA_FILE__CONTENT_ID : - return getContentId(); - case JpaCorePackage.JPA_FILE__CONTENT : - return getContent(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaCorePackage.JPA_FILE__CONTENT_ID : - setContentId((String) newValue); - return; - case JpaCorePackage.JPA_FILE__CONTENT : - setContent((IJpaRootContentNode) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_FILE__CONTENT_ID : - setContentId(CONTENT_ID_EDEFAULT); - return; - case JpaCorePackage.JPA_FILE__CONTENT : - setContent((IJpaRootContentNode) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_FILE__CONTENT_ID : - return CONTENT_ID_EDEFAULT == null ? contentId != null : !CONTENT_ID_EDEFAULT.equals(contentId); - case JpaCorePackage.JPA_FILE__CONTENT : - return content != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (contentId: "); - result.append(contentId); - result.append(')'); - return result.toString(); - } - - public IJpaContentNode getContentNode(int offset) { - return getContent().getContentNode(offset); - } - - @Override - public IResource getResource() { - return file; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFileContentRegistry.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFileContentRegistry.java deleted file mode 100644 index 8336c651e3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFileContentRegistry.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.io.IOException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.content.IContentType; - -public class JpaFileContentRegistry -{ - private JpaFileContentRegistry() { - super(); - } - - public static IJpaFile getFile(IJpaProject jpaProject, IFile file) { - //attempting to get the contentType based on the file contents. - //have to check the file contents instead of just the file name - //because for xml we base it on the rootElement name - IContentType contentType = null; - try { - contentType = (file == null) ? - null : - Platform.getContentTypeManager().findContentTypeFor(file.getContents(), file.getName()); - } - catch (IOException e) { - JptCorePlugin.log(e); - } - catch (CoreException e) { - JptCorePlugin.log(e); - } - if (contentType == null) { - return null; - } - String contentTypeId = contentType.getId(); - IJpaRootContentNode content = buildContent(jpaProject, file, contentTypeId); - - if (content == null) { - return null; - } - JpaFile jpaFile = JpaCoreFactory.eINSTANCE.createJpaFile(); - jpaFile.setFile(file); - jpaFile.setContentId(contentTypeId); - jpaFile.setContent(content); - - return jpaFile; - } - - private static IJpaRootContentNode buildContent(IJpaProject jpaProject, IFile file, String contentTypeId) { - for (IJpaFileContentProvider provider : jpaProject.getPlatform().jpaFileContentProviders()) { - if (provider.contentType().equals(contentTypeId)) { - return provider.buildRootContent(file); - } - } - return null; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModel.java deleted file mode 100644 index f99442fd4d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModel.java +++ /dev/null @@ -1,264 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Collection; -import java.util.Iterator; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jpt.utility.internal.iterators.CloneIterator; -import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator; - -/** - * - * A representation of the model object 'Jpa Model'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.JpaModel#getProjects Projects}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaModel() - * @model kind="class" - * @generated - */ -public class JpaModel extends JpaEObject implements IJpaModel -{ - /** - * The cached value of the '{@link #getProjects() Projects}' containment reference list. - * - * - * @see #getProjects() - * @generated - * @ordered - */ - protected EList projects; - - /** - * Flag to indicate whether the model has been filled with projects - */ - private boolean filled = false; - - /** - * - * - * @generated - */ - protected JpaModel() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.JPA_MODEL; - } - - /** - * Returns the value of the 'Projects' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.IJpaProject}. - * - *

- * If the meaning of the 'Projects' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Projects' containment reference list. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaModel_Projects() - * @model type="org.eclipse.jpt.core.internal.IJpaProject" containment="true" - * @generated - */ - public EList getProjects() { - if (projects == null) { - projects = new EObjectContainmentEList(IJpaProject.class, this, JpaCorePackage.JPA_MODEL__PROJECTS); - } - return projects; - } - - /** - * @see IJpaModel#getJpaProject(IProject) - */ - public synchronized IJpaProject getJpaProject(IProject project) { - for (IJpaProject jpaProject : getProjects()) { - if (jpaProject.getProject().equals(project)) { - return jpaProject; - } - } - if (!this.filled) { - try { - return JpaModelManager.instance().createJpaProject(project); - } - catch (CoreException ce) { - JptCorePlugin.log(ce.getStatus()); - return null; - } - } - return null; - } - - /** - * @see IJpaModel#jpaProjects() - */ - public Iterator jpaProjects() { - return new ReadOnlyIterator(getProjects().iterator()); - } - - @Override - public IResource getResource() { - return null; - } - - /** - * INTERNAL ONLY - * Initialize model with workspace resources - */ - void fill() throws CoreException { - if (filled) - return; - IResourceProxyVisitor visitor = new IResourceProxyVisitor() { - public boolean visit(IResourceProxy resourceProxy) throws CoreException { - if (!resourceProxy.isAccessible()) { - return false; - } - switch (resourceProxy.getType()) { - case IResource.ROOT : - return true; - case IResource.PROJECT : - JpaModelManager.instance().fillJpaProject((IProject) resourceProxy.requestResource()); - default : - return false; - } - } - }; - ResourcesPlugin.getWorkspace().getRoot().accept(visitor, IResource.NONE); - filled = true; - } - - /** - * INTERNAL ONLY - * Dispose of model - */ - void dispose() { - for (Iterator stream = new CloneIterator(getProjects()); stream.hasNext();) { - disposeProject((JpaProject) stream.next()); - } - } - - /** - * INTERNAL ONLY - * Dispose project and remove it - */ - void disposeProject(JpaProject jpaProject) { - jpaProject.dispose(); - getProjects().remove(jpaProject); - } - - /** - * INTERNAL ONLY - * Handle java element change event. - */ - void handleEvent(ElementChangedEvent event) { - for (Iterator stream = getProjects().iterator(); stream.hasNext();) { - ((JpaProject) stream.next()).handleEvent(event); - } - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaCorePackage.JPA_MODEL__PROJECTS : - return ((InternalEList) getProjects()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaCorePackage.JPA_MODEL__PROJECTS : - return getProjects(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaCorePackage.JPA_MODEL__PROJECTS : - getProjects().clear(); - getProjects().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_MODEL__PROJECTS : - getProjects().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_MODEL__PROJECTS : - return projects != null && !projects.isEmpty(); - } - return super.eIsSet(featureID); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java deleted file mode 100644 index a92adec995..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java +++ /dev/null @@ -1,551 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.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.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; -import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jdt.core.IElementChangedListener; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; - -public class JpaModelManager -{ - private static JpaModelManager INSTANCE; - - - /** - * Returns the singleton JpaModelManager - */ - public final static JpaModelManager instance() { - if (INSTANCE == null) { - INSTANCE = new JpaModelManager(); - } - return INSTANCE; - } - - - /** - * Unique handle onto the JpaModel - */ - JpaModel model; - - /** - * Processes resource changes - */ - private IResourceChangeListener resourceChangeListener; - - /** - * Process element changes - */ - private IElementChangedListener elementChangeListener; - - /** - * Process changes to preferences - */ - private IPropertyChangeListener preferencesListener; - - - private JpaModelManager() { - super(); - model = JpaCoreFactory.eINSTANCE.createJpaModel(); - resourceChangeListener = new ResourceChangeListener(); - elementChangeListener = new ElementChangeListener(); - preferencesListener = new PreferencesListener(); - } - - public void startup() { - try { - buildWorkspace(); - ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener); - JavaCore.addElementChangedListener(elementChangeListener); - JptCorePlugin.getPlugin().getPluginPreferences().addPropertyChangeListener(preferencesListener); - } - catch (RuntimeException re) { - JptCorePlugin.log(re); - shutdown(); - } - } - - public void shutdown() { - JptCorePlugin.getPlugin().getPluginPreferences().removePropertyChangeListener(preferencesListener); - JavaCore.removeElementChangedListener(elementChangeListener); - ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); - model.dispose(); - } - - private void buildWorkspace() { - Job workspaceBuildJob = new WorkspaceBuildJob(); - workspaceBuildJob.schedule(5000L); //temporary delay for bundle init problem - } - - /** - * Return the workspace-wide IJpaModel - * - * This IJpaProject may not be fully filled (it may not have all the correct - * projects added) if retrieved soon after it is created (e.g. workspace opening, - * project opening, facet installation ...) To ensure it is fully filled in - * those cases, you may instead use getFilledJpaModel(). - * @see getFilledJpaModel() - */ - public IJpaModel getJpaModel() { - return model; - } - - /** - * Return the workspace-wide IJpaModel - * - * This IJpaModel will be fully filled (it will have all the correct projects added). - * @see getJpaProject(IProject) - */ - public IJpaModel getFilledJpaModel() - throws CoreException { - model.fill(); - return model; - } - - /** - * Returns the IJpaProject corresponding to the given IProject. - * Returns null if unable to associate the given project - * with an IJpaProject. - * - * This IJpaProject may not be fully filled (it may not have all the correct - * files added) if retrieved soon after it is created (e.g. workspace opening, - * project opening, facet installation ...) To ensure it is fully filled in - * those cases, you may instead use getFilledJpaProject(IProject). - * @see getFilledJpaProject(IProject) - */ - public synchronized IJpaProject getJpaProject(IProject project) { - if (project == null) { - return null; - } - - return model.getJpaProject(project); - } - - /** - * Returns the IJpaProject corresponding to the given IProject. - * Returns null if unable to associate the given project - * with an IJpaProject. - * - * This IJpaProject will be fully filled (it will have all the correct files added). - * @see getJpaProject(IProject) - */ - public synchronized IJpaProject getFilledJpaProject(IProject project) - throws CoreException { - JpaProject jpaProject = (JpaProject) getJpaProject(project); - - if (jpaProject != null) { - jpaProject.fill(); - } - - return jpaProject; - } - - /** - * INTERNAL ONLY - * - * Fills the IJpaProject associated with the IProject, if it exists - */ - public synchronized void fillJpaProject(IProject project) - throws CoreException { - JpaProject jpaProject = (JpaProject) getJpaProject(project); - - if (jpaProject != null) { - jpaProject.fill(); - } - } - - /** - * INTERNAL ONLY - * Create an IJpaProject without files filled in - */ - public synchronized IJpaProject createJpaProject(IProject project) - throws CoreException { - if (FacetedProjectFramework.hasProjectFacet(project, JptCorePlugin.FACET_ID)) { - JpaProject jpaProject = JpaCoreFactory.eINSTANCE.createJpaProject(); - jpaProject.setProject(project); - model.getProjects().add(jpaProject); - return jpaProject; - } - return null; - } - - /** - * INTERNAL ONLY - * Create an IJpaProject with files filled in - */ - public synchronized IJpaProject createFilledJpaProject(IProject project) - throws CoreException { - JpaProject jpaProject = (JpaProject) createJpaProject(project); - - if (jpaProject != null) { - jpaProject.fill(); - } - - return jpaProject; - } - - /** - * INTERNAL ONLY - * Dispose the IJpaProject - */ - public void disposeJpaProject(IJpaProject jpaProject) { - model.disposeProject((JpaProject) jpaProject); - } - - /** - * Returns the IJpaFile corresponding to the given IFile. - * Returns null if unable to associate the given file - * with an IJpaFile. - */ - public synchronized IJpaFile getJpaFile(IFile file) { - if (file == null) { - return null; - } - - IProject project = file.getProject(); - JpaProject jpaProject = (JpaProject) getJpaProject(project); - if (jpaProject == null) { - return null; - } - - return jpaProject.getJpaFile(file); - } - - - - private class WorkspaceBuildJob extends Job - { - WorkspaceBuildJob() { - // TODO - Internationalize (? It *is* a system job ...) - super("Initializing JPA Model ..."); - setSystem(true); - setPriority(SHORT); - } - - @Override - protected IStatus run(IProgressMonitor monitor) { - final IWorkspace workspace = ResourcesPlugin.getWorkspace(); - - try { - workspace.run( - new IWorkspaceRunnable() { - public void run(IProgressMonitor progress) throws CoreException { - model.fill(); - } - }, - monitor); - } - catch (CoreException ce) { - return ce.getStatus(); - } - return Status.OK_STATUS; - } - - } - - - private static class ResourceChangeListener - implements IResourceChangeListener - { - ThreadLocal resourceChangeProcessors = new ThreadLocal(); - - ResourceChangeListener() { - super(); - } - - public void resourceChanged(IResourceChangeEvent event) { - getResourceChangeProcessor().resourceChanged(event); - } - - public ResourceChangeProcessor getResourceChangeProcessor() { - ResourceChangeProcessor processor = this.resourceChangeProcessors.get(); - if (processor == null) { - processor = new ResourceChangeProcessor(); - this.resourceChangeProcessors.set(processor); - } - return processor; - } - } - - - private static class ResourceChangeProcessor - { - private JpaModel model; - - ResourceChangeProcessor() { - model = JpaModelManager.instance().model; - } - - public void resourceChanged(IResourceChangeEvent event) { - if (event.getSource() instanceof IWorkspace) { - IResource resource = event.getResource(); - IResourceDelta delta = event.getDelta(); - - switch (event.getType()){ - case IResourceChangeEvent.PRE_DELETE : - try { - if ((resource.getType() == IResource.PROJECT) - && (FacetedProjectFramework.hasProjectFacet( - (IProject) resource, JptCorePlugin.FACET_ID))) { - projectBeingDeleted((IProject) resource); - } - } - catch (CoreException e) { - // project doesn't exist or is not open: ignore - } - return; - - case IResourceChangeEvent.POST_CHANGE : - if (isApplicable(delta)) { // avoid changing due to SYNC or MARKER deltas - checkForProjectsBeingAddedOrRemoved(delta); - checkForFilesBeingAddedOrRemoved(delta); - } - return; - - case IResourceChangeEvent.PRE_CLOSE : - return; - } - } - } - - /** - * Process the given delta and look for files being added, removed, or changed - */ - private void checkForFilesBeingAddedOrRemoved(IResourceDelta delta) { - IResource resource = delta.getResource(); - boolean processChildren = false; - - switch (resource.getType()) { - case IResource.ROOT : - processChildren = true; - break; - - case IResource.PROJECT : - IProject project = (IProject) resource; - - try { - if (FacetedProjectFramework.hasProjectFacet(project, JptCorePlugin.FACET_ID)) { - JpaProject jpaProject = (JpaProject) model.getJpaProject(project); - if (jpaProject != null) { - // sometimes we receive events before the project - // has been fully initialized - jpaProject.synchInternalResources(delta); - } - } - } - catch (CoreException ex) { - // we can't do anything anyway - } - break; - } - if (processChildren) { - IResourceDelta[] children = delta.getAffectedChildren(); - for (int i = 0; i < children.length; i++) { - checkForFilesBeingAddedOrRemoved(children[i]); - } - } - - } - - /** - * Process the given delta and look for projects being added, opened, or closed. - * Note that projects being deleted are checked in deletingProject(IProject). - */ - private void checkForProjectsBeingAddedOrRemoved(IResourceDelta delta) { - IResource resource = delta.getResource(); - boolean processChildren = false; - - switch (resource.getType()) { - case IResource.ROOT : - processChildren = true; - break; - - case IResource.PROJECT : - // NB: No need to check project's facet as if the project is not a jpa project: - // - if the project is added or changed this is a noop for projectsBeingDeleted - // - if the project is closed, it has already lost its jpa facet - IProject project = (IProject) resource; - - // could be problems here ... - JpaProject jpaProject = (JpaProject) model.getJpaProject(project); - switch (delta.getKind()) { - case IResourceDelta.REMOVED : - // we should have already handled this in the PRE_DELETE event - break; - - case IResourceDelta.ADDED : - // if project is renamed (for instance, we should act as though it's been opened) - // fall through - - case IResourceDelta.CHANGED : - if ((delta.getFlags() & IResourceDelta.OPEN) != 0) { - if (project.isOpen()) { - // project has been opened, but don't create it if it's already there - // (which can happen on project creation) - if (jpaProject == null) { - try { - JpaModelManager.instance().createFilledJpaProject(project); - } - catch (CoreException ce) { - JptCorePlugin.log(ce); - } - } - } - else { - // project has been closed. dispose jpa project if it exists. - if (jpaProject != null) { - model.disposeProject(jpaProject); - } - } - } - else if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) { - // again, not sure ... - } - else { - // ... - } - break; - } - break; - } - if (processChildren) { - IResourceDelta[] children = delta.getAffectedChildren(); - for (int i = 0; i < children.length; i++) { - checkForProjectsBeingAddedOrRemoved(children[i]); - } - } - } - - /** - * The platform project is being deleted. Remove jpa info. - */ - private void projectBeingDeleted(IProject project) { - // could be problems here ... - JpaProject jpaProject = (JpaProject) model.getJpaProject(project); - model.disposeProject(jpaProject); - } - - /** - * Returns whether a given delta contains some information relevant to - * the JPA model, - * in particular it will not consider SYNC or MARKER only deltas. - */ - private boolean isApplicable(IResourceDelta rootDelta) { - if (rootDelta != null) { - // use local exception to quickly escape from delta traversal - class FoundRelevantDeltaException extends RuntimeException { - private static final long serialVersionUID = 7137113252936111022L; // backward compatible - // only the class name is used (to differentiate from other RuntimeExceptions) - } - try { - rootDelta.accept( - new IResourceDeltaVisitor() { - public boolean visit(IResourceDelta delta) { - switch (delta.getKind()) { - case IResourceDelta.ADDED : - case IResourceDelta.REMOVED : - throw new FoundRelevantDeltaException(); - case IResourceDelta.CHANGED : - // if any flag is set but SYNC or MARKER, this delta should be considered - if (delta.getAffectedChildren().length == 0 // only check leaf delta nodes - && (delta.getFlags() & ~(IResourceDelta.SYNC | IResourceDelta.MARKERS)) != 0) { - throw new FoundRelevantDeltaException(); - } - } - return true; - } - } - ); - } - catch(FoundRelevantDeltaException e) { - return true; - } - catch(CoreException e) { // ignore delta if not able to traverse - } - } - return false; - } - } - - - private static class ElementChangeListener - implements IElementChangedListener - { - ThreadLocal elementChangeProcessors = new ThreadLocal(); - - ElementChangeListener() { - super(); - } - - public void elementChanged(ElementChangedEvent event) { - getElementChangeProcessor().elementChanged(event); - } - - public ElementChangeProcessor getElementChangeProcessor() { - ElementChangeProcessor processor = this.elementChangeProcessors.get(); - if (processor == null) { - processor = new ElementChangeProcessor(); - this.elementChangeProcessors.set(processor); - } - return processor; - } - } - - - private static class ElementChangeProcessor - { - ElementChangeProcessor() { - super(); - } - - public void elementChanged(ElementChangedEvent event) { - JpaModelManager.instance().model.handleEvent(event); - } - } - - - private static class PreferencesListener - implements IPropertyChangeListener - { - PreferencesListener() { - super(); - } - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty() == JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB) { - try { - JavaCore.setClasspathVariable("DEFAULT_JPA_LIB", new Path((String) event.getNewValue()), null); - } - catch (JavaModelException jme) { - JptCorePlugin.log(jme); - } - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java deleted file mode 100644 index 7e396d832f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java +++ /dev/null @@ -1,190 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Collections; -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.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -public class JpaPlatformRegistry -{ - public static final JpaPlatformRegistry INSTANCE = new JpaPlatformRegistry(); - - private static final String EXTENSION_ID = - "jpaPlatform"; //$NON-NLS-1$ - - private static final String EL_PLATFORM = - "jpaPlatform"; //$NON-NLS-1$ - - private static final String AT_ID = - "id"; //$NON-NLS-1$ - - private static final String AT_LABEL = - "label"; //$NON-NLS-1$ - - private static final String AT_CLASS = - "class"; //$NON-NLS-1$ - - // key: String jpaPlatform id value: IConfigurationElement class descriptor - private Map jpaPlatforms; - - - /* (non Java doc) - * restrict access - */ - private JpaPlatformRegistry() { - buildJpaPlatforms(); - } - - - private void buildJpaPlatforms() { - this.jpaPlatforms = new HashMap(); - - for (Iterator stream = allConfigElements(); stream.hasNext(); ) { - buildJpaPlatform(stream.next()); - } - } - - private void buildJpaPlatform(IConfigurationElement configElement) { - if (! configElement.getName().equals(EL_PLATFORM)) { - return; - } - - String platformId = configElement.getAttribute(AT_ID); - String platformLabel = configElement.getAttribute(AT_LABEL); - String platformClass = configElement.getAttribute(AT_CLASS); - - if ((platformId == null) || (platformLabel == null) || (platformClass == null)) { - if (platformId == null) { - reportMissingAttribute(configElement, AT_ID); - } - if (platformLabel == null) { - reportMissingAttribute(configElement, AT_LABEL); - } - if (platformClass == null) { - reportMissingAttribute(configElement, AT_CLASS); - } - return; - } - - if (this.jpaPlatforms.containsKey(platformId)) { - IConfigurationElement otherConfigElement = this.jpaPlatforms.get(platformId); - reportDuplicatePlatform(configElement, otherConfigElement); - } - - this.jpaPlatforms.put(platformId, configElement); - } - - /** - * Return a new IJpaPlatform for the given id. - * NB: This should only be done when instantiating a platform for a given - * IJpaProject, either when creating the project, or when changing the - * platform. - */ - public IJpaPlatform getJpaPlatform(String id) { - IConfigurationElement registeredConfigElement = this.jpaPlatforms.get(id); - - if (registeredConfigElement == null) { - return null; - } - - try { - IJpaPlatform platform = - (IJpaPlatform) registeredConfigElement.createExecutableExtension(AT_CLASS); - platform.setId(id); - return platform; - } - catch (CoreException ce) { - reportFailedInstantiation(registeredConfigElement); - return null; - } - } - - /** - * Return an iterator of String ids for all registered JPA platforms. - * This does not load any of the platforms' plugin classes. - */ - public Iterator allJpaPlatformIds() { - return Collections.unmodifiableMap(jpaPlatforms).keySet().iterator(); - } - - /** - * Return the label for the platform with the given id. - * This does not load the platform's plugin classes. - */ - public String getJpaPlatformLabel(String id) { - return jpaPlatforms.get(id).getAttribute(AT_LABEL); - } - - private Iterator allConfigElements() { - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint extensionPoint = - registry.getExtensionPoint(JptCorePlugin.PLUGIN_ID, EXTENSION_ID); - IExtension[] extensions = extensionPoint.getExtensions(); - - return new CompositeIterator( - new TransformationIterator>(CollectionTools.iterator(extensions)) { - @Override - protected Iterator transform(IExtension next) { - return CollectionTools.iterator(next.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 - + "\"."; - JptCorePlugin.log(message); - } - - // TODO externalize strings - private void reportDuplicatePlatform( - 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 \"jpaPlatform\"."; - JptCorePlugin.log(message); - } - - // TODO externalize strings - private void reportFailedInstantiation(IConfigurationElement configElement) { - String message = - "Could not instantiate the class \"" - + configElement.getAttribute(AT_CLASS) - + "\" for the extension element \"" - + configElement.getName() - + "\" in the plugin \"" - + configElement.getContributor().getName() - + "\"."; - JptCorePlugin.log(message); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java deleted file mode 100644 index e009306293..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java +++ /dev/null @@ -1,793 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.IJobChangeEvent; -import org.eclipse.core.runtime.jobs.IJobChangeListener; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.core.runtime.jobs.JobChangeAdapter; -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.jdt.core.ElementChangedEvent; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.facet.JpaFacetUtils; -import org.eclipse.jpt.core.internal.platform.IContext; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.JptDbPlugin; -import org.eclipse.jpt.utility.internal.iterators.CloneIterator; -import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * - * A representation of the model object 'Jpa Project'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.JpaProject#getPlatform Platform}
  • - *
  • {@link org.eclipse.jpt.core.internal.JpaProject#getDataSource Data Source}
  • - *
  • {@link org.eclipse.jpt.core.internal.JpaProject#isDiscoverAnnotatedClasses Discover Annotated Classes}
  • - *
  • {@link org.eclipse.jpt.core.internal.JpaProject#getFiles Files}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject() - * @model kind="class" - * @generated - */ -public class JpaProject extends JpaEObject implements IJpaProject -{ - /** - * The IProject associated with this JPA project - */ - protected IProject project; - - /** - * The IJpaPlatform associated with this JPA project - */ - protected IJpaPlatform platform; - - /** - * The cached value of the '{@link #getDataSource() Data Source}' containment reference. - * - * - * @see #getDataSource() - * @generated - * @ordered - */ - protected IJpaDataSource dataSource; - - /** - * The default value of the '{@link #isDiscoverAnnotatedClasses() Discover Annotated Classes}' attribute. - * - * - * @see #isDiscoverAnnotatedClasses() - * @generated - * @ordered - */ - protected static final boolean DISCOVER_ANNOTATED_CLASSES_EDEFAULT = false; - - /** - * The cached value of the '{@link #isDiscoverAnnotatedClasses() Discover Annotated Classes}' attribute. - * - * - * @see #isDiscoverAnnotatedClasses() - * @generated - * @ordered - */ - protected boolean discoverAnnotatedClasses = DISCOVER_ANNOTATED_CLASSES_EDEFAULT; - - /** - * This is true if the Discover Annotated Classes attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean discoverAnnotatedClassesESet; - - /** - * The cached value of the '{@link #getFiles() Files}' containment reference list. - * - * - * @see #getFiles() - * @generated - * @ordered - */ - protected EList files; - - /** - * Flag to indicate whether this project has been filled with files - */ - private boolean filled = false; - - /** - * Flag to indicate that the resynchJob has been scheduled or is running. - * This is set to false when that job is completed - */ - boolean resynching = false; - - /** - * Flag to indicate that the resynchJob needs to be run. This is - * set to true if resynching = true so that the next time the job completes - * it will be run again. - */ - boolean needsToResynch = false; - - /** - * Job used to reconnect the model parts throughout the project containment hierarchy - * @see IJpaProject#resynch() - */ - Job resynchJob; - - private IJobChangeListener resynchJobListener; - - /** - * - * - * @generated NOT - */ - protected JpaProject() { - super(); - this.resynchJob = buildResynchJob(); - this.resynchJobListener = buildResynchJobListener(); - Job.getJobManager().addJobChangeListener(this.resynchJobListener); - } - - private Job buildResynchJob() { - return new Job("Resynching JPA model ...") { - @Override - protected IStatus run(IProgressMonitor monitor) { - IContext contextHierarchy = getPlatform().buildProjectContext(); - getPlatform().resynch(contextHierarchy); - return Status.OK_STATUS; - } - }; - } - - private IJobChangeListener buildResynchJobListener() { - return new JobChangeAdapter() { - @Override - public void done(IJobChangeEvent event) { - super.done(event); - if (event.getJob() == JpaProject.this.resynchJob) { - JpaProject.this.resynching = false; - if (JpaProject.this.needsToResynch) { - resynch(); - } - } - } - }; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.JPA_PROJECT; - } - - /** - * @see IJpaProject#getProject() - */ - public IProject getProject() { - return project; - } - - void setProject(IProject theProject) { - project = theProject; - } - - public IJavaProject getJavaProject() { - return JavaCore.create(getProject()); - } - - /** - * @see IJpaProject#getModel() - */ - public IJpaModel getModel() { - return (IJpaModel) eContainer(); - } - - /** - * Returns the value of the 'Platform' reference. - * - *

- * If the meaning of the 'Platform' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Platform' reference. - * @see #setPlatform(IJpaPlatform) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject_Platform() - * @model resolveProxies="false" required="true" ordered="false" - * @generated - */ - public IJpaPlatform getPlatformGen() { - return platform; - } - - public IJpaPlatform getPlatform() { - if (platform == null) { - setPlatform(JpaFacetUtils.getPlatform(project)); - } - return getPlatformGen(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.JpaProject#getPlatform Platform}' reference. - * - * - * @param value the new value of the 'Platform' reference. - * @see #getPlatform() - * @generated - */ - public void setPlatformGen(IJpaPlatform newPlatform) { - IJpaPlatform oldPlatform = platform; - platform = newPlatform; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_PROJECT__PLATFORM, oldPlatform, platform)); - } - - public void setPlatform(IJpaPlatform jpaPlatform) { - jpaPlatform.setProject(this); - setPlatformGen(jpaPlatform); - } - - /** - * @see IJpaProject#setPlatform(String) - */ - public void setPlatform(String platformId) { - setPlatform(JpaPlatformRegistry.INSTANCE.getJpaPlatform(platformId)); - } - - /** - * Returns the value of the 'Data Source' containment reference. - * - *

- * If the meaning of the 'Data Source' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Data Source' containment reference. - * @see #setDataSource(IJpaDataSource) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject_DataSource() - * @model containment="true" ordered="false" - * @generated - */ - public IJpaDataSource getDataSourceGen() { - return dataSource; - } - - public synchronized IJpaDataSource getDataSource() { - if (dataSource == null) { - setDataSource(JpaFacetUtils.getConnectionName(project)); - } - return getDataSourceGen(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetDataSource(IJpaDataSource newDataSource, NotificationChain msgs) { - IJpaDataSource oldDataSource = dataSource; - dataSource = newDataSource; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_PROJECT__DATA_SOURCE, oldDataSource, newDataSource); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.JpaProject#getDataSource Data Source}' containment reference. - * - * - * @param value the new value of the 'Data Source' containment reference. - * @see #getDataSource() - * @generated - */ - public void setDataSource(IJpaDataSource newDataSource) { - if (newDataSource != dataSource) { - NotificationChain msgs = null; - if (dataSource != null) - msgs = ((InternalEObject) dataSource).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaCorePackage.JPA_PROJECT__DATA_SOURCE, null, msgs); - if (newDataSource != null) - msgs = ((InternalEObject) newDataSource).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaCorePackage.JPA_PROJECT__DATA_SOURCE, null, msgs); - msgs = basicSetDataSource(newDataSource, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_PROJECT__DATA_SOURCE, newDataSource, newDataSource)); - } - - /** - * @see IJpaProject#setDataSource(String) - */ - public void setDataSource(String connectionProfileName) { - if (dataSource == null) { - JpaDataSource ds = JpaCoreFactory.eINSTANCE.createJpaDataSource(); - setDataSource(ds); - } - dataSource.setConnectionProfileName(connectionProfileName); - } - - /** - * Returns the value of the 'Discover Annotated Classes' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Discover Annotated Classes' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Discover Annotated Classes' attribute. - * @see #isSetDiscoverAnnotatedClasses() - * @see #unsetDiscoverAnnotatedClasses() - * @see #setDiscoverAnnotatedClasses(boolean) - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject_DiscoverAnnotatedClasses() - * @model default="false" unique="false" unsettable="true" required="true" ordered="false" - * @generated - */ - public boolean isDiscoverAnnotatedClassesGen() { - return discoverAnnotatedClasses; - } - - public boolean isDiscoverAnnotatedClasses() { - if (!isSetDiscoverAnnotatedClasses()) { - setDiscoverAnnotatedClasses(JpaFacetUtils.getDiscoverAnnotatedClasses(project)); - } - return isDiscoverAnnotatedClassesGen(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.JpaProject#isDiscoverAnnotatedClasses Discover Annotated Classes}' attribute. - * - * - * @param value the new value of the 'Discover Annotated Classes' attribute. - * @see #isSetDiscoverAnnotatedClasses() - * @see #unsetDiscoverAnnotatedClasses() - * @see #isDiscoverAnnotatedClasses() - * @generated - */ - public void setDiscoverAnnotatedClasses(boolean newDiscoverAnnotatedClasses) { - boolean oldDiscoverAnnotatedClasses = discoverAnnotatedClasses; - discoverAnnotatedClasses = newDiscoverAnnotatedClasses; - boolean oldDiscoverAnnotatedClassesESet = discoverAnnotatedClassesESet; - discoverAnnotatedClassesESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaCorePackage.JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES, oldDiscoverAnnotatedClasses, discoverAnnotatedClasses, !oldDiscoverAnnotatedClassesESet)); - } - - /** - * Unsets the value of the '{@link org.eclipse.jpt.core.internal.JpaProject#isDiscoverAnnotatedClasses Discover Annotated Classes}' attribute. - * - * - * @see #isSetDiscoverAnnotatedClasses() - * @see #isDiscoverAnnotatedClasses() - * @see #setDiscoverAnnotatedClasses(boolean) - * @generated - */ - public void unsetDiscoverAnnotatedClasses() { - boolean oldDiscoverAnnotatedClasses = discoverAnnotatedClasses; - boolean oldDiscoverAnnotatedClassesESet = discoverAnnotatedClassesESet; - discoverAnnotatedClasses = DISCOVER_ANNOTATED_CLASSES_EDEFAULT; - discoverAnnotatedClassesESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, JpaCorePackage.JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES, oldDiscoverAnnotatedClasses, DISCOVER_ANNOTATED_CLASSES_EDEFAULT, oldDiscoverAnnotatedClassesESet)); - } - - /** - * Returns whether the value of the '{@link org.eclipse.jpt.core.internal.JpaProject#isDiscoverAnnotatedClasses Discover Annotated Classes}' attribute is set. - * - * - * @return whether the value of the 'Discover Annotated Classes' attribute is set. - * @see #unsetDiscoverAnnotatedClasses() - * @see #isDiscoverAnnotatedClasses() - * @see #setDiscoverAnnotatedClasses(boolean) - * @generated - */ - public boolean isSetDiscoverAnnotatedClasses() { - return discoverAnnotatedClassesESet; - } - - public String rootDeployLocation() { - String metaInfLocation = ""; - try { - if (FacetedProjectFramework.hasProjectFacet(project, IModuleConstants.JST_WEB_MODULE)) { - metaInfLocation = J2EEConstants.WEB_INF_CLASSES; - } - } - catch (CoreException ce) { - // if exception occurs, we'll take the default location - JptCorePlugin.log(ce); - } - return metaInfLocation; - } - - @Override - public IJpaProject getJpaProject() { - return this; - } - - /** - * Returns the value of the 'Files' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.IJpaFile}. - * - *

- * If the meaning of the 'Files' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Files' containment reference list. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getJpaProject_Files() - * @model type="org.eclipse.jpt.core.internal.IJpaFile" containment="true" - * @generated - */ - public EList getFiles() { - if (files == null) { - files = new EObjectContainmentEList(IJpaFile.class, this, JpaCorePackage.JPA_PROJECT__FILES); - } - return files; - } - - /** - * INTERNAL ONLY - * Fill project with file resources - */ - void fill() throws CoreException { - if (filled) { - return; - } - IResourceProxyVisitor visitor = new IResourceProxyVisitor() { - public boolean visit(IResourceProxy resource) throws CoreException { - switch (resource.getType()) { - case IResource.PROJECT : - case IResource.FOLDER : - return true; - case IResource.FILE : - IFile file = (IFile) resource.requestResource(); - if (getJpaFileInternal(file) == null) { - createJpaFile(file); - } - default : - return false; - } - } - }; - getProject().accept(visitor, IResource.NONE); - resynch(); - filled = true; - } - - /** - * @see IJpaProject#getJpaFile(IFile) - */ - public synchronized IJpaFile getJpaFile(IFile file) { - IJpaFile jpaFile = getJpaFileInternal(file); - if (jpaFile != null) { - return jpaFile; - } - else if (!filled) { - return createJpaFile(file); - } - else { - return null; - } - } - - synchronized IJpaFile getJpaFileInternal(IFile file) { - for (IJpaFile next : this.getFiles()) { - if (next.getFile().equals(file)) { - return next; - } - } - return null; - } - - public Iterator jpaFiles() { - return new ReadOnlyIterator(getFiles().iterator()); - } - - public Collection jpaFiles(String contentType) { - Collection jpaFiles = new ArrayList(); - for (Iterator stream = jpaFiles(); stream.hasNext();) { - IJpaFile next = stream.next(); - if (next.getContentId().equals(contentType)) { - jpaFiles.add(next); - } - } - return jpaFiles; - } - - public JavaPersistentType findJavaPersistentType(IType type) { - if (type == null) { - return null; - } - Collection persistenceFiles = jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE); - for (IJpaFile jpaFile : persistenceFiles) { - JpaCompilationUnit compilationUnit = (JpaCompilationUnit) jpaFile.getContent(); - for (JavaPersistentType persistentType : compilationUnit.getTypes()) { - if (type.equals(persistentType.getType().getJdtMember())) { - return persistentType; - } - } - } - return null; - } - - /** - * INTERNAL ONLY - * Dispose of project before it is removed - */ - void dispose() { - for (Iterator stream = new CloneIterator(getFiles()); stream.hasNext();) { - disposeFile((JpaFile) stream.next()); - } - Job.getJobManager().removeJobChangeListener(this.resynchJobListener); - } - - /** - * INTERNAL ONLY - * Dispose file and remove it - */ - void disposeFile(JpaFile jpaFile) { - jpaFile.dispose(); - getFiles().remove(jpaFile); - } - - /** - * INTERNAL ONLY - * Synch internal JPA resources. - */ - void synchInternalResources(IResourceDelta delta) throws CoreException { - delta.accept(this.buildResourceDeltaVisitor()); - } - - private IResourceDeltaVisitor buildResourceDeltaVisitor() { - return new IResourceDeltaVisitor() { - private IResource currentResource = getProject(); - - public boolean visit(IResourceDelta delta) throws CoreException { - IResource res = delta.getResource(); - if (res.equals(currentResource)) - return true; - if (res.getType() == IResource.FILE) { - IFile file = (IFile) res; - switch (delta.getKind()) { - case IResourceDelta.ADDED : - if (getJpaFile(file) == null) { - createJpaFile(file); - JpaProject.this.resynch();//TODO different api for this? - } - break; - case IResourceDelta.REMOVED : - JpaFile jpaFile = (JpaFile) getJpaFile(file); - if (jpaFile != null) { - disposeFile(jpaFile); - JpaProject.this.resynch();//TODO different api for this? - } - break; - case IResourceDelta.CHANGED : - // shouldn't have to worry, since all changes we're looking for have to do with file name - } - } - return true; - } - }; - } - - synchronized IJpaFile createJpaFile(IFile file) { - if (!JavaCore.create(getProject()).isOnClasspath(file)) { - return null; - } - IJpaFile jpaFile = JpaFileContentRegistry.getFile(this, file); - // PWFTODO - // Return a NullPersistenceFile if no content found? - if (jpaFile != null) { - getFiles().add(jpaFile); - return jpaFile; - } - return null; - } - - /** - * INTERNAL ONLY - * Handle java element change event. - */ - void handleEvent(ElementChangedEvent event) { - if (filled) { - for (Iterator stream = jpaFiles(); stream.hasNext();) { - ((JpaFile) stream.next()).handleEvent(event); - } - resynch(); - } - } - - public Iterator validationMessages() { - List messages = new ArrayList(); - getPlatform().addToMessages(messages); - return messages.iterator(); - } - - //leaving this at the JpaProject level for now instead of - //passing it on to the JpaModel. We don't currently support - //multiple projects having cross-references - public void resynch() { - if (!this.resynching) { - this.resynching = true; - this.needsToResynch = false; - this.resynchJob.schedule(); - } - else { - this.needsToResynch = true; - } - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaCorePackage.JPA_PROJECT__DATA_SOURCE : - return basicSetDataSource(null, msgs); - case JpaCorePackage.JPA_PROJECT__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaCorePackage.JPA_PROJECT__PLATFORM : - return getPlatform(); - case JpaCorePackage.JPA_PROJECT__DATA_SOURCE : - return getDataSource(); - case JpaCorePackage.JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES : - return isDiscoverAnnotatedClasses() ? Boolean.TRUE : Boolean.FALSE; - case JpaCorePackage.JPA_PROJECT__FILES : - return getFiles(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaCorePackage.JPA_PROJECT__PLATFORM : - setPlatform((IJpaPlatform) newValue); - return; - case JpaCorePackage.JPA_PROJECT__DATA_SOURCE : - setDataSource((IJpaDataSource) newValue); - return; - case JpaCorePackage.JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES : - setDiscoverAnnotatedClasses(((Boolean) newValue).booleanValue()); - return; - case JpaCorePackage.JPA_PROJECT__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_PROJECT__PLATFORM : - setPlatform((IJpaPlatform) null); - return; - case JpaCorePackage.JPA_PROJECT__DATA_SOURCE : - setDataSource((IJpaDataSource) null); - return; - case JpaCorePackage.JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES : - unsetDiscoverAnnotatedClasses(); - return; - case JpaCorePackage.JPA_PROJECT__FILES : - getFiles().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaCorePackage.JPA_PROJECT__PLATFORM : - return platform != null; - case JpaCorePackage.JPA_PROJECT__DATA_SOURCE : - return dataSource != null; - case JpaCorePackage.JPA_PROJECT__DISCOVER_ANNOTATED_CLASSES : - return isSetDiscoverAnnotatedClasses(); - case JpaCorePackage.JPA_PROJECT__FILES : - return files != null && !files.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * @generated NOT - */ - @Override - public String toString() { - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (" + getProject().toString() + ")"); - return result.toString(); - } - - public ConnectionProfile connectionProfile() { - String profileName = getDataSource().getConnectionProfileName(); - return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed(profileName); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java deleted file mode 100644 index 27713e4bcb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jdt.core.IJavaProject; - -public class JpaProjectAdapterFactory - implements IAdapterFactory -{ - private static Class[] PROPERTIES= new Class[] { - IJpaProject.class - }; - - public Class[] getAdapterList() { - return PROPERTIES; - } - - public Object getAdapter(Object element, Class key) { - IProject project; - - if (element instanceof IProject) { - project = (IProject) element; - } - else if (element instanceof IJavaProject) { - project = ((IJavaProject) element).getProject(); - } - else { - return null; - } - - return JptCorePlugin.getJpaProject(project); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java deleted file mode 100644 index fa75d97b34..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.osgi.util.NLS; - -public class JptCoreMessages extends NLS -{ - private static final String BUNDLE_NAME = "jpa_core"; //$NON-NLS-1$ - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, JptCoreMessages.class); - } - - public static String VALIDATE_PLATFORM_NOT_SPECIFIED; - - public static String VALIDATE_CONNECTION_NOT_SPECIFIED; - - public static String VALIDATE_CONNECTION_NOT_CONNECTED; - - public static String VALIDATE_RUNTIME_NOT_SPECIFIED; - - public static String VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30; - - public static String VALIDATE_LIBRARY_NOT_SPECIFIED; - - public static String SYNCHRONIZE_CLASSES_JOB; - - public static String SYNCHRONIZING_CLASSES_TASK; - - public static String INVALID_PERSISTENCE_XML_CONTENT; - - public static String ERROR_WRITING_FILE; - - - private JptCoreMessages() { - throw new UnsupportedOperationException(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCorePlugin.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCorePlugin.java deleted file mode 100644 index 2db5675b78..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCorePlugin.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jpt.core.internal.content.orm.OrmInit; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceInit; -import org.osgi.framework.BundleContext; - -public class JptCorePlugin extends Plugin -{ - private static JptCorePlugin INSTANCE; - - /** - * The plug-in identifier of the persistence support - * (value "org.eclipse.jpt.core"). - */ - public final static String PLUGIN_ID = "org.eclipse.jpt.core"; //$NON-NLS-1$ - - /** - * The identifier for the JPA facet - * (value "jpt.jpa"). - */ - public final static String FACET_ID = "jpt.jpa"; //$NON-NLS-1$ - - /** - * The identifier for the JPA validation marker - * (value "org.eclipse.jpt.core.jpaProblemMarker"). - */ - public final static String VALIDATION_MARKER_ID = PLUGIN_ID + ".jpaProblemMarker"; - - /** - * Value of the content-type for orm.xml mappings files. Use this value to retrieve - * the ORM xml content type from the content type manager, and to add new - * orm.xml-like extensions to this content type. - * - * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String) - */ - public static final String ORM_XML_CONTENT_TYPE = PLUGIN_ID + ".content.orm"; //$NON-NLS-1$ - - public static final String PERSISTENCE_XML_CONTENT_TYPE = PLUGIN_ID + ".content.persistence"; //$NON-NLS-1$ - - public static final String JAVA_CONTENT_TYPE = JavaCore.JAVA_SOURCE_CONTENT_TYPE; - - /** - * Returns the singular IJpaModel corresponding to the current workspace. - * - * @return the singular IJpaModel corresponding to the current workspace. - */ - public static IJpaModel getJpaModel() { - return JpaModelManager.instance().getJpaModel(); - } - - /** - * Returns the IJpaProject corresponding to the given IProject, - * or null if unable to associate the given project with an - * IJpaProject. - * - * @param project the given project - * @return the IJpaProject corresponding to the given project, - * or null if unable to associate the given project with an - * IJpaProject - */ - public static IJpaProject getJpaProject(IProject project) { - return JpaModelManager.instance().getJpaProject(project); - } - - /** - * Returns the IJpaFile corresponding to the given IFile, - * or null if unable to associate the given file with an - * IJpaFile. - * - * @param file the given file - * @return the IJpaFile corresponding to the given file, - * or null if unable to associate the given file with an - * IJpaFile - */ - public static IJpaFile getJpaFile(IFile file) { - return JpaModelManager.instance().getJpaFile(file); - } - - /** - * Returns the singleton DaliPlugin - */ - public static JptCorePlugin getPlugin() { - return INSTANCE; - } - - public static void log(IStatus status) { - INSTANCE.getLog().log(status); - } - - public static void log(String msg) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null)); - } - - public static void log(Throwable throwable) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable)); - } - - - public JptCorePlugin() { - super(); - INSTANCE = this; - } - - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - JpaModelManager.instance().startup(); - OrmInit.init(); - PersistenceInit.init(); - } - - @Override - public void stop(BundleContext context) throws Exception { - try { - JpaModelManager.instance().shutdown(); - } - finally { - super.stop(context); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/NullTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/NullTypeMapping.java deleted file mode 100644 index 01dbd3b0ae..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/NullTypeMapping.java +++ /dev/null @@ -1,265 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Iterator; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -/** - * - * A representation of the model object 'Null Type Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getNullTypeMapping() - * @model kind="class" - * @generated - */ -public class NullTypeMapping extends JpaEObject - implements ITypeMapping, IJpaSourceObject -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getTableName() Table Name}' attribute. - * - * - * @see #getTableName() - * @generated - * @ordered - */ - protected static final String TABLE_NAME_EDEFAULT = null; - - /** - * - * - * @generated - */ - protected NullTypeMapping() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.NULL_TYPE_MAPPING; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getITypeMapping_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getName() { - return ""; - } - - /** - * Returns the value of the 'Table Name' attribute. - * - *

- * If the meaning of the 'Table Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table Name' attribute. - * @see org.eclipse.jpt.core.internal.JpaCoreackage#getITypeMapping_TableName() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getTableName() { - return ""; - } - - public IPersistentType getPersistentType() { - throw new UnsupportedOperationException(); - } - - public IResource getResource() { - throw new UnsupportedOperationException("getResource()"); - } - - /** - * @model kind="operation" - * @generated NOT - */ - public IJpaFile getJpaFile() { - throw new UnsupportedOperationException("getJpaFile()"); - } - - public ITextRange validationTextRange() { - throw new UnsupportedOperationException("validationTextRange()"); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaCorePackage.NULL_TYPE_MAPPING__NAME : - return getName(); - case JpaCorePackage.NULL_TYPE_MAPPING__TABLE_NAME : - return getTableName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaCorePackage.NULL_TYPE_MAPPING__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case JpaCorePackage.NULL_TYPE_MAPPING__TABLE_NAME : - return TABLE_NAME_EDEFAULT == null ? getTableName() != null : !TABLE_NAME_EDEFAULT.equals(getTableName()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaSourceObject.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == ITypeMapping.class) { - switch (derivedFeatureID) { - case JpaCorePackage.NULL_TYPE_MAPPING__NAME : - return JpaCorePackage.ITYPE_MAPPING__NAME; - case JpaCorePackage.NULL_TYPE_MAPPING__TABLE_NAME : - return JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaSourceObject.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == ITypeMapping.class) { - switch (baseFeatureID) { - case JpaCorePackage.ITYPE_MAPPING__NAME : - return JpaCorePackage.NULL_TYPE_MAPPING__NAME; - case JpaCorePackage.ITYPE_MAPPING__TABLE_NAME : - return JpaCorePackage.NULL_TYPE_MAPPING__TABLE_NAME; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public String getKey() { - return IMappingKeys.NULL_TYPE_MAPPING_KEY; - } - - public void javaElementChanged(ElementChangedEvent event) {} - - public Iterator associatedTableNamesIncludingInherited() { - return EmptyIterator.instance(); - } - - public Iterator associatedTables() { - return EmptyIterator.instance(); - } - - public Iterator associatedTablesIncludingInherited() { - return EmptyIterator.instance(); - } - - public Table primaryDbTable() { - return null; - } - - public Table dbTable(String tableName) { - return null; - } - - public Schema dbSchema() { - return null; - } - - public boolean tableNameIsInvalid(String tableName) { - return false; - } - - public Iterator overridableAssociationNames() { - return EmptyIterator.instance(); - } - - public Iterator overridableAttributeNames() { - return EmptyIterator.instance(); - } - - public Iterator allOverridableAssociationNames() { - return EmptyIterator.instance(); - } - - public Iterator allOverridableAttributeNames() { - return EmptyIterator.instance(); - } - - public boolean attributeMappingKeyAllowed(String attributeMappingKey) { - // it's not so much that all mapping keys are allowed. - // it's just that they're not really invalid, per se - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java deleted file mode 100644 index 5db6ad2d72..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Straightforward, albeit almost useless, implementation of ITextRange. - */ -public class SimpleTextRange implements ITextRange { - private final int offset; - private final int length; - private final int lineNumber; - - public SimpleTextRange(int offset, int length, int lineNumber) { - super(); - this.offset = offset; - this.length = length; - this.lineNumber = lineNumber; - } - - public int getOffset() { - return this.offset; - } - - public int getLength() { - return this.length; - } - - public int getLineNumber() { - return this.lineNumber; - } - - public boolean includes(int index) { - return (this.offset <= index) && (index < this.end()); - } - - public boolean touches(int index) { - return this.includes(index) || (index == this.end()); - } - - /** - * The end offset is "exclusive", i.e. the element at the end offset - * is not included in the range. - */ - private int end() { - return this.offset + this.length; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if ( ! (o instanceof ITextRange)) { - return false; - } - ITextRange r = (ITextRange) o; - return (r.getOffset() == this.offset) - && (r.getLength() == this.length); - } - - @Override - public int hashCode() { - return this.offset ^ this.length; - } - - @Override - public String toString() { - String start = String.valueOf(this.offset); - String end = String.valueOf(this.end()); - return StringTools.buildToStringFor(this, start + ", " + end); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlEObject.java deleted file mode 100644 index a88c60e190..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlEObject.java +++ /dev/null @@ -1,287 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Map; -import java.util.Set; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.utility.internal.ClassTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; -import org.w3c.dom.Node; - -/** - * - * A representation of the model object 'Xml EObject'. - * - * - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlEObject extends JpaEObject implements IXmlEObject -{ - protected IDOMNode node; - - /** - * Sets of "insignificant" feature ids, keyed by class. - * This is built up lazily, as the objects are modified. - */ - private static final Map> insignificantXmlFeatureIdSets = new Hashtable>(); - - /** - * - * - * @generated - */ - protected XmlEObject() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaCorePackage.Literals.XML_EOBJECT; - } - - /** - * - * - * @model kind="operation" - * @generated NOT - */ - public IJpaFile getJpaFile() { - IJpaRootContentNode root = getRoot(); - return (root == null) ? null : root.getJpaFile(); - } - - @Override - public EList eAdapters() { - if (this.eAdapters == null) { - this.eAdapters = new XmlEAdapterList(this); - } - return this.eAdapters; - } - - public IDOMNode getNode() { - return this.node; - } - - - protected class XmlEAdapterList extends EAdapterList - { - public XmlEAdapterList(Notifier notifier) { - super(notifier); - } - - @Override - protected void didAdd(int index, Object newObject) { - super.didAdd(index, newObject); - try { - node = (IDOMNode) ClassTools.executeMethod(newObject, "getNode"); - } - catch (RuntimeException re) { - // nothing to do - } - } - - @Override - protected void didRemove(int index, Object oldObject) { - super.didRemove(index, oldObject); - if ((oldObject instanceof EMF2DOMAdapter) && (((EMF2DOMAdapter) oldObject).getNode() == XmlEObject.this.node)) { - XmlEObject.this.node = null; - } - } - } - - public boolean isAllFeaturesUnset() { - for (EStructuralFeature feature : eClass().getEAllStructuralFeatures()) { - if (xmlFeatureIsInsignificant(feature.getFeatureID())) { - continue; - } - if (feature instanceof EReference) { - Object object = eGet(feature); - if (object instanceof Collection) { - if (eIsSet(feature)) { - return false; - } - } - else { - XmlEObject eObject = (XmlEObject) eGet(feature); - if (eObject != null) { - return eObject.isAllFeaturesUnset(); - } - } - } - else if (eIsSet(feature)) { - return false; - } - } - return true; - } - - public IJpaRootContentNode getRoot() { - XmlEObject container = (XmlEObject) eContainer(); - return (container == null) ? null : container.getRoot(); - } - - public IResource getResource() { - return getJpaFile().getResource(); - } - - public ITextRange validationTextRange() { - return fullTextRange(); - } - - public ITextRange selectionTextRange() { - return fullTextRange(); - } - - public ITextRange fullTextRange() { - return buildTextRange(this.node); - } - - protected ITextRange buildTextRange(IDOMNode domNode) { - if (domNode == null) { - return null; - } - return new DOMNodeTextRange(domNode); - } - - protected boolean xmlFeatureIsSignificant(int featureId) { - return !this.xmlFeatureIsInsignificant(featureId); - } - - protected boolean xmlFeatureIsInsignificant(int featureId) { - return this.insignificantXmlFeatureIds().contains(featureId); - } - - /** - * Return a set of the xml object's "insignificant" feature ids. - * These are the EMF features that will not be used to determine if all - * the features are unset. We use this to determine when to remove - * an element from the xml. - * - * If you need instance-based calculation of your xml "insignificant" aspects, - * override this method. If class-based calculation is sufficient, - * override #addInsignificantXmlFeatureIdsTo(Set). - * - * @see isAllFeaturesUnset() - */ - protected Set insignificantXmlFeatureIds() { - synchronized (insignificantXmlFeatureIdSets) { - Set insignificantXmlFeatureIds = insignificantXmlFeatureIdSets.get(this.getClass()); - if (insignificantXmlFeatureIds == null) { - insignificantXmlFeatureIds = new HashSet(); - this.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - insignificantXmlFeatureIdSets.put(this.getClass(), insignificantXmlFeatureIds); - } - return insignificantXmlFeatureIds; - } - } - - /** - * Add the object's "insignificant" feature ids to the specified set. - * These are the EMF features that, when they change, will NOT cause the - * object (or its containing tree) to be resynched, i.e. defaults calculated. - * If class-based calculation of your "insignificant" features is sufficient, - * override this method. If you need instance-based calculation, - * override #insignificantXmlFeatureIds(). - */ - protected void addInsignificantXmlFeatureIdsTo(Set insignificantXmlFeatureIds) { - // when you override this method, don't forget to include: - // super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - } - - - /** - * Implementation of ITextRange that adapts a IDOMNode. - */ - private static class DOMNodeTextRange implements ITextRange - { - private final IDOMNode node; - - DOMNodeTextRange(IDOMNode node) { - super(); - this.node = node; - } - - public int getOffset() { - return this.node.getStartOffset(); - } - - public int getLength() { - if (this.node.getNodeType() == Node.ELEMENT_NODE) { - return ((IDOMElement) this.node).getStartEndOffset() - this.node.getStartOffset(); - } - return this.node.getLength(); - } - - public int getLineNumber() { - return this.node.getStructuredDocument().getLineOfOffset(getOffset()) + 1; - } - - public boolean includes(int index) { - return (this.getOffset() <= index) && (index < this.end()); - } - - public boolean touches(int index) { - return this.includes(index) || (index == this.end()); - } - - /** - * The end offset is "exclusive", i.e. the element at the end offset - * is not included in the range. - */ - private int end() { - return this.getOffset() + this.getLength(); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ITextRange)) { - return false; - } - ITextRange r = (ITextRange) o; - return (r.getOffset() == this.getOffset()) && (r.getLength() == this.getLength()); - } - - @Override - public int hashCode() { - return this.getOffset() ^ this.getLength(); - } - - @Override - public String toString() { - String start = String.valueOf(this.getOffset()); - String end = String.valueOf(this.getOffset() + this.getLength() - 1); - return StringTools.buildToStringFor(this, start + ", " + end); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java deleted file mode 100644 index 918f77c821..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import java.util.Iterator; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'IJava Attribute Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJavaAttributeMapping extends IAttributeMapping -{ - /** - * - * Initialize the model after the AttributeMapping has been - * created and added to its container. Some things - * can't be accessed. Build anything that doesn't depend - * on resources throughout the model being built. - * - * @model - * @generated - */ - void initialize(); - - void updateFromJava(CompilationUnit astRoot); - - /** - * Refresh defaults using the given DefaultsContext - */ - void refreshDefaults(DefaultsContext defaultsContext); - - Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMappingProvider.java deleted file mode 100644 index ff71764a1f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMappingProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * Map a string key to an attribute mapping and its corresponding - * Java annotation adapter. - */ -public interface IJavaAttributeMappingProvider { - - String key(); - - boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext); - - IJavaAttributeMapping buildMapping(Attribute attribute); - - DeclarationAnnotationAdapter declarationAnnotationAdapter(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaContentNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaContentNodes.java deleted file mode 100644 index 21ec42e486..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaContentNodes.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import org.eclipse.jpt.core.internal.JptCorePlugin; - -public interface IJavaContentNodes -{ - public static final String COMPILATION_UNIT_ID = - JptCorePlugin.PLUGIN_ID + ".java.compilationUnit"; - - public static final String PERSISTENT_TYPE_ID = - JptCorePlugin.PLUGIN_ID + ".java.persistentType"; - - public static final String PERSISTENT_ATTRIBUTE_ID = - JptCorePlugin.PLUGIN_ID + ".java.persistentAttribute"; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMapping.java deleted file mode 100644 index 4a9646480d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMapping.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import java.util.Iterator; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'IJava Type Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJavaTypeMapping extends ITypeMapping -{ - /** - * - * - * @model - * @generated - */ - void initialize(); - - void updateFromJava(CompilationUnit astRoot); - - /** - * Return the candidate code-completion values for the specified position - * in the source code. - */ - Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot); -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMappingProvider.java deleted file mode 100644 index 9f34675844..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMappingProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -/** - * Map a string key to a type mapping and its corresponding - * Java annotation adapter. - */ -public interface IJavaTypeMappingProvider { - - String key(); - - IJavaTypeMapping buildMapping(Type type); - - DeclarationAnnotationAdapter declarationAnnotationAdapter(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaEObject.java deleted file mode 100644 index 5af9ddeb05..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaEObject.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import java.util.Iterator; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java EObject'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaEObject() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaEObject extends JpaEObject - implements IJpaSourceObject -{ - protected JavaEObject() { - super(); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - JavaEObject.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - // do nothing by default - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaPackage.Literals.JAVA_EOBJECT; - } - - public IJpaFile getJpaFile() { - return this.getRoot().getJpaFile(); - } - - public IJpaRootContentNode getRoot() { - return ((JavaEObject) this.eContainer()).getRoot(); - } - - @Override - public IResource getResource() { - return this.getJpaFile().getResource(); - } - - /** - * All features are "insiginificant". We do a resynch of our java model - * when it gets notification from the jdt java model. We had problems - * with the java model being in a bad state while doing our resynch. - */ - @Override - protected boolean featureIsInsignificant(int featureId) { - return true; - } - - /** - * Convenience method. If the specified element text range is null - * return the Java object's text range instead (which is usually the - * annotation's text range). - */ - protected ITextRange elementTextRange(ITextRange elementTextRange) { - return (elementTextRange != null) ? elementTextRange : this.validationTextRange(); - } - - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - if (this.isConnected()) { - Iterator result = this.connectedCandidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - /** - * This method is called if the database is connected, allowing us to - * get candidates from the various database tables etc. - * This method should NOT be cascaded to "child" objects; it should - * only return candidates for the current object. The cascading is - * handled by #candidateValuesFor(int, Filter, CompilationUnit). - */ - public Iterator connectedCandidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - return null; - } - - /** - * Convenience method. Return whether element's text range is not - * null (meaning the element exists) and the specified position touches it. - */ - protected boolean elementTouches(ITextRange elementTextRange, int pos) { - return (elementTextRange != null) && elementTextRange.touches(pos); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaJpaFileContentProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaJpaFileContentProvider.java deleted file mode 100644 index 27c561b942..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaJpaFileContentProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jpt.core.internal.IJpaFileContentProvider; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.JptCorePlugin; - -public class JavaJpaFileContentProvider implements IJpaFileContentProvider -{ - public static JavaJpaFileContentProvider INSTANCE = new JavaJpaFileContentProvider(); - - /** - * Restrict access - */ - private JavaJpaFileContentProvider() { - super(); - } - - public IJpaRootContentNode buildRootContent(IFile resourceFile) { - JpaCompilationUnit content = JpaJavaFactory.eINSTANCE.createJpaCompilationUnit(); - content.setFile(resourceFile); - return content; - } - - public String contentType() { - return JptCorePlugin.JAVA_CONTENT_TYPE; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java deleted file mode 100644 index 4a50f4bc20..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java +++ /dev/null @@ -1,649 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.IMember; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasicProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedIdProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaIdProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToManyProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOneProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMappingProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToManyProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOneProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransientProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersionProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Java Persistent Attribute'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getDefaultMapping Default Mapping}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getSpecifiedMapping Specified Mapping}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentAttribute() - * @model kind="class" - * @generated - */ -public class JavaPersistentAttribute extends JavaEObject - implements IPersistentAttribute -{ - /** - * The cached value of the '{@link #getDefaultMapping() Default Mapping}' containment reference. - * - * - * @see #getDefaultMapping() - * @generated - * @ordered - */ - protected IJavaAttributeMapping defaultMapping; - - /** - * The cached value of the '{@link #getSpecifiedMapping() Specified Mapping}' containment reference. - * - * - * @see #getSpecifiedMapping() - * @generated - * @ordered - */ - protected IJavaAttributeMapping specifiedMapping; - - private Attribute attribute; - - // TODO move these to the platform - private IJavaAttributeMappingProvider[] attributeMappingProviders; - - /** - * the "null" attribute mapping is used when the attribute is neither - * modified with a mapping annotation nor mapped by a "default" mapping - */ - // TODO move this to the platform - private IJavaAttributeMappingProvider nullAttributeMappingProvider; - - /** - * - * - * @generated - */ - protected JavaPersistentAttribute() { - super(); - } - - protected JavaPersistentAttribute(Attribute attribute) { - super(); - this.attribute = attribute; - this.attributeMappingProviders = this.buildAttributeMappingProviders(); - this.nullAttributeMappingProvider = this.buildNullAttributeMappingProvider(); - this.setDefaultMapping(this.nullAttributeMappingProvider.buildMapping(this.attribute)); - } - - private IJavaAttributeMappingProvider[] buildAttributeMappingProviders() { - List providers = new ArrayList(); - this.addAttributeMappingProvidersTo(providers); - return providers.toArray(new IJavaAttributeMappingProvider[providers.size()]); - } - - /** - * Override this to specify more or different attribute mapping providers. - * The default includes the JPA spec-defined type mappings of - * Basic, Id, OneToOne, OneToMany, ManyToOne, ManyToMany, Embeddable, EmbeddedId. - */ - protected void addAttributeMappingProvidersTo(List providers) { - providers.add(JavaEmbeddedProvider.instance()); //bug 190344 need to test default embedded before basic - providers.add(JavaBasicProvider.instance()); - providers.add(JavaIdProvider.instance()); - providers.add(JavaTransientProvider.instance()); - providers.add(JavaOneToManyProvider.instance()); - providers.add(JavaManyToOneProvider.instance()); - providers.add(JavaManyToManyProvider.instance()); - providers.add(JavaOneToOneProvider.instance()); - providers.add(JavaEmbeddedIdProvider.instance()); - providers.add(JavaVersionProvider.instance()); - } - - protected IJavaAttributeMappingProvider buildNullAttributeMappingProvider() { - return JavaNullAttributeMappingProvider.instance(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaPackage.Literals.JAVA_PERSISTENT_ATTRIBUTE; - } - - /** - * Returns the value of the 'Default Mapping' containment reference. - * - *

- * If the meaning of the 'Default Mapping' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Mapping' containment reference. - * @see #setDefaultMapping(IJavaAttributeMapping) - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentAttribute_DefaultMapping() - * @model containment="true" required="true" - * @generated - */ - public IJavaAttributeMapping getDefaultMapping() { - return defaultMapping; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetDefaultMapping(IJavaAttributeMapping newDefaultMapping, NotificationChain msgs) { - IJavaAttributeMapping oldDefaultMapping = defaultMapping; - defaultMapping = newDefaultMapping; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING, oldDefaultMapping, newDefaultMapping); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getDefaultMapping Default Mapping}' containment reference. - * - * - * @param value the new value of the 'Default Mapping' containment reference. - * @see #getDefaultMapping() - * @generated - */ - public void setDefaultMappingGen(IJavaAttributeMapping newDefaultMapping) { - if (newDefaultMapping != defaultMapping) { - NotificationChain msgs = null; - if (defaultMapping != null) - msgs = ((InternalEObject) defaultMapping).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING, null, msgs); - if (newDefaultMapping != null) - msgs = ((InternalEObject) newDefaultMapping).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING, null, msgs); - msgs = basicSetDefaultMapping(newDefaultMapping, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING, newDefaultMapping, newDefaultMapping)); - } - - /** - * clients do not set the "default" mapping - */ - private void setDefaultMapping(IJavaAttributeMapping defaultMapping) { - this.setDefaultMappingGen(defaultMapping); - } - - /** - * Returns the value of the 'Specified Mapping' containment reference. - * - *

- * If the meaning of the 'Specified Mapping' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Mapping' containment reference. - * @see #setSpecifiedMapping(IJavaAttributeMapping) - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentAttribute_SpecifiedMapping() - * @model containment="true" required="true" - * @generated - */ - public IJavaAttributeMapping getSpecifiedMapping() { - return specifiedMapping; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSpecifiedMapping(IJavaAttributeMapping newSpecifiedMapping, NotificationChain msgs) { - IJavaAttributeMapping oldSpecifiedMapping = specifiedMapping; - specifiedMapping = newSpecifiedMapping; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING, oldSpecifiedMapping, newSpecifiedMapping); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getSpecifiedMapping Specified Mapping}' containment reference. - * - * clients do not set the "specified" mapping directly; - * call #setMappingKey(String, boolean) instead - * - * @param value the new value of the 'Specified Mapping' containment reference. - * @see #getSpecifiedMapping() - * @generated - */ - public void setSpecifiedMappingGen(IJavaAttributeMapping newSpecifiedMapping) { - if (newSpecifiedMapping != specifiedMapping) { - NotificationChain msgs = null; - if (specifiedMapping != null) - msgs = ((InternalEObject) specifiedMapping).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING, null, msgs); - if (newSpecifiedMapping != null) - msgs = ((InternalEObject) newSpecifiedMapping).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING, null, msgs); - msgs = basicSetSpecifiedMapping(newSpecifiedMapping, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING, newSpecifiedMapping, newSpecifiedMapping)); - } - - /** - * clients do not set the "specified" mapping; - * use #setMappingKey(String) - */ - private void setSpecifiedMapping(IJavaAttributeMapping specifiedMapping) { - this.setSpecifiedMappingGen(specifiedMapping); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING : - return basicSetDefaultMapping(null, msgs); - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING : - return basicSetSpecifiedMapping(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING : - return getMapping(); - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING : - return getDefaultMapping(); - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING : - return getSpecifiedMapping(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING : - setDefaultMapping((IJavaAttributeMapping) newValue); - return; - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING : - setSpecifiedMapping((IJavaAttributeMapping) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING : - setDefaultMapping((IJavaAttributeMapping) null); - return; - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING : - setSpecifiedMapping((IJavaAttributeMapping) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING : - return getMapping() != null; - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING : - return defaultMapping != null; - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING : - return specifiedMapping != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentAttribute.class) { - switch (derivedFeatureID) { - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING : - return JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentAttribute.class) { - switch (baseFeatureID) { - case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING : - return JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public IPersistentType getPersistentType() { - return (IPersistentType) this.eContainer(); - } - - public IJavaAttributeMapping getMapping() { - return (this.specifiedMapping != null) ? this.specifiedMapping : this.defaultMapping; - } - - public String getName() { - return this.attribute.attributeName(); - } - - public ITypeMapping typeMapping() { - return this.getPersistentType().getMapping(); - } - - public String mappingKey() { - return this.getMapping().getKey(); - } - - /** - * return null if there is no "default" mapping for the attribute - */ - public String defaultMappingKey() { - return this.defaultMapping.getKey(); - } - - /** - * return null if there is no "specified" mapping for the attribute - */ - public String specifiedMappingKey() { - return (this.specifiedMapping == null) ? null : this.specifiedMapping.getKey(); - } - - // TODO support morphing mappings, i.e. copying common settings over - // to the new mapping; this can't be done in the same was as XmlAttributeMapping - // since we don't know all the possible mapping types - public void setSpecifiedMappingKey(String newKey) { - String oldKey = this.specifiedMappingKey(); - if (newKey == oldKey) { - return; - } - IJavaAttributeMapping old = this.getMapping(); - if (newKey == null) { - // remove mapping annotation - this.setSpecifiedMapping(null); - this.attribute.removeAnnotation(this.declarationAnnotationAdapterForAttributeMappingKey(oldKey)); - } - else { - // add or replace mapping annotation - this.setSpecifiedMapping(this.attributeMappingProviderFor(newKey).buildMapping(this.attribute)); - if (oldKey != null) { - this.attribute.removeAnnotation(this.declarationAnnotationAdapterForAttributeMappingKey(oldKey)); - } - this.attribute.newMarkerAnnotation(this.declarationAnnotationAdapterForAttributeMappingKey(newKey)); - this.specifiedMapping.initialize(); - } - if (this.eNotificationRequired()) { - this.eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING, old, this.getMapping())); - } - } - - private DeclarationAnnotationAdapter declarationAnnotationAdapterForAttributeMappingKey(String attributeMappingKey) { - return this.attributeMappingProviderFor(attributeMappingKey).declarationAnnotationAdapter(); - } - - /** - * throw an exception if the provider is not found - */ - private IJavaAttributeMappingProvider attributeMappingProviderFor(String attributeMappingKey) { - for (IJavaAttributeMappingProvider provider : this.attributeMappingProviders) { - if (provider.key() == attributeMappingKey) { - return provider; - } - } - throw new IllegalArgumentException("Unsupported attribute mapping key: " + attributeMappingKey); - } - - public Iterator candidateMappingKeys() { - return new TransformationIterator(new ArrayIterator(this.attributeMappingProviders)) { - @Override - protected String transform(IJavaAttributeMappingProvider provider) { - return provider.key(); - } - }; - } - - public Object getId() { - return IJavaContentNodes.PERSISTENT_ATTRIBUTE_ID; - } - - public Attribute getAttribute() { - return this.attribute; - } - - public boolean includes(int offset) { - ITextRange fullTextRange = this.fullTextRange(); - if (fullTextRange == null) { - //This happens if the attribute no longer exists in the java. - //The text selection event is fired before the update from java so our - //model has not yet had a chance to update appropriately. The list of - //JavaPersistentAttriubtes is stale at this point. For now, we are trying - //to avoid the NPE, not sure of the ultimate solution to these 2 threads accessing - //our model - return false; - } - return fullTextRange.includes(offset); - } - - public ITextRange fullTextRange() { - return this.attribute.textRange(); - } - - public ITextRange validationTextRange() { - return this.selectionTextRange(); - } - - public ITextRange selectionTextRange() { - return this.attribute.nameTextRange(); - } - - public boolean isFor(IMember member) { - return this.attribute.wraps(member); - } - - public void updateFromJava(CompilationUnit astRoot) { - // synchronize the "specified" mapping with the Java source - String jpaKey = this.specifiedMappingKey(); - IJavaAttributeMappingProvider javaProvider = this.javaAttributeMappingProvider(astRoot); - String javaKey = ((javaProvider == null) ? null : javaProvider.key()); - if (javaKey != jpaKey) { - IJavaAttributeMapping old = this.getMapping(); - if (javaKey == null) { - // no mapping annotation found in Java source - this.setSpecifiedMapping(null); - } - else { - // the mapping has changed - this.setSpecifiedMapping(javaProvider.buildMapping(this.attribute)); - this.specifiedMapping.initialize(); - } - if (this.eNotificationRequired()) { - this.eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING, old, this.getMapping())); - } - } - // once the "specified" mapping is in place, update it from Java; - // unless it is null, in which case we update the "default" mapping from Java - this.getMapping().updateFromJava(astRoot); - } - - /** - * return null if we can't find a mapping annotation on the attribute - */ - private IJavaAttributeMappingProvider javaAttributeMappingProvider(CompilationUnit astRoot) { - for (IJavaAttributeMappingProvider provider : this.attributeMappingProviders) { - if (this.attribute.containsAnnotation(provider.declarationAnnotationAdapter(), astRoot)) { - return provider; - } - } - return null; - } - - public String primaryKeyColumnName() { - IJavaAttributeMapping mapping = this.getMapping(); - return (mapping == null) ? null : mapping.primaryKeyColumnName(); - } - - /** - * the mapping might be "default", but it still might be a "null" mapping... - */ - public boolean mappingIsDefault() { - return this.specifiedMapping == null; - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - return this.getMapping().candidateValuesFor(pos, filter, astRoot); - } - - /** - * check to see whether the "default" mapping has changed - */ - public void refreshDefaults(DefaultsContext defaultsContext) { - IJavaAttributeMappingProvider defaultProvider = this.defaultAttributeMappingProvider(defaultsContext); - if (defaultProvider.key() == this.defaultMapping.getKey()) { - return; - } - // the "default" mapping has changed - IJavaAttributeMapping old = this.getMapping(); - this.setDefaultMapping(defaultProvider.buildMapping(this.attribute)); - this.defaultMapping.updateFromJava(this.attribute.astRoot()); - if (this.eNotificationRequired()) { - this.eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING, old, this.getMapping())); - } - } - - /** - * return the first(?) provider that can supply a "default" mapping for the attribute; - * return the null provider if we can't find a provider - */ - private IJavaAttributeMappingProvider defaultAttributeMappingProvider(DefaultsContext defaultsContext) { - for (IJavaAttributeMappingProvider provider : this.attributeMappingProviders) { - if (provider.defaultApplies(this.attribute, defaultsContext)) { - return provider; - } - } - return this.nullAttributeMappingProvider; - } - - public boolean isOverridableAttribute() { - return this.getMapping().isOverridableAttributeMapping(); - } - - public boolean isOverridableAssociation() { - return this.getMapping().isOverridableAssociationMapping(); - } - - public boolean isIdAttribute() { - return this.getMapping().isIdMapping(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java deleted file mode 100644 index 50b81df365..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java +++ /dev/null @@ -1,939 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.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.IField; -import org.eclipse.jdt.core.IMember; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddableProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEntityProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclassProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMappingProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.AttributeAnnotationTools; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.FieldAttribute; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.jdtutility.MethodAttribute; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; -import org.eclipse.jpt.utility.internal.iterators.ChainIterator; -import org.eclipse.jpt.utility.internal.iterators.CloneIterator; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Java Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getMapping Mapping}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getAttributes Attributes}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getAccess Access}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentType() - * @model kind="class" - * @generated - */ -public class JavaPersistentType extends JavaEObject implements IPersistentType -{ - /** - * The default value of the '{@link #getMappingKey() Mapping Key}' attribute. - * - * - * @see #getMappingKey() - * @generated - * @ordered - */ - protected static final String MAPPING_KEY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMappingKey() Mapping Key}' attribute. - * - * - * @see #getMappingKey() - * @generated - * @ordered - */ - protected String mappingKey = MAPPING_KEY_EDEFAULT; - - /** - * The cached value of the '{@link #getMapping() Mapping}' containment reference. - * - * - * @see #getMapping() - * @generated - * @ordered - */ - protected IJavaTypeMapping mapping; - - /** - * The cached value of the '{@link #getAttributes() Attributes}' containment reference list. - * - * - * @see #getAttributes() - * @generated - * @ordered - */ - protected EList attributes; - - /** - * The default value of the '{@link #getAccess() Access}' attribute. - * - * - * @see #getAccess() - * @generated - * @ordered - */ - protected static final AccessType ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getAccess() Access}' attribute. - * - * - * @see #getAccess() - * @generated - * @ordered - */ - protected AccessType access = ACCESS_EDEFAULT; - - private Type type; - - private IJavaTypeMappingProvider[] typeMappingProviders; - - private DeclarationAnnotationAdapter[] attributeMappingAnnotationAdapters; - - /** - * Store the parentPersistentType during default calculation. This will - * be the first persisentType found in the hierarchy, the JPA spec allows - * for non-persistent types to be part of the hierarchy. - * Example: - * - * @Entity public abstract class Model {} - * - * public abstract class Animal extends Model {} - * - * @Entity public class Cat extends Animal {} - * - * If this is the Cat JavaPersistentType then parentPersistentType is the Model JavaPersistentType - * The parentPersistentType could be found in java or xml. - */ - private IPersistentType parentPersistentType; - - protected JavaPersistentType() { - super(); - this.typeMappingProviders = this.buildTypeMappingProviders(); - this.attributeMappingAnnotationAdapters = this.buildAttributeMappingAnnotationAdapters(); - } - - private IJavaTypeMappingProvider[] buildTypeMappingProviders() { - ArrayList providers = new ArrayList(); - this.addTypeMappingProvidersTo(providers); - return providers.toArray(new IJavaTypeMappingProvider[providers.size()]); - } - - /** - * Override this to specify more or different type mapping providers. - * The default includes the JPA spec-defined type mappings of - * Entity, MappedSuperclass, and Embeddable - */ - protected void addTypeMappingProvidersTo(Collection providers) { - providers.add(JavaNullTypeMappingProvider.instance()); - providers.add(JavaEntityProvider.instance()); - providers.add(JavaMappedSuperclassProvider.instance()); - providers.add(JavaEmbeddableProvider.instance()); - } - - private DeclarationAnnotationAdapter[] buildAttributeMappingAnnotationAdapters() { - ArrayList adapters = new ArrayList(); - this.addAttributeMappingAnnotationAdaptersTo(adapters); - return adapters.toArray(new DeclarationAnnotationAdapter[adapters.size()]); - } - - /** - * Override this to specify more or different attribute mapping annotation - * adapters. The default includes the JPA spec-defined attribute mapping - * annotations. - */ - protected void addAttributeMappingAnnotationAdaptersTo(Collection adapters) { - adapters.add(JavaAssociationOverride.SINGLE_DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaAssociationOverride.MULTIPLE_DECLARATION_ANNOTATION_ADAPTER); // AssociationOverrides - adapters.add(JavaAttributeOverride.SINGLE_DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaAttributeOverride.MULTIPLE_DECLARATION_ANNOTATION_ADAPTER); // AttributeOverrides - adapters.add(JavaBasic.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaColumn.MAPPING_DECLARATION_ANNOTATION_ADAPTER); // standalone Column - adapters.add(JavaEmbedded.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaEmbeddedId.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaBasic.ENUMERATED_ADAPTER); - adapters.add(JavaGeneratedValue.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaId.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaJoinColumn.SINGLE_DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaJoinColumn.MULTIPLE_DECLARATION_ANNOTATION_ADAPTER); // JoinColumns - adapters.add(JavaJoinTable.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaBasic.LOB_ADAPTER); - adapters.add(JavaManyToMany.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaManyToOne.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaMultiRelationshipMapping.ORDER_BY_ADAPTER); - adapters.add(JavaMultiRelationshipMapping.MAP_KEY_ADAPTER); - adapters.add(JavaOneToMany.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaOneToOne.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaPrimaryKeyJoinColumn.MULTIPLE_DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaPrimaryKeyJoinColumn.SINGLE_DECLARATION_ANNOTATION_ADAPTER); // PrimaryKeyJoinColumns - adapters.add(JavaSequenceGenerator.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaTableGenerator.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaBasic.TEMPORAL_ADAPTER); - adapters.add(JavaTransient.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaVersion.DECLARATION_ANNOTATION_ADAPTER); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaPackage.Literals.JAVA_PERSISTENT_TYPE; - } - - /** - * Returns the value of the 'Mapping Key' attribute. - * - *

- * If the meaning of the 'Mapping Key' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Mapping Key' attribute. - * @see #setMappingKey(String) - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIPersistentType_MappingKey() - * @model required="true" - * @generated - */ - public String getMappingKey() { - return mappingKey; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getMappingKey Mapping Key}' attribute. - * - * - * @param value the new value of the 'Mapping Key' attribute. - * @see #getMappingKey() - * @generated - */ - public void setMappingKeyGen(String newMappingKey) { - String oldMappingKey = mappingKey; - mappingKey = newMappingKey; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY, oldMappingKey, mappingKey)); - } - - /** - * This is called by the UI, it should not be called when updating - * the persistence model from the java model. - */ - public void setMappingKey(String newMappingKey) { - if (newMappingKey == this.mappingKey) { - return; - } - setMapping(buildJavaTypeMapping(newMappingKey)); - setMappingKeyGen(newMappingKey); - } - - /** - * Returns the value of the 'Mapping' containment reference. - * The default value is "". - * - *

- * If the meaning of the 'Mapping' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Mapping' containment reference. - * @see #setMapping(IJavaTypeMapping) - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentType_Mapping() - * @model containment="true" required="true" - * @generated - */ - public IJavaTypeMapping getMapping() { - return mapping; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetMapping(IJavaTypeMapping newMapping, NotificationChain msgs) { - IJavaTypeMapping oldMapping = mapping; - mapping = newMapping; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING, oldMapping, newMapping); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getMapping Mapping}' containment reference. - * - * - * @param value the new value of the 'Mapping' containment reference. - * @see #getMapping() - * @generated - */ - public void setMappingGen(IJavaTypeMapping newMapping) { - if (newMapping != mapping) { - NotificationChain msgs = null; - if (mapping != null) - msgs = ((InternalEObject) mapping).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING, null, msgs); - if (newMapping != null) - msgs = ((InternalEObject) newMapping).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING, null, msgs); - msgs = basicSetMapping(newMapping, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING, newMapping, newMapping)); - } - - /** - * This should not be called when updating the persistence model - * from the java model, it should only be called when going in the - * other direction. This will update the java code appropriately - * to the change in mapping in the persistence model. - */ - public void setMapping(IJavaTypeMapping newMapping) { - this.type.removeAnnotation(this.annotationAdapterForTypeMappingKey(this.mapping.getKey())); - this.type.newMarkerAnnotation(this.annotationAdapterForTypeMappingKey(newMapping.getKey())); - this.setMappingGen(newMapping); - } - - private DeclarationAnnotationAdapter annotationAdapterForTypeMappingKey(String typeMappingKey) { - return this.typeMappingProviderFor(typeMappingKey).declarationAnnotationAdapter(); - } - - private IJavaTypeMappingProvider typeMappingProviderFor(String typeMappingKey) { - for (IJavaTypeMappingProvider provider : this.typeMappingProviders) { - if (provider.key() == typeMappingKey) { - return provider; - } - } - throw new IllegalArgumentException("Unsupported type mapping key: " + typeMappingKey); - } - - /** - * Returns the value of the 'Attributes' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute}. - * - *

- * If the meaning of the 'Attributes' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Attributes' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentType_Attributes() - * @model type="org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute" containment="true" - * @generated - */ - public EList getAttributes() { - if (attributes == null) { - attributes = new EObjectContainmentEList(JavaPersistentAttribute.class, this, JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES); - } - return attributes; - } - - /** - * Returns the value of the 'Access' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

- * If the meaning of the 'Access' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentType_Access() - * @model default="" changeable="false" - * @generated - */ - public AccessType getAccess() { - return access; - } - - private void setAccess(AccessType newAccess) { - AccessType oldAccess = access; - access = newAccess == null ? ACCESS_EDEFAULT : newAccess; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_TYPE__ACCESS, oldAccess, access)); - } - - /* @see IJpaContentNode#getId() */ - public Object getId() { - return IJavaContentNodes.PERSISTENT_TYPE_ID; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING : - return basicSetMapping(null, msgs); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES : - return ((InternalEList) getAttributes()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY : - return getMappingKey(); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING : - return getMapping(); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES : - return getAttributes(); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ACCESS : - return getAccess(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY : - setMappingKey((String) newValue); - return; - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING : - setMapping((IJavaTypeMapping) newValue); - return; - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES : - getAttributes().clear(); - getAttributes().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY : - setMappingKey(MAPPING_KEY_EDEFAULT); - return; - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING : - setMapping((IJavaTypeMapping) null); - return; - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES : - getAttributes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY : - return MAPPING_KEY_EDEFAULT == null ? mappingKey != null : !MAPPING_KEY_EDEFAULT.equals(mappingKey); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING : - return mapping != null; - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES : - return attributes != null && !attributes.isEmpty(); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ACCESS : - return access != ACCESS_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentType.class) { - switch (derivedFeatureID) { - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY : - return JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentType.class) { - switch (baseFeatureID) { - case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY : - return JpaJavaPackage.JAVA_PERSISTENT_TYPE__MAPPING_KEY; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mappingKey: "); - result.append(mappingKey); - result.append(", access: "); - result.append(access); - result.append(')'); - return result.toString(); - } - - public void setJdtType(IType iType, CompilationUnit astRoot) { - this.type = new Type(iType); - this.setAccess(this.javaAccessType(astRoot)); - this.createAndSetPersistentTypeMappingFromJava(this.javaTypeMappingKey(astRoot)); - } - - public JavaPersistentAttribute addJavaPersistentAttribute(IMember jdtMember) { - JavaPersistentAttribute persistentAttribute = createJavaPersistentAttribute(jdtMember); - getAttributes().add(persistentAttribute); - return persistentAttribute; - } - - public JavaPersistentAttribute createJavaPersistentAttribute(IMember member) { - Attribute attribute = null; - if (member instanceof IField) { - attribute = new FieldAttribute((IField) member); - } - else if (member instanceof IMethod) { - attribute = new MethodAttribute((IMethod) member); - } - else { - throw new IllegalArgumentException(); - } - return JpaJavaFactory.eINSTANCE.createJavaPersistentAttribute(attribute); - } - - private void createAndSetPersistentTypeMappingFromJava(String key) { - setMappingGen(buildJavaTypeMapping(key)); - setMappingKeyGen(key); - } - - private IJavaTypeMapping buildJavaTypeMapping(String key) { - return this.typeMappingProviderFor(key).buildMapping(this.type); - } - - public Type getType() { - return this.type; - } - - public String fullyQualifiedTypeName() { - return jdtType().getFullyQualifiedName(); - } - - public IType jdtType() { - return getType().getJdtMember(); - } - - /** - * This implementation of IPersistentType#findJdtType() will - * *always* find its type - */ - public IType findJdtType() { - return jdtType(); - } - - public boolean isFor(IType member) { - return this.type.wraps(member); - } - - protected void updateFromJava(CompilationUnit astRoot) { - this.setAccess(this.javaAccessType(astRoot)); - String jpaKey = this.getMapping().getKey(); - String javaKey = this.javaTypeMappingKey(astRoot); - if (jpaKey != javaKey) { - this.createAndSetPersistentTypeMappingFromJava(javaKey); - } - this.getMapping().updateFromJava(astRoot); - this.updatePersistentAttributes(astRoot); - } - - private void updatePersistentAttributes(CompilationUnit astRoot) { - List persistentAttributesToRemove = new ArrayList(getAttributes()); - if (getAccess() == AccessType.FIELD) { - updatePersistentFields(astRoot, persistentAttributesToRemove); - } - else if (getAccess() == AccessType.PROPERTY) { - updatePersistentProperties(astRoot, persistentAttributesToRemove); - } - getAttributes().removeAll(persistentAttributesToRemove); - } - - private void updatePersistentFields(CompilationUnit astRoot, List persistentAttributesToRemove) { - for (IField field : this.jdtPersistableFields()) { - JavaPersistentAttribute persistentAttribute = persistentAttributeFor(field); - if (persistentAttribute == null) { - persistentAttribute = addJavaPersistentAttribute(field); - } - else { - persistentAttributesToRemove.remove(persistentAttribute); - } - persistentAttribute.updateFromJava(astRoot); - } - } - - private void updatePersistentProperties(CompilationUnit astRoot, List persistentAttributesToRemove) { - for (IMethod method : this.jdtPersistableProperties()) { - JavaPersistentAttribute persistentAttribute = persistentAttributeFor(method); - if (persistentAttribute == null) { - addJavaPersistentAttribute(method); - } - else { - persistentAttributesToRemove.remove(persistentAttribute); - persistentAttribute.updateFromJava(astRoot); - } - } - } - - private IField[] jdtPersistableFields() { - return AttributeAnnotationTools.persistableFields(jdtType()); - } - - private IMethod[] jdtPersistableProperties() { - return AttributeAnnotationTools.persistablePropertyGetters(jdtType()); - } - - private String javaTypeMappingKey(CompilationUnit astRoot) { - for (IJavaTypeMappingProvider provider : this.typeMappingProviders) { - if (this.type.containsAnnotation(provider.declarationAnnotationAdapter(), astRoot)) { - return provider.key(); - } - } - return null; - } - - public Iterator candidateMappingKeys() { - return new TransformationIterator(new ArrayIterator(this.typeMappingProviders)) { - @Override - protected String transform(IJavaTypeMappingProvider p) { - return p.key(); - } - }; - } - - protected Iterator attributesNamed(final String attributeName) { - return new FilteringIterator(attributes()) { - @Override - protected boolean accept(Object o) { - return attributeName.equals(((JavaPersistentAttribute) o).getName()); - } - }; - } - - public JavaPersistentAttribute attributeNamed(String attributeName) { - Iterator stream = attributesNamed(attributeName); - return (stream.hasNext()) ? stream.next() : null; - } - - public IPersistentAttribute resolveAttribute(String attributeName) { - Iterator stream = attributesNamed(attributeName); - if (stream.hasNext()) { - JavaPersistentAttribute attribute = stream.next(); - return (stream.hasNext()) ? null /*more than one*/: attribute; - } - return (parentPersistentType() == null) ? null : parentPersistentType().resolveAttribute(attributeName); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - Iterator values = this.mapping.candidateValuesFor(pos, filter, astRoot); - if (values != null) { - return values; - } - for (Iterator stream = attributes(); stream.hasNext();) { - values = stream.next().candidateValuesFor(pos, filter, astRoot); - if (values != null) { - return values; - } - } - return null; - } - - public IJpaContentNode contentNodeAt(int offset) { - for (Iterator i = attributes(); i.hasNext();) { - JavaPersistentAttribute persistentAttribute = i.next(); - if (persistentAttribute.includes(offset)) { - return persistentAttribute; - } - } - return null; - } - - public boolean includes(int offset) { - return this.fullTextRange().includes(offset); - } - - public ITextRange fullTextRange() { - return this.type.textRange(); - } - - public ITextRange validationTextRange() { - return this.selectionTextRange(); - } - - public ITextRange selectionTextRange() { - return this.type.nameTextRange(); - } - - public ITextRange getTextRange() { - return type.textRange(); - } - - private JavaPersistentAttribute persistentAttributeFor(IMember member) { - for (Iterator i = attributes(); i.hasNext();) { - JavaPersistentAttribute attribute = i.next(); - if (attribute.isFor(member)) { - return attribute; - } - } - return null; - } - - //TODO CloneIterator - public Iterator attributes() { - return new CloneIterator(getAttributes()); - } - - public Iterator attributeNames() { - return this.attributeNames(this.attributes()); - } - - private Iterator attributeNames(Iterator attrs) { - return new TransformationIterator(attrs) { - @Override - protected String transform(IPersistentAttribute attribute) { - return attribute.getName(); - } - }; - } - - public Iterator allAttributes() { - return new CompositeIterator(new TransformationIterator>(this.inheritanceHierarchy()) { - @Override - protected Iterator transform(IPersistentType pt) { - //TODO how to remove this warning? - return (Iterator) pt.attributes(); - } - }); - } - - public Iterator allAttributeNames() { - return this.attributeNames(this.allAttributes()); - } - - public Iterator inheritanceHierarchy() { - // using a chain iterator to traverse up the inheritance tree - return new ChainIterator(this) { - @Override - protected IPersistentType nextLink(IPersistentType pt) { - return pt.parentPersistentType(); - } - }; - } - - public IPersistentType parentPersistentType() { - return this.parentPersistentType; - } - - private String superclassTypeSignature() { - try { - return this.jdtType().getSuperclassTypeSignature(); - } - catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Return the AccessType currently implied by the Java source code: - * - if only Fields are annotated => FIELD - * - if only Properties are annotated => PROPERTY - * - if both Fields and Properties are annotated => FIELD - * - if nothing is annotated - * - and fields exist => FIELD - * - and properties exist, but no fields exist => PROPERTY - * - and neither fields nor properties exist => FIELD - */ - private AccessType javaAccessType(CompilationUnit astRoot) { - IType jdtType = this.jdtType(); - boolean hasPersistableFields = false; - boolean hasPersistableProperties = false; - for (IField field : AttributeAnnotationTools.persistableFields(jdtType)) { - hasPersistableFields = true; - FieldAttribute fa = new FieldAttribute(field); - if (fa.containsAnyAnnotation(this.attributeMappingAnnotationAdapters, astRoot)) { - // any field is annotated => FIELD - return AccessType.FIELD; - } - } - for (IMethod method : AttributeAnnotationTools.persistablePropertyGetters(jdtType)) { - hasPersistableProperties = true; - MethodAttribute ma = new MethodAttribute(method); - if (ma.containsAnyAnnotation(this.attributeMappingAnnotationAdapters, astRoot)) { - // none of the fields are annotated and a getter is annotated => PROPERTY - return AccessType.PROPERTY; - } - } - // no annotations exist - default to fields, unless it's *obvious* to use properties - if (hasPersistableProperties && !hasPersistableFields) { - return AccessType.PROPERTY; - } - return AccessType.FIELD; - } - - public void refreshDefaults(DefaultsContext context) { - refreshParentPersistentType(context); - } - - private void refreshParentPersistentType(DefaultsContext context) { - String superclassTypeSignature = this.superclassTypeSignature(); - if (superclassTypeSignature == null) { - this.parentPersistentType = null; - return; - } - String fullyQualifiedTypeName = JDTTools.resolveSignature(superclassTypeSignature, this.jdtType()); - if (fullyQualifiedTypeName == null) { - this.parentPersistentType = null; - return; - } - IPersistentType possibleParent = context.persistentType(fullyQualifiedTypeName); - if (possibleParent == null) { - //TODO look to superclass - this.parentPersistentType = null; - return; - } - if (possibleParent.getMappingKey() != null) { - this.parentPersistentType = possibleParent; - } - else { - this.parentPersistentType = possibleParent.parentPersistentType(); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java deleted file mode 100644 index e42ed42ed6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java +++ /dev/null @@ -1,454 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaElementDelta; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.JpaFile; -import org.eclipse.jpt.core.internal.jdtutility.ASTNodeTextRange; -import org.eclipse.jpt.core.internal.jdtutility.AttributeAnnotationTools; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -/** - * - * A representation of the model object 'Java File Content'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit#getTypes Types}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJpaCompilationUnit() - * @model kind="class" - * @generated - */ -public class JpaCompilationUnit extends JavaEObject - implements IJpaRootContentNode -{ - //can this just have one JavaType, or does it need to be multiple. - //only 1 primary type that can be annotated according to the spec? - kfm - /** - * The cached value of the '{@link #getTypes() Types}' containment reference list. - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected EList types; - - private ICompilationUnit compilationUnit; - - protected JpaCompilationUnit() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaPackage.Literals.JPA_COMPILATION_UNIT; - } - - /** - * Returns the value of the 'Jpa File' container reference. - * The default value is "". - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}'. - * - *

- * If the meaning of the 'Jpa File' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Jpa File' container reference. - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJpaRootContentNode_JpaFile() - * @see org.eclipse.jpt.core.internal.JpaFile#getContent - * @model opposite="content" changeable="false" - * @generated - */ - @Override - public IJpaFile getJpaFile() { - if (eContainerFeatureID != JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE) - return null; - return (IJpaFile) eContainer(); - } - - /** - * Returns the value of the 'Types' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType}. - * - *

- * If the meaning of the 'Types' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Types' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJpaCompilationUnit_Types() - * @model type="org.eclipse.jpt.core.internal.content.java.JavaPersistentType" containment="true" - * @generated - */ - public EList getTypes() { - if (types == null) { - types = new EObjectContainmentEList(JavaPersistentType.class, this, JpaJavaPackage.JPA_COMPILATION_UNIT__TYPES); - } - return types; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE : - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE : - return eBasicSetContainer(null, JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE, msgs); - case JpaJavaPackage.JPA_COMPILATION_UNIT__TYPES : - return ((InternalEList) getTypes()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE : - return eInternalContainer().eInverseRemove(this, JpaCorePackage.JPA_FILE__CONTENT, JpaFile.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE : - return getJpaFile(); - case JpaJavaPackage.JPA_COMPILATION_UNIT__TYPES : - return getTypes(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__TYPES : - getTypes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE : - return getJpaFile() != null; - case JpaJavaPackage.JPA_COMPILATION_UNIT__TYPES : - return types != null && !types.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IJpaRootContentNode.class) { - switch (derivedFeatureID) { - case JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE : - return JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IJpaRootContentNode.class) { - switch (baseFeatureID) { - case JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE : - return JpaJavaPackage.JPA_COMPILATION_UNIT__JPA_FILE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public ITextRange fullTextRange() { - return new ASTNodeTextRange(this.astRoot()); - } - - public ITextRange validationTextRange() { - return this.selectionTextRange(); - } - - /** - * Return null for selection textRange. Entire java file will appear selected when - * switching files otherwise - */ - public ITextRange selectionTextRange() { - return null; - } - - public Object getId() { - return IJavaContentNodes.COMPILATION_UNIT_ID; - } - - @Override - public IJpaRootContentNode getRoot() { - return this; - } - - public void setFile(IFile file) { - this.compilationUnit = JavaCore.createCompilationUnitFrom(file); - try { - this.compilationUnit.open(null); - } - catch (JavaModelException jme) { - // do nothing - we just won't have a primary type in this case - } - this.synchronizePersistentTypes(); - } - - public JavaPersistentType addJavaPersistentType(IType primaryType, CompilationUnit astRoot) { - return this.addJavaPersistentType(this.createJavaPersistentType(), primaryType, astRoot); - } - - public JavaPersistentType createJavaPersistentType() { - return JpaJavaFactory.eINSTANCE.createJavaPersistentType(); - } - - private JavaPersistentType addJavaPersistentType(JavaPersistentType javaPersistentType, IType primaryType, CompilationUnit astRoot) { - this.getTypes().add(javaPersistentType); - javaPersistentType.setJdtType(primaryType, astRoot); - return javaPersistentType; - } - - public IJpaContentNode getContentNode(int offset) { - for (JavaPersistentType javaType : this.getTypes()) { - if (javaType.includes(offset)) { - IJpaContentNode contentNode = javaType.contentNodeAt(offset); - if (contentNode != null) { - return contentNode; - } - return javaType; - } - } - return this; - } - - public void handleJavaElementChangedEvent(ElementChangedEvent event) { - synchWithJavaDelta(event.getDelta()); - } - - private void synchWithJavaDelta(IJavaElementDelta delta) { - switch (delta.getElement().getElementType()) { - case IJavaElement.JAVA_MODEL : - case IJavaElement.JAVA_PROJECT : - case IJavaElement.PACKAGE_FRAGMENT_ROOT : - case IJavaElement.PACKAGE_FRAGMENT : - this.synchChildrenWithJavaDelta(delta); - break; - case IJavaElement.COMPILATION_UNIT : - this.synchCompilationUnitWithJavaDelta(delta); - break; - default : - break; // the event is somehow lower than a compilation unit - } - } - - private void synchChildrenWithJavaDelta(IJavaElementDelta delta) { - for (IJavaElementDelta child : delta.getAffectedChildren()) { - this.synchWithJavaDelta(child); // recurse - } - } - - private void synchCompilationUnitWithJavaDelta(IJavaElementDelta delta) { - // ignore changes to/from primary working copy - no content has changed - if ((delta.getFlags() & IJavaElementDelta.F_PRIMARY_WORKING_COPY) != 0) { - return; - } - // synchronize if the change is for this compilation unit - if (delta.getElement().equals(this.compilationUnit)) { - this.synchronizePersistentTypes(); - } - } - - private void synchronizePersistentTypes() { - CompilationUnit astRoot = this.astRoot(); - List persistentTypesToRemove = new ArrayList(this.getTypes()); - IType[] iTypes = this.compilationUnitTypes(); - for (IType iType : iTypes) { - JavaPersistentType persistentType = this.persistentTypeFor(iType); - if (persistentType == null) { - if (AttributeAnnotationTools.typeIsPersistable(iType)) { - persistentType = this.addJavaPersistentType(iType, astRoot); - } - } - if (persistentType != null) { - persistentTypesToRemove.remove(persistentType); - if (AttributeAnnotationTools.typeIsPersistable(iType)) { - persistentType.updateFromJava(astRoot); - } - else { - this.getTypes().remove(persistentType); - } - } - } - this.getTypes().removeAll(persistentTypesToRemove); - } - - private JavaPersistentType persistentTypeFor(IType iType) { - for (JavaPersistentType persistentType : this.getTypes()) { - if (persistentType.isFor(iType)) { - return persistentType; - } - } - return null; - } - - private IType[] compilationUnitTypes() { - try { - return this.compilationUnit.getTypes(); - } - catch (JavaModelException e) { - //TODO not throwing an exception because of tests, should I be? - //throw new RuntimeException(e); - return new IType[0]; - } - } - - public Iterator candidateValuesFor(int pos, Filter filter) { - CompilationUnit astRoot = this.astRoot(); - for (JavaPersistentType persistentType : this.getTypes()) { - Iterator values = persistentType.candidateValuesFor(pos, filter, astRoot); - if (values != null) { - return values; - } - } - return EmptyIterator.instance(); - } - - public CompilationUnit astRoot() { - return JDTTools.createASTRoot(this.compilationUnit); - } - - public void dispose() { - // TODO - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java deleted file mode 100644 index ff55bf5503..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage - * @generated - */ -public class JpaJavaFactory extends EFactoryImpl -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final JpaJavaFactory eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static JpaJavaFactory init() { - try { - JpaJavaFactory theJpaJavaFactory = (JpaJavaFactory) EPackage.Registry.INSTANCE.getEFactory("jpt.java.xmi"); - if (theJpaJavaFactory != null) { - return theJpaJavaFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new JpaJavaFactory(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public JpaJavaFactory() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case JpaJavaPackage.JPA_COMPILATION_UNIT : - return createJpaCompilationUnit(); - case JpaJavaPackage.JAVA_PERSISTENT_TYPE : - return createJavaPersistentType(); - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE : - return createJavaPersistentAttribute(); - default : - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public JpaCompilationUnit createJpaCompilationUnit() { - JpaCompilationUnit jpaCompilationUnit = new JpaCompilationUnit(); - return jpaCompilationUnit; - } - - /** - * - * - * @generated - */ - public JavaPersistentType createJavaPersistentType() { - JavaPersistentType javaPersistentType = new JavaPersistentType(); - return javaPersistentType; - } - - /** - * - * - * @generated - */ - public JavaPersistentAttribute createJavaPersistentAttribute() { - JavaPersistentAttribute javaPersistentAttribute = new JavaPersistentAttribute(); - return javaPersistentAttribute; - } - - public JavaPersistentAttribute createJavaPersistentAttribute(Attribute attribute) { - JavaPersistentAttribute javaPersistentAttribute = new JavaPersistentAttribute(attribute); - return javaPersistentAttribute; - } - - /** - * - * - * @generated - */ - public JpaJavaPackage getJpaJavaPackage() { - return (JpaJavaPackage) getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static JpaJavaPackage getPackage() { - return JpaJavaPackage.eINSTANCE; - } -} //JpaCoreJavaFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java deleted file mode 100644 index 120ef850cf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java +++ /dev/null @@ -1,787 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaFactory - * @model kind="package" - * @generated - */ -public class JpaJavaPackage extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "java"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "jpt.java.xmi"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "org.eclipse.jpt.core.content.java"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final JpaJavaPackage eINSTANCE = org.eclipse.jpt.core.internal.content.java.JpaJavaPackage.init(); - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject Java EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JavaEObject - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaEObject() - * @generated - */ - public static final int JAVA_EOBJECT = 0; - - /** - * The number of structural features of the 'Java EObject' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EOBJECT_FEATURE_COUNT = JpaCorePackage.JPA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit Jpa Compilation Unit}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJpaCompilationUnit() - * @generated - */ - public static final int JPA_COMPILATION_UNIT = 1; - - /** - * The feature id for the 'Jpa File' container reference. - * - * - * @generated - * @ordered - */ - public static final int JPA_COMPILATION_UNIT__JPA_FILE = JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JPA_COMPILATION_UNIT__TYPES = JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Jpa Compilation Unit' class. - * - * - * @generated - * @ordered - */ - public static final int JPA_COMPILATION_UNIT_FEATURE_COUNT = JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType Java Persistent Type}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentType() - * @generated - */ - public static final int JAVA_PERSISTENT_TYPE = 2; - - /** - * The feature id for the 'Mapping Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_TYPE__MAPPING_KEY = JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Mapping' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_TYPE__MAPPING = JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Attributes' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_TYPE__ATTRIBUTES = JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_TYPE__ACCESS = JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Java Persistent Type' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_TYPE_FEATURE_COUNT = JAVA_EOBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute Java Persistent Attribute}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentAttribute() - * @generated - */ - public static final int JAVA_PERSISTENT_ATTRIBUTE = 3; - - /** - * The feature id for the 'Mapping' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_ATTRIBUTE__MAPPING = JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Default Mapping' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING = JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Mapping' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING = JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Persistent Attribute' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PERSISTENT_ATTRIBUTE_FEATURE_COUNT = JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping IJava Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping() - * @generated - */ - public static final int IJAVA_TYPE_MAPPING = 4; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJAVA_TYPE_MAPPING__NAME = JpaCorePackage.ITYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJAVA_TYPE_MAPPING__TABLE_NAME = JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - - /** - * The number of structural features of the 'IJava Type Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int IJAVA_TYPE_MAPPING_FEATURE_COUNT = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping IJava Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping() - * @generated - */ - public static final int IJAVA_ATTRIBUTE_MAPPING = 5; - - /** - * The number of structural features of the 'IJava Attribute Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int IJAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * - * - * @generated - */ - private EClass javaEObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass jpaCompilationUnitEClass = null; - - /** - * - * - * @generated - */ - private EClass javaPersistentTypeEClass = null; - - /** - * - * - * @generated - */ - private EClass javaPersistentAttributeEClass = null; - - /** - * - * - * @generated - */ - private EClass iJavaTypeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iJavaAttributeMappingEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

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. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#eNS_URI - * @see #init() - * @generated - */ - private JpaJavaPackage() { - super(eNS_URI, JpaJavaFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static JpaJavaPackage init() { - if (isInited) - return (JpaJavaPackage) EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI); - // Obtain or create and register package - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new JpaJavaPackage()); - isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - // Obtain or create and register interdependencies - JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE); - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE); - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) instanceof JpaJavaMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) : JpaJavaMappingsPackage.eINSTANCE); - OrmPackage theOrmPackage = (OrmPackage) (EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE); - PersistencePackage thePersistencePackage = (PersistencePackage) (EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE); - // Create package meta-data objects - theJpaJavaPackage.createPackageContents(); - theJpaCorePackage.createPackageContents(); - theJpaCoreMappingsPackage.createPackageContents(); - theJpaJavaMappingsPackage.createPackageContents(); - theOrmPackage.createPackageContents(); - thePersistencePackage.createPackageContents(); - // Initialize created meta-data - theJpaJavaPackage.initializePackageContents(); - theJpaCorePackage.initializePackageContents(); - theJpaCoreMappingsPackage.initializePackageContents(); - theJpaJavaMappingsPackage.initializePackageContents(); - theOrmPackage.initializePackageContents(); - thePersistencePackage.initializePackageContents(); - // Mark meta-data to indicate it can't be changed - theJpaJavaPackage.freeze(); - return theJpaJavaPackage; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject Java EObject}'. - * - * - * @return the meta object for class 'Java EObject'. - * @see org.eclipse.jpt.core.internal.content.java.JavaEObject - * @generated - */ - public EClass getJavaEObject() { - return javaEObjectEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit Jpa Compilation Unit}'. - * - * - * @return the meta object for class 'Jpa Compilation Unit'. - * @see org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit - * @generated - */ - public EClass getJpaCompilationUnit() { - return jpaCompilationUnitEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit#getTypes Types}'. - * - * - * @return the meta object for the containment reference list 'Types'. - * @see org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit#getTypes() - * @see #getJpaCompilationUnit() - * @generated - */ - public EReference getJpaCompilationUnit_Types() { - return (EReference) jpaCompilationUnitEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType Java Persistent Type}'. - * - * - * @return the meta object for class 'Java Persistent Type'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType - * @generated - */ - public EClass getJavaPersistentType() { - return javaPersistentTypeEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getMapping Mapping}'. - * - * - * @return the meta object for the containment reference 'Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getMapping() - * @see #getJavaPersistentType() - * @generated - */ - public EReference getJavaPersistentType_Mapping() { - return (EReference) javaPersistentTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getAttributes Attributes}'. - * - * - * @return the meta object for the containment reference list 'Attributes'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getAttributes() - * @see #getJavaPersistentType() - * @generated - */ - public EReference getJavaPersistentType_Attributes() { - return (EReference) javaPersistentTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getAccess Access}'. - * - * - * @return the meta object for the attribute 'Access'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType#getAccess() - * @see #getJavaPersistentType() - * @generated - */ - public EAttribute getJavaPersistentType_Access() { - return (EAttribute) javaPersistentTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute Java Persistent Attribute}'. - * - * - * @return the meta object for class 'Java Persistent Attribute'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute - * @generated - */ - public EClass getJavaPersistentAttribute() { - return javaPersistentAttributeEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getDefaultMapping Default Mapping}'. - * - * - * @return the meta object for the containment reference 'Default Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getDefaultMapping() - * @see #getJavaPersistentAttribute() - * @generated - */ - public EReference getJavaPersistentAttribute_DefaultMapping() { - return (EReference) javaPersistentAttributeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getSpecifiedMapping Specified Mapping}'. - * - * - * @return the meta object for the containment reference 'Specified Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute#getSpecifiedMapping() - * @see #getJavaPersistentAttribute() - * @generated - */ - public EReference getJavaPersistentAttribute_SpecifiedMapping() { - return (EReference) javaPersistentAttributeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping IJava Type Mapping}'. - * - * - * @return the meta object for class 'IJava Type Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping - * @generated - */ - public EClass getIJavaTypeMapping() { - return iJavaTypeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping IJava Attribute Mapping}'. - * - * - * @return the meta object for class 'IJava Attribute Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping - * @generated - */ - public EClass getIJavaAttributeMapping() { - return iJavaAttributeMappingEClass; - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public JpaJavaFactory getJpaJavaFactory() { - return (JpaJavaFactory) getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - // Create classes and their features - javaEObjectEClass = createEClass(JAVA_EOBJECT); - jpaCompilationUnitEClass = createEClass(JPA_COMPILATION_UNIT); - createEReference(jpaCompilationUnitEClass, JPA_COMPILATION_UNIT__TYPES); - javaPersistentTypeEClass = createEClass(JAVA_PERSISTENT_TYPE); - createEReference(javaPersistentTypeEClass, JAVA_PERSISTENT_TYPE__MAPPING); - createEReference(javaPersistentTypeEClass, JAVA_PERSISTENT_TYPE__ATTRIBUTES); - createEAttribute(javaPersistentTypeEClass, JAVA_PERSISTENT_TYPE__ACCESS); - javaPersistentAttributeEClass = createEClass(JAVA_PERSISTENT_ATTRIBUTE); - createEReference(javaPersistentAttributeEClass, JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING); - createEReference(javaPersistentAttributeEClass, JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING); - iJavaTypeMappingEClass = createEClass(IJAVA_TYPE_MAPPING); - iJavaAttributeMappingEClass = createEClass(IJAVA_ATTRIBUTE_MAPPING); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - // Obtain other dependent packages - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI); - JpaCorePackage theJpaCorePackage = (JpaCorePackage) EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI); - // Add subpackages - getESubpackages().add(theJpaJavaMappingsPackage); - // Create type parameters - // Set bounds for type parameters - // Add supertypes to classes - javaEObjectEClass.getESuperTypes().add(theJpaCorePackage.getJpaEObject()); - javaEObjectEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - jpaCompilationUnitEClass.getESuperTypes().add(this.getJavaEObject()); - jpaCompilationUnitEClass.getESuperTypes().add(theJpaCorePackage.getIJpaRootContentNode()); - javaPersistentTypeEClass.getESuperTypes().add(this.getJavaEObject()); - javaPersistentTypeEClass.getESuperTypes().add(theJpaCorePackage.getIPersistentType()); - javaPersistentAttributeEClass.getESuperTypes().add(this.getJavaEObject()); - javaPersistentAttributeEClass.getESuperTypes().add(theJpaCorePackage.getIPersistentAttribute()); - iJavaTypeMappingEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping()); - iJavaAttributeMappingEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - // Initialize classes and features; add operations and parameters - initEClass(javaEObjectEClass, JavaEObject.class, "JavaEObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(javaEObjectEClass, theJpaCorePackage.getIJpaFile(), "getJpaFile", 0, 1); - addEOperation(javaEObjectEClass, theJpaCorePackage.getIJpaRootContentNode(), "getRoot", 0, 1); - initEClass(jpaCompilationUnitEClass, JpaCompilationUnit.class, "JpaCompilationUnit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJpaCompilationUnit_Types(), this.getJavaPersistentType(), null, "types", null, 0, -1, JpaCompilationUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(javaPersistentTypeEClass, JavaPersistentType.class, "JavaPersistentType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJavaPersistentType_Mapping(), this.getIJavaTypeMapping(), null, "mapping", "", 1, 1, JavaPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getJavaPersistentType_Attributes(), this.getJavaPersistentAttribute(), null, "attributes", null, 0, -1, JavaPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getJavaPersistentType_Access(), theJpaCorePackage.getAccessType(), "access", "", 0, 1, JavaPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(javaPersistentAttributeEClass, JavaPersistentAttribute.class, "JavaPersistentAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJavaPersistentAttribute_DefaultMapping(), this.getIJavaAttributeMapping(), null, "defaultMapping", null, 1, 1, JavaPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getJavaPersistentAttribute_SpecifiedMapping(), this.getIJavaAttributeMapping(), null, "specifiedMapping", null, 1, 1, JavaPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iJavaTypeMappingEClass, IJavaTypeMapping.class, "IJavaTypeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJavaTypeMappingEClass, null, "initialize"); - initEClass(iJavaAttributeMappingEClass, IJavaAttributeMapping.class, "IJavaAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJavaAttributeMappingEClass, null, "initialize"); - // Create resource - createResource(eNS_URI); - } - - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject Java EObject}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JavaEObject - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaEObject() - * @generated - */ - public static final EClass JAVA_EOBJECT = eINSTANCE.getJavaEObject(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit Jpa Compilation Unit}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJpaCompilationUnit() - * @generated - */ - public static final EClass JPA_COMPILATION_UNIT = eINSTANCE.getJpaCompilationUnit(); - - /** - * The meta object literal for the 'Types' containment reference list feature. - * - * - * @generated - */ - public static final EReference JPA_COMPILATION_UNIT__TYPES = eINSTANCE.getJpaCompilationUnit_Types(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType Java Persistent Type}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentType() - * @generated - */ - public static final EClass JAVA_PERSISTENT_TYPE = eINSTANCE.getJavaPersistentType(); - - /** - * The meta object literal for the 'Mapping' containment reference feature. - * - * - * @generated - */ - public static final EReference JAVA_PERSISTENT_TYPE__MAPPING = eINSTANCE.getJavaPersistentType_Mapping(); - - /** - * The meta object literal for the 'Attributes' containment reference list feature. - * - * - * @generated - */ - public static final EReference JAVA_PERSISTENT_TYPE__ATTRIBUTES = eINSTANCE.getJavaPersistentType_Attributes(); - - /** - * The meta object literal for the 'Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute JAVA_PERSISTENT_TYPE__ACCESS = eINSTANCE.getJavaPersistentType_Access(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute Java Persistent Attribute}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getJavaPersistentAttribute() - * @generated - */ - public static final EClass JAVA_PERSISTENT_ATTRIBUTE = eINSTANCE.getJavaPersistentAttribute(); - - /** - * The meta object literal for the 'Default Mapping' containment reference feature. - * - * - * @generated - */ - public static final EReference JAVA_PERSISTENT_ATTRIBUTE__DEFAULT_MAPPING = eINSTANCE.getJavaPersistentAttribute_DefaultMapping(); - - /** - * The meta object literal for the 'Specified Mapping' containment reference feature. - * - * - * @generated - */ - public static final EReference JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING = eINSTANCE.getJavaPersistentAttribute_SpecifiedMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping IJava Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping() - * @generated - */ - public static final EClass IJAVA_TYPE_MAPPING = eINSTANCE.getIJavaTypeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping IJava Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping() - * @generated - */ - public static final EClass IJAVA_ATTRIBUTE_MAPPING = eINSTANCE.getIJavaAttributeMapping(); - } -} //JpaJavaPackage diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaColumn.java deleted file mode 100644 index 23cbe8fb51..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaColumn.java +++ /dev/null @@ -1,695 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Abstract Java Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getAbstractJavaColumn() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class AbstractJavaColumn extends JavaNamedColumn - implements IAbstractColumn -{ - /** - * The default value of the '{@link #getUnique() Unique}' attribute. - * - * - * @see #getUnique() - * @generated - * @ordered - */ - protected static final DefaultFalseBoolean UNIQUE_EDEFAULT = DefaultFalseBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getUnique() Unique}' attribute. - * - * - * @see #getUnique() - * @generated - * @ordered - */ - protected DefaultFalseBoolean unique = UNIQUE_EDEFAULT; - - /** - * The default value of the '{@link #getNullable() Nullable}' attribute. - * - * - * @see #getNullable() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean NULLABLE_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getNullable() Nullable}' attribute. - * - * - * @see #getNullable() - * @generated - * @ordered - */ - protected DefaultTrueBoolean nullable = NULLABLE_EDEFAULT; - - /** - * The default value of the '{@link #getInsertable() Insertable}' attribute. - * - * - * @see #getInsertable() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean INSERTABLE_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getInsertable() Insertable}' attribute. - * - * - * @see #getInsertable() - * @generated - * @ordered - */ - protected DefaultTrueBoolean insertable = INSERTABLE_EDEFAULT; - - /** - * The default value of the '{@link #getUpdatable() Updatable}' attribute. - * - * - * @see #getUpdatable() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean UPDATABLE_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getUpdatable() Updatable}' attribute. - * - * - * @see #getUpdatable() - * @generated - * @ordered - */ - protected DefaultTrueBoolean updatable = UPDATABLE_EDEFAULT; - - /** - * The default value of the '{@link #getTable() Table}' attribute. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected static final String TABLE_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected String specifiedTable = SPECIFIED_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected static final String DEFAULT_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected String defaultTable = DEFAULT_TABLE_EDEFAULT; - - // hold this so we can get the 'table' text range - private final DeclarationAnnotationElementAdapter tableDeclarationAdapter; - - private final AnnotationElementAdapter tableAdapter; - - private final AnnotationElementAdapter uniqueAdapter; - - private final AnnotationElementAdapter nullableAdapter; - - private final AnnotationElementAdapter insertableAdapter; - - private final AnnotationElementAdapter updatableAdapter; - - protected AbstractJavaColumn() { - super(); - throw new UnsupportedOperationException("Use AbstractJavaColumn(Owner, Member, DeclarationAnnotationAdapter) instead"); - } - - protected AbstractJavaColumn(Owner owner, Member member, DeclarationAnnotationAdapter daa) { - super(owner, member, daa); - this.tableDeclarationAdapter = this.buildStringElementAdapter(this.tableElementName()); - this.tableAdapter = this.buildShortCircuitElementAdapter(this.tableDeclarationAdapter); - this.uniqueAdapter = this.buildShortCircuitBooleanElementAdapter(this.uniqueElementName()); - this.nullableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nullableElementName()); - this.insertableAdapter = this.buildShortCircuitBooleanElementAdapter(this.insertableElementName()); - this.updatableAdapter = this.buildShortCircuitBooleanElementAdapter(this.updatableElementName()); - } - - protected abstract String tableElementName(); - - protected abstract String uniqueElementName(); - - protected abstract String nullableElementName(); - - protected abstract String insertableElementName(); - - protected abstract String updatableElementName(); - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IAbstractColumn.class)) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE : - this.tableAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE : - this.uniqueAdapter.setValue(((DefaultFalseBoolean) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE : - this.nullableAdapter.setValue(((DefaultTrueBoolean) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE : - this.insertableAdapter.setValue(((DefaultTrueBoolean) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE : - this.updatableAdapter.setValue(((DefaultTrueBoolean) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.ABSTRACT_JAVA_COLUMN; - } - - /** - * Returns the value of the 'Unique' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean}. - * - *

- * If the meaning of the 'Unique' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Unique' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #setUnique(DefaultFalseBoolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractColumn_Unique() - * @model - * @generated - */ - public DefaultFalseBoolean getUnique() { - return unique; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn#getUnique Unique}' attribute. - * - * - * @param value the new value of the 'Unique' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #getUnique() - * @generated - */ - public void setUnique(DefaultFalseBoolean newUnique) { - DefaultFalseBoolean oldUnique = unique; - unique = newUnique == null ? UNIQUE_EDEFAULT : newUnique; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE, oldUnique, unique)); - } - - /** - * Returns the value of the 'Nullable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Nullable' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Nullable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setNullable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractColumn_Nullable() - * @model - * @generated - */ - public DefaultTrueBoolean getNullable() { - return nullable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn#getNullable Nullable}' attribute. - * - * - * @param value the new value of the 'Nullable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getNullable() - * @generated - */ - public void setNullable(DefaultTrueBoolean newNullable) { - DefaultTrueBoolean oldNullable = nullable; - nullable = newNullable == null ? NULLABLE_EDEFAULT : newNullable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE, oldNullable, nullable)); - } - - /** - * Returns the value of the 'Insertable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Insertable' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Insertable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setInsertable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractColumn_Insertable() - * @model - * @generated - */ - public DefaultTrueBoolean getInsertable() { - return insertable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn#getInsertable Insertable}' attribute. - * - * - * @param value the new value of the 'Insertable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getInsertable() - * @generated - */ - public void setInsertable(DefaultTrueBoolean newInsertable) { - DefaultTrueBoolean oldInsertable = insertable; - insertable = newInsertable == null ? INSERTABLE_EDEFAULT : newInsertable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE, oldInsertable, insertable)); - } - - /** - * Returns the value of the 'Updatable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Updatable' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Updatable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setUpdatable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractColumn_Updatable() - * @model - * @generated - */ - public DefaultTrueBoolean getUpdatable() { - return updatable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn#getUpdatable Updatable}' attribute. - * - * - * @param value the new value of the 'Updatable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getUpdatable() - * @generated - */ - public void setUpdatable(DefaultTrueBoolean newUpdatable) { - DefaultTrueBoolean oldUpdatable = updatable; - updatable = newUpdatable == null ? UPDATABLE_EDEFAULT : newUpdatable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE, oldUpdatable, updatable)); - } - - public String getTable() { - return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable(); - } - - /** - * Returns the value of the 'Specified Table' attribute. - * - *

- * If the meaning of the 'Specified Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Table' attribute. - * @see #setSpecifiedTable(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractColumn_SpecifiedTable() - * @model - * @generated - */ - public String getSpecifiedTable() { - return specifiedTable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn#getSpecifiedTable Specified Table}' attribute. - * - * - * @param value the new value of the 'Specified Table' attribute. - * @see #getSpecifiedTable() - * @generated - */ - public void setSpecifiedTable(String newSpecifiedTable) { - String oldSpecifiedTable = specifiedTable; - specifiedTable = newSpecifiedTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE, oldSpecifiedTable, specifiedTable)); - } - - protected void setDefaultTable(String newDefaultTable) { - String oldDefaultTable = this.defaultTable; - this.defaultTable = newDefaultTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE, oldDefaultTable, newDefaultTable)); - } - - /** - * Returns the value of the 'Default Table' attribute. - * - *

- * If the meaning of the 'Default Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Table' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractColumn_DefaultTable() - * @model changeable="false" - * @generated - */ - public String getDefaultTable() { - return defaultTable; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE : - return getUnique(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE : - return getNullable(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE : - return getInsertable(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE : - return getUpdatable(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__TABLE : - return getTable(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE : - return getSpecifiedTable(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE : - return getDefaultTable(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE : - setUnique((DefaultFalseBoolean) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE : - setNullable((DefaultTrueBoolean) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE : - setInsertable((DefaultTrueBoolean) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE : - setUpdatable((DefaultTrueBoolean) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE : - setSpecifiedTable((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE : - setUnique(UNIQUE_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE : - setNullable(NULLABLE_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE : - setInsertable(INSERTABLE_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE : - setUpdatable(UPDATABLE_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE : - setSpecifiedTable(SPECIFIED_TABLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE : - return unique != UNIQUE_EDEFAULT; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE : - return nullable != NULLABLE_EDEFAULT; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE : - return insertable != INSERTABLE_EDEFAULT; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE : - return updatable != UPDATABLE_EDEFAULT; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__TABLE : - return TABLE_EDEFAULT == null ? getTable() != null : !TABLE_EDEFAULT.equals(getTable()); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE : - return SPECIFIED_TABLE_EDEFAULT == null ? specifiedTable != null : !SPECIFIED_TABLE_EDEFAULT.equals(specifiedTable); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE : - return DEFAULT_TABLE_EDEFAULT == null ? defaultTable != null : !DEFAULT_TABLE_EDEFAULT.equals(defaultTable); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAbstractColumn.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__UNIQUE; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__NULLABLE; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__INSERTABLE; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__UPDATABLE; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__TABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAbstractColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__UNIQUE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UNIQUE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__NULLABLE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__NULLABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__INSERTABLE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__INSERTABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__UPDATABLE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__UPDATABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__TABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (unique: "); - result.append(unique); - result.append(", nullable: "); - result.append(nullable); - result.append(", insertable: "); - result.append(insertable); - result.append(", updatable: "); - result.append(updatable); - result.append(", specifiedTable: "); - result.append(specifiedTable); - result.append(", defaultTable: "); - result.append(defaultTable); - result.append(')'); - return result.toString(); - } - - @Override - protected String tableName() { - return this.getTable(); - } - - public ITextRange tableTextRange() { - return this.elementTextRange(this.tableDeclarationAdapter); - } - - public boolean tableTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.tableDeclarationAdapter, pos, astRoot); - } - - private Iterator candidateTableNames() { - return this.tableIsAllowed() ? this.getOwner().getTypeMapping().associatedTableNamesIncludingInherited() : EmptyIterator. instance(); - } - - private Iterator candidateTableNames(Filter filter) { - return new FilteringIterator(this.candidateTableNames(), filter); - } - - private Iterator quotedCandidateTableNames(Filter filter) { - return StringTools.quote(this.candidateTableNames(filter)); - } - - /** - * Return whether the 'table' element is allowed. It is not allowed for - * join columns inside of join tables. - */ - public abstract boolean tableIsAllowed(); - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.tableTouches(pos, astRoot)) { - return this.quotedCandidateTableNames(filter); - } - return null; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.setSpecifiedTable(this.tableAdapter.getValue(astRoot)); - this.setUnique(DefaultFalseBoolean.fromJavaAnnotationValue(this.uniqueAdapter.getValue(astRoot))); - this.setNullable(DefaultTrueBoolean.fromJavaAnnotationValue(this.nullableAdapter.getValue(astRoot))); - this.setInsertable(DefaultTrueBoolean.fromJavaAnnotationValue(this.insertableAdapter.getValue(astRoot))); - this.setUpdatable(DefaultTrueBoolean.fromJavaAnnotationValue(this.updatableAdapter.getValue(astRoot))); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java deleted file mode 100644 index 6bf5e1b0f8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java +++ /dev/null @@ -1,1114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.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.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Abstract Java Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getAbstractJavaTable() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class AbstractJavaTable extends JavaEObject implements ITable -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected String specifiedName = SPECIFIED_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected static final String DEFAULT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected String defaultName = DEFAULT_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getCatalog() Catalog}' attribute. - * - * - * @see #getCatalog() - * @generated - * @ordered - */ - protected static final String CATALOG_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected static final String SPECIFIED_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected String specifiedCatalog = SPECIFIED_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected static final String DEFAULT_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected String defaultCatalog = DEFAULT_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected String specifiedSchema = SPECIFIED_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected static final String DEFAULT_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT; - - /** - * The cached value of the '{@link #getUniqueConstraints() Unique Constraints}' containment reference list. - * - * - * @see #getUniqueConstraints() - * @generated - * @ordered - */ - protected EList uniqueConstraints; - - private final Owner owner; - - private final Member member; - - // hold this so we can get the annotation's text range - private final DeclarationAnnotationAdapter daa; - - // hold this so we can get the 'name' text range - private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; - - // hold this so we can get the 'schema' text range - private final DeclarationAnnotationElementAdapter schemaDeclarationAdapter; - - // hold this so we can get the 'catalog' text range - private final DeclarationAnnotationElementAdapter catalogDeclarationAdapter; - - private final AnnotationElementAdapter nameAdapter; - - private final AnnotationElementAdapter schemaAdapter; - - private final AnnotationElementAdapter catalogAdapter; - - protected AbstractJavaTable() { - super(); - throw new UnsupportedOperationException("Use AbstractJavaTable(Owner, Member) instead"); - } - - protected AbstractJavaTable(Owner owner, Member member, DeclarationAnnotationAdapter daa) { - super(); - this.owner = owner; - this.member = member; - this.daa = daa; - this.nameDeclarationAdapter = this.nameAdapter(daa); - this.schemaDeclarationAdapter = this.schemaAdapter(daa); - this.catalogDeclarationAdapter = this.catalogAdapter(daa); - this.nameAdapter = new ShortCircuitAnnotationElementAdapter(this.member, this.nameDeclarationAdapter); - this.schemaAdapter = new ShortCircuitAnnotationElementAdapter(this.member, this.schemaDeclarationAdapter); - this.catalogAdapter = new ShortCircuitAnnotationElementAdapter(this.member, this.catalogDeclarationAdapter); - } - - /** - * Build and return a declaration element adapter for the table's 'name' element - */ - protected abstract DeclarationAnnotationElementAdapter nameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter); - - /** - * Build and return a declaration element adapter for the table's 'schema' element - */ - protected abstract DeclarationAnnotationElementAdapter schemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter); - - /** - * Build and return a declaration element adapter for the table's 'catalog' element - */ - protected abstract DeclarationAnnotationElementAdapter catalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter); - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(ITable.class)) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : - this.nameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : - this.schemaAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : - this.catalogAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - uniqueConstraintsChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void uniqueConstraintsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - uniqueConstraintAdded(notification.getPosition(), (IUniqueConstraint) notification.getNewValue()); - break; - case Notification.ADD_MANY : - uniqueConstraintsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - uniqueConstraintRemoved(notification.getPosition(), (IUniqueConstraint) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - uniqueConstraintsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - uniqueConstraintsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - uniqueConstraintSet(notification.getPosition(), (IUniqueConstraint) notification.getOldValue(), (IUniqueConstraint) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - uniqueConstraintMoved(notification.getOldIntValue(), notification.getPosition(), (IUniqueConstraint) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.ABSTRACT_JAVA_TABLE; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getName() { - return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName(); - } - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

- * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_SpecifiedName() - * @model - * @generated - */ - public String getSpecifiedName() { - return specifiedName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - public void setSpecifiedName(String newSpecifiedName) { - String oldSpecifiedName = specifiedName; - specifiedName = newSpecifiedName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); - } - - /** - * Returns the value of the 'Default Name' attribute. - * - *

- * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_DefaultName() - * @model changeable="false" - * @generated - */ - public String getDefaultName() { - return defaultName; - } - - /** - * Returns the value of the 'Catalog' attribute. - * - *

- * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_Catalog() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getCatalog() { - return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog(); - } - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

- * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_SpecifiedCatalog() - * @model - * @generated - */ - public String getSpecifiedCatalog() { - return specifiedCatalog; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - public void setSpecifiedCatalog(String newSpecifiedCatalog) { - String oldSpecifiedCatalog = specifiedCatalog; - specifiedCatalog = newSpecifiedCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG, oldSpecifiedCatalog, specifiedCatalog)); - } - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

- * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_DefaultCatalog() - * @model changeable="false" - * @generated - */ - public String getDefaultCatalog() { - return defaultCatalog; - } - - /** - * Returns the value of the 'Schema' attribute. - * - *

- * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_Schema() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getSchema() { - return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema(); - } - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

- * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_SpecifiedSchema() - * @model - * @generated - */ - public String getSpecifiedSchema() { - return specifiedSchema; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - public void setSpecifiedSchema(String newSpecifiedSchema) { - String oldSpecifiedSchema = specifiedSchema; - specifiedSchema = newSpecifiedSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA, oldSpecifiedSchema, specifiedSchema)); - } - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

- * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_DefaultSchema() - * @model changeable="false" - * @generated - */ - public String getDefaultSchema() { - return defaultSchema; - } - - /** - * Returns the value of the 'Unique Constraints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}. - * - *

- * If the meaning of the 'Unique Constraints' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Unique Constraints' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_UniqueConstraints() - * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true" - * @generated - */ - public EList getUniqueConstraints() { - if (uniqueConstraints == null) { - uniqueConstraints = new EObjectContainmentEList(IUniqueConstraint.class, this, JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS); - } - return uniqueConstraints; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - return ((InternalEList) getUniqueConstraints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__NAME : - return getName(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : - return getSpecifiedName(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_NAME : - return getDefaultName(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__CATALOG : - return getCatalog(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : - return getSpecifiedCatalog(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG : - return getDefaultCatalog(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SCHEMA : - return getSchema(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : - return getSpecifiedSchema(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA : - return getDefaultSchema(); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - return getUniqueConstraints(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : - setSpecifiedName((String) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : - setSpecifiedCatalog((String) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : - setSpecifiedSchema((String) newValue); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - getUniqueConstraints().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : - setSpecifiedName(SPECIFIED_NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : - setSpecifiedCatalog(SPECIFIED_CATALOG_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : - setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT); - return; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : - return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_NAME : - return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__CATALOG : - return CATALOG_EDEFAULT == null ? getCatalog() != null : !CATALOG_EDEFAULT.equals(getCatalog()); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : - return SPECIFIED_CATALOG_EDEFAULT == null ? specifiedCatalog != null : !SPECIFIED_CATALOG_EDEFAULT.equals(specifiedCatalog); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG : - return DEFAULT_CATALOG_EDEFAULT == null ? defaultCatalog != null : !DEFAULT_CATALOG_EDEFAULT.equals(defaultCatalog); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SCHEMA : - return SCHEMA_EDEFAULT == null ? getSchema() != null : !SCHEMA_EDEFAULT.equals(getSchema()); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : - return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA : - return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema); - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - return uniqueConstraints != null && !uniqueConstraints.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ITable.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__NAME : - return JpaCoreMappingsPackage.ITABLE__NAME; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_NAME : - return JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__CATALOG : - return JpaCoreMappingsPackage.ITABLE__CATALOG; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG : - return JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SCHEMA : - return JpaCoreMappingsPackage.ITABLE__SCHEMA; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA : - return JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA; - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS : - return JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ITable.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ITABLE__NAME : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__NAME; - case JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME; - case JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_NAME; - case JpaCoreMappingsPackage.ITABLE__CATALOG : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__CATALOG; - case JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG; - case JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG; - case JpaCoreMappingsPackage.ITABLE__SCHEMA : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SCHEMA; - case JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA; - case JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA; - case JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS : - return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedName: "); - result.append(specifiedName); - result.append(", defaultName: "); - result.append(defaultName); - result.append(", specifiedCatalog: "); - result.append(specifiedCatalog); - result.append(", defaultCatalog: "); - result.append(defaultCatalog); - result.append(", specifiedSchema: "); - result.append(specifiedSchema); - result.append(", defaultSchema: "); - result.append(defaultSchema); - result.append(')'); - return result.toString(); - } - - // ********** ITable implementation ********** - public ITextRange nameTextRange() { - return this.elementTextRange(this.nameDeclarationAdapter); - } - - public ITextRange nameTextRange(CompilationUnit astRoot) { - return this.elementTextRange(this.nameDeclarationAdapter, astRoot); - } - - public boolean nameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot); - } - - public ITextRange schemaTextRange() { - return this.elementTextRange(this.schemaDeclarationAdapter); - } - - public ITextRange schemaTextRange(CompilationUnit astRoot) { - return this.elementTextRange(this.schemaDeclarationAdapter, astRoot); - } - - public boolean schemaTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.schemaDeclarationAdapter, pos, astRoot); - } - - public ITextRange catalogTextRange() { - return this.elementTextRange(this.catalogDeclarationAdapter); - } - - public ITextRange catalogTextRange(CompilationUnit astRoot) { - return this.elementTextRange(this.catalogDeclarationAdapter, astRoot); - } - - public boolean catalogTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.catalogDeclarationAdapter, pos, astRoot); - } - - //TODO should we allow setting through the ecore, that would make this method - //public and part of the ITable api. only the model needs to be setting the default, - //but the ui needs to be listening for changes to the default. - protected void setDefaultName(String newDefaultName) { - String oldDefaultName = this.defaultName; - this.defaultName = newDefaultName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE__DEFAULT_NAME, oldDefaultName, this.defaultName)); - } - - protected void setDefaultCatalog(String newDefaultCatalog) { - String oldDefaultCatalog = this.defaultCatalog; - this.defaultCatalog = newDefaultCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE__DEFAULT_CATALOG, oldDefaultCatalog, this.defaultCatalog)); - } - - protected void setDefaultSchema(String newDefaultSchema) { - String oldDefaultSchema = this.defaultSchema; - this.defaultSchema = newDefaultSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE__DEFAULT_SCHEMA, oldDefaultSchema, this.defaultSchema)); - } - - public Owner getOwner() { - return owner; - } - - protected Member getMember() { - return this.member; - } - - protected DeclarationAnnotationAdapter getDeclarationAnnotationAdapter() { - return this.daa; - } - - public IUniqueConstraint createUniqueConstraint(int index) { - return createJavaUniqueConstraint(index); - } - - protected abstract JavaUniqueConstraint createJavaUniqueConstraint(int index); - - //set these defaults here or call setDefaultCatalog from JavaTableContext instead - public void refreshDefaults(DefaultsContext defaultsContext) { - this.setDefaultCatalog((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)); - this.setDefaultSchema((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY)); - } - - protected void updateFromJava(CompilationUnit astRoot) { - this.setSpecifiedName(this.nameAdapter.getValue(astRoot)); - this.setSpecifiedSchema(this.schemaAdapter.getValue(astRoot)); - this.setSpecifiedCatalog(this.catalogAdapter.getValue(astRoot)); - this.updateUniqueConstraintsFromJava(astRoot); - } - - /** - * here we just worry about getting the unique constraints lists the same size; - * then we delegate to the unique constraints to synch themselves up - */ - private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List constraints = this.getUniqueConstraints(); - int persSize = constraints.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaUniqueConstraint uniqueConstraint = (JavaUniqueConstraint) constraints.get(i); - if (uniqueConstraint.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - uniqueConstraint.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - constraints.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaUniqueConstraint uniqueConstraint = this.createJavaUniqueConstraint(javaSize); - if (uniqueConstraint.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - this.getUniqueConstraints().add(uniqueConstraint); - uniqueConstraint.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - public ITextRange validationTextRange() { - ITextRange textRange = this.member.annotationTextRange(this.daa); - return (textRange != null) ? textRange : this.getOwner().validationTextRange(); - } - - public Table dbTable() { - Schema schema = this.dbSchema(); - return (schema == null) ? null : schema.tableNamed(this.getName()); - } - - public Schema dbSchema() { - return this.database().schemaNamed(this.getSchema()); - } - - public boolean hasResolvedSchema() { - return this.dbSchema() != null; - } - - public boolean isResolved() { - return this.dbTable() != null; - } - - protected ITextRange elementTextRange(DeclarationAnnotationElementAdapter elementAdapter) { - return this.elementTextRange(this.member.annotationElementTextRange(elementAdapter)); - } - - protected ITextRange elementTextRange(DeclarationAnnotationElementAdapter elementAdapter, CompilationUnit astRoot) { - return this.elementTextRange(this.member.annotationElementTextRange(elementAdapter, astRoot)); - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos) { - return this.elementTouches(this.member.annotationElementTextRange(elementAdapter), pos); - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos, CompilationUnit astRoot) { - return this.elementTouches(this.member.annotationElementTextRange(elementAdapter, astRoot), pos); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (IUniqueConstraint constraint : this.getUniqueConstraints()) { - result = ((JavaUniqueConstraint) constraint).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - /** - * called if the database is connected - * name, schema, catalog - */ - @Override - public Iterator connectedCandidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.connectedCandidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.nameTouches(pos, astRoot)) { - return this.quotedCandidateNames(filter); - } - if (this.schemaTouches(pos, astRoot)) { - return this.quotedCandidateSchemas(filter); - } - if (this.catalogTouches(pos, astRoot)) { - return this.quotedCandidateCatalogs(filter); - } - return null; - } - - private Iterator candidateNames() { - Schema dbSchema = this.dbSchema(); - return (dbSchema != null) ? dbSchema.tableNames() : EmptyIterator. instance(); - } - - private Iterator candidateNames(Filter filter) { - return new FilteringIterator(this.candidateNames(), filter); - } - - private Iterator quotedCandidateNames(Filter filter) { - return StringTools.quote(this.candidateNames(filter)); - } - - private Iterator candidateSchemas() { - return this.database().schemaNames(); - } - - private Iterator candidateSchemas(Filter filter) { - return new FilteringIterator(this.candidateSchemas(), filter); - } - - private Iterator quotedCandidateSchemas(Filter filter) { - return StringTools.quote(this.candidateSchemas(filter)); - } - - private Iterator candidateCatalogs() { - return this.database().catalogNames(); - } - - private Iterator candidateCatalogs(Filter filter) { - return new FilteringIterator(this.candidateCatalogs(), filter); - } - - private Iterator quotedCandidateCatalogs(Filter filter) { - return StringTools.quote(this.candidateCatalogs(filter)); - } - - // ********** jpa model -> java annotations ********** - //////////////////////////////////////////////////////// - /** - * slide over all the annotations that follow the new join column - */ - public void uniqueConstraintAdded(int index, IUniqueConstraint uniqueConstraint) { - // JoinColumn was added to jpa model when updating from java, do not need - // to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaUniqueConstraint) uniqueConstraint).annotation(getMember().astRoot()) == null) { - this.synchUniqueConstraintAnnotationsAfterAdd(index + 1); - ((JavaUniqueConstraint) uniqueConstraint).newAnnotation(); - } - } - - // bjv look at this - public void uniqueConstraintsAdded(int index, List constraints) { - // JoinColumn was added to jpa model when updating from java, do not need - // to edit the java in this case. TODO is there a better way to handle this?? - if (!constraints.isEmpty() && ((JavaUniqueConstraint) constraints.get(0)).annotation(getMember().astRoot()) == null) { - this.synchUniqueConstraintAnnotationsAfterAdd(index + constraints.size()); - for (IUniqueConstraint uniqueConstraint : constraints) { - ((JavaUniqueConstraint) uniqueConstraint).newAnnotation(); - } - } - } - - public void uniqueConstraintRemoved(int index, IUniqueConstraint uniqueConstraint) { - ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation(); - this.synchUniqueConstraintAnnotationsAfterRemove(index); - } - - public void uniqueConstraintsRemoved(int[] indexes, List constraints) { - for (IUniqueConstraint uniqueConstraint : constraints) { - ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation(); - } - this.synchUniqueConstraintAnnotationsAfterRemove(indexes[0]); - } - - public void uniqueConstraintsCleared(List constraints) { - for (IUniqueConstraint uniqueConstraint : constraints) { - ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation(); - } - } - - public void uniqueConstraintSet(int index, IUniqueConstraint oldUniqueConstraint, IUniqueConstraint newUniqueConstraint) { - ((JavaUniqueConstraint) newUniqueConstraint).newAnnotation(); - } - - public void uniqueConstraintMoved(int sourceIndex, int targetIndex, IUniqueConstraint uniqueConstraint) { - List constraints = this.getUniqueConstraints(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(constraints.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchUniqueConstraintAnnotationsAfterAdd(int index) { - List constraints = this.getUniqueConstraints(); - for (int i = constraints.size(); i-- > index;) { - this.synch(constraints.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchUniqueConstraintAnnotationsAfterRemove(int index) { - List joinColumns = this.getUniqueConstraints(); - for (int i = index; i < joinColumns.size(); i++) { - this.synch(joinColumns.get(i), i); - } - } - - private void synch(IUniqueConstraint uniqueConstraint, int index) { - ((JavaUniqueConstraint) uniqueConstraint).moveAnnotation(index); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/IntAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/IntAnnotationElementAdapter.java deleted file mode 100644 index 1660481a5b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/IntAnnotationElementAdapter.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Wrap an AnnotationElementAdapter and convert its value to an int, - * and vice-versa. The public protocol is identical to - * AnnotationElementAdapter; except the #getValue and #setValue - * methods deal with an int instead of an Object. - * - * Assumptions: - * - the nested adapter returns and expects a String value - * - the value should be a non-negative number (value >= 0) - * - an invalid value is represented with a -1/null - * These assumptions work reasonably enough with the JPA requirements. - */ -public class IntAnnotationElementAdapter { - private final AnnotationElementAdapter adapter; - - public IntAnnotationElementAdapter(AnnotationElementAdapter adapter) { - super(); - this.adapter = adapter; - } - - public ASTNode astNode() { - return this.adapter.astNode(); - } - - public ASTNode astNode(CompilationUnit astRoot) { - return this.adapter.astNode(astRoot); - } - - public int getValue() { - return this.convertValueToInt(this.adapter.getValue()); - } - - public int getValue(CompilationUnit astRoot) { - return this.convertValueToInt(this.adapter.getValue(astRoot)); - } - - protected int convertValueToInt(Object value) { - return this.convertStringToInt(this.convertValueToString(value)); - } - - /** - * assume the wrapped adapter returns a string - */ - protected String convertValueToString(Object value) { - return (String) value; - } - - protected int convertStringToInt(String stringValue) { - if (stringValue == null) { - return -1; - } - try { - int intValue = Integer.parseInt(stringValue); - return (intValue >= 0) ? intValue : -1; - } catch (NumberFormatException ex) { - return -1; - } - } - - public void setValue(int value) { - this.adapter.setValue(this.convertIntToValue(value)); - } - - protected String convertIntToValue(int intValue) { - return this.convertStringToValue(this.convertIntToString(intValue)); - } - - /** - * assume the wrapped adapter expects a string - */ - protected String convertStringToValue(String stringValue) { - return stringValue; - } - - protected String convertIntToString(int intValue) { - return (intValue >= 0) ? Integer.toString(intValue) : null; - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.adapter); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JPA.java deleted file mode 100644 index 8675c6da6f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JPA.java +++ /dev/null @@ -1,294 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - - -/** - * JPA Java-related stuff (annotations etc.) - */ -public interface JPA { - - // JPA package - String PACKAGE = "javax.persistence"; - String PACKAGE_ = PACKAGE + "."; - - - // ********** API ********** - - // JPA annotations - String ASSOCIATION_OVERRIDE = PACKAGE_ + "AssociationOverride"; - String ASSOCIATION_OVERRIDE__NAME = "name"; - String ASSOCIATION_OVERRIDE__JOIN_COLUMNS = "joinColumns"; - String ASSOCIATION_OVERRIDES = PACKAGE_ + "AssociationOverrides"; - String ASSOCIATION_OVERRIDES__VALUE = "value"; - String ATTRIBUTE_OVERRIDE = PACKAGE_ + "AttributeOverride"; - String ATTRIBUTE_OVERRIDE__NAME = "name"; - String ATTRIBUTE_OVERRIDE__COLUMN = "column"; - String ATTRIBUTE_OVERRIDES = PACKAGE_ + "AttributeOverrides"; - String ATTRIBUTE_OVERRIDES__VALUE = "value"; - String BASIC = PACKAGE_ + "Basic"; - String BASIC__FETCH = "fetch"; - String BASIC__OPTIONAL = "optional"; - String COLUMN = PACKAGE_ + "Column"; - String COLUMN__NAME = "name"; - String COLUMN__UNIQUE = "unique"; - String COLUMN__NULLABLE = "nullable"; - String COLUMN__INSERTABLE = "insertable"; - String COLUMN__UPDATABLE = "updatable"; - String COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String COLUMN__TABLE = "table"; - String COLUMN__LENGTH = "length"; - String COLUMN__PRECISION = "precision"; - String COLUMN__SCALE = "scale"; - String COLUMN_RESULT = PACKAGE_ + "ColumnResult"; - String COLUMN_RESULT__NAME = "name"; - String DISCRIMINATOR_COLUMN = PACKAGE_ + "DiscriminatorColumn"; - String DISCRIMINATOR_COLUMN__NAME = "name"; - String DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType"; - String DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String DISCRIMINATOR_COLUMN__LENGTH = "length"; - String DISCRIMINATOR_VALUE = PACKAGE_ + "DiscriminatorValue"; - String DISCRIMINATOR_VALUE__VALUE = "value"; - String EMBEDDABLE = PACKAGE_ + "Embeddable"; - String EMBEDDED = PACKAGE_ + "Embedded"; - String EMBEDDED_ID = PACKAGE_ + "EmbeddedId"; - String ENTITY = PACKAGE_ + "Entity"; - String ENTITY__NAME = "name"; - String ENTITY_LISTENERS = PACKAGE_ + "EntityListeners"; - String ENTITY_LISTENERS__VALUE = "value"; - String ENTITY_RESULT = PACKAGE_ + "EntityResult"; - String ENTITY_RESULT__ENTITY_CLASS = "entityClass"; - String ENTITY_RESULT__FIELDS = "fields"; - String ENTITY_RESULT__DISCRIMINATOR_COLUMN = "discriminatorColumn"; - String ENUMERATED = PACKAGE_ + "Enumerated"; - String ENUMERATED__VALUE = "value"; - String EXCLUDE_DEFAULT_LISTENERS = PACKAGE_ + "ExcludeDefaultListeners"; - String EXCLUDE_SUPERCLASS_LISTENERS = PACKAGE_ + "ExcludeSuperclassListeners"; - String FIELD_RESULT = PACKAGE_ + "FieldResult"; - String FIELD_RESULT__NAME = "name"; - String FIELD_RESULT__COLUMN = "column"; - String FLUSH_MODE = PACKAGE_ + "FlushMode"; - String FLUSH_MODE__VALUE = "value"; - String GENERATED_VALUE = PACKAGE_ + "GeneratedValue"; - String GENERATED_VALUE__STRATEGY = "strategy"; - String GENERATED_VALUE__GENERATOR = "generator"; - String ID = PACKAGE_ + "Id"; - String ID_CLASS = PACKAGE_ + "IdClass"; - String ID_CLASS__VALUE = "value"; - String INHERITANCE = PACKAGE_ + "Inheritance"; - String INHERITANCE__STRATEGY = "strategy"; - String JOIN_COLUMN = PACKAGE_ + "JoinColumn"; - String JOIN_COLUMN__NAME = "name"; - String JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName"; - String JOIN_COLUMN__UNIQUE = "unique"; - String JOIN_COLUMN__NULLABLE = "nullable"; - String JOIN_COLUMN__INSERTABLE = "insertable"; - String JOIN_COLUMN__UPDATABLE = "updatable"; - String JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String JOIN_COLUMN__TABLE = "table"; - String JOIN_COLUMNS = PACKAGE_ + "JoinColumns"; - String JOIN_COLUMNS__VALUE = "value"; - String JOIN_TABLE = PACKAGE_ + "JoinTable"; - String JOIN_TABLE__NAME = "name"; - String JOIN_TABLE__CATALOG = "catalog"; - String JOIN_TABLE__SCHEMA = "schema"; - String JOIN_TABLE__JOIN_COLUMNS = "joinColumns"; - String JOIN_TABLE__INVERSE_JOIN_COLUMNS = "inverseJoinColumns"; - String JOIN_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String LOB = PACKAGE_ + "Lob"; - String MANY_TO_MANY = PACKAGE_ + "ManyToMany"; - String MANY_TO_MANY__TARGET_ENTITY = "targetEntity"; - String MANY_TO_MANY__CASCADE = "cascade"; - String MANY_TO_MANY__FETCH = "fetch"; - String MANY_TO_MANY__MAPPED_BY = "mappedBy"; - String MANY_TO_ONE = PACKAGE_ + "ManyToOne"; - String MANY_TO_ONE__TARGET_ENTITY = "targetEntity"; - String MANY_TO_ONE__CASCADE = "cascade"; - String MANY_TO_ONE__FETCH = "fetch"; - String MANY_TO_ONE__OPTIONAL = "optional"; - String MAP_KEY = PACKAGE_ + "MapKey"; - String MAP_KEY__NAME = "name"; - String MAPPED_SUPERCLASS = PACKAGE_ + "MappedSuperclass"; - String NAMED_NATIVE_QUERIES = PACKAGE_ + "NamedNativeQueries"; - String NAMED_NATIVE_QUERIES__VALUE = "value"; - String NAMED_NATIVE_QUERY = PACKAGE_ + "NamedNativeQuery"; - String NAMED_NATIVE_QUERY__NAME = "name"; - String NAMED_NATIVE_QUERY__QUERY = "query"; - String NAMED_NATIVE_QUERY__HINTS = "hints"; - String NAMED_NATIVE_QUERY__RESULT_CLASS = "resultClass"; - String NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = "resultSetMapping"; - String NAMED_QUERIES = PACKAGE_ + "NamedQueries"; - String NAMED_QUERIES__VALUE = "value"; - String NAMED_QUERY = PACKAGE_ + "NamedQuery"; - String NAMED_QUERY__NAME = "name"; - String NAMED_QUERY__QUERY = "query"; - String NAMED_QUERY__HINTS = "hints"; - String ONE_TO_MANY = PACKAGE_ + "OneToMany"; - String ONE_TO_MANY__TARGET_ENTITY = "targetEntity"; - String ONE_TO_MANY__CASCADE = "cascade"; - String ONE_TO_MANY__FETCH = "fetch"; - String ONE_TO_MANY__MAPPED_BY = "mappedBy"; - String ONE_TO_ONE = PACKAGE_ + "OneToOne"; - String ONE_TO_ONE__TARGET_ENTITY = "targetEntity"; - String ONE_TO_ONE__CASCADE = "cascade"; - String ONE_TO_ONE__FETCH = "fetch"; - String ONE_TO_ONE__OPTIONAL = "optional"; - String ONE_TO_ONE__MAPPED_BY = "mappedBy"; - String ORDER_BY = PACKAGE_ + "OrderBy"; - String ORDER_BY__VALUE = "value"; - String PERSISTENCE_CONTEXT = PACKAGE_ + "PersistenceContext"; - String PERSISTENCE_CONTEXT__NAME = "name"; - String PERSISTENCE_CONTEXT__UNIT_NAME = "unitName"; - String PERSISTENCE_CONTEXT__TYPE = "type"; - String PERSISTENCE_CONTEXTS = PACKAGE_ + "PersistenceContexts"; - String PERSISTENCE_CONTEXTS__VALUE = "value"; - String PERSISTENCE_UNIT = PACKAGE_ + "PersistenceUnit"; - String PERSISTENCE_UNIT__NAME = "name"; - String PERSISTENCE_UNIT__UNIT_NAME = "unitName"; - String PERSISTENCE_UNITS = PACKAGE_ + "PersistenceUnits"; - String PERSISTENCE_UNITS__VALUE = "value"; - String POST_LOAD = PACKAGE_ + "PostLoad"; - String POST_PERSIST = PACKAGE_ + "PostPersist"; - String POST_REMOVE = PACKAGE_ + "PostRemove"; - String POST_UPDATE = PACKAGE_ + "PostUpdate"; - String PRE_PERSIST = PACKAGE_ + "PrePersist"; - String PRE_REMOVE = PACKAGE_ + "PreRemove"; - String PRE_UPDATE = PACKAGE_ + "PreUpdate"; - String PRIMARY_KEY_JOIN_COLUMN = PACKAGE_ + "PrimaryKeyJoinColumn"; - String PRIMARY_KEY_JOIN_COLUMN__NAME = "name"; - String PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName"; - String PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String PRIMARY_KEY_JOIN_COLUMNS = PACKAGE_ + "PrimaryKeyJoinColumns"; - String PRIMARY_KEY_JOIN_COLUMNS__VALUE = "value"; - String QUERY_HINT = PACKAGE_ + "QueryHint"; - String QUERY_HINT__NAME = "name"; - String QUERY_HINT__VALUE = "value"; - String SECONDARY_TABLE = PACKAGE_ + "SecondaryTable"; - String SECONDARY_TABLE__NAME = "name"; - String SECONDARY_TABLE__CATALOG = "catalog"; - String SECONDARY_TABLE__SCHEMA = "schema"; - String SECONDARY_TABLE__PK_JOIN_COLUMNS = "pkJoinColumns"; - String SECONDARY_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String SECONDARY_TABLES = PACKAGE_ + "SecondaryTables"; - String SECONDARY_TABLES__VALUE = "value"; - String SEQUENCE_GENERATOR = PACKAGE_ + "SequenceGenerator"; - String SEQUENCE_GENERATOR__NAME = "name"; - String SEQUENCE_GENERATOR__SEQUENCE_NAME = "sequenceName"; - String SEQUENCE_GENERATOR__INITIAL_VALUE = "initialValue"; - String SEQUENCE_GENERATOR__ALLOCATION_SIZE = "allocationSize"; - String SQL_RESULT_SET_MAPPING = PACKAGE_ + "SqlResultSetMapping"; - String SQL_RESULT_SET_MAPPING__NAME = "name"; - String SQL_RESULT_SET_MAPPING__ENTITIES = "entities"; - String SQL_RESULT_SET_MAPPING__COLUMNS = "columns"; - String TABLE = PACKAGE_ + "Table"; - String TABLE__NAME = "name"; - String TABLE__CATALOG = "catalog"; - String TABLE__SCHEMA = "schema"; - String TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String TABLE_GENERATOR = PACKAGE_ + "TableGenerator"; - String TABLE_GENERATOR__NAME = "name"; - String TABLE_GENERATOR__TABLE = "table"; - String TABLE_GENERATOR__CATALOG = "catalog"; - String TABLE_GENERATOR__SCHEMA = "schema"; - String TABLE_GENERATOR__PK_COLUMN_NAME = "pkColumnName"; - String TABLE_GENERATOR__VALUE_COLUMN_NAME = "valueColumnName"; - String TABLE_GENERATOR__PK_COLUMN_VALUE = "pkColumnValue"; - String TABLE_GENERATOR__INITIAL_VALUE = "initialValue"; - String TABLE_GENERATOR__ALLOCATION_SIZE = "allocationSize"; - String TABLE_GENERATOR__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String TEMPORAL = PACKAGE_ + "Temporal"; - String TEMPORAL__VALUE = "value"; - String TRANSIENT = PACKAGE_ + "Transient"; - String UNIQUE_CONSTRAINT = PACKAGE_ + "UniqueConstraint"; - String UNIQUE_CONSTRAINT__COLUMN_NAMES = "columnNames"; - String VERSION = PACKAGE_ + "Version"; - - // JPA enums - String GENERATION_TYPE = PACKAGE_ + "GenerationType"; - String GENERATION_TYPE_ = GENERATION_TYPE + "."; - String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO"; - String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY"; - String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE"; - String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE"; - - String CASCADE_TYPE = PACKAGE_ + "CascadeType"; - String CASCADE_TYPE_ = CASCADE_TYPE + "."; - String CASCADE_TYPE__ALL = CASCADE_TYPE_ + "ALL"; - String CASCADE_TYPE__MERGE = CASCADE_TYPE_ + "MERGE"; - String CASCADE_TYPE__PERSIST = CASCADE_TYPE_ + "PERSIST"; - String CASCADE_TYPE__REFRESH = CASCADE_TYPE_ + "REFRESH"; - String CASCADE_TYPE__REMOVE = CASCADE_TYPE_ + "REMOVE"; - - String DISCRIMINATOR_TYPE = PACKAGE_ + "DiscriminatorType"; - String DISCRIMINATOR_TYPE_ = DISCRIMINATOR_TYPE + "."; - String DISCRIMINATOR_TYPE__CHAR = DISCRIMINATOR_TYPE_ + "CHAR"; - String DISCRIMINATOR_TYPE__INTEGER = DISCRIMINATOR_TYPE_ + "INTEGER"; - String DISCRIMINATOR_TYPE__STRING = DISCRIMINATOR_TYPE_ + "STRING"; - - String ENUM_TYPE = PACKAGE_ + "EnumType"; - String ENUM_TYPE_ = ENUM_TYPE + "."; - String ENUM_TYPE__ORDINAL = ENUM_TYPE_ + "ORDINAL"; - String ENUM_TYPE__STRING = ENUM_TYPE_ + "STRING"; - - String FETCH_TYPE = PACKAGE_ + "FetchType"; - String FETCH_TYPE_ = FETCH_TYPE + "."; - String FETCH_TYPE__EAGER = FETCH_TYPE_ + "EAGER"; - String FETCH_TYPE__LAZY = FETCH_TYPE_ + "LAZY"; - - String FLUSH_MODE_TYPE = PACKAGE_ + "FlushModeType"; - String FLUSH_MODE_TYPE_ = FLUSH_MODE_TYPE + "."; - String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO"; - String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT"; - - String INHERITANCE_TYPE = PACKAGE_ + "InheritanceType"; - String INHERITANCE_TYPE_ = INHERITANCE_TYPE + "."; - String INHERITANCE_TYPE__JOINED = INHERITANCE_TYPE_ + "JOINED"; - String INHERITANCE_TYPE__SINGLE_TABLE = INHERITANCE_TYPE_ + "SINGLE_TABLE"; - String INHERITANCE_TYPE__TABLE_PER_CLASS = INHERITANCE_TYPE_ + "TABLE_PER_CLASS"; - - String PERSISTENCE_CONTEXT_TYPE = PACKAGE_ + "PersistenceContextType"; - String PERSISTENCE_CONTEXT_TYPE_ = PERSISTENCE_CONTEXT_TYPE + "."; - String PERSISTENCE_CONTEXT_TYPE__EXTENDED = PERSISTENCE_CONTEXT_TYPE_ + "EXTENDED"; - String PERSISTENCE_CONTEXT_TYPE__TRANSACTION = PERSISTENCE_CONTEXT_TYPE_ + "TRANSACTION"; - - String TEMPORAL_TYPE = PACKAGE_ + "TemporalType"; - String TEMPORAL_TYPE_ = TEMPORAL_TYPE + "."; - String TEMPORAL_TYPE__DATE = TEMPORAL_TYPE_ + "DATE"; - String TEMPORAL_TYPE__TIME = TEMPORAL_TYPE_ + "TIME"; - String TEMPORAL_TYPE__TIMESTAMP = TEMPORAL_TYPE_ + "TIMESTAMP"; - - // JPA interfaces - String ENTITY_MANAGER = PACKAGE_ + "EntityManager"; - String ENTITY_MANAGER_FACTORY = PACKAGE_ + "EntityManagerFactory"; - String ENTITY_TRANSACTION = PACKAGE_ + "EntityTransaction"; - String INSTRUMENTABLE_CLASS_LOADER = PACKAGE_ + "InstrumentableClassLoader"; - String QUERY = PACKAGE_ + "Query"; - - // JPA classes - String PERSISTENCE = PACKAGE_ + "Persistence"; - - // JPA exceptions - String NON_UNIQUE_RESULT_EXCEPTION = PACKAGE_ + "NonUniqueResultException"; - String OBJECT_NOT_FOUND_EXCEPTION = PACKAGE_ + "ObjectNotFoundException"; - String PERSISTENCE_EXCEPTION = PACKAGE_ + "PersistenceException"; - - - // ********** SPI ********** - - // JPA SPI package - String SPI_PACKAGE = PACKAGE_ + "spi"; - String SPI_PACKAGE_ = SPI_PACKAGE + "."; - - // JPA SPI interfaces - String ENTITY_MANAGER_FACTORY_PROVIDER = SPI_PACKAGE_ + "EntityManagerFactoryProvider"; - String PERSISTENCE_INFO = SPI_PACKAGE_ + "PersistenceInfo"; - String PERSISTENCE_PROVIDER = SPI_PACKAGE_ + "PersistenceProvider"; - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAbstractQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAbstractQuery.java deleted file mode 100644 index bc6aba495a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAbstractQuery.java +++ /dev/null @@ -1,631 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.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.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Abstract Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAbstractQuery() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaAbstractQuery extends JavaEObject implements IQuery -{ - private final Member member; - - // hold this so we can get the annotation's text range - private final IndexedDeclarationAnnotationAdapter idaa; - - // hold this so we can get the 'name' text range - private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; - - // hold this so we can get the 'query' text range - private final DeclarationAnnotationElementAdapter queryDeclarationAdapter; - - private final IndexedAnnotationAdapter annotationAdapter; - - private final AnnotationElementAdapter nameAdapter; - - private final AnnotationElementAdapter queryAdapter; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getQuery() Query}' attribute. - * - * - * @see #getQuery() - * @generated - * @ordered - */ - protected static final String QUERY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQuery() Query}' attribute. - * - * - * @see #getQuery() - * @generated - * @ordered - */ - protected String query = QUERY_EDEFAULT; - - /** - * The cached value of the '{@link #getHints() Hints}' containment reference list. - * - * - * @see #getHints() - * @generated - * @ordered - */ - protected EList hints; - - protected JavaAbstractQuery() { - throw new UnsupportedOperationException("Use JavaAbstractQuery(Member) instead"); - } - - protected JavaAbstractQuery(Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(); - this.member = member; - this.idaa = idaa; - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); - this.nameDeclarationAdapter = nameAdapter(this.idaa); - this.queryDeclarationAdapter = queryAdapter(this.idaa); - this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter); - this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter); - } - - // ********** initialization ********** - protected AnnotationElementAdapter buildAdapter(DeclarationAnnotationElementAdapter daea) { - return new ShortCircuitAnnotationElementAdapter(this.member, daea); - } - - protected DeclarationAnnotationElementAdapter nameAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, nameElementName()); - } - - protected DeclarationAnnotationElementAdapter queryAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, queryElementName()); - } - - protected abstract String nameElementName(); - - protected abstract String queryElementName(); - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IQuery.class)) { - case JpaCoreMappingsPackage.IQUERY__NAME : - this.nameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaCoreMappingsPackage.IQUERY__QUERY : - this.queryAdapter.setValue((String) notification.getNewValue()); - break; - case JpaCoreMappingsPackage.IQUERY__HINTS : - hintsChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void hintsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - hintAdded(notification.getPosition(), (IQueryHint) notification.getNewValue()); - break; - case Notification.ADD_MANY : - hintsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - hintRemoved(notification.getPosition(), (IQueryHint) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - hintsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - hintsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - hintSet(notification.getPosition(), (IQueryHint) notification.getOldValue(), (IQueryHint) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - hintMoved(notification.getOldIntValue(), notification.getPosition(), (IQueryHint) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ABSTRACT_QUERY; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIQuery_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME, oldName, name)); - } - - /** - * Returns the value of the 'Query' attribute. - * - *

- * If the meaning of the 'Query' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Query' attribute. - * @see #setQuery(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIQuery_Query() - * @model - * @generated - */ - public String getQuery() { - return query; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery#getQuery Query}' attribute. - * - * - * @param value the new value of the 'Query' attribute. - * @see #getQuery() - * @generated - */ - public void setQuery(String newQuery) { - String oldQuery = query; - query = newQuery; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY, oldQuery, query)); - } - - /** - * Returns the value of the 'Hints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IQueryHint}. - * - *

- * If the meaning of the 'Hints' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Hints' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIQuery_Hints() - * @model type="org.eclipse.jpt.core.internal.mappings.IQueryHint" containment="true" - * @generated - */ - public EList getHints() { - if (hints == null) { - hints = new EObjectContainmentEList(IQueryHint.class, this, JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS); - } - return hints; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS : - return ((InternalEList) getHints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME : - return getName(); - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY : - return getQuery(); - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS : - return getHints(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME : - setName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY : - setQuery((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS : - getHints().clear(); - getHints().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME : - setName(NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY : - setQuery(QUERY_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS : - getHints().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY : - return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query); - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS : - return hints != null && !hints.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IQuery.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME : - return JpaCoreMappingsPackage.IQUERY__NAME; - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY : - return JpaCoreMappingsPackage.IQUERY__QUERY; - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS : - return JpaCoreMappingsPackage.IQUERY__HINTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IQuery.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IQUERY__NAME : - return JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__NAME; - case JpaCoreMappingsPackage.IQUERY__QUERY : - return JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__QUERY; - case JpaCoreMappingsPackage.IQUERY__HINTS : - return JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY__HINTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", query: "); - result.append(query); - result.append(')'); - return result.toString(); - } - - protected Member getMember() { - return this.member; - } - - // ********** jpa model -> java annotations ********** - /** - * slide over all the annotations that follow the new join column - */ - public void hintAdded(int index, IQueryHint hint) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaQueryHint) hint).annotation(getMember().astRoot()) == null) { - this.synchHintAnnotationsAfterAdd(index + 1); - ((JavaQueryHint) hint).newAnnotation(); - } - } - - // bjv look at this - public void hintsAdded(int index, List queryHints) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!queryHints.isEmpty() && ((JavaQueryHint) queryHints.get(0)).annotation(getMember().astRoot()) == null) { - this.synchHintAnnotationsAfterAdd(index + queryHints.size()); - for (IQueryHint hint : queryHints) { - ((JavaQueryHint) hint).newAnnotation(); - } - } - } - - public void hintRemoved(int index, IQueryHint hint) { - ((JavaQueryHint) hint).removeAnnotation(); - this.synchHintAnnotationsAfterRemove(index); - } - - public void hintsRemoved(int[] indexes, List queryHints) { - for (IQueryHint hint : queryHints) { - ((JavaQueryHint) hint).removeAnnotation(); - } - this.synchHintAnnotationsAfterRemove(indexes[0]); - } - - public void hintsCleared(List queryHints) { - for (IQueryHint hint : queryHints) { - ((JavaQueryHint) hint).removeAnnotation(); - } - } - - public void hintSet(int index, IQueryHint oldHint, IQueryHint newHint) { - ((JavaQueryHint) newHint).newAnnotation(); - } - - public void hintMoved(int sourceIndex, int targetIndex, IQueryHint hint) { - List queryHints = this.getHints(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(queryHints.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchHintAnnotationsAfterAdd(int index) { - List queryHints = this.getHints(); - for (int i = queryHints.size(); i-- > index;) { - this.synch(queryHints.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchHintAnnotationsAfterRemove(int index) { - List queryHints = this.getHints(); - for (int i = index; i < queryHints.size(); i++) { - this.synch(queryHints.get(i), i); - } - } - - private void synch(IQueryHint queryHint, int index) { - ((JavaQueryHint) queryHint).moveAnnotation(index); - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - protected void updateFromJava(CompilationUnit astRoot) { - this.setName(this.nameAdapter.getValue(astRoot)); - this.setQuery(this.queryAdapter.getValue(astRoot)); - this.updateQueryHintsFromJava(astRoot); - } - - /** - * here we just worry about getting the named query lists the same size; - * then we delegate to the named queries to synch themselves up - */ - private void updateQueryHintsFromJava(CompilationUnit astRoot) { - // synchronize the model named queries with the Java source - List queryHints = this.getHints(); - int persSize = queryHints.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaQueryHint hint = (JavaQueryHint) queryHints.get(i); - if (hint.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - hint.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model named queries beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - queryHints.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaQueryHint javaQueryHint = createJavaQueryHint(javaSize); - if (javaQueryHint.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getHints().add(javaQueryHint); - javaQueryHint.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - public JavaQueryHint createQueryHint(int index) { - return createJavaQueryHint(index); - } - - protected abstract JavaQueryHint createJavaQueryHint(int index); - - protected IndexedDeclarationAnnotationAdapter getDeclarationAnnotationAdapter() { - return this.idaa; - } - - // ********** persistence model -> java annotations ********** - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - // ********* IJpaSourceObject implementation *********** - public ITextRange validationTextRange() { - return this.member.annotationTextRange(this.idaa); - } - - // ********** static methods ********** - protected static DeclarationAnnotationElementAdapter buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName); - } -} // JavaAbstractQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAssociationOverride.java deleted file mode 100644 index 1966b57575..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAssociationOverride.java +++ /dev/null @@ -1,506 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Association Override'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAssociationOverride() - * @model kind="class" - * @generated - */ -public class JavaAssociationOverride extends JavaOverride - implements IAssociationOverride -{ - /** - * The cached value of the '{@link #getSpecifiedJoinColumns() Specified Join Columns}' containment reference list. - * - * - * @see #getSpecifiedJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedJoinColumns; - - /** - * The cached value of the '{@link #getDefaultJoinColumns() Default Join Columns}' containment reference list. - * - * - * @see #getDefaultJoinColumns() - * @generated - * @ordered - */ - protected EList defaultJoinColumns; - - public static final SimpleDeclarationAnnotationAdapter SINGLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ASSOCIATION_OVERRIDE); - - public static final SimpleDeclarationAnnotationAdapter MULTIPLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ASSOCIATION_OVERRIDES); - - protected JavaAssociationOverride() { - throw new UnsupportedOperationException("use JavaAssociationOverride(Owner, Member, IndexedDeclarationAnnotationAdapter)"); - } - - protected JavaAssociationOverride(Owner owner, Member member, IndexedDeclarationAnnotationAdapter daa) { - super(owner, member, daa); - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IJoinTable.class)) { - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - specifiedJoinColumnsChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void specifiedJoinColumnsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - specifiedJoinColumnAdded(notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - case Notification.ADD_MANY : - specifiedJoinColumnsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - specifiedJoinColumnRemoved(notification.getPosition(), (IJoinColumn) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - specifiedJoinColumnsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - specifiedJoinColumnsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - specifiedJoinColumnSet(notification.getPosition(), (IJoinColumn) notification.getOldValue(), (IJoinColumn) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - specifiedJoinColumnMoved(notification.getOldIntValue(), notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - default : - break; - } - } - - @Override - protected String nameElementName() { - return JPA.ASSOCIATION_OVERRIDE__NAME; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ASSOCIATION_OVERRIDE; - } - - public EList getJoinColumns() { - return this.getSpecifiedJoinColumns().isEmpty() ? this.getDefaultJoinColumns() : this.getSpecifiedJoinColumns(); - } - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAssociationOverride_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedJoinColumns() { - if (specifiedJoinColumns == null) { - specifiedJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS); - } - return specifiedJoinColumns; - } - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAssociationOverride_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultJoinColumns() { - if (defaultJoinColumns == null) { - defaultJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS); - } - return defaultJoinColumns; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return ((InternalEList) getJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return ((InternalEList) getDefaultJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return getJoinColumns(); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return getSpecifiedJoinColumns(); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return getDefaultJoinColumns(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - getSpecifiedJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - getDefaultJoinColumns().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return !getJoinColumns().isEmpty(); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return specifiedJoinColumns != null && !specifiedJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return defaultJoinColumns != null && !defaultJoinColumns.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAssociationOverride.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAssociationOverride.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__JOIN_COLUMNS; - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public ITypeMapping typeMapping() { - return (ITypeMapping) eContainer(); - } - - public boolean containsSpecifiedJoinColumns() { - return !this.getSpecifiedJoinColumns().isEmpty(); - } - - public IJoinColumn createJoinColumn(int index) { - return this.createJavaJoinColumn(index); - } - - private JavaJoinColumn createJavaJoinColumn(int index) { - return JavaJoinColumn.createAssociationOverrideJoinColumn(this.getDeclarationAnnotationAdapter(), new JoinColumnOwner(this), this.getMember(), index); - } - - // ********** jpa model -> java annotations ********** - /** - * slide over all the annotations that follow the new join column - */ - public void specifiedJoinColumnAdded(int index, IJoinColumn joinColumn) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaJoinColumn) joinColumn).annotation(getMember().astRoot()) == null) { - this.synchJoinColumnAnnotationsAfterAdd(index + 1); - ((JavaJoinColumn) joinColumn).newAnnotation(); - } - } - - // bjv look at this - public void specifiedJoinColumnsAdded(int index, List joinColumns) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!joinColumns.isEmpty() && ((JavaJoinColumn) joinColumns.get(0)).annotation(getMember().astRoot()) == null) { - this.synchJoinColumnAnnotationsAfterAdd(index + joinColumns.size()); - for (IJoinColumn joinColumn : joinColumns) { - ((JavaJoinColumn) joinColumn).newAnnotation(); - } - } - } - - public void specifiedJoinColumnRemoved(int index, IJoinColumn joinColumn) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - this.synchJoinColumnAnnotationsAfterRemove(index); - } - - public void specifiedJoinColumnsRemoved(int[] indexes, List joinColumns) { - for (IJoinColumn joinColumn : joinColumns) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - } - this.synchJoinColumnAnnotationsAfterRemove(indexes[0]); - } - - public void specifiedJoinColumnsCleared(List joinColumns) { - for (IJoinColumn joinColumn : joinColumns) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - } - } - - public void specifiedJoinColumnSet(int index, IJoinColumn oldJoinColumn, IJoinColumn newJoinColumn) { - ((JavaJoinColumn) newJoinColumn).newAnnotation(); - } - - public void specifiedJoinColumnMoved(int sourceIndex, int targetIndex, IJoinColumn joinColumn) { - List joinColumns = this.getSpecifiedJoinColumns(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchJoinColumnAnnotationsAfterAdd(int index) { - List joinColumns = this.getSpecifiedJoinColumns(); - for (int i = joinColumns.size(); i-- > index;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchJoinColumnAnnotationsAfterRemove(int index) { - List joinColumns = this.getSpecifiedJoinColumns(); - for (int i = index; i < joinColumns.size(); i++) { - this.synch(joinColumns.get(i), i); - } - } - - private void synch(IJoinColumn joinColumn, int index) { - ((JavaJoinColumn) joinColumn).moveAnnotation(index); - } - - @Override - protected Iterator candidateNames() { - return this.getOwner().getTypeMapping().allOverridableAssociationNames(); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (IJoinColumn column : this.getJoinColumns()) { - result = ((JavaJoinColumn) column).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - updateSpecifiedJoinColumnsFromJava(astRoot); - } - - /** - * here we just worry about getting the join column lists the same size; - * then we delegate to the join columns to synch themselves up - */ - private void updateSpecifiedJoinColumnsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List joinColumns = getSpecifiedJoinColumns(); - int persSize = joinColumns.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaJoinColumn joinColumn = (JavaJoinColumn) joinColumns.get(i); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - joinColumn.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - joinColumns.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaJoinColumn joinColumn = this.createJavaJoinColumn(javaSize); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedJoinColumns().add(joinColumn); - joinColumn.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - static JavaAssociationOverride createAssociationOverride(Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaAssociationOverride(owner, member, buildAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.ASSOCIATION_OVERRIDE); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeMapping.java deleted file mode 100644 index a12eeeaa59..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeMapping.java +++ /dev/null @@ -1,170 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'Java Attribute Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAttributeMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaAttributeMapping extends JavaEObject - implements IJavaAttributeMapping -{ - private final Attribute attribute; - - // TODO remove? - private final AnnotationAdapter annotationAdapter; - - protected JavaAttributeMapping() { - throw new UnsupportedOperationException("Use JavaAttributeMapping(Attribute) instead"); - } - - protected JavaAttributeMapping(Attribute attribute) { - super(); - this.attribute = attribute; - this.annotationAdapter = this.buildAnnotationAdapter(this.declarationAnnotationAdapter()); - } - - /** - * Return the declaration adapter for the mapping's annotation. - */ - protected abstract DeclarationAnnotationAdapter declarationAnnotationAdapter(); - - /** - * Build and return an adapter for the mapping's annotation. - */ - protected AnnotationAdapter buildAnnotationAdapter(DeclarationAnnotationAdapter daa) { - return new MemberAnnotationAdapter(this.attribute, daa); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ATTRIBUTE_MAPPING; - } - - public void initialize() { - this.updateFromJava(this.attribute.astRoot()); - } - - public JavaPersistentAttribute getPersistentAttribute() { - return (JavaPersistentAttribute) this.eContainer(); - } - - /** - * the persistent attribute can tell whether there is a "specified" mapping - * or a "default" one - */ - public boolean isDefault() { - return this.getPersistentAttribute().mappingIsDefault(); - } - - public ITypeMapping typeMapping() { - return this.getPersistentAttribute().typeMapping(); - } - - public Attribute getAttribute() { - return this.attribute; - } - - public ITextRange validationTextRange() { - ITextRange textRange = attribute.annotationTextRange(this.declarationAnnotationAdapter()); - return (textRange == null) ? this.getPersistentAttribute().validationTextRange() : textRange; - } - - protected ITextRange elementTextRange(DeclarationAnnotationElementAdapter elementAdapter) { - return this.elementTextRange(this.attribute.annotationElementTextRange(elementAdapter)); - } - - protected IType jdtType() { - return this.typeMapping().getPersistentType().findJdtType(); - } - - public void updateFromJava(CompilationUnit astRoot) { - // do nothing - override as appropriate - } - - protected INamedColumn.Owner buildColumnOwner() { - return new ColumnOwner(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - // do nothing - override as appropriate - } - - public String primaryKeyColumnName() { - return null; - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos) { - return this.elementTouches(this.attribute.annotationElementTextRange(elementAdapter), pos); - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos, CompilationUnit astRoot) { - return this.elementTouches(this.attribute.annotationElementTextRange(elementAdapter, astRoot), pos); - } - - public boolean isOverridableAttributeMapping() { - return false; - } - - public boolean isOverridableAssociationMapping() { - return false; - } - - public boolean isIdMapping() { - return false; - } - - - /** - * mapping implementation of column owner - */ - protected class ColumnOwner implements INamedColumn.Owner - { - public ITypeMapping getTypeMapping() { - return JavaAttributeMapping.this.typeMapping(); - } - - public ITextRange validationTextRange() { - return JavaAttributeMapping.this.validationTextRange(); - } - - public Table dbTable(String tableName) { - return this.getTypeMapping().dbTable(tableName); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeOverride.java deleted file mode 100644 index 467b5a512d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeOverride.java +++ /dev/null @@ -1,268 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Attribute Override'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAttributeOverride() - * @model kind="class" - * @generated - */ -public class JavaAttributeOverride extends JavaOverride - implements IAttributeOverride -{ - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - public static final SimpleDeclarationAnnotationAdapter SINGLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ATTRIBUTE_OVERRIDE); - - public static final SimpleDeclarationAnnotationAdapter MULTIPLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ATTRIBUTE_OVERRIDES); - - protected JavaAttributeOverride() { - throw new UnsupportedOperationException("use JavaAttributeOverride(Owner, Member, IndexedDeclarationAnnotationAdapter)"); - } - - protected JavaAttributeOverride(Owner owner, Member member, IndexedDeclarationAnnotationAdapter daa) { - super(owner, member, daa); - this.column = JavaColumn.createAttributeOverrideColumn(this.buildColumnOwner(), member, daa); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN, null, null); - } - - @Override - protected String nameElementName() { - return JPA.ATTRIBUTE_OVERRIDE__NAME; - } - - // TODO figure out how to use [stupid] EMF to implement the Column.Owner interface directly - protected INamedColumn.Owner buildColumnOwner() { - return new ColumnOwner(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ATTRIBUTE_OVERRIDE; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

- * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAttributeOverride_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN : - return basicSetColumn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN : - return getColumn(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN : - return column != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IAttributeOverride.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN : - return JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE__COLUMN; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IAttributeOverride.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE__COLUMN : - return JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE__COLUMN; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.getJavaColumn().updateFromJava(astRoot); - } - - private JavaColumn getJavaColumn() { - return (JavaColumn) this.column; - } - - @Override - protected Iterator candidateNames() { - return this.getOwner().getTypeMapping().allOverridableAttributeNames(); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - result = this.getJavaColumn().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - return null; - } - - // ********** static methods ********** - static JavaAttributeOverride createAttributeOverride(Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaAttributeOverride(owner, member, buildAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.ATTRIBUTE_OVERRIDE); - } - - - // ********** member class ********** - public class ColumnOwner implements INamedColumn.Owner - { - public ITypeMapping getTypeMapping() { - return JavaAttributeOverride.this.getOwner().getTypeMapping(); - } - - public ITextRange validationTextRange() { - return JavaAttributeOverride.this.validationTextRange(); - } - - public Table dbTable(String tableName) { - return this.getTypeMapping().dbTable(tableName); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java deleted file mode 100644 index 7ab0f41a1a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java +++ /dev/null @@ -1,938 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.core.WorkingCopyOwner; -import org.eclipse.jdt.core.dom.BooleanLiteral; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.BooleanAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.BooleanStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleBooleanAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.EnumType; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Basic'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaBasic() - * @model kind="class" - * @generated - */ -public class JavaBasic extends JavaAttributeMapping implements IBasic -{ - private final AnnotationElementAdapter optionalAdapter; - - private final AnnotationElementAdapter fetchAdapter; - - private final AnnotationAdapter temporalAnnotationAdapter; - - private final AnnotationElementAdapter temporalValueAdapter; - - private final AnnotationAdapter enumeratedAnnotationAdapter; - - private final AnnotationElementAdapter enumeratedValueAdapter; - - private final BooleanAnnotationAdapter lobAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.BASIC); - - private static final DeclarationAnnotationElementAdapter OPTIONAL_ADAPTER = buildOptionalAdapter(); - - private static final DeclarationAnnotationElementAdapter FETCH_ADAPTER = buildFetchAdapter(); - - public static final DeclarationAnnotationAdapter TEMPORAL_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TEMPORAL); - - private static final DeclarationAnnotationElementAdapter TEMPORAL_VALUE_ADAPTER = buildTemporalValueAdapter(); - - public static final DeclarationAnnotationAdapter ENUMERATED_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ENUMERATED); - - private static final DeclarationAnnotationElementAdapter ENUMERATED_VALUE_ADAPTER = buildEnumeratedValueAdapter(); - - public static final DeclarationAnnotationAdapter LOB_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.LOB); - - /** - * The default value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected static final DefaultEagerFetchType FETCH_EDEFAULT = DefaultEagerFetchType.DEFAULT; - - /** - * The cached value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected DefaultEagerFetchType fetch = FETCH_EDEFAULT; - - /** - * The default value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean OPTIONAL_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected DefaultTrueBoolean optional = OPTIONAL_EDEFAULT; - - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - /** - * The default value of the '{@link #isLob() Lob}' attribute. - * - * - * @see #isLob() - * @generated - * @ordered - */ - protected static final boolean LOB_EDEFAULT = false; - - /** - * The cached value of the '{@link #isLob() Lob}' attribute. - * - * - * @see #isLob() - * @generated - * @ordered - */ - protected boolean lob = LOB_EDEFAULT; - - /** - * The default value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected static final TemporalType TEMPORAL_EDEFAULT = TemporalType.NULL; - - /** - * The cached value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected TemporalType temporal = TEMPORAL_EDEFAULT; - - /** - * The default value of the '{@link #getEnumerated() Enumerated}' attribute. - * - * - * @see #getEnumerated() - * @generated - * @ordered - */ - protected static final EnumType ENUMERATED_EDEFAULT = EnumType.DEFAULT; - - /** - * The cached value of the '{@link #getEnumerated() Enumerated}' attribute. - * - * - * @see #getEnumerated() - * @generated - * @ordered - */ - protected EnumType enumerated = ENUMERATED_EDEFAULT; - - protected JavaBasic() { - this(null); - } - - protected JavaBasic(Attribute attribute) { - super(attribute); - this.column = JavaColumn.createColumnMappingColumn(buildColumnOwner(), getAttribute()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_BASIC__COLUMN, null, null); - this.optionalAdapter = new ShortCircuitAnnotationElementAdapter(attribute, OPTIONAL_ADAPTER); - this.fetchAdapter = new ShortCircuitAnnotationElementAdapter(attribute, FETCH_ADAPTER); - this.lobAdapter = new SimpleBooleanAnnotationAdapter(new MemberAnnotationAdapter(attribute, LOB_ADAPTER)); - this.temporalAnnotationAdapter = new MemberAnnotationAdapter(this.getAttribute(), TEMPORAL_ADAPTER); - this.temporalValueAdapter = new ShortCircuitAnnotationElementAdapter(attribute, TEMPORAL_VALUE_ADAPTER); - this.enumeratedAnnotationAdapter = new MemberAnnotationAdapter(this.getAttribute(), ENUMERATED_ADAPTER); - this.enumeratedValueAdapter = new ShortCircuitAnnotationElementAdapter(attribute, ENUMERATED_VALUE_ADAPTER); - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IBasic.class)) { - case JpaJavaMappingsPackage.JAVA_BASIC__FETCH : - this.fetchAdapter.setValue(((DefaultEagerFetchType) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL : - this.optionalAdapter.setValue(((DefaultTrueBoolean) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.JAVA_BASIC__LOB : - this.lobAdapter.setValue(notification.getNewBooleanValue()); - break; - case JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL : - TemporalType newTemporal = (TemporalType) notification.getNewValue(); - if (newTemporal == TemporalType.NULL) { - this.temporalAnnotationAdapter.removeAnnotation(); - } - else { - this.temporalValueAdapter.setValue(newTemporal.convertToJavaAnnotationValue()); - } - break; - case JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED : - EnumType newEnumerated = (EnumType) notification.getNewValue(); - if (newEnumerated == EnumType.DEFAULT) { - this.enumeratedAnnotationAdapter.removeAnnotation(); - } - else { - this.enumeratedValueAdapter.setValue(newEnumerated.convertToJavaAnnotationValue()); - } - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_BASIC; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

- * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIBasic_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_BASIC__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType}. - * - *

- * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #setFetch(DefaultEagerFetchType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIBasic_Fetch() - * @model - * @generated - */ - public DefaultEagerFetchType getFetch() { - return fetch; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #getFetch() - * @generated - */ - public void setFetch(DefaultEagerFetchType newFetch) { - DefaultEagerFetchType oldFetch = fetch; - fetch = newFetch == null ? FETCH_EDEFAULT : newFetch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_BASIC__FETCH, oldFetch, fetch)); - } - - /** - * Returns the value of the 'Optional' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Optional' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setOptional(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIBasic_Optional() - * @model - * @generated - */ - public DefaultTrueBoolean getOptional() { - return optional; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic#getOptional Optional}' attribute. - * - * - * @param value the new value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getOptional() - * @generated - */ - public void setOptional(DefaultTrueBoolean newOptional) { - DefaultTrueBoolean oldOptional = optional; - optional = newOptional == null ? OPTIONAL_EDEFAULT : newOptional; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL, oldOptional, optional)); - } - - /** - * Returns the value of the 'Lob' attribute. - * - *

- * If the meaning of the 'Lob' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Lob' attribute. - * @see #setLob(boolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIBasic_Lob() - * @model - * @generated - */ - public boolean isLob() { - return lob; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic#isLob Lob}' attribute. - * - * - * @param value the new value of the 'Lob' attribute. - * @see #isLob() - * @generated - */ - public void setLob(boolean newLob) { - boolean oldLob = lob; - lob = newLob; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_BASIC__LOB, oldLob, lob)); - } - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

- * If the meaning of the 'Temporal' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIBasic_Temporal() - * @model - * @generated - */ - public TemporalType getTemporal() { - return temporal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.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, JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL, oldTemporal, temporal)); - } - - /** - * Returns the value of the 'Enumerated' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.EnumType}. - * - *

- * If the meaning of the 'Enumerated' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Enumerated' attribute. - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see #setEnumerated(EnumType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIBasic_Enumerated() - * @model - * @generated - */ - public EnumType getEnumerated() { - return enumerated; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic#getEnumerated Enumerated}' attribute. - * - * - * @param value the new value of the 'Enumerated' attribute. - * @see org.eclipse.jpt.core.internal.mappings.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, JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED, oldEnumerated, enumerated)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_BASIC__COLUMN : - return basicSetColumn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_BASIC__FETCH : - return getFetch(); - case JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL : - return getOptional(); - case JpaJavaMappingsPackage.JAVA_BASIC__COLUMN : - return getColumn(); - case JpaJavaMappingsPackage.JAVA_BASIC__LOB : - return isLob() ? Boolean.TRUE : Boolean.FALSE; - case JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL : - return getTemporal(); - case JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED : - return getEnumerated(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_BASIC__FETCH : - setFetch((DefaultEagerFetchType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL : - setOptional((DefaultTrueBoolean) newValue); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__LOB : - setLob(((Boolean) newValue).booleanValue()); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL : - setTemporal((TemporalType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED : - setEnumerated((EnumType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_BASIC__FETCH : - setFetch(FETCH_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL : - setOptional(OPTIONAL_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__LOB : - setLob(LOB_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL : - setTemporal(TEMPORAL_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED : - setEnumerated(ENUMERATED_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_BASIC__FETCH : - return fetch != FETCH_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL : - return optional != OPTIONAL_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_BASIC__COLUMN : - return column != null; - case JpaJavaMappingsPackage.JAVA_BASIC__LOB : - return lob != LOB_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL : - return temporal != TEMPORAL_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED : - return enumerated != ENUMERATED_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IBasic.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_BASIC__FETCH : - return JpaCoreMappingsPackage.IBASIC__FETCH; - case JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL : - return JpaCoreMappingsPackage.IBASIC__OPTIONAL; - case JpaJavaMappingsPackage.JAVA_BASIC__COLUMN : - return JpaCoreMappingsPackage.IBASIC__COLUMN; - case JpaJavaMappingsPackage.JAVA_BASIC__LOB : - return JpaCoreMappingsPackage.IBASIC__LOB; - case JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL : - return JpaCoreMappingsPackage.IBASIC__TEMPORAL; - case JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED : - return JpaCoreMappingsPackage.IBASIC__ENUMERATED; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IBasic.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IBASIC__FETCH : - return JpaJavaMappingsPackage.JAVA_BASIC__FETCH; - case JpaCoreMappingsPackage.IBASIC__OPTIONAL : - return JpaJavaMappingsPackage.JAVA_BASIC__OPTIONAL; - case JpaCoreMappingsPackage.IBASIC__COLUMN : - return JpaJavaMappingsPackage.JAVA_BASIC__COLUMN; - case JpaCoreMappingsPackage.IBASIC__LOB : - return JpaJavaMappingsPackage.JAVA_BASIC__LOB; - case JpaCoreMappingsPackage.IBASIC__TEMPORAL : - return JpaJavaMappingsPackage.JAVA_BASIC__TEMPORAL; - case JpaCoreMappingsPackage.IBASIC__ENUMERATED : - return JpaJavaMappingsPackage.JAVA_BASIC__ENUMERATED; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fetch: "); - result.append(fetch); - result.append(", optional: "); - result.append(optional); - result.append(", lob: "); - result.append(lob); - result.append(", temporal: "); - result.append(temporal); - result.append(", enumerated: "); - result.append(enumerated); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.setOptional(DefaultTrueBoolean.fromJavaAnnotationValue(this.optionalAdapter.getValue(astRoot))); - this.setFetch(DefaultEagerFetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot))); - this.getJavaColumn().updateFromJava(astRoot); - this.setLob(this.lobAdapter.getValue(astRoot)); - this.updateTemporalFromJava(astRoot); - this.updateEnumeratedFromJava(astRoot); - } - - private JavaColumn getJavaColumn() { - return (JavaColumn) this.column; - } - - /* - * The @Temporal annotation is a bit different than most JPA annotations. - * For some indecipherable reason it has no default value (e.g. TIMESTAMP). - * Also, it is *required* for any attribute declared with a type of - * java.util.Date or java.util.Calendar; otherwise, it is *prohibited*. - * As a result we allow a Basic mapping to have a null 'temporal', - * indicating that the annotation is completely missing, as opposed - * to the annotation being present but its value is invalid (e.g. - * @Temporal(FRIDAY)). - * - * TODO this comment is wrong now, revisit this with Brian at some point - */ - private void updateTemporalFromJava(CompilationUnit astRoot) { - if (this.temporalAnnotationAdapter.getAnnotation(astRoot) == null) { - this.setTemporal(TemporalType.NULL); - } - else { - this.setTemporal(TemporalType.fromJavaAnnotationValue(this.temporalValueAdapter.getValue(astRoot))); - } - } - - private void updateEnumeratedFromJava(CompilationUnit astRoot) { - if (this.enumeratedAnnotationAdapter.getAnnotation(astRoot) == null) { - this.setEnumerated(EnumType.DEFAULT); - } - else { - this.setEnumerated(EnumType.fromJavaAnnotationValue(this.enumeratedValueAdapter.getValue(astRoot))); - } - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildOptionalAdapter() { - return new ConversionDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__OPTIONAL, false, BooleanStringExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter buildFetchAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__FETCH, false); - } - - /** - * From the JPA spec, when the basic mapping applies: - * If the type of the attribute (field or property) is one of the following - * it must be mapped as @Basic: - * primitive types - * byte[] - * Byte[] - * char[] - * Character[] - * primitive wrappers - * java.lang.String - * java.math.BigInteger - * java.math.BigDecimal - * java.util.Date - * java.util.Calendar - * java.sql.Date - * java.sql.Time - * java.sql.Timestamp - * enums - * any other type that implements java.io.Serializable - */ - public static boolean signatureIsBasic(String signature, IType scope) { - if (JDTTools.signatureIsPrimitive(signature)) { - return true; - } - int arrayCount = Signature.getArrayCount(signature); - if (arrayCount > 1) { - return false; // multi-dimensional arrays are not supported - } - signature = Signature.getElementType(signature); - String typeName = JDTTools.resolveSignature(signature, scope); - if (typeName == null) { - return false; // unable to resolve the type - } - if (arrayCount == 1) { - return elementTypeIsValid(typeName); - } - if (typeIsPrimitiveWrapper(typeName)) { - return true; - } - if (typeIsOtherSupportedType(typeName)) { - return true; - } - IType type = findType(scope.getCompilationUnit().getJavaProject(), typeName); - if (type == null) { - return false; // type not found - } - if (typeIsEnum(type)) { - return true; - } - if (typeImplementsSerializable(type)) { - return true; - } - return false; - } - - private static IType findType(IJavaProject javaProject, String typeName) { - try { - return javaProject.findType(typeName); - } - catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Return whether the specified type is a valid element type for - * a one-dimensional array: - * byte - * char - * java.lang.Byte - * java.lang.Character - */ - private static boolean elementTypeIsValid(String elementTypeName) { - return CollectionTools.contains(VALID_ELEMENT_TYPE_NAMES, elementTypeName); - } - - private static final String[] VALID_ELEMENT_TYPE_NAMES = { - byte.class.getName(), - char.class.getName(), - java.lang.Byte.class.getName(), - java.lang.Character.class.getName() - }; - - /** - * Return whether the specified type is a primitive wrapper. - */ - private static boolean typeIsPrimitiveWrapper(String typeName) { - return CollectionTools.contains(PRIMITIVE_WRAPPER_TYPE_NAMES, typeName); - } - - private static final String[] PRIMITIVE_WRAPPER_TYPE_NAMES = { - java.lang.Byte.class.getName(), - java.lang.Character.class.getName(), - java.lang.Double.class.getName(), - java.lang.Float.class.getName(), - java.lang.Integer.class.getName(), - java.lang.Long.class.getName(), - java.lang.Short.class.getName(), - java.lang.Boolean.class.getName(), - }; - - /** - * Return whether the specified type is among the various other types - * that default to a Basic mapping. - */ - private static boolean typeIsOtherSupportedType(String typeName) { - return CollectionTools.contains(OTHER_SUPPORTED_TYPE_NAMES, typeName); - } - - private static final String[] OTHER_SUPPORTED_TYPE_NAMES = { - java.lang.String.class.getName(), - java.math.BigInteger.class.getName(), - java.math.BigDecimal.class.getName(), - java.util.Date.class.getName(), - java.util.Calendar.class.getName(), - java.sql.Date.class.getName(), - java.sql.Time.class.getName(), - java.sql.Timestamp.class.getName(), - }; - - /** - * Return whether the specified type is an enum. - */ - private static boolean typeIsEnum(IType type) { - try { - return type.isEnum(); - } - catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Return whether the specified type implements java.io.Serializable. - */ - // TODO should we be using IType.getSuperInterfaceTypeSignatures() instead? - // would this be less of a performance hog?? - private static boolean typeImplementsSerializable(IType type) { - ITypeHierarchy hierarchy = typeHierarchy(type); - IType[] interfaces = hierarchy.getAllSuperInterfaces(type); - for (int i = interfaces.length; i-- > 0;) { - if (interfaces[i].getFullyQualifiedName().equals(SERIALIZABLE_TYPE_NAME)) { - return true; - } - } - return false; - } - - private static final String SERIALIZABLE_TYPE_NAME = java.io.Serializable.class.getName(); - - private static ITypeHierarchy typeHierarchy(IType type) { - // TODO hmm... what to do about the working copy, probably shouldn't pass in null; - // also, this looks like a performance hog, other ways to do this? - try { - return type.newSupertypeHierarchy((WorkingCopyOwner) null, null); - } - catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - @Override - public boolean isOverridableAttributeMapping() { - return true; - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - result = this.getJavaColumn().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - return null; - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildTemporalValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(TEMPORAL_ADAPTER, JPA.TEMPORAL__VALUE, false); - } - - private static DeclarationAnnotationElementAdapter buildEnumeratedValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(ENUMERATED_ADAPTER, JPA.ENUMERATED__VALUE, false); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasicProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasicProvider.java deleted file mode 100644 index e08673bf43..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasicProvider.java +++ /dev/null @@ -1,228 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.core.WorkingCopyOwner; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.CollectionTools; - -/** - * - */ -public class JavaBasicProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaBasicProvider INSTANCE = new JavaBasicProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaBasicProvider() { - super(); - } - - public String key() { - return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return signatureIsBasic(attribute.typeSignature(), attribute.getDeclaringType().getJdtMember()); - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaBasic(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaBasic.DECLARATION_ANNOTATION_ADAPTER; - } - - // ********** static methods ********** - - /** - * From the JPA spec, when the basic mapping applies: - * If the type of the attribute (field or property) is one of the following - * it must be mapped as @Basic: - * primitive types - * byte[] - * Byte[] - * char[] - * Character[] - * primitive wrappers - * java.lang.String - * java.math.BigInteger - * java.math.BigDecimal - * java.util.Date - * java.util.Calendar - * java.sql.Date - * java.sql.Time - * java.sql.Timestamp - * enums - * any other type that implements java.io.Serializable - */ - public static boolean signatureIsBasic(String signature, IType scope) { - if (JDTTools.signatureIsPrimitive(signature)) { - return true; - } - int arrayCount = Signature.getArrayCount(signature); - if (arrayCount > 1) { - return false; // multi-dimensional arrays are not supported - } - signature = Signature.getElementType(signature); - String typeName = JDTTools.resolveSignature(signature, scope); - if (typeName == null) { - return false; // unable to resolve the type - } - if (arrayCount == 1) { - return elementTypeIsValid(typeName); - } - if (typeIsPrimitiveWrapper(typeName)) { - return true; - } - if (typeIsOtherSupportedType(typeName)) { - return true; - } - IType type = findType(scope.getCompilationUnit().getJavaProject(), typeName); - if (type == null) { - return false; // type not found - } - if (typeIsEnum(type)) { - return true; - } - if (typeImplementsSerializable(type)) { - return true; - } - return false; - } - - private static IType findType(IJavaProject javaProject, String typeName) { - try { - return javaProject.findType(typeName); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Return whether the specified type is a valid element type for - * a one-dimensional array: - * byte - * char - * java.lang.Byte - * java.lang.Character - */ - private static boolean elementTypeIsValid(String elementTypeName) { - return CollectionTools.contains(VALID_ELEMENT_TYPE_NAMES, elementTypeName); - } - - private static final String[] VALID_ELEMENT_TYPE_NAMES = { - byte.class.getName(), - char.class.getName(), - java.lang.Byte.class.getName(), - java.lang.Character.class.getName() - }; - - /** - * Return whether the specified type is a primitive wrapper. - */ - private static boolean typeIsPrimitiveWrapper(String typeName) { - return CollectionTools.contains(PRIMITIVE_WRAPPER_TYPE_NAMES, typeName); - } - - private static final String[] PRIMITIVE_WRAPPER_TYPE_NAMES = { - java.lang.Byte.class.getName(), - java.lang.Character.class.getName(), - java.lang.Double.class.getName(), - java.lang.Float.class.getName(), - java.lang.Integer.class.getName(), - java.lang.Long.class.getName(), - java.lang.Short.class.getName(), - java.lang.Boolean.class.getName(), - }; - - /** - * Return whether the specified type is among the various other types - * that default to a Basic mapping. - */ - private static boolean typeIsOtherSupportedType(String typeName) { - return CollectionTools.contains(OTHER_SUPPORTED_TYPE_NAMES, typeName); - } - - private static final String[] OTHER_SUPPORTED_TYPE_NAMES = { - java.lang.String.class.getName(), - java.math.BigInteger.class.getName(), - java.math.BigDecimal.class.getName(), - java.util.Date.class.getName(), - java.util.Calendar.class.getName(), - java.sql.Date.class.getName(), - java.sql.Time.class.getName(), - java.sql.Timestamp.class.getName(), - }; - - /** - * Return whether the specified type is an enum. - */ - private static boolean typeIsEnum(IType type) { - try { - return type.isEnum(); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Return whether the specified type implements java.io.Serializable. - */ - // TODO should we be using IType.getSuperInterfaceTypeSignatures() instead? - // would this be less of a performance hog?? - private static boolean typeImplementsSerializable(IType type) { - ITypeHierarchy hierarchy = typeHierarchy(type); - IType[] interfaces = hierarchy.getAllSuperInterfaces(type); - for (int i = interfaces.length; i-- > 0; ) { - if (interfaces[i].getFullyQualifiedName().equals(SERIALIZABLE_TYPE_NAME)) { - return true; - } - } - return false; - } - - private static final String SERIALIZABLE_TYPE_NAME = java.io.Serializable.class.getName(); - - private static ITypeHierarchy typeHierarchy(IType type) { - // TODO hmm... what to do about the working copy, probably shouldn't pass in null; - // also, this looks like a performance hog, other ways to do this? - try { - return type.newSupertypeHierarchy((WorkingCopyOwner) null, null); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java deleted file mode 100644 index d5998f5f61..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java +++ /dev/null @@ -1,583 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitArrayAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.CascadeType; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.CollectionTools; - -/** - * - * A representation of the model object 'Java Cascade'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade() - * @model kind="class" - * @generated - */ -public class JavaCascade extends JavaEObject implements ICascade -{ - /** - * The default value of the '{@link #isAll() All}' attribute. - * - * - * @see #isAll() - * @generated - * @ordered - */ - protected static final boolean ALL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isAll() All}' attribute. - * - * - * @see #isAll() - * @generated - * @ordered - */ - protected boolean all = ALL_EDEFAULT; - - /** - * The default value of the '{@link #isPersist() Persist}' attribute. - * - * - * @see #isPersist() - * @generated - * @ordered - */ - protected static final boolean PERSIST_EDEFAULT = false; - - /** - * The cached value of the '{@link #isPersist() Persist}' attribute. - * - * - * @see #isPersist() - * @generated - * @ordered - */ - protected boolean persist = PERSIST_EDEFAULT; - - /** - * The default value of the '{@link #isMerge() Merge}' attribute. - * - * - * @see #isMerge() - * @generated - * @ordered - */ - protected static final boolean MERGE_EDEFAULT = false; - - /** - * The cached value of the '{@link #isMerge() Merge}' attribute. - * - * - * @see #isMerge() - * @generated - * @ordered - */ - protected boolean merge = MERGE_EDEFAULT; - - /** - * The default value of the '{@link #isRemove() Remove}' attribute. - * - * - * @see #isRemove() - * @generated - * @ordered - */ - protected static final boolean REMOVE_EDEFAULT = false; - - /** - * The cached value of the '{@link #isRemove() Remove}' attribute. - * - * - * @see #isRemove() - * @generated - * @ordered - */ - protected boolean remove = REMOVE_EDEFAULT; - - /** - * The default value of the '{@link #isRefresh() Refresh}' attribute. - * - * - * @see #isRefresh() - * @generated - * @ordered - */ - protected static final boolean REFRESH_EDEFAULT = false; - - /** - * The cached value of the '{@link #isRefresh() Refresh}' attribute. - * - * - * @see #isRefresh() - * @generated - * @ordered - */ - protected boolean refresh = REFRESH_EDEFAULT; - - /** - * - * - * @generated - */ - protected JavaCascade() { - super(); - } - - private Attribute attribute; - - private AnnotationElementAdapter cascadeAdapter; - - private DeclarationAnnotationElementAdapter cascadeDeclarationAdapter; - - protected JavaCascade(Attribute attribute, DeclarationAnnotationElementAdapter cascadeAdapter) { - super(); - this.attribute = attribute; - this.cascadeDeclarationAdapter = cascadeAdapter; - this.cascadeAdapter = new ShortCircuitArrayAnnotationElementAdapter(this.attribute, cascadeAdapter); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(ICascade.class)) { - case JpaJavaMappingsPackage.JAVA_CASCADE__ALL : - updateJavaAnnotation(isAll(), CascadeType.ALL); - break; - case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE : - updateJavaAnnotation(isMerge(), CascadeType.MERGE); - break; - case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST : - updateJavaAnnotation(isPersist(), CascadeType.PERSIST); - break; - case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE : - updateJavaAnnotation(isRemove(), CascadeType.REMOVE); - break; - case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH : - updateJavaAnnotation(isRefresh(), CascadeType.REFRESH); - break; - default : - break; - } - } - - private void updateJavaAnnotation(boolean isSet, CascadeType cascadeType) { - String[] javaValue = this.cascadeAdapter.getValue(); - CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue); - List cascadeCollection = CollectionTools.list(cascadeTypes); - if (cascadeCollection.contains(cascadeType)) { - if (!isSet) { - if (javaValue.length == 1) { - this.cascadeAdapter.setValue(null); - } - else { - cascadeCollection.remove(cascadeType); - String[] newJavaValue = CascadeType.toJavaAnnotationValue(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()])); - this.cascadeAdapter.setValue(newJavaValue); - } - } - } - else { - if (isSet) { - cascadeCollection.add(cascadeType); - String[] newJavaValue = CascadeType.toJavaAnnotationValue(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()])); - this.cascadeAdapter.setValue(newJavaValue); - } - } - } - - protected AnnotationElementAdapter getCascadeAdapter() { - return this.cascadeAdapter; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_CASCADE; - } - - /** - * Returns the value of the 'All' attribute. - * - *

- * If the meaning of the 'All' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'All' attribute. - * @see #setAll(boolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_All() - * @model - * @generated - */ - public boolean isAll() { - return all; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isAll All}' attribute. - * - * - * @param value the new value of the 'All' attribute. - * @see #isAll() - * @generated - */ - public void setAll(boolean newAll) { - boolean oldAll = all; - all = newAll; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__ALL, oldAll, all)); - } - - /** - * Returns the value of the 'Persist' attribute. - * - *

- * If the meaning of the 'Persist' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persist' attribute. - * @see #setPersist(boolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Persist() - * @model - * @generated - */ - public boolean isPersist() { - return persist; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isPersist Persist}' attribute. - * - * - * @param value the new value of the 'Persist' attribute. - * @see #isPersist() - * @generated - */ - public void setPersist(boolean newPersist) { - boolean oldPersist = persist; - persist = newPersist; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST, oldPersist, persist)); - } - - /** - * Returns the value of the 'Merge' attribute. - * - *

- * If the meaning of the 'Merge' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Merge' attribute. - * @see #setMerge(boolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Merge() - * @model - * @generated - */ - public boolean isMerge() { - return merge; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isMerge Merge}' attribute. - * - * - * @param value the new value of the 'Merge' attribute. - * @see #isMerge() - * @generated - */ - public void setMerge(boolean newMerge) { - boolean oldMerge = merge; - merge = newMerge; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__MERGE, oldMerge, merge)); - } - - /** - * Returns the value of the 'Remove' attribute. - * - *

- * If the meaning of the 'Remove' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Remove' attribute. - * @see #setRemove(boolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Remove() - * @model - * @generated - */ - public boolean isRemove() { - return remove; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isRemove Remove}' attribute. - * - * - * @param value the new value of the 'Remove' attribute. - * @see #isRemove() - * @generated - */ - public void setRemove(boolean newRemove) { - boolean oldRemove = remove; - remove = newRemove; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE, oldRemove, remove)); - } - - /** - * Returns the value of the 'Refresh' attribute. - * - *

- * If the meaning of the 'Refresh' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Refresh' attribute. - * @see #setRefresh(boolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Refresh() - * @model - * @generated - */ - public boolean isRefresh() { - return refresh; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isRefresh Refresh}' attribute. - * - * - * @param value the new value of the 'Refresh' attribute. - * @see #isRefresh() - * @generated - */ - public void setRefresh(boolean newRefresh) { - boolean oldRefresh = refresh; - refresh = newRefresh; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH, oldRefresh, refresh)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_CASCADE__ALL : - return isAll() ? Boolean.TRUE : Boolean.FALSE; - case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST : - return isPersist() ? Boolean.TRUE : Boolean.FALSE; - case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE : - return isMerge() ? Boolean.TRUE : Boolean.FALSE; - case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE : - return isRemove() ? Boolean.TRUE : Boolean.FALSE; - case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH : - return isRefresh() ? Boolean.TRUE : Boolean.FALSE; - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_CASCADE__ALL : - setAll(((Boolean) newValue).booleanValue()); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST : - setPersist(((Boolean) newValue).booleanValue()); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE : - setMerge(((Boolean) newValue).booleanValue()); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE : - setRemove(((Boolean) newValue).booleanValue()); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH : - setRefresh(((Boolean) newValue).booleanValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_CASCADE__ALL : - setAll(ALL_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST : - setPersist(PERSIST_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE : - setMerge(MERGE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE : - setRemove(REMOVE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH : - setRefresh(REFRESH_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_CASCADE__ALL : - return all != ALL_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST : - return persist != PERSIST_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE : - return merge != MERGE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE : - return remove != REMOVE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH : - return refresh != REFRESH_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ICascade.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_CASCADE__ALL : - return JpaCoreMappingsPackage.ICASCADE__ALL; - case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST : - return JpaCoreMappingsPackage.ICASCADE__PERSIST; - case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE : - return JpaCoreMappingsPackage.ICASCADE__MERGE; - case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE : - return JpaCoreMappingsPackage.ICASCADE__REMOVE; - case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH : - return JpaCoreMappingsPackage.ICASCADE__REFRESH; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ICascade.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ICASCADE__ALL : - return JpaJavaMappingsPackage.JAVA_CASCADE__ALL; - case JpaCoreMappingsPackage.ICASCADE__PERSIST : - return JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST; - case JpaCoreMappingsPackage.ICASCADE__MERGE : - return JpaJavaMappingsPackage.JAVA_CASCADE__MERGE; - case JpaCoreMappingsPackage.ICASCADE__REMOVE : - return JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE; - case JpaCoreMappingsPackage.ICASCADE__REFRESH : - return JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (all: "); - result.append(all); - result.append(", persist: "); - result.append(persist); - result.append(", merge: "); - result.append(merge); - result.append(", remove: "); - result.append(remove); - result.append(", refresh: "); - result.append(refresh); - result.append(')'); - return result.toString(); - } - - public Attribute getAttribute() { - return this.attribute; - } - - public ITextRange validationTextRange() { - return getAttribute().annotationElementTextRange(this.cascadeDeclarationAdapter); - } - - public void updateFromJava(CompilationUnit astRoot) { - String[] javaValue = this.cascadeAdapter.getValue(astRoot); - CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue); - Collection cascadeCollection = CollectionTools.collection(cascadeTypes); - setAll(cascadeCollection.contains(CascadeType.ALL)); - setPersist(cascadeCollection.contains(CascadeType.PERSIST)); - setMerge(cascadeCollection.contains(CascadeType.MERGE)); - setRemove(cascadeCollection.contains(CascadeType.REMOVE)); - setRefresh(cascadeCollection.contains(CascadeType.REFRESH)); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java deleted file mode 100644 index 6fd3bdb728..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java +++ /dev/null @@ -1,453 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.NestedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - * A representation of the model object 'Java Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaColumn() - * @model kind="class" - * @generated - */ -public class JavaColumn extends AbstractJavaColumn implements IColumn -{ - /** - * The default value of the '{@link #getLength() Length}' attribute. - * - * - * @see #getLength() - * @generated - * @ordered - */ - protected static final int LENGTH_EDEFAULT = 255; - - /** - * The cached value of the '{@link #getLength() Length}' attribute. - * - * - * @see #getLength() - * @generated - * @ordered - */ - protected int length = LENGTH_EDEFAULT; - - /** - * The default value of the '{@link #getPrecision() Precision}' attribute. - * - * - * @see #getPrecision() - * @generated - * @ordered - */ - protected static final int PRECISION_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getPrecision() Precision}' attribute. - * - * - * @see #getPrecision() - * @generated - * @ordered - */ - protected int precision = PRECISION_EDEFAULT; - - /** - * The default value of the '{@link #getScale() Scale}' attribute. - * - * - * @see #getScale() - * @generated - * @ordered - */ - protected static final int SCALE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getScale() Scale}' attribute. - * - * - * @see #getScale() - * @generated - * @ordered - */ - protected int scale = SCALE_EDEFAULT; - - private final IntAnnotationElementAdapter lengthAdapter; - - private final IntAnnotationElementAdapter precisionAdapter; - - private final IntAnnotationElementAdapter scaleAdapter; - - // this adapter is only used by a Column annotation associated with a mapping annotation (e.g. Basic) - public static final SimpleDeclarationAnnotationAdapter MAPPING_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.COLUMN); - - protected JavaColumn() { - super(); - throw new UnsupportedOperationException("Use JavaColumn(Owner, Member, DeclarationAnnotationAdapter) instead"); - } - - protected JavaColumn(Owner owner, Member member, DeclarationAnnotationAdapter daa) { - super(owner, member, daa); - this.lengthAdapter = this.buildShortCircuitIntElementAdapter(JPA.COLUMN__LENGTH); - this.precisionAdapter = this.buildShortCircuitIntElementAdapter(JPA.COLUMN__PRECISION); - this.scaleAdapter = this.buildShortCircuitIntElementAdapter(JPA.COLUMN__SCALE); - } - - @Override - protected String nameElementName() { - return JPA.COLUMN__NAME; - } - - @Override - protected String columnDefinitionElementName() { - return JPA.COLUMN__COLUMN_DEFINITION; - } - - @Override - protected String tableElementName() { - return JPA.COLUMN__TABLE; - } - - @Override - protected String uniqueElementName() { - return JPA.COLUMN__UNIQUE; - } - - @Override - protected String nullableElementName() { - return JPA.COLUMN__NULLABLE; - } - - @Override - protected String insertableElementName() { - return JPA.COLUMN__INSERTABLE; - } - - @Override - protected String updatableElementName() { - return JPA.COLUMN__UPDATABLE; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IColumn.class)) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - this.lengthAdapter.setValue(notification.getNewIntValue()); - break; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - this.precisionAdapter.setValue(notification.getNewIntValue()); - break; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - this.scaleAdapter.setValue(notification.getNewIntValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_COLUMN; - } - - /** - * Returns the value of the 'Length' attribute. - * The default value is "255". - * - *

- * If the meaning of the 'Length' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Length' attribute. - * @see #setLength(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_Length() - * @model default="255" - * @generated - */ - public int getLength() { - return length; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getLength Length}' attribute. - * - * - * @param value the new value of the 'Length' attribute. - * @see #getLength() - * @generated - */ - public void setLength(int newLength) { - int oldLength = length; - length = newLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH, oldLength, length)); - } - - /** - * Returns the value of the 'Precision' attribute. - * - *

- * If the meaning of the 'Precision' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Precision' attribute. - * @see #setPrecision(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_Precision() - * @model - * @generated - */ - public int getPrecision() { - return precision; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getPrecision Precision}' attribute. - * - * - * @param value the new value of the 'Precision' attribute. - * @see #getPrecision() - * @generated - */ - public void setPrecision(int newPrecision) { - int oldPrecision = precision; - precision = newPrecision; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION, oldPrecision, precision)); - } - - /** - * Returns the value of the 'Scale' attribute. - * - *

- * If the meaning of the 'Scale' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Scale' attribute. - * @see #setScale(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_Scale() - * @model - * @generated - */ - public int getScale() { - return scale; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getScale Scale}' attribute. - * - * - * @param value the new value of the 'Scale' attribute. - * @see #getScale() - * @generated - */ - public void setScale(int newScale) { - int oldScale = scale; - scale = newScale; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__SCALE, oldScale, scale)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - return new Integer(getLength()); - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - return new Integer(getPrecision()); - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - return new Integer(getScale()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - setLength(((Integer) newValue).intValue()); - return; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - setPrecision(((Integer) newValue).intValue()); - return; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - setScale(((Integer) newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - setLength(LENGTH_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - setPrecision(PRECISION_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - setScale(SCALE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - return length != LENGTH_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - return precision != PRECISION_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - return scale != SCALE_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumn.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - return JpaCoreMappingsPackage.ICOLUMN__LENGTH; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - return JpaCoreMappingsPackage.ICOLUMN__PRECISION; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - return JpaCoreMappingsPackage.ICOLUMN__SCALE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ICOLUMN__LENGTH : - return JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH; - case JpaCoreMappingsPackage.ICOLUMN__PRECISION : - return JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION; - case JpaCoreMappingsPackage.ICOLUMN__SCALE : - return JpaJavaMappingsPackage.JAVA_COLUMN__SCALE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (length: "); - result.append(length); - result.append(", precision: "); - result.append(precision); - result.append(", scale: "); - result.append(scale); - result.append(')'); - return result.toString(); - } - - @Override - public boolean tableIsAllowed() { - return true; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.setLength(this.lengthAdapter.getValue(astRoot)); - this.setPrecision(this.precisionAdapter.getValue(astRoot)); - this.setScale(this.scaleAdapter.getValue(astRoot)); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.setDefaultTable((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_COLUMN_TABLE_KEY)); - this.setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)); - } - - // ********** static methods ********** - static JavaColumn createColumnMappingColumn(Owner owner, Member member) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaColumn(owner, member, MAPPING_DECLARATION_ANNOTATION_ADAPTER); - } - - static JavaColumn createAttributeOverrideColumn(Owner owner, Member member, DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaColumn(owner, member, buildAttributeOverrideAnnotationAdapter(attributeOverrideAnnotationAdapter)); - } - - private static DeclarationAnnotationAdapter buildAttributeOverrideAnnotationAdapter(DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) { - return new NestedDeclarationAnnotationAdapter(attributeOverrideAnnotationAdapter, JPA.ATTRIBUTE_OVERRIDE__COLUMN, JPA.COLUMN); - } -} // JavaColumn diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaDiscriminatorColumn.java deleted file mode 100644 index e1735f7ae3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaDiscriminatorColumn.java +++ /dev/null @@ -1,451 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.DiscriminatorType; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Discriminator Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaDiscriminatorColumn() - * @model kind="class" - * @generated - */ -public class JavaDiscriminatorColumn extends JavaNamedColumn - implements IDiscriminatorColumn -{ - private AnnotationElementAdapter discriminatorTypeAdapter; - - private IntAnnotationElementAdapter lengthAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.DISCRIMINATOR_COLUMN); - - private static final DeclarationAnnotationElementAdapter DISCRIMINATOR_TYPE_ADAPTER = buildDiscriminatorTypeAdapter(); - - /** - * The default value of the '{@link #getDiscriminatorType() Discriminator Type}' attribute. - * - * - * @see #getDiscriminatorType() - * @generated - * @ordered - */ - protected static final DiscriminatorType DISCRIMINATOR_TYPE_EDEFAULT = DiscriminatorType.DEFAULT; - - /** - * The cached value of the '{@link #getDiscriminatorType() Discriminator Type}' attribute. - * - * - * @see #getDiscriminatorType() - * @generated - * @ordered - */ - protected DiscriminatorType discriminatorType = DISCRIMINATOR_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultLength() Default Length}' attribute. - * - * - * @see #getDefaultLength() - * @generated - * @ordered - */ - protected static final int DEFAULT_LENGTH_EDEFAULT = 31; - - /** - * The cached value of the '{@link #getDefaultLength() Default Length}' attribute. - * - * - * @see #getDefaultLength() - * @generated - * @ordered - */ - protected int defaultLength = DEFAULT_LENGTH_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedLength() Specified Length}' attribute. - * - * - * @see #getSpecifiedLength() - * @generated - * @ordered - */ - protected static final int SPECIFIED_LENGTH_EDEFAULT = -1; - - /** - * The cached value of the '{@link #getSpecifiedLength() Specified Length}' attribute. - * - * - * @see #getSpecifiedLength() - * @generated - * @ordered - */ - protected int specifiedLength = SPECIFIED_LENGTH_EDEFAULT; - - /** - * The default value of the '{@link #getLength() Length}' attribute. - * - * - * @see #getLength() - * @generated - * @ordered - */ - protected static final int LENGTH_EDEFAULT = 0; - - protected JavaDiscriminatorColumn() { - throw new UnsupportedOperationException(); - } - - protected JavaDiscriminatorColumn(INamedColumn.Owner owner, Type type, DeclarationAnnotationAdapter daa) { - super(owner, type, daa); - this.discriminatorTypeAdapter = this.buildShortCircuitElementAdapter(DISCRIMINATOR_TYPE_ADAPTER); - this.lengthAdapter = this.buildShortCircuitIntElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH); - } - - @Override - protected String nameElementName() { - return JPA.DISCRIMINATOR_COLUMN__NAME; - } - - @Override - protected String columnDefinitionElementName() { - return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IDiscriminatorColumn.class)) { - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - this.discriminatorTypeAdapter.setValue(((DiscriminatorType) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - this.lengthAdapter.setValue(notification.getNewIntValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_DISCRIMINATOR_COLUMN; - } - - /** - * Returns the value of the 'Discriminator Type' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType}. - * - *

- * If the meaning of the 'Discriminator Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Discriminator Type' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see #setDiscriminatorType(DiscriminatorType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIDiscriminatorColumn_DiscriminatorType() - * @model - * @generated - */ - public DiscriminatorType getDiscriminatorType() { - return discriminatorType; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn#getDiscriminatorType Discriminator Type}' attribute. - * - * - * @param value the new value of the 'Discriminator Type' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see #getDiscriminatorType() - * @generated - */ - public void setDiscriminatorType(DiscriminatorType newDiscriminatorType) { - DiscriminatorType oldDiscriminatorType = discriminatorType; - discriminatorType = newDiscriminatorType == null ? DISCRIMINATOR_TYPE_EDEFAULT : newDiscriminatorType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, oldDiscriminatorType, discriminatorType)); - } - - /** - * Returns the value of the 'Default Length' attribute. - * The default value is "31". - * - *

- * If the meaning of the 'Default Length' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Length' attribute. - * @see #setDefaultLength(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIDiscriminatorColumn_DefaultLength() - * @model default="31" - * @generated - */ - public int getDefaultLength() { - return defaultLength; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn#getDefaultLength Default Length}' attribute. - * - * - * @param value the new value of the 'Default Length' attribute. - * @see #getDefaultLength() - * @generated - */ - public void setDefaultLength(int newDefaultLength) { - int oldDefaultLength = defaultLength; - defaultLength = newDefaultLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH, oldDefaultLength, defaultLength)); - } - - /** - * Returns the value of the 'Specified Length' attribute. - * The default value is "-1". - * - *

- * If the meaning of the 'Specified Length' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Length' attribute. - * @see #setSpecifiedLength(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIDiscriminatorColumn_SpecifiedLength() - * @model default="-1" - * @generated - */ - public int getSpecifiedLength() { - return specifiedLength; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn#getSpecifiedLength Specified Length}' attribute. - * - * - * @param value the new value of the 'Specified Length' attribute. - * @see #getSpecifiedLength() - * @generated - */ - public void setSpecifiedLength(int newSpecifiedLength) { - int oldSpecifiedLength = specifiedLength; - specifiedLength = newSpecifiedLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH, oldSpecifiedLength, specifiedLength)); - } - - /** - * Returns the value of the 'Length' attribute. - * - *

- * If the meaning of the 'Length' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Length' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIDiscriminatorColumn_Length() - * @model transient="true" changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public int getLength() { - return (this.getSpecifiedLength() == -1) ? this.getDefaultLength() : this.getSpecifiedLength(); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return getDiscriminatorType(); - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return new Integer(getDefaultLength()); - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return new Integer(getSpecifiedLength()); - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__LENGTH : - return new Integer(getLength()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - setDiscriminatorType((DiscriminatorType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - setDefaultLength(((Integer) newValue).intValue()); - return; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - setSpecifiedLength(((Integer) newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - setDefaultLength(DEFAULT_LENGTH_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - setSpecifiedLength(SPECIFIED_LENGTH_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return defaultLength != DEFAULT_LENGTH_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return specifiedLength != SPECIFIED_LENGTH_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__LENGTH : - return getLength() != LENGTH_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IDiscriminatorColumn.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH; - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__LENGTH : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__LENGTH; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IDiscriminatorColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH; - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH; - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__LENGTH : - return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__LENGTH; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (discriminatorType: "); - result.append(discriminatorType); - result.append(", defaultLength: "); - result.append(defaultLength); - result.append(", specifiedLength: "); - result.append(specifiedLength); - result.append(')'); - return result.toString(); - } - - @Override - protected String tableName() { - return this.getOwner().getTypeMapping().getTableName(); - } - - // ********** java annotations -> persistence model ********** - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setDiscriminatorType(DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot))); - setSpecifiedLength(this.lengthAdapter.getValue(astRoot)); - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildDiscriminatorTypeAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); - } -} // JavaDiscriminatorColumn diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddable.java deleted file mode 100644 index 08b8a3c239..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddable.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; - -/** - * - * A representation of the model object 'Java Embeddable'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbeddable() - * @model kind="class" - * @generated - */ -public class JavaEmbeddable extends JavaTypeMapping implements IEmbeddable -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.EMBEDDABLE); - - protected JavaEmbeddable() { - throw new UnsupportedOperationException("Use JavaEmbeddable(Type) instead"); - } - - protected JavaEmbeddable(Type type) { - super(type); - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_EMBEDDABLE; - } - - public String getKey() { - return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - @Override - public boolean attributeMappingKeyAllowed(String attributeMappingKey) { - return attributeMappingKey == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || attributeMappingKey == IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddableProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddableProvider.java deleted file mode 100644 index 714a815a6c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddableProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -/** - * - */ -public class JavaEmbeddableProvider - implements IJavaTypeMappingProvider -{ - - // singleton - private static final JavaEmbeddableProvider INSTANCE = new JavaEmbeddableProvider(); - - /** - * Return the singleton. - */ - public static IJavaTypeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaEmbeddableProvider() { - super(); - } - - public String key() { - return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - public IJavaTypeMapping buildMapping(Type type) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaEmbeddable(type); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaEmbeddable.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java deleted file mode 100644 index b92f7a893c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java +++ /dev/null @@ -1,577 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EObjectEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Java Embedded'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbedded() - * @model kind="class" - * @generated - */ -public class JavaEmbedded extends JavaAttributeMapping implements IEmbedded -{ - /** - * The cached value of the '{@link #getSpecifiedAttributeOverrides() Specified Attribute Overrides}' containment reference list. - * - * - * @see #getSpecifiedAttributeOverrides() - * @generated - * @ordered - */ - protected EList specifiedAttributeOverrides; - - /** - * The cached value of the '{@link #getDefaultAttributeOverrides() Default Attribute Overrides}' containment reference list. - * - * - * @see #getDefaultAttributeOverrides() - * @generated - * @ordered - */ - protected EList defaultAttributeOverrides; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.EMBEDDED); - - private IEmbeddable embeddable; - - protected JavaEmbedded() { - throw new UnsupportedOperationException("Use JavaEmbedded(Attribute) instead"); - } - - protected JavaEmbedded(Attribute attribute) { - super(attribute); - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IEntity.class)) { - case JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - attributeOverridesChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void attributeOverridesChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - attributeOverrideAdded(notification.getPosition(), (JavaAttributeOverride) notification.getNewValue()); - break; - case Notification.ADD_MANY : - attributeOverridesAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - attributeOverrideRemoved(notification.getPosition(), (JavaAttributeOverride) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - attributeOverridesCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - attributeOverridesRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - attributeOverrideSet(notification.getPosition(), (JavaAttributeOverride) notification.getOldValue(), (JavaAttributeOverride) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - attributeOverrideMoved(notification.getOldIntValue(), notification.getPosition(), (JavaAttributeOverride) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** jpa model -> java annotations ********** - /** - * slide over all the annotations that follow the new join column - */ - public void attributeOverrideAdded(int index, JavaAttributeOverride attributeOverride) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (attributeOverride.annotation(getAttribute().astRoot()) == null) { - this.synchAttributeOverrideAnnotationsAfterAdd(index + 1); - attributeOverride.newAnnotation(); - } - } - - public void attributeOverridesAdded(int index, List attributeOverrides) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!attributeOverrides.isEmpty() && (attributeOverrides.get(0).annotation(getAttribute().astRoot()) == null)) { - this.synchAttributeOverrideAnnotationsAfterAdd(index + attributeOverrides.size()); - for (JavaAttributeOverride attributeOverride : attributeOverrides) { - attributeOverride.newAnnotation(); - } - } - } - - public void attributeOverrideRemoved(int index, JavaAttributeOverride attributeOverride) { - attributeOverride.removeAnnotation(); - this.synchAttributeOverrideAnnotationsAfterRemove(index); - } - - public void attributeOverridesRemoved(int[] indexes, List attributeOverrides) { - for (JavaAttributeOverride attributeOverride : attributeOverrides) { - attributeOverride.removeAnnotation(); - } - this.synchAttributeOverrideAnnotationsAfterRemove(indexes[0]); - } - - public void attributeOverridesCleared(List attributeOverrides) { - for (JavaAttributeOverride attributeOverride : attributeOverrides) { - attributeOverride.removeAnnotation(); - } - } - - public void attributeOverrideSet(int index, JavaAttributeOverride oldAttributeOverride, JavaAttributeOverride newAttributeOverride) { - newAttributeOverride.newAnnotation(); - } - - public void attributeOverrideMoved(int sourceIndex, int targetIndex, JavaAttributeOverride attributeOverride) { - List attributeOverrides = getSpecifiedAttributeOverrides(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaAttributeOverride) attributeOverrides.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchAttributeOverrideAnnotationsAfterAdd(int index) { - List attributeOverrides = getSpecifiedAttributeOverrides(); - for (int i = attributeOverrides.size(); i-- > index;) { - this.synch((JavaAttributeOverride) attributeOverrides.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchAttributeOverrideAnnotationsAfterRemove(int index) { - List attributeOverrides = getSpecifiedAttributeOverrides(); - for (int i = index; i < attributeOverrides.size(); i++) { - this.synch((JavaAttributeOverride) attributeOverrides.get(i), i); - } - } - - private void synch(JavaAttributeOverride attributeOverride, int index) { - attributeOverride.moveAnnotation(index); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_EMBEDDED; - } - - public EList getAttributeOverrides() { - EList list = new EObjectEList(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES); - list.addAll(getSpecifiedAttributeOverrides()); - list.addAll(getDefaultAttributeOverrides()); - return list; - } - - /** - * Returns the value of the 'Specified Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

- * If the meaning of the 'Specified Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEmbedded_SpecifiedAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getSpecifiedAttributeOverrides() { - if (specifiedAttributeOverrides == null) { - specifiedAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES); - } - return specifiedAttributeOverrides; - } - - /** - * Returns the value of the 'Default Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

- * If the meaning of the 'Default Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEmbedded_DefaultAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getDefaultAttributeOverrides() { - if (defaultAttributeOverrides == null) { - defaultAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES); - } - return defaultAttributeOverrides; - } - - public IEmbeddable embeddable() { - return this.embeddable; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES : - return ((InternalEList) getAttributeOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getSpecifiedAttributeOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getDefaultAttributeOverrides()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES : - return getAttributeOverrides(); - case JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return getSpecifiedAttributeOverrides(); - case JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return getDefaultAttributeOverrides(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - getSpecifiedAttributeOverrides().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - getDefaultAttributeOverrides().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - return; - case JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES : - return !getAttributeOverrides().isEmpty(); - case JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return specifiedAttributeOverrides != null && !specifiedAttributeOverrides.isEmpty(); - case JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return defaultAttributeOverrides != null && !defaultAttributeOverrides.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IEmbedded.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IEMBEDDED__ATTRIBUTE_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IEmbedded.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IEMBEDDED__ATTRIBUTE_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - public String getKey() { - return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - refreshEmbeddable(defaultsContext); - } - - private void refreshEmbeddable(DefaultsContext defaultsContext) { - this.embeddable = embeddableFor(getAttribute(), defaultsContext); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - updateAttributeOverridesFromJava(astRoot); - } - - /** - * here we just worry about getting the attribute override lists the same size; - * then we delegate to the attribute overrides to synch themselves up - */ - private void updateAttributeOverridesFromJava(CompilationUnit astRoot) { - // synchronize the model attribute overrides with the Java source - List attributeOverrides = getSpecifiedAttributeOverrides(); - int persSize = attributeOverrides.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaAttributeOverride attributeOverride = (JavaAttributeOverride) attributeOverrides.get(i); - if (attributeOverride.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - attributeOverride.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model attribute overrides beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - attributeOverrides.remove(persSize); - } - } - else { - // add new model attribute overrides until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaAttributeOverride attributeOverride = this.createJavaAttributeOverride(javaSize); - if (attributeOverride.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedAttributeOverrides().add(attributeOverride); - attributeOverride.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - public IAttributeOverride attributeOverrideNamed(String name) { - return (IAttributeOverride) overrideNamed(name, getAttributeOverrides()); - } - - public boolean containsAttributeOverride(String name) { - return containsOverride(name, getAttributeOverrides()); - } - - public boolean containsSpecifiedAttributeOverride(String name) { - return containsOverride(name, getSpecifiedAttributeOverrides()); - } - - private IOverride overrideNamed(String name, List overrides) { - for (IOverride override : overrides) { - String overrideName = override.getName(); - if (overrideName == null && name == null) { - return override; - } - if (overrideName != null && overrideName.equals(name)) { - return override; - } - } - return null; - } - - private boolean containsOverride(String name, List overrides) { - return overrideNamed(name, overrides) != null; - } - - public Iterator allOverridableAttributeNames() { - return new TransformationIterator(this.allOverridableAttributes()) { - @Override - protected String transform(IPersistentAttribute attribute) { - return attribute.getName(); - } - }; - } - - public Iterator allOverridableAttributes() { - if (this.embeddable() == null) { - return EmptyIterator.instance(); - } - return new FilteringIterator(this.embeddable().getPersistentType().attributes()) { - @Override - protected boolean accept(Object o) { - return ((IPersistentAttribute) o).isOverridableAttribute(); - } - }; - } - - public IAttributeOverride createAttributeOverride(int index) { - return createJavaAttributeOverride(index); - } - - private JavaAttributeOverride createJavaAttributeOverride(int index) { - return JavaAttributeOverride.createAttributeOverride(new AttributeOverrideOwner(this), this.getAttribute(), index); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (IAttributeOverride override : this.getAttributeOverrides()) { - result = ((JavaAttributeOverride) override).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - //******* static methods ********* - public static IEmbeddable embeddableFor(Attribute attribute, DefaultsContext defaultsContext) { - String resolvedTypeName = attribute.resolvedTypeName(); - if (resolvedTypeName == null) { - return null; - } - IPersistentType persistentType = defaultsContext.persistentType(resolvedTypeName); - if (persistentType != null) { - if (persistentType.getMapping() instanceof IEmbeddable) { - return (IEmbeddable) persistentType.getMapping(); - } - } - return null; - } -} // JavaEmbedded diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java deleted file mode 100644 index a904f9316f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; - -/** - * - * A representation of the model object 'Java Embedded Id'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbeddedId() - * @model kind="class" - * @generated - */ -public class JavaEmbeddedId extends JavaAttributeMapping implements IEmbeddedId -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.EMBEDDED_ID); - - protected JavaEmbeddedId() { - throw new UnsupportedOperationException("Use JavaEmbeddedId(Attribute) instead"); - } - - protected JavaEmbeddedId(Attribute attribute) { - super(attribute); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_EMBEDDED_ID; - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - public String getKey() { - return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public boolean isIdMapping() { - return true; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedIdProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedIdProvider.java deleted file mode 100644 index 470cc40f0e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedIdProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaEmbeddedIdProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaEmbeddedIdProvider INSTANCE = new JavaEmbeddedIdProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaEmbeddedIdProvider() { - super(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaEmbeddedId(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaEmbeddedId.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedProvider.java deleted file mode 100644 index 6e39f23352..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedProvider.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaEmbeddedProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaEmbeddedProvider INSTANCE = new JavaEmbeddedProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaEmbeddedProvider() { - super(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return embeddableFor(attribute, defaultsContext) != null; - } - - private IEmbeddable embeddableFor(Attribute attribute, DefaultsContext defaultsContext) { - String resolvedTypeName = attribute.resolvedTypeName(); - if (resolvedTypeName == null) { - return null; - } - IPersistentType persistentType = defaultsContext.persistentType(resolvedTypeName); - if (persistentType != null && persistentType.getMappingKey() == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) { - return (IEmbeddable) persistentType.getMapping(); - } - return null; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaEmbedded(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaEmbedded.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java deleted file mode 100644 index ac151354e5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java +++ /dev/null @@ -1,3000 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EObjectEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.TypeLiteral; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.DiscriminatorType; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Java Entity'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEntity() - * @model kind="class" - * @generated - */ -public class JavaEntity extends JavaTypeMapping implements IEntity -{ - /** - * The default value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected String specifiedName = SPECIFIED_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected static final String DEFAULT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected String defaultName = DEFAULT_NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getTable() Table}' containment reference. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected ITable table; - - /** - * The cached value of the '{@link #getSpecifiedSecondaryTables() Specified Secondary Tables}' containment reference list. - * - * - * @see #getSpecifiedSecondaryTables() - * @generated - * @ordered - */ - protected EList specifiedSecondaryTables; - - /** - * The cached value of the '{@link #getSpecifiedPrimaryKeyJoinColumns() Specified Primary Key Join Columns}' containment reference list. - * - * - * @see #getSpecifiedPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedPrimaryKeyJoinColumns; - - /** - * The cached value of the '{@link #getDefaultPrimaryKeyJoinColumns() Default Primary Key Join Columns}' containment reference list. - * - * - * @see #getDefaultPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList defaultPrimaryKeyJoinColumns; - - /** - * The default value of the '{@link #getInheritanceStrategy() Inheritance Strategy}' attribute. - * - * - * @see #getInheritanceStrategy() - * @generated - * @ordered - */ - protected static final InheritanceType INHERITANCE_STRATEGY_EDEFAULT = InheritanceType.DEFAULT; - - /** - * The cached value of the '{@link #getInheritanceStrategy() Inheritance Strategy}' attribute. - * - * - * @see #getInheritanceStrategy() - * @generated - * @ordered - */ - protected InheritanceType inheritanceStrategy = INHERITANCE_STRATEGY_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultDiscriminatorValue() Default Discriminator Value}' attribute. - * - * - * @see #getDefaultDiscriminatorValue() - * @generated - * @ordered - */ - protected static final String DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultDiscriminatorValue() Default Discriminator Value}' attribute. - * - * - * @see #getDefaultDiscriminatorValue() - * @generated - * @ordered - */ - protected String defaultDiscriminatorValue = DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedDiscriminatorValue() Specified Discriminator Value}' attribute. - * - * - * @see #getSpecifiedDiscriminatorValue() - * @generated - * @ordered - */ - protected static final String SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedDiscriminatorValue() Specified Discriminator Value}' attribute. - * - * - * @see #getSpecifiedDiscriminatorValue() - * @generated - * @ordered - */ - protected String specifiedDiscriminatorValue = SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getDiscriminatorValue() Discriminator Value}' attribute. - * - * - * @see #getDiscriminatorValue() - * @generated - * @ordered - */ - protected static final String DISCRIMINATOR_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDiscriminatorColumn() Discriminator Column}' containment reference. - * - * - * @see #getDiscriminatorColumn() - * @generated - * @ordered - */ - protected IDiscriminatorColumn discriminatorColumn; - - /** - * The cached value of the '{@link #getSequenceGenerator() Sequence Generator}' containment reference. - * - * - * @see #getSequenceGenerator() - * @generated - * @ordered - */ - protected ISequenceGenerator sequenceGenerator; - - /** - * The cached value of the '{@link #getTableGenerator() Table Generator}' containment reference. - * - * - * @see #getTableGenerator() - * @generated - * @ordered - */ - protected ITableGenerator tableGenerator; - - /** - * The cached value of the '{@link #getSpecifiedAttributeOverrides() Specified Attribute Overrides}' containment reference list. - * - * - * @see #getSpecifiedAttributeOverrides() - * @generated - * @ordered - */ - protected EList specifiedAttributeOverrides; - - /** - * The cached value of the '{@link #getDefaultAttributeOverrides() Default Attribute Overrides}' containment reference list. - * - * - * @see #getDefaultAttributeOverrides() - * @generated - * @ordered - */ - protected EList defaultAttributeOverrides; - - /** - * The cached value of the '{@link #getSpecifiedAssociationOverrides() Specified Association Overrides}' containment reference list. - * - * - * @see #getSpecifiedAssociationOverrides() - * @generated - * @ordered - */ - protected EList specifiedAssociationOverrides; - - /** - * The cached value of the '{@link #getDefaultAssociationOverrides() Default Association Overrides}' containment reference list. - * - * - * @see #getDefaultAssociationOverrides() - * @generated - * @ordered - */ - protected EList defaultAssociationOverrides; - - /** - * The cached value of the '{@link #getNamedQueries() Named Queries}' containment reference list. - * - * - * @see #getNamedQueries() - * @generated - * @ordered - */ - protected EList namedQueries; - - /** - * The cached value of the '{@link #getNamedNativeQueries() Named Native Queries}' containment reference list. - * - * - * @see #getNamedNativeQueries() - * @generated - * @ordered - */ - protected EList namedNativeQueries; - - /** - * The default value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected static final String ID_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected String idClass = ID_CLASS_EDEFAULT; - - private AnnotationElementAdapter nameAdapter; - - private AnnotationElementAdapter inheritanceStrategyAdapter; - - private final AnnotationElementAdapter discriminatorValueAdapter; - - private AnnotationAdapter tableGeneratorAnnotationAdapter; - - private AnnotationAdapter sequenceGeneratorAnnotationAdapter; - - private final AnnotationAdapter idClassAnnotationAdapter; - - private final AnnotationElementAdapter idClassValueAdapter; - - public static final DeclarationAnnotationAdapter ID_CLASS_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ID_CLASS); - - private static final DeclarationAnnotationElementAdapter ID_CLASS_VALUE_ADAPTER = buildIdClassValueAdapter(); - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ENTITY); - - private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = buildNameAdapter(); - - private static final DeclarationAnnotationAdapter INHERITANCE_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.INHERITANCE); - - private static final DeclarationAnnotationElementAdapter INHERITANCE_STRATEGY_ADAPTER = buildStrategyAdapter(); - - private static final DeclarationAnnotationAdapter DISCRIMINATOR_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.DISCRIMINATOR_VALUE); - - private static final DeclarationAnnotationElementAdapter DISCRIMINATOR_VALUE_ADAPTER = buildDiscriminatorValueAdapter(); - - protected JavaEntity() { - this(null); - } - - protected JavaEntity(Type type) { - super(type); - this.table = JpaJavaMappingsFactory.eINSTANCE.createJavaTable(buildTableOwner(), getType()); - ((InternalEObject) this.table).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ENTITY__TABLE, null, null); - this.discriminatorColumn = JpaJavaMappingsFactory.eINSTANCE.createJavaDiscriminatorColumn(new IDiscriminatorColumn.Owner(this), type, JavaDiscriminatorColumn.DECLARATION_ANNOTATION_ADAPTER); - ((InternalEObject) this.discriminatorColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN, null, null); - // this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(IPrimaryKeyJoinColumnModelAdapter.DEFAULT)); - // this.eAdapters().add(this.buildListener()); - this.nameAdapter = new ShortCircuitAnnotationElementAdapter(getType(), NAME_ADAPTER); - this.inheritanceStrategyAdapter = new ShortCircuitAnnotationElementAdapter(type, INHERITANCE_STRATEGY_ADAPTER); - this.discriminatorValueAdapter = new ShortCircuitAnnotationElementAdapter(type, DISCRIMINATOR_VALUE_ADAPTER); - this.idClassAnnotationAdapter = new MemberAnnotationAdapter(this.getType(), ID_CLASS_ADAPTER); - this.idClassValueAdapter = new ShortCircuitAnnotationElementAdapter(this.getType(), ID_CLASS_VALUE_ADAPTER); - this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(0)); - this.tableGeneratorAnnotationAdapter = new MemberAnnotationAdapter(getType(), JavaTableGenerator.DECLARATION_ANNOTATION_ADAPTER); - this.sequenceGeneratorAnnotationAdapter = new MemberAnnotationAdapter(getType(), JavaSequenceGenerator.DECLARATION_ANNOTATION_ADAPTER); - } - - private ITable.Owner buildTableOwner() { - return new ITable.Owner() { - public ITextRange validationTextRange() { - return JavaEntity.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return JavaEntity.this; - } - }; - } - - @Override - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - private static DeclarationAnnotationElementAdapter buildNameAdapter() { - return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ENTITY__NAME, false); // false = do not remove annotation when empty - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IEntity.class)) { - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME : - this.nameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY : - this.inheritanceStrategyAdapter.setValue(((InheritanceType) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - this.discriminatorValueAdapter.setValue((String) notification.getNewValue()); - break; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - this.attributeOverridesChanged(notification); - break; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - this.associationOverridesChanged(notification); - break; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES : - this.secondaryTablesChanged(notification); - break; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - this.specifiedPrimaryKeyJoinColumnsChanged(notification); - break; - case JpaCoreMappingsPackage.IENTITY__NAMED_QUERIES : - this.namedQueriesChanged(notification); - break; - case JpaCoreMappingsPackage.IENTITY__NAMED_NATIVE_QUERIES : - this.namedNativeQueriesChanged(notification); - break; - case JpaCoreMappingsPackage.IENTITY__TABLE_GENERATOR : - attributeChanged(notification.getNewValue(), this.tableGeneratorAnnotationAdapter); - break; - case JpaCoreMappingsPackage.IENTITY__SEQUENCE_GENERATOR : - attributeChanged(notification.getNewValue(), this.sequenceGeneratorAnnotationAdapter); - break; - case JpaCoreMappingsPackage.IENTITY__ID_CLASS : - String newIdClass = (String) notification.getNewValue(); - if (newIdClass == null) { - this.idClassAnnotationAdapter.removeAnnotation(); - } - else { - this.idClassValueAdapter.setValue(newIdClass); - } - default : - break; - } - } - - @SuppressWarnings("unchecked") - void attributeOverridesChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - attributeOverrideAdded(notification.getPosition(), (JavaAttributeOverride) notification.getNewValue()); - break; - case Notification.ADD_MANY : - attributeOverridesAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - attributeOverrideRemoved(notification.getPosition(), (JavaAttributeOverride) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - attributeOverridesCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - attributeOverridesRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - attributeOverrideSet(notification.getPosition(), (JavaAttributeOverride) notification.getOldValue(), (JavaAttributeOverride) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - attributeOverrideMoved(notification.getOldIntValue(), notification.getPosition(), (JavaAttributeOverride) notification.getNewValue()); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void associationOverridesChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - associationOverrideAdded(notification.getPosition(), (JavaAssociationOverride) notification.getNewValue()); - break; - case Notification.ADD_MANY : - associationOverridesAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - associationOverrideRemoved(notification.getPosition(), (JavaAssociationOverride) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - associationOverridesCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - associationOverridesRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - associationOverrideSet(notification.getPosition(), (JavaAssociationOverride) notification.getOldValue(), (JavaAssociationOverride) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - associationOverrideMoved(notification.getOldIntValue(), notification.getPosition(), (JavaAssociationOverride) notification.getNewValue()); - break; - default : - break; - } - } - - void defaultJoinColumnsChanged(Notification notification) { - throw new IllegalStateException("'defaultJoinColumns' cannot be changed"); - } - - @SuppressWarnings("unchecked") - void secondaryTablesChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - secondaryTableAdded(notification.getPosition(), (JavaSecondaryTable) notification.getNewValue()); - break; - case Notification.ADD_MANY : - secondaryTablesAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - secondaryTableRemoved(notification.getPosition(), (JavaSecondaryTable) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - secondaryTablesCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - secondaryTablesRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - secondaryTableSet(notification.getPosition(), (JavaSecondaryTable) notification.getOldValue(), (JavaSecondaryTable) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - secondaryTableMoved(notification.getOldIntValue(), notification.getPosition(), (ISecondaryTable) notification.getNewValue()); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void specifiedPrimaryKeyJoinColumnsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - specifiedPrimaryKeyJoinColumnAdded(notification.getPosition(), (JavaPrimaryKeyJoinColumn) notification.getNewValue()); - break; - case Notification.ADD_MANY : - specifiedPrimaryKeyJoinColumnsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - specifiedPrimaryKeyJoinColumnRemoved(notification.getPosition(), (JavaPrimaryKeyJoinColumn) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - specifiedPrimaryKeyJoinColumnsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - specifiedPrimaryKeyJoinColumnsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - specifiedPrimaryKeyJoinColumnSet(notification.getPosition(), (JavaPrimaryKeyJoinColumn) notification.getOldValue(), (JavaPrimaryKeyJoinColumn) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - specifiedPrimaryKeyJoinColumnMoved(notification.getOldIntValue(), notification.getPosition(), (JavaPrimaryKeyJoinColumn) notification.getNewValue()); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void namedQueriesChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - namedQueryAdded(notification.getPosition(), (JavaNamedQuery) notification.getNewValue()); - break; - case Notification.ADD_MANY : - namedQueriesAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - namedQueryRemoved(notification.getPosition(), (JavaNamedQuery) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - namedQueriesCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - namedQueriesRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - namedQuerySet(notification.getPosition(), (JavaNamedQuery) notification.getOldValue(), (JavaNamedQuery) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - namedQueryMoved(notification.getOldIntValue(), notification.getPosition(), (JavaNamedQuery) notification.getNewValue()); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void namedNativeQueriesChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - namedNativeQueryAdded(notification.getPosition(), (JavaNamedNativeQuery) notification.getNewValue()); - break; - case Notification.ADD_MANY : - namedNativeQueriesAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - namedNativeQueryRemoved(notification.getPosition(), (JavaNamedNativeQuery) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - namedNativeQueriesCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - namedNativeQueriesRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - namedNativeQuerySet(notification.getPosition(), (JavaNamedNativeQuery) notification.getOldValue(), (JavaNamedNativeQuery) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - namedNativeQueryMoved(notification.getOldIntValue(), notification.getPosition(), (JavaNamedNativeQuery) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** jpa model -> java annotations ********** - /** - * slide over all the annotations that follow the new attribute override - */ - public void attributeOverrideAdded(int index, JavaAttributeOverride attributeOverride) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (attributeOverride.annotation(getType().astRoot()) == null) { - this.synchAttributeOverrideAnnotationsAfterAdd(index + 1); - attributeOverride.newAnnotation(); - } - } - - public void attributeOverridesAdded(int index, List attributeOverrides) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!attributeOverrides.isEmpty() && (attributeOverrides.get(0).annotation(getType().astRoot()) == null)) { - this.synchAttributeOverrideAnnotationsAfterAdd(index + attributeOverrides.size()); - for (JavaAttributeOverride attributeOverride : attributeOverrides) { - attributeOverride.newAnnotation(); - } - } - } - - public void attributeOverrideRemoved(int index, JavaAttributeOverride attributeOverride) { - attributeOverride.removeAnnotation(); - this.synchAttributeOverrideAnnotationsAfterRemove(index); - } - - public void attributeOverridesRemoved(int[] indexes, List attributeOverrides) { - for (JavaAttributeOverride attributeOverride : attributeOverrides) { - attributeOverride.removeAnnotation(); - } - this.synchAttributeOverrideAnnotationsAfterRemove(indexes[0]); - } - - public void attributeOverridesCleared(List attributeOverrides) { - for (JavaAttributeOverride attributeOverride : attributeOverrides) { - attributeOverride.removeAnnotation(); - } - } - - public void attributeOverrideSet(int index, JavaAttributeOverride oldAttributeOverride, JavaAttributeOverride newAttributeOverride) { - newAttributeOverride.newAnnotation(); - } - - public void attributeOverrideMoved(int sourceIndex, int targetIndex, JavaAttributeOverride attributeOverride) { - List attributeOverrides = getSpecifiedAttributeOverrides(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaAttributeOverride) attributeOverrides.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchAttributeOverrideAnnotationsAfterAdd(int index) { - List attributeOverrides = getSpecifiedAttributeOverrides(); - for (int i = attributeOverrides.size(); i-- > index;) { - this.synch((JavaAttributeOverride) attributeOverrides.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchAttributeOverrideAnnotationsAfterRemove(int index) { - List attributeOverrides = getSpecifiedAttributeOverrides(); - for (int i = index; i < attributeOverrides.size(); i++) { - this.synch((JavaAttributeOverride) attributeOverrides.get(i), i); - } - } - - private void synch(JavaAttributeOverride attributeOverride, int index) { - attributeOverride.moveAnnotation(index); - } - - /** - * slide over all the annotations that follow the new association override - */ - public void associationOverrideAdded(int index, JavaAssociationOverride associationOverride) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (associationOverride.annotation(getType().astRoot()) == null) { - this.synchAssociationOverrideAnnotationsAfterAdd(index + 1); - associationOverride.newAnnotation(); - } - } - - public void associationOverridesAdded(int index, List associationOverrides) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!associationOverrides.isEmpty() && (associationOverrides.get(0).annotation(getType().astRoot()) == null)) { - this.synchAssociationOverrideAnnotationsAfterAdd(index + associationOverrides.size()); - for (JavaAssociationOverride associationOverride : associationOverrides) { - associationOverride.newAnnotation(); - } - } - } - - public void associationOverrideRemoved(int index, JavaAssociationOverride associationOverride) { - associationOverride.removeAnnotation(); - this.synchAssociationOverrideAnnotationsAfterRemove(index); - } - - public void associationOverridesRemoved(int[] indexes, List associationOverrides) { - for (JavaAssociationOverride associationOverride : associationOverrides) { - associationOverride.removeAnnotation(); - } - this.synchAssociationOverrideAnnotationsAfterRemove(indexes[0]); - } - - public void associationOverridesCleared(List associationOverrides) { - for (JavaAssociationOverride associationOverride : associationOverrides) { - associationOverride.removeAnnotation(); - } - } - - public void associationOverrideSet(int index, JavaAssociationOverride oldAssociationOverride, JavaAssociationOverride newAssociationOverride) { - newAssociationOverride.newAnnotation(); - } - - public void associationOverrideMoved(int sourceIndex, int targetIndex, JavaAssociationOverride associationOverride) { - List assocationOverrides = getSpecifiedAssociationOverrides(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaAssociationOverride) assocationOverrides.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchAssociationOverrideAnnotationsAfterAdd(int index) { - List associationOverrides = getSpecifiedAssociationOverrides(); - for (int i = associationOverrides.size(); i-- > index;) { - this.synch((JavaAssociationOverride) associationOverrides.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchAssociationOverrideAnnotationsAfterRemove(int index) { - List assocationOverrides = getSpecifiedAssociationOverrides(); - for (int i = index; i < assocationOverrides.size(); i++) { - this.synch((JavaAssociationOverride) assocationOverrides.get(i), i); - } - } - - private void synch(JavaAssociationOverride associationOverride, int index) { - associationOverride.moveAnnotation(index); - } - - /** - * slide over all the annotations that follow the new secondary table - */ - // bjv look at this - public void secondaryTableAdded(int index, JavaSecondaryTable secondaryTable) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (secondaryTable.annotation(getType().astRoot()) == null) { - this.synchSecondaryTableAnnotationsAfterAdd(index + 1); - secondaryTable.newAnnotation(); - } - } - - public void secondaryTablesAdded(int index, List secondaryTables) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!secondaryTables.isEmpty() && ((JavaSecondaryTable) secondaryTables.get(0)).annotation(getType().astRoot()) == null) { - this.synchSecondaryTableAnnotationsAfterAdd(index + secondaryTables.size()); - for (Iterator stream = secondaryTables.iterator(); stream.hasNext();) { - JavaSecondaryTable secondaryTable = (JavaSecondaryTable) stream.next(); - secondaryTable.newAnnotation(); - } - } - } - - public void secondaryTableRemoved(int index, JavaSecondaryTable secondaryTable) { - secondaryTable.removeAnnotation(); - this.synchSecondaryTableAnnotationsAfterRemove(index); - } - - public void secondaryTablesRemoved(int[] indexes, List secondaryTables) { - for (Iterator stream = secondaryTables.iterator(); stream.hasNext();) { - JavaSecondaryTable secondaryTable = (JavaSecondaryTable) stream.next(); - secondaryTable.removeAnnotation(); - } - this.synchSecondaryTableAnnotationsAfterRemove(indexes[0]); - } - - public void secondaryTablesCleared(List secondaryTables) { - for (Iterator stream = secondaryTables.iterator(); stream.hasNext();) { - JavaSecondaryTable secondaryTable = (JavaSecondaryTable) stream.next(); - secondaryTable.removeAnnotation(); - } - } - - public void secondaryTableSet(int index, JavaSecondaryTable oldSecondaryTable, JavaSecondaryTable newSecondaryTable) { - newSecondaryTable.newAnnotation(); - } - - public void secondaryTableMoved(int sourceIndex, int targetIndex, ISecondaryTable secondaryTable) { - List secondaryTables = getSecondaryTables(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaSecondaryTable) secondaryTables.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchSecondaryTableAnnotationsAfterAdd(int index) { - List secondaryTables = getSecondaryTables(); - for (int i = secondaryTables.size(); i-- > index;) { - this.synch((JavaSecondaryTable) secondaryTables.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchSecondaryTableAnnotationsAfterRemove(int index) { - List secondaryTables = getSecondaryTables(); - for (int i = index; i < secondaryTables.size(); i++) { - this.synch((JavaSecondaryTable) secondaryTables.get(i), i); - } - } - - private void synch(JavaSecondaryTable secondaryTable, int index) { - secondaryTable.moveAnnotation(index); - } - - /** - * slide over all the annotations that follow the new - * primary key join column - */ - // bjv look at this - public void specifiedPrimaryKeyJoinColumnAdded(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) { - if (primaryKeyJoinColumn.annotation(getType().astRoot()) == null) { - this.synchPKJCAnnotationsAfterAdd(index + 1); - primaryKeyJoinColumn.newAnnotation(); - } - } - - public void specifiedPrimaryKeyJoinColumnsAdded(int index, List primaryKeyJoinColumns) { - if (!primaryKeyJoinColumns.isEmpty() && ((JavaPrimaryKeyJoinColumn) primaryKeyJoinColumns.get(0)).annotation(getType().astRoot()) == null) { - this.synchPKJCAnnotationsAfterAdd(index + primaryKeyJoinColumns.size()); - for (Iterator stream = primaryKeyJoinColumns.iterator(); stream.hasNext();) { - JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = (JavaPrimaryKeyJoinColumn) stream.next(); - primaryKeyJoinColumn.newAnnotation(); - } - } - } - - public void specifiedPrimaryKeyJoinColumnRemoved(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) { - primaryKeyJoinColumn.removeAnnotation(); - this.synchPKJCAnnotationsAfterRemove(index); - } - - public void specifiedPrimaryKeyJoinColumnsRemoved(int[] indexes, List primaryKeyJoinColumns) { - for (Iterator stream = primaryKeyJoinColumns.iterator(); stream.hasNext();) { - JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = (JavaPrimaryKeyJoinColumn) stream.next(); - primaryKeyJoinColumn.removeAnnotation(); - } - this.synchPKJCAnnotationsAfterRemove(indexes[0]); - } - - public void specifiedPrimaryKeyJoinColumnsCleared(List primaryKeyJoinColumns) { - for (Iterator stream = primaryKeyJoinColumns.iterator(); stream.hasNext();) { - JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = (JavaPrimaryKeyJoinColumn) stream.next(); - primaryKeyJoinColumn.removeAnnotation(); - } - } - - public void specifiedPrimaryKeyJoinColumnSet(int index, JavaPrimaryKeyJoinColumn oldPrimaryKeyJoinColumn, JavaPrimaryKeyJoinColumn newPrimaryKeyJoinColumn) { - newPrimaryKeyJoinColumn.newAnnotation(); - } - - public void specifiedPrimaryKeyJoinColumnMoved(int sourceIndex, int targetIndex, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) { - List primaryKeyJoinColumns = getSpecifiedPrimaryKeyJoinColumns(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaPrimaryKeyJoinColumn) primaryKeyJoinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchPKJCAnnotationsAfterAdd(int index) { - List primaryKeyJoinColumns = getSpecifiedPrimaryKeyJoinColumns(); - for (int i = primaryKeyJoinColumns.size(); i-- > index;) { - this.synch((JavaPrimaryKeyJoinColumn) primaryKeyJoinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchPKJCAnnotationsAfterRemove(int index) { - List primaryKeyJoinColumns = getSpecifiedPrimaryKeyJoinColumns(); - for (int i = index; i < primaryKeyJoinColumns.size(); i++) { - this.synch((JavaPrimaryKeyJoinColumn) primaryKeyJoinColumns.get(i), i); - } - } - - private void synch(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn, int index) { - primaryKeyJoinColumn.moveAnnotation(index); - } - - /** - * slide over all the annotations that follow the new secondary table - */ - // bjv look at this - public void namedQueryAdded(int index, JavaNamedQuery namedQuery) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (namedQuery.annotation(getType().astRoot()) == null) { - this.synchNamedQueryAnnotationsAfterAdd(index + 1); - namedQuery.newAnnotation(); - } - } - - public void namedQueriesAdded(int index, List queries) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!queries.isEmpty() && queries.get(0).annotation(getType().astRoot()) == null) { - this.synchNamedQueryAnnotationsAfterAdd(index + queries.size()); - for (JavaNamedQuery namedQuery : queries) { - namedQuery.newAnnotation(); - } - } - } - - public void namedQueryRemoved(int index, JavaNamedQuery namedQuery) { - namedQuery.removeAnnotation(); - this.synchNamedQueryAnnotationsAfterRemove(index); - } - - public void namedQueriesRemoved(int[] indexes, List queries) { - for (JavaNamedQuery namedQuery : queries) { - namedQuery.removeAnnotation(); - } - this.synchNamedQueryAnnotationsAfterRemove(indexes[0]); - } - - public void namedQueriesCleared(List queries) { - for (JavaNamedQuery namedQuery : queries) { - namedQuery.removeAnnotation(); - } - } - - public void namedQuerySet(int index, JavaNamedQuery oldNamedQuery, JavaNamedQuery newNamedQuery) { - newNamedQuery.newAnnotation(); - } - - public void namedQueryMoved(int sourceIndex, int targetIndex, JavaNamedQuery namedQuery) { - List queries = getNamedQueries(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaNamedQuery) queries.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchNamedQueryAnnotationsAfterAdd(int index) { - List queries = getNamedQueries(); - for (int i = queries.size(); i-- > index;) { - this.synch((JavaNamedQuery) queries.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchNamedQueryAnnotationsAfterRemove(int index) { - List queries = getNamedQueries(); - for (int i = index; i < queries.size(); i++) { - this.synch((JavaNamedQuery) queries.get(i), i); - } - } - - private void synch(JavaNamedQuery namedQuery, int index) { - namedQuery.moveAnnotation(index); - } - - /** - * slide over all the annotations that follow the new secondary table - */ - // bjv look at this - public void namedNativeQueryAdded(int index, JavaNamedNativeQuery namedQuery) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (namedQuery.annotation(getType().astRoot()) == null) { - this.synchNamedNativeQueryAnnotationsAfterAdd(index + 1); - namedQuery.newAnnotation(); - } - } - - public void namedNativeQueriesAdded(int index, List queries) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!queries.isEmpty() && queries.get(0).annotation(getType().astRoot()) == null) { - this.synchNamedNativeQueryAnnotationsAfterAdd(index + queries.size()); - for (JavaNamedNativeQuery namedQuery : queries) { - namedQuery.newAnnotation(); - } - } - } - - public void namedNativeQueryRemoved(int index, JavaNamedNativeQuery namedQuery) { - namedQuery.removeAnnotation(); - this.synchNamedNativeQueryAnnotationsAfterRemove(index); - } - - public void namedNativeQueriesRemoved(int[] indexes, List queries) { - for (JavaNamedNativeQuery namedQuery : queries) { - namedQuery.removeAnnotation(); - } - this.synchNamedNativeQueryAnnotationsAfterRemove(indexes[0]); - } - - public void namedNativeQueriesCleared(List queries) { - for (JavaNamedNativeQuery namedQuery : queries) { - namedQuery.removeAnnotation(); - } - } - - public void namedNativeQuerySet(int index, JavaNamedNativeQuery oldNamedQuery, JavaNamedNativeQuery newNamedQuery) { - newNamedQuery.newAnnotation(); - } - - public void namedNativeQueryMoved(int sourceIndex, int targetIndex, JavaNamedNativeQuery namedQuery) { - List queries = getNamedNativeQueries(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch((JavaNamedNativeQuery) queries.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchNamedNativeQueryAnnotationsAfterAdd(int index) { - List queries = getNamedNativeQueries(); - for (int i = queries.size(); i-- > index;) { - this.synch((JavaNamedNativeQuery) queries.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchNamedNativeQueryAnnotationsAfterRemove(int index) { - List queries = getNamedNativeQueries(); - for (int i = index; i < queries.size(); i++) { - this.synch((JavaNamedNativeQuery) queries.get(i), i); - } - } - - private void synch(JavaNamedNativeQuery namedQuery, int index) { - namedQuery.moveAnnotation(index); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ENTITY; - } - - @Override - public String getName() { - return (this.getSpecifiedName() == null) ? this.getDefaultName() : this.getSpecifiedName(); - } - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

- * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SpecifiedName() - * @model - * @generated - */ - public String getSpecifiedName() { - return specifiedName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - public void setSpecifiedName(String newSpecifiedName) { - String oldSpecifiedName = specifiedName; - specifiedName = newSpecifiedName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); - } - - /** - * Returns the value of the 'Default Name' attribute. - * - *

- * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DefaultName() - * @model changeable="false" - * @generated - */ - public String getDefaultName() { - return defaultName; - } - - /** - * Returns the value of the 'Table' containment reference. - * - *

- * If the meaning of the 'Table' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_Table() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public ITable getTable() { - return table; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTable(ITable newTable, NotificationChain msgs) { - ITable oldTable = table; - table = newTable; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__TABLE, oldTable, newTable); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Specified Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

- * If the meaning of the 'Specified Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SpecifiedSecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" - * @generated - */ - public EList getSpecifiedSecondaryTables() { - if (specifiedSecondaryTables == null) { - specifiedSecondaryTables = new EObjectContainmentEList(ISecondaryTable.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES); - } - return specifiedSecondaryTables; - } - - public EList getSecondaryTables() { - return getSpecifiedSecondaryTables(); - } - - public boolean containsSecondaryTable(String name) { - return containsSecondaryTable(name, getSecondaryTables()); - } - - public boolean containsSpecifiedSecondaryTable(String name) { - return containsSecondaryTable(name, getSpecifiedSecondaryTables()); - } - - private boolean containsSecondaryTable(String name, List secondaryTables) { - for (ISecondaryTable secondaryTable : secondaryTables) { - String secondaryTableName = secondaryTable.getName(); - if (secondaryTableName != null && secondaryTableName.equals(name)) { - return true; - } - } - return false; - } - - /** - * Returns the value of the 'Inheritance Strategy' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.InheritanceType}. - * - *

- * If the meaning of the 'Inheritance Strategy' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Inheritance Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #setInheritanceStrategy(InheritanceType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_InheritanceStrategy() - * @model - * @generated - */ - public InheritanceType getInheritanceStrategy() { - return inheritanceStrategy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getInheritanceStrategy Inheritance Strategy}' attribute. - * - * - * @param value the new value of the 'Inheritance Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #getInheritanceStrategy() - * @generated - */ - public void setInheritanceStrategy(InheritanceType newInheritanceStrategy) { - InheritanceType oldInheritanceStrategy = inheritanceStrategy; - inheritanceStrategy = newInheritanceStrategy == null ? INHERITANCE_STRATEGY_EDEFAULT : newInheritanceStrategy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY, oldInheritanceStrategy, inheritanceStrategy)); - } - - /** - * Returns the value of the 'Discriminator Column' containment reference. - * - *

- * If the meaning of the 'Discriminator Column' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Discriminator Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DiscriminatorColumn() - * @model containment="true" changeable="false" - * @generated - */ - public IDiscriminatorColumn getDiscriminatorColumn() { - return discriminatorColumn; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetDiscriminatorColumn(IDiscriminatorColumn newDiscriminatorColumn, NotificationChain msgs) { - IDiscriminatorColumn oldDiscriminatorColumn = discriminatorColumn; - discriminatorColumn = newDiscriminatorColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN, oldDiscriminatorColumn, newDiscriminatorColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Sequence Generator' containment reference. - * - *

- * If the meaning of the 'Sequence Generator' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Sequence Generator' containment reference. - * @see #setSequenceGenerator(ISequenceGenerator) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SequenceGenerator() - * @model containment="true" - * @generated - */ - public ISequenceGenerator getSequenceGenerator() { - return sequenceGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSequenceGenerator(ISequenceGenerator newSequenceGenerator, NotificationChain msgs) { - ISequenceGenerator oldSequenceGenerator = sequenceGenerator; - sequenceGenerator = newSequenceGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getSequenceGenerator Sequence Generator}' containment reference. - * - * - * @param value the new value of the 'Sequence Generator' containment reference. - * @see #getSequenceGenerator() - * @generated - */ - public void setSequenceGenerator(ISequenceGenerator newSequenceGenerator) { - if (newSequenceGenerator != sequenceGenerator) { - NotificationChain msgs = null; - if (sequenceGenerator != null) - msgs = ((InternalEObject) sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR, null, msgs); - if (newSequenceGenerator != null) - msgs = ((InternalEObject) newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR, null, msgs); - msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator)); - } - - /** - * Returns the value of the 'Table Generator' containment reference. - * - *

- * If the meaning of the 'Table Generator' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table Generator' containment reference. - * @see #setTableGenerator(ITableGenerator) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_TableGenerator() - * @model containment="true" - * @generated - */ - public ITableGenerator getTableGenerator() { - return tableGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTableGenerator(ITableGenerator newTableGenerator, NotificationChain msgs) { - ITableGenerator oldTableGenerator = tableGenerator; - tableGenerator = newTableGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR, oldTableGenerator, newTableGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getTableGenerator Table Generator}' containment reference. - * - * - * @param value the new value of the 'Table Generator' containment reference. - * @see #getTableGenerator() - * @generated - */ - public void setTableGenerator(ITableGenerator newTableGenerator) { - if (newTableGenerator != tableGenerator) { - NotificationChain msgs = null; - if (tableGenerator != null) - msgs = ((InternalEObject) tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR, null, msgs); - if (newTableGenerator != null) - msgs = ((InternalEObject) newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR, null, msgs); - msgs = basicSetTableGenerator(newTableGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR, newTableGenerator, newTableGenerator)); - } - - /** - * Returns the value of the 'Default Discriminator Value' attribute. - * - *

- * If the meaning of the 'Default Discriminator Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Discriminator Value' attribute. - * @see #setDefaultDiscriminatorValue(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DefaultDiscriminatorValue() - * @model - * @generated - */ - public String getDefaultDiscriminatorValue() { - return defaultDiscriminatorValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getDefaultDiscriminatorValue Default Discriminator Value}' attribute. - * - * - * @param value the new value of the 'Default Discriminator Value' attribute. - * @see #getDefaultDiscriminatorValue() - * @generated - */ - public void setDefaultDiscriminatorValue(String newDefaultDiscriminatorValue) { - String oldDefaultDiscriminatorValue = defaultDiscriminatorValue; - defaultDiscriminatorValue = newDefaultDiscriminatorValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE, oldDefaultDiscriminatorValue, defaultDiscriminatorValue)); - } - - /** - * Returns the value of the 'Specified Discriminator Value' attribute. - * - *

- * If the meaning of the 'Specified Discriminator Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Discriminator Value' attribute. - * @see #setSpecifiedDiscriminatorValue(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SpecifiedDiscriminatorValue() - * @model - * @generated - */ - public String getSpecifiedDiscriminatorValue() { - return specifiedDiscriminatorValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getSpecifiedDiscriminatorValue Specified Discriminator Value}' attribute. - * - * - * @param value the new value of the 'Specified Discriminator Value' attribute. - * @see #getSpecifiedDiscriminatorValue() - * @generated - */ - public void setSpecifiedDiscriminatorValue(String newSpecifiedDiscriminatorValue) { - String oldSpecifiedDiscriminatorValue = specifiedDiscriminatorValue; - specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE, oldSpecifiedDiscriminatorValue, specifiedDiscriminatorValue)); - } - - /** - * Returns the value of the 'Discriminator Value' attribute. - * - *

- * If the meaning of the 'Discriminator Value' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Discriminator Value' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DiscriminatorValue() - * @model transient="true" changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getDiscriminatorValue() { - return (this.getSpecifiedDiscriminatorValue() == null) ? getDefaultDiscriminatorValue() : this.getSpecifiedDiscriminatorValue(); - } - - public EList getPrimaryKeyJoinColumns() { - return this.getSpecifiedPrimaryKeyJoinColumns().isEmpty() ? this.getDefaultPrimaryKeyJoinColumns() : this.getSpecifiedPrimaryKeyJoinColumns(); - } - - /** - * Returns the value of the 'Specified Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

- * If the meaning of the 'Specified Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SpecifiedPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedPrimaryKeyJoinColumns() { - if (specifiedPrimaryKeyJoinColumns == null) { - specifiedPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS); - } - return specifiedPrimaryKeyJoinColumns; - } - - /** - * Returns the value of the 'Default Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

- * If the meaning of the 'Default Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DefaultPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getDefaultPrimaryKeyJoinColumns() { - if (defaultPrimaryKeyJoinColumns == null) { - defaultPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS); - } - return defaultPrimaryKeyJoinColumns; - } - - public EList getAttributeOverrides() { - EList list = new EObjectEList(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES); - list.addAll(getSpecifiedAttributeOverrides()); - list.addAll(getDefaultAttributeOverrides()); - return list; - } - - public IAttributeOverride attributeOverrideNamed(String name) { - return (IAttributeOverride) overrideNamed(name, getAttributeOverrides()); - } - - public boolean containsAttributeOverride(String name) { - return containsOverride(name, getAttributeOverrides()); - } - - public boolean containsDefaultAttributeOverride(String name) { - return containsOverride(name, getDefaultAttributeOverrides()); - } - - public boolean containsSpecifiedAttributeOverride(String name) { - return containsOverride(name, getSpecifiedAttributeOverrides()); - } - - public boolean containsAssociationOverride(String name) { - return containsOverride(name, getAssociationOverrides()); - } - - public boolean containsSpecifiedAssociationOverride(String name) { - return containsOverride(name, getSpecifiedAssociationOverrides()); - } - - public boolean containsDefaultAssociationOverride(String name) { - return containsOverride(name, getDefaultAssociationOverrides()); - } - - - private IOverride overrideNamed(String name, List overrides) { - for (IOverride override : overrides) { - String overrideName = override.getName(); - if (overrideName == null && name == null) { - return override; - } - if (overrideName != null && overrideName.equals(name)) { - return override; - } - } - return null; - } - - private boolean containsOverride(String name, List overrides) { - return overrideNamed(name, overrides) != null; - } - - /** - * Returns the value of the 'Specified Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

- * If the meaning of the 'Specified Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SpecifiedAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getSpecifiedAttributeOverrides() { - if (specifiedAttributeOverrides == null) { - specifiedAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES); - } - return specifiedAttributeOverrides; - } - - /** - * Returns the value of the 'Default Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

- * If the meaning of the 'Default Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DefaultAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getDefaultAttributeOverrides() { - if (defaultAttributeOverrides == null) { - defaultAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES); - } - return defaultAttributeOverrides; - } - - public EList getAssociationOverrides() { - EList list = new EObjectEList(IAssociationOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES); - list.addAll(getSpecifiedAssociationOverrides()); - list.addAll(getDefaultAssociationOverrides()); - return list; - } - - /** - * Returns the value of the 'Specified Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

- * If the meaning of the 'Specified Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_SpecifiedAssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" - * @generated - */ - public EList getSpecifiedAssociationOverrides() { - if (specifiedAssociationOverrides == null) { - specifiedAssociationOverrides = new EObjectContainmentEList(IAssociationOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES); - } - return specifiedAssociationOverrides; - } - - /** - * Returns the value of the 'Default Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

- * If the meaning of the 'Default Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_DefaultAssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" - * @generated - */ - public EList getDefaultAssociationOverrides() { - if (defaultAssociationOverrides == null) { - defaultAssociationOverrides = new EObjectContainmentEList(IAssociationOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES); - } - return defaultAssociationOverrides; - } - - /** - * Returns the value of the 'Named Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.INamedQuery}. - * - *

- * If the meaning of the 'Named Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Named Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_NamedQueries() - * @model type="org.eclipse.jpt.core.internal.mappings.INamedQuery" containment="true" - * @generated - */ - public EList getNamedQueries() { - if (namedQueries == null) { - namedQueries = new EObjectContainmentEList(INamedQuery.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES); - } - return namedQueries; - } - - /** - * Returns the value of the 'Named Native Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery}. - * - *

- * If the meaning of the 'Named Native Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Named Native Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_NamedNativeQueries() - * @model type="org.eclipse.jpt.core.internal.mappings.INamedNativeQuery" containment="true" - * @generated - */ - public EList getNamedNativeQueries() { - if (namedNativeQueries == null) { - namedNativeQueries = new EObjectContainmentEList(INamedNativeQuery.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES); - } - return namedNativeQueries; - } - - /** - * Returns the value of the 'Id Class' attribute. - * - *

- * If the meaning of the 'Id Class' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Id Class' attribute. - * @see #setIdClass(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIEntity_IdClass() - * @model - * @generated - */ - public String getIdClass() { - return idClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity#getIdClass Id Class}' attribute. - * - * - * @param value the new value of the 'Id Class' attribute. - * @see #getIdClass() - * @generated - */ - public void setIdClass(String newIdClass) { - String oldIdClass = idClass; - idClass = newIdClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS, oldIdClass, idClass)); - } - - /** - * - * - * @model - * @generated NOT - */ - public boolean discriminatorValueIsAllowed() { - return !getType().isAbstract(); - } - - public IEntity parentEntity() { - for (Iterator i = getPersistentType().inheritanceHierarchy(); i.hasNext();) { - ITypeMapping typeMapping = i.next().getMapping(); - if (typeMapping != this && typeMapping instanceof IEntity) { - return (IEntity) typeMapping; - } - } - return this; - } - - public IEntity rootEntity() { - IEntity rootEntity = null; - for (Iterator i = getPersistentType().inheritanceHierarchy(); i.hasNext();) { - IPersistentType persistentType = i.next(); - if (persistentType.getMapping() instanceof IEntity) { - rootEntity = (IEntity) persistentType.getMapping(); - } - } - return rootEntity; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE : - return basicSetTable(null, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES : - return ((InternalEList) getSpecifiedSecondaryTables()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getDefaultPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN : - return basicSetDiscriminatorColumn(null, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR : - return basicSetSequenceGenerator(null, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR : - return basicSetTableGenerator(null, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES : - return ((InternalEList) getAttributeOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getSpecifiedAttributeOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getDefaultAttributeOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES : - return ((InternalEList) getAssociationOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - return ((InternalEList) getSpecifiedAssociationOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - return ((InternalEList) getDefaultAssociationOverrides()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES : - return ((InternalEList) getNamedQueries()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES : - return ((InternalEList) getNamedNativeQueries()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - protected void setDefaultName(String newDefaultName) { - String oldDefaultName = defaultName; - defaultName = newDefaultName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_NAME, oldDefaultName, defaultName)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME : - return getSpecifiedName(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_NAME : - return getDefaultName(); - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE : - return getTable(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES : - return getSpecifiedSecondaryTables(); - case JpaJavaMappingsPackage.JAVA_ENTITY__PRIMARY_KEY_JOIN_COLUMNS : - return getPrimaryKeyJoinColumns(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return getSpecifiedPrimaryKeyJoinColumns(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return getDefaultPrimaryKeyJoinColumns(); - case JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY : - return getInheritanceStrategy(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE : - return getDefaultDiscriminatorValue(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - return getSpecifiedDiscriminatorValue(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_VALUE : - return getDiscriminatorValue(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN : - return getDiscriminatorColumn(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR : - return getSequenceGenerator(); - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR : - return getTableGenerator(); - case JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES : - return getAttributeOverrides(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - return getSpecifiedAttributeOverrides(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - return getDefaultAttributeOverrides(); - case JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES : - return getAssociationOverrides(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - return getSpecifiedAssociationOverrides(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - return getDefaultAssociationOverrides(); - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES : - return getNamedQueries(); - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES : - return getNamedNativeQueries(); - case JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS : - return getIdClass(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME : - setSpecifiedName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES : - getSpecifiedSecondaryTables().clear(); - getSpecifiedSecondaryTables().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - getSpecifiedPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - getDefaultPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY : - setInheritanceStrategy((InheritanceType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE : - setDefaultDiscriminatorValue((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - setSpecifiedDiscriminatorValue((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - getSpecifiedAttributeOverrides().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - getDefaultAttributeOverrides().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - getSpecifiedAssociationOverrides().clear(); - getSpecifiedAssociationOverrides().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - getDefaultAssociationOverrides().clear(); - getDefaultAssociationOverrides().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES : - getNamedQueries().clear(); - getNamedQueries().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES : - getNamedNativeQueries().clear(); - getNamedNativeQueries().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS : - setIdClass((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME : - setSpecifiedName(SPECIFIED_NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES : - getSpecifiedSecondaryTables().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY : - setInheritanceStrategy(INHERITANCE_STRATEGY_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE : - setDefaultDiscriminatorValue(DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - setSpecifiedDiscriminatorValue(SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) null); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) null); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - getSpecifiedAssociationOverrides().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - getDefaultAssociationOverrides().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES : - getNamedQueries().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES : - getNamedNativeQueries().clear(); - return; - case JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS : - setIdClass(ID_CLASS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME : - return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_NAME : - return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE : - return table != null; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES : - return specifiedSecondaryTables != null && !specifiedSecondaryTables.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__PRIMARY_KEY_JOIN_COLUMNS : - return !getPrimaryKeyJoinColumns().isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return specifiedPrimaryKeyJoinColumns != null && !specifiedPrimaryKeyJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return defaultPrimaryKeyJoinColumns != null && !defaultPrimaryKeyJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY : - return inheritanceStrategy != INHERITANCE_STRATEGY_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE : - return DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT == null ? defaultDiscriminatorValue != null : !DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT.equals(defaultDiscriminatorValue); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - return SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT == null ? specifiedDiscriminatorValue != null : !SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT.equals(specifiedDiscriminatorValue); - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_VALUE : - return DISCRIMINATOR_VALUE_EDEFAULT == null ? getDiscriminatorValue() != null : !DISCRIMINATOR_VALUE_EDEFAULT.equals(getDiscriminatorValue()); - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN : - return discriminatorColumn != null; - case JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR : - return sequenceGenerator != null; - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR : - return tableGenerator != null; - case JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES : - return !getAttributeOverrides().isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - return specifiedAttributeOverrides != null && !specifiedAttributeOverrides.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - return defaultAttributeOverrides != null && !defaultAttributeOverrides.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES : - return !getAssociationOverrides().isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - return specifiedAssociationOverrides != null && !specifiedAssociationOverrides.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - return defaultAssociationOverrides != null && !defaultAssociationOverrides.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES : - return namedQueries != null && !namedQueries.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES : - return namedNativeQueries != null && !namedNativeQueries.isEmpty(); - case JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS : - return ID_CLASS_EDEFAULT == null ? idClass != null : !ID_CLASS_EDEFAULT.equals(idClass); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IEntity.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_NAME : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME; - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE : - return JpaCoreMappingsPackage.IENTITY__TABLE; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES; - case JpaJavaMappingsPackage.JAVA_ENTITY__PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IENTITY__PRIMARY_KEY_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY : - return JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE; - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_VALUE : - return JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_VALUE; - case JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN : - return JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_COLUMN; - case JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR : - return JpaCoreMappingsPackage.IENTITY__SEQUENCE_GENERATOR; - case JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR : - return JpaCoreMappingsPackage.IENTITY__TABLE_GENERATOR; - case JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__ATTRIBUTE_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__ASSOCIATION_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES; - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES : - return JpaCoreMappingsPackage.IENTITY__NAMED_QUERIES; - case JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES : - return JpaCoreMappingsPackage.IENTITY__NAMED_NATIVE_QUERIES; - case JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS : - return JpaCoreMappingsPackage.IENTITY__ID_CLASS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IEntity.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME : - return JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_NAME; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME : - return JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_NAME; - case JpaCoreMappingsPackage.IENTITY__TABLE : - return JpaJavaMappingsPackage.JAVA_ENTITY__TABLE; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES : - return JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES; - case JpaCoreMappingsPackage.IENTITY__PRIMARY_KEY_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_ENTITY__PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY : - return JpaJavaMappingsPackage.JAVA_ENTITY__INHERITANCE_STRATEGY; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE : - return JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - return JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE; - case JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_VALUE : - return JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_VALUE; - case JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_COLUMN : - return JpaJavaMappingsPackage.JAVA_ENTITY__DISCRIMINATOR_COLUMN; - case JpaCoreMappingsPackage.IENTITY__SEQUENCE_GENERATOR : - return JpaJavaMappingsPackage.JAVA_ENTITY__SEQUENCE_GENERATOR; - case JpaCoreMappingsPackage.IENTITY__TABLE_GENERATOR : - return JpaJavaMappingsPackage.JAVA_ENTITY__TABLE_GENERATOR; - case JpaCoreMappingsPackage.IENTITY__ATTRIBUTE_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__ASSOCIATION_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - return JpaJavaMappingsPackage.JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__NAMED_QUERIES : - return JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_QUERIES; - case JpaCoreMappingsPackage.IENTITY__NAMED_NATIVE_QUERIES : - return JpaJavaMappingsPackage.JAVA_ENTITY__NAMED_NATIVE_QUERIES; - case JpaCoreMappingsPackage.IENTITY__ID_CLASS : - return JpaJavaMappingsPackage.JAVA_ENTITY__ID_CLASS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedName: "); - result.append(specifiedName); - result.append(", defaultName: "); - result.append(defaultName); - result.append(", inheritanceStrategy: "); - result.append(inheritanceStrategy); - result.append(", defaultDiscriminatorValue: "); - result.append(defaultDiscriminatorValue); - result.append(", specifiedDiscriminatorValue: "); - result.append(specifiedDiscriminatorValue); - result.append(", idClass: "); - result.append(idClass); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - @Override - public String getTableName() { - return getTable().getName(); - } - - @Override - public Table primaryDbTable() { - return getTable().dbTable(); - } - - @Override - public Table dbTable(String tableName) { - for (Iterator stream = this.associatedTablesIncludingInherited(); stream.hasNext();) { - Table dbTable = stream.next().dbTable(); - if (dbTable != null && dbTable.matchesShortJavaClassName(tableName)) { - return dbTable; - } - } - return null; - } - - @Override - public Schema dbSchema() { - return getTable().dbSchema(); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - this.setSpecifiedName(this.getType().annotationElementValue(NAME_ADAPTER, astRoot)); - this.setDefaultName(this.getType().getName()); - this.getJavaTable().updateFromJava(astRoot); - this.updateSecondaryTablesFromJava(astRoot); - this.updateNamedQueriesFromJava(astRoot); - this.updateNamedNativeQueriesFromJava(astRoot); - this.updateSpecifiedPrimaryKeyJoinColumnsFromJava(astRoot); - this.updateAttributeOverridesFromJava(astRoot); - this.updateAssociationOverridesFromJava(astRoot); - this.setInheritanceStrategy(InheritanceType.fromJavaAnnotationValue(this.inheritanceStrategyAdapter.getValue(astRoot))); - this.getJavaDiscriminatorColumn().updateFromJava(astRoot); - this.setSpecifiedDiscriminatorValue(this.discriminatorValueAdapter.getValue(astRoot)); - this.setDefaultDiscriminatorValue(this.javaDefaultDiscriminatorValue()); - this.updateTableGeneratorFromJava(astRoot); - this.updateSequenceGeneratorFromJava(astRoot); - this.updateIdClassFromJava(astRoot); - } - - private void updateIdClassFromJava(CompilationUnit astRoot) { - if (this.idClassAnnotationAdapter.getAnnotation(astRoot) == null) { - this.setIdClass(null); - } - else { - this.setIdClass(this.idClassValueAdapter.getValue(astRoot)); - } - } - - private JavaTable getJavaTable() { - return (JavaTable) this.table; - } - - private JavaDiscriminatorColumn getJavaDiscriminatorColumn() { - return (JavaDiscriminatorColumn) this.discriminatorColumn; - } - - private void updateTableGeneratorFromJava(CompilationUnit astRoot) { - if (this.tableGeneratorAnnotationAdapter.getAnnotation(astRoot) == null) { - if (this.tableGenerator != null) { - setTableGenerator(null); - } - } - else { - if (this.tableGenerator == null) { - setTableGenerator(createTableGenerator()); - } - this.getJavaTableGenerator().updateFromJava(astRoot); - } - } - - private JavaTableGenerator getJavaTableGenerator() { - return (JavaTableGenerator) this.tableGenerator; - } - - private void updateSequenceGeneratorFromJava(CompilationUnit astRoot) { - if (this.sequenceGeneratorAnnotationAdapter.getAnnotation(astRoot) == null) { - if (this.sequenceGenerator != null) { - setSequenceGenerator(null); - } - } - else { - if (this.sequenceGenerator == null) { - setSequenceGenerator(createSequenceGenerator()); - } - this.getJavaSequenceGenerator().updateFromJava(astRoot); - } - } - - private JavaSequenceGenerator getJavaSequenceGenerator() { - return (JavaSequenceGenerator) this.sequenceGenerator; - } - - /** - * From the Spec: - * If the DiscriminatorValue annotation is not specified, a - * provider-specific function to generate a value representing - * the entity type is used for the value of the discriminator - * column. If the DiscriminatorType is STRING, the discriminator - * value default is the entity name. - * - * TODO extension point for provider-specific function? - */ - private String javaDefaultDiscriminatorValue() { - if (this.getType().isAbstract()) { - return null; - } - if (!this.discriminatorType().isString()) { - return null; - } - return this.getName(); - } - - private DiscriminatorType discriminatorType() { - return this.getDiscriminatorColumn().getDiscriminatorType(); - } - - /** - * here we just worry about getting the attribute override lists the same size; - * then we delegate to the attribute overrides to synch themselves up - */ - private void updateAttributeOverridesFromJava(CompilationUnit astRoot) { - // synchronize the model attribute overrides with the Java source - List attributeOverrides = getSpecifiedAttributeOverrides(); - int persSize = attributeOverrides.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaAttributeOverride attributeOverride = (JavaAttributeOverride) attributeOverrides.get(i); - if (attributeOverride.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - attributeOverride.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model attribute overrides beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - attributeOverrides.remove(persSize); - } - } - else { - // add new model attribute overrides until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaAttributeOverride attributeOverride = this.createJavaAttributeOverride(javaSize); - if (attributeOverride.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedAttributeOverrides().add(attributeOverride); - attributeOverride.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * here we just worry about getting the attribute override lists the same size; - * then we delegate to the attribute overrides to synch themselves up - */ - private void updateAssociationOverridesFromJava(CompilationUnit astRoot) { - // synchronize the model attribute overrides with the Java source - List associationOverrides = getSpecifiedAssociationOverrides(); - int persSize = associationOverrides.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaAssociationOverride associationOverride = (JavaAssociationOverride) associationOverrides.get(i); - if (associationOverride.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - associationOverride.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model attribute overrides beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - associationOverrides.remove(persSize); - } - } - else { - // add new model attribute overrides until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaAssociationOverride associationOverride = this.createJavaAssociationOverride(javaSize); - if (associationOverride.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedAssociationOverrides().add(associationOverride); - associationOverride.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * here we just worry about getting the secondary table lists the same size; - * then we delegate to the secondary tables to synch themselves up - */ - private void updateSecondaryTablesFromJava(CompilationUnit astRoot) { - // synchronize the model secondary tables with the Java source - List sTables = this.getSecondaryTables(); - int persSize = sTables.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaSecondaryTable secondaryTable = (JavaSecondaryTable) sTables.get(i); - if (secondaryTable.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - secondaryTable.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model secondary tables beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - sTables.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaSecondaryTable secondaryTable = this.createJavaSecondaryTable(javaSize); - if (secondaryTable.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSecondaryTables().add(secondaryTable); - secondaryTable.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * here we just worry about getting the named query lists the same size; - * then we delegate to the named queries to synch themselves up - */ - private void updateNamedQueriesFromJava(CompilationUnit astRoot) { - // synchronize the model named queries with the Java source - List queries = this.getNamedQueries(); - int persSize = queries.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaNamedQuery namedQuery = (JavaNamedQuery) queries.get(i); - if (namedQuery.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - namedQuery.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model named queries beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - queries.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaNamedQuery javaNamedQuery = this.createJavaNamedQuery(javaSize); - if (javaNamedQuery.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getNamedQueries().add(javaNamedQuery); - javaNamedQuery.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * here we just worry about getting the named native query lists the same size; - * then we delegate to the named native queries to synch themselves up - */ - private void updateNamedNativeQueriesFromJava(CompilationUnit astRoot) { - // synchronize the model named queries with the Java source - List queries = this.getNamedNativeQueries(); - int persSize = queries.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaNamedNativeQuery namedQuery = (JavaNamedNativeQuery) queries.get(i); - if (namedQuery.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - namedQuery.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model named queries beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - queries.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaNamedNativeQuery javaNamedQuery = this.createJavaNamedNativeQuery(javaSize); - if (javaNamedQuery.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getNamedNativeQueries().add(javaNamedQuery); - javaNamedQuery.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * here we just worry about getting the primary key join column lists - * the same size; then we delegate to the join columns to synch - * themselves up - */ - private void updateSpecifiedPrimaryKeyJoinColumnsFromJava(CompilationUnit astRoot) { - // synchronize the model primary key join columns with the Java source - List pkJoinColumns = getSpecifiedPrimaryKeyJoinColumns(); - int persSize = pkJoinColumns.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaPrimaryKeyJoinColumn pkJoinColumn = (JavaPrimaryKeyJoinColumn) pkJoinColumns.get(i); - if (pkJoinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - pkJoinColumn.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model primary key join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - pkJoinColumns.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaPrimaryKeyJoinColumn jpkjc = this.createJavaPrimaryKeyJoinColumn(javaSize); - if (jpkjc.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedPrimaryKeyJoinColumns().add(jpkjc); - jpkjc.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - public String primaryKeyColumnName() { - String pkColumnName = null; - for (Iterator stream = getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute attribute = stream.next(); - String name = attribute.primaryKeyColumnName(); - if (pkColumnName == null) { - pkColumnName = name; - } - else if (name != null) { - // if we encounter a composite primary key, return null - return null; - } - } - // if we encounter only a single primary key column name, return it - return pkColumnName; - } - - public String primaryKeyAttributeName() { - String pkColumnName = null; - String pkAttributeName = null; - for (Iterator stream = getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute attribute = stream.next(); - String name = attribute.primaryKeyColumnName(); - if (pkColumnName == null) { - pkColumnName = name; - pkAttributeName = attribute.getName(); - } - else if (name != null) { - // if we encounter a composite primary key, return null - return null; - } - } - // if we encounter only a single primary key column name, return it - return pkAttributeName; - } - - @Override - public boolean tableNameIsInvalid(String tableName) { - return !CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName); - } - - @Override - public Iterator associatedTables() { - return new CompositeIterator(this.getTable(), this.getSecondaryTables().iterator()); - } - - @Override - public Iterator associatedTablesIncludingInherited() { - return new CompositeIterator(new TransformationIterator>(this.inheritanceHierarchy()) { - @Override - protected Iterator transform(ITypeMapping mapping) { - return new FilteringIterator(mapping.associatedTables()) { - @Override - protected boolean accept(Object o) { - return true; - //TODO - //filtering these out so as to avoid the duplicate table, root and children share the same table - //return !(o instanceof SingleTableInheritanceChildTableImpl); - } - }; - } - }); - } - - @Override - public Iterator associatedTableNamesIncludingInherited() { - return this.nonNullTableNames(this.associatedTablesIncludingInherited()); - } - - private Iterator nonNullTableNames(Iterator tables) { - return new FilteringIterator(this.tableNames(tables)) { - @Override - protected boolean accept(Object o) { - return o != null; - } - }; - } - - private Iterator tableNames(Iterator tables) { - return new TransformationIterator(tables) { - @Override - protected String transform(ITable t) { - return t.getName(); - } - }; - } - - /** - * Return an iterator of Entities, each which inherits from the one before, - * and terminates at the root entity (or at the point of cyclicity). - */ - private Iterator inheritanceHierarchy() { - return new TransformationIterator(getPersistentType().inheritanceHierarchy()) { - @Override - protected ITypeMapping transform(IPersistentType type) { - return type.getMapping(); - } - }; - //TODO once we support inheritance, which of these should we use?? - //return this.getInheritance().typeMappingLineage(); - } - - public Iterator allOverridableAttributeNames() { - return new CompositeIterator(new TransformationIterator>(this.inheritanceHierarchy()) { - @Override - protected Iterator transform(ITypeMapping mapping) { - return mapping.overridableAttributeNames(); - } - }); - } - - public Iterator allOverridableAssociationNames() { - return new CompositeIterator(new TransformationIterator>(this.inheritanceHierarchy()) { - @Override - protected Iterator transform(ITypeMapping mapping) { - return mapping.overridableAssociationNames(); - } - }); - } - - public IAttributeOverride createAttributeOverride(int index) { - return createJavaAttributeOverride(index); - } - - private JavaAttributeOverride createJavaAttributeOverride(int index) { - return JavaAttributeOverride.createAttributeOverride(new AttributeOverrideOwner(this), this.getType(), index); - } - - public IAssociationOverride createAssociationOverride(int index) { - return createJavaAssociationOverride(index); - } - - private JavaAssociationOverride createJavaAssociationOverride(int index) { - return JavaAssociationOverride.createAssociationOverride(new AssociationOverrideOwner(this), this.getType(), index); - } - - public JavaSecondaryTable createSecondaryTable(int index) { - return createJavaSecondaryTable(index); - } - - private JavaSecondaryTable createJavaSecondaryTable(int index) { - return JavaSecondaryTable.createJavaSecondaryTable(buildSecondaryTableOwner(), this.getType(), index); - } - - private ITable.Owner buildSecondaryTableOwner() { - return new ITable.Owner() { - public ITextRange validationTextRange() { - return JavaEntity.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return JavaEntity.this; - } - }; - } - - public boolean containsSpecifiedPrimaryKeyJoinColumns() { - return !this.getSpecifiedPrimaryKeyJoinColumns().isEmpty(); - } - - public IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index) { - return this.createJavaPrimaryKeyJoinColumn(index); - } - - private JavaPrimaryKeyJoinColumn createJavaPrimaryKeyJoinColumn(int index) { - return JavaPrimaryKeyJoinColumn.createEntityPrimaryKeyJoinColumn(buildPkJoinColumnOwner(), this.getType(), index); - } - - protected IAbstractJoinColumn.Owner buildPkJoinColumnOwner() { - return new IEntity.PrimaryKeyJoinColumnOwner(this); - } - - public JavaNamedQuery createNamedQuery(int index) { - return createJavaNamedQuery(index); - } - - private JavaNamedQuery createJavaNamedQuery(int index) { - return JavaNamedQuery.createJavaNamedQuery(this.getType(), index); - } - - public JavaNamedNativeQuery createNamedNativeQuery(int index) { - return createJavaNamedNativeQuery(index); - } - - private JavaNamedNativeQuery createJavaNamedNativeQuery(int index) { - return JavaNamedNativeQuery.createJavaNamedNativeQuery(this.getType(), index); - } - - public ISequenceGenerator createSequenceGenerator() { - return JpaJavaMappingsFactory.eINSTANCE.createJavaSequenceGenerator(getType()); - } - - public ITableGenerator createTableGenerator() { - return JpaJavaMappingsFactory.eINSTANCE.createJavaTableGenerator(getType()); - } - - // ********** misc ********** - private static void attributeChanged(Object value, AnnotationAdapter annotationAdapter) { - Annotation annotation = annotationAdapter.getAnnotation(); - if (value == null) { - if (annotation != null) { - annotationAdapter.removeAnnotation(); - } - } - else { - if (annotation == null) { - annotationAdapter.newMarkerAnnotation(); - } - } - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - result = this.getJavaTable().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (ISecondaryTable sTable : this.getSecondaryTables()) { - result = ((JavaSecondaryTable) sTable).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - for (IPrimaryKeyJoinColumn column : this.getPrimaryKeyJoinColumns()) { - result = ((JavaPrimaryKeyJoinColumn) column).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - for (IAttributeOverride override : this.getAttributeOverrides()) { - result = ((JavaAttributeOverride) override).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - for (IAssociationOverride override : this.getAssociationOverrides()) { - result = ((JavaAssociationOverride) override).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - result = this.getJavaDiscriminatorColumn().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - JavaTableGenerator jtg = this.getJavaTableGenerator(); - if (jtg != null) { - result = jtg.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - JavaSequenceGenerator jsg = this.getJavaSequenceGenerator(); - if (jsg != null) { - result = jsg.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - // ********** static methods ********** - protected static DeclarationAnnotationElementAdapter buildStrategyAdapter() { - return new EnumDeclarationAnnotationElementAdapter(INHERITANCE_ANNOTATION_ADAPTER, JPA.INHERITANCE__STRATEGY); - } - - private static DeclarationAnnotationElementAdapter buildDiscriminatorValueAdapter() { - return ConversionDeclarationAnnotationElementAdapter.forStrings(DISCRIMINATOR_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_VALUE__VALUE); - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildIdClassValueAdapter() { - return new ConversionDeclarationAnnotationElementAdapter(ID_CLASS_ADAPTER, JPA.ID_CLASS__VALUE, false, SimpleTypeStringExpressionConverter.instance()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntityProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntityProvider.java deleted file mode 100644 index fe3796d8b5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntityProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -/** - * - */ -public class JavaEntityProvider - implements IJavaTypeMappingProvider -{ - - // singleton - private static final JavaEntityProvider INSTANCE = new JavaEntityProvider(); - - /** - * Return the singleton. - */ - public static IJavaTypeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaEntityProvider() { - super(); - } - - public String key() { - return IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - public IJavaTypeMapping buildMapping(Type type) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaEntity(type); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaEntity.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGeneratedValue.java deleted file mode 100644 index 17cd499080..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGeneratedValue.java +++ /dev/null @@ -1,347 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.GenerationType; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Generated Value'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaGeneratedValue() - * @model kind="class" - * @generated - */ -public class JavaGeneratedValue extends JavaEObject implements IGeneratedValue -{ - private Member member; - - private final AnnotationElementAdapter strategyAdapter; - - private final AnnotationElementAdapter generatorAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.GENERATED_VALUE); - - private static final DeclarationAnnotationElementAdapter STRATEGY_ADAPTER = buildStrategyAdapter(); - - private static final DeclarationAnnotationElementAdapter GENERATOR_ADAPTER = buildGeneratorAdapter(); - - /** - * The default value of the '{@link #getStrategy() Strategy}' attribute. - * - * - * @see #getStrategy() - * @generated - * @ordered - */ - protected static final GenerationType STRATEGY_EDEFAULT = GenerationType.DEFAULT; - - /** - * The cached value of the '{@link #getStrategy() Strategy}' attribute. - * - * - * @see #getStrategy() - * @generated - * @ordered - */ - protected GenerationType strategy = STRATEGY_EDEFAULT; - - /** - * The default value of the '{@link #getGenerator() Generator}' attribute. - * - * - * @see #getGenerator() - * @generated - * @ordered - */ - protected static final String GENERATOR_EDEFAULT = null; - - /** - * The cached value of the '{@link #getGenerator() Generator}' attribute. - * - * - * @see #getGenerator() - * @generated - * @ordered - */ - protected String generator = GENERATOR_EDEFAULT; - - protected JavaGeneratedValue() { - throw new UnsupportedOperationException("Use JavaGeneratedValue(Member) instead"); - } - - protected JavaGeneratedValue(Member member) { - super(); - this.member = member; - this.strategyAdapter = new ShortCircuitAnnotationElementAdapter(this.member, STRATEGY_ADAPTER); - this.generatorAdapter = new ShortCircuitAnnotationElementAdapter(this.member, GENERATOR_ADAPTER); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IGeneratedValue.class)) { - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR : - this.generatorAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY : - this.strategyAdapter.setValue(((GenerationType) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_GENERATED_VALUE; - } - - /** - * Returns the value of the 'Strategy' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.GenerationType}. - * - *

- * If the meaning of the 'Strategy' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see #setStrategy(GenerationType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGeneratedValue_Strategy() - * @model - * @generated - */ - public GenerationType getStrategy() { - return strategy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue#getStrategy Strategy}' attribute. - * - * - * @param value the new value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see #getStrategy() - * @generated - */ - public void setStrategy(GenerationType newStrategy) { - GenerationType oldStrategy = strategy; - strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY, oldStrategy, strategy)); - } - - /** - * Returns the value of the 'Generator' attribute. - * - *

- * If the meaning of the 'Generator' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Generator' attribute. - * @see #setGenerator(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGeneratedValue_Generator() - * @model - * @generated - */ - public String getGenerator() { - return generator; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue#getGenerator Generator}' attribute. - * - * - * @param value the new value of the 'Generator' attribute. - * @see #getGenerator() - * @generated - */ - public void setGenerator(String newGenerator) { - String oldGenerator = generator; - generator = newGenerator; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR, oldGenerator, generator)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY : - return getStrategy(); - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR : - return getGenerator(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY : - setStrategy((GenerationType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR : - setGenerator((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY : - setStrategy(STRATEGY_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR : - setGenerator(GENERATOR_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY : - return strategy != STRATEGY_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR : - return GENERATOR_EDEFAULT == null ? generator != null : !GENERATOR_EDEFAULT.equals(generator); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IGeneratedValue.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY : - return JpaCoreMappingsPackage.IGENERATED_VALUE__STRATEGY; - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR : - return JpaCoreMappingsPackage.IGENERATED_VALUE__GENERATOR; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IGeneratedValue.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IGENERATED_VALUE__STRATEGY : - return JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__STRATEGY; - case JpaCoreMappingsPackage.IGENERATED_VALUE__GENERATOR : - return JpaJavaMappingsPackage.JAVA_GENERATED_VALUE__GENERATOR; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (strategy: "); - result.append(strategy); - result.append(", generator: "); - result.append(generator); - result.append(')'); - return result.toString(); - } - - public ITextRange validationTextRange() { - return this.member.annotationTextRange(DECLARATION_ANNOTATION_ADAPTER); - } - - public ITextRange generatorTextRange() { - return elementTextRange(this.member.annotationElementTextRange(GENERATOR_ADAPTER)); - } - - // ********** java annotations -> persistence model ********** - public void updateFromJava(CompilationUnit astRoot) { - setStrategy(GenerationType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot))); - setGenerator(this.generatorAdapter.getValue(astRoot)); - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildStrategyAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__STRATEGY, false); - } - - private static DeclarationAnnotationElementAdapter buildGeneratorAdapter() { - return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__GENERATOR, false); - } -} // JavaGeneratedValue diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGenerator.java deleted file mode 100644 index 8066e5356c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGenerator.java +++ /dev/null @@ -1,570 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.NumberLiteral; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.NumberStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Generator'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaGenerator() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaGenerator extends JavaEObject implements IGenerator -{ - private final Member member; - - private final AnnotationElementAdapter nameAdapter; - - private final IntAnnotationElementAdapter initialValueAdapter; - - private final IntAnnotationElementAdapter allocationSizeAdapter; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getInitialValue() Initial Value}' attribute. - * - * - * @see #getInitialValue() - * @generated - * @ordered - */ - protected static final int INITIAL_VALUE_EDEFAULT = 0; - - /** - * The default value of the '{@link #getSpecifiedInitialValue() Specified Initial Value}' attribute. - * - * - * @see #getSpecifiedInitialValue() - * @generated - * @ordered - */ - protected static final int SPECIFIED_INITIAL_VALUE_EDEFAULT = -1; - - /** - * The cached value of the '{@link #getSpecifiedInitialValue() Specified Initial Value}' attribute. - * - * - * @see #getSpecifiedInitialValue() - * @generated - * @ordered - */ - protected int specifiedInitialValue = SPECIFIED_INITIAL_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultInitialValue() Default Initial Value}' attribute. - * - * - * @see #getDefaultInitialValue() - * @generated - * @ordered - */ - protected static final int DEFAULT_INITIAL_VALUE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getDefaultInitialValue() Default Initial Value}' attribute. - * - * - * @see #getDefaultInitialValue() - * @generated - * @ordered - */ - protected int defaultInitialValue = DEFAULT_INITIAL_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getAllocationSize() Allocation Size}' attribute. - * - * - * @see #getAllocationSize() - * @generated - * @ordered - */ - protected static final int ALLOCATION_SIZE_EDEFAULT = 0; - - /** - * The default value of the '{@link #getSpecifiedAllocationSize() Specified Allocation Size}' attribute. - * - * - * @see #getSpecifiedAllocationSize() - * @generated - * @ordered - */ - protected static final int SPECIFIED_ALLOCATION_SIZE_EDEFAULT = -1; - - /** - * The cached value of the '{@link #getSpecifiedAllocationSize() Specified Allocation Size}' attribute. - * - * - * @see #getSpecifiedAllocationSize() - * @generated - * @ordered - */ - protected int specifiedAllocationSize = SPECIFIED_ALLOCATION_SIZE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultAllocationSize() Default Allocation Size}' attribute. - * - * - * @see #getDefaultAllocationSize() - * @generated - * @ordered - */ - protected static final int DEFAULT_ALLOCATION_SIZE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getDefaultAllocationSize() Default Allocation Size}' attribute. - * - * - * @see #getDefaultAllocationSize() - * @generated - * @ordered - */ - protected int defaultAllocationSize = DEFAULT_ALLOCATION_SIZE_EDEFAULT; - - protected JavaGenerator() { - throw new UnsupportedOperationException("Use JavaGenerator(Member) instead"); - } - - protected JavaGenerator(Member member) { - super(); - this.member = member; - this.nameAdapter = this.buildAdapter(this.nameAdapter()); - this.initialValueAdapter = this.buildIntAdapter(this.initialValueAdapter()); - this.allocationSizeAdapter = this.buildIntAdapter(this.allocationSizeAdapter()); - } - - protected Member getMember() { - return this.member; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IGenerator.class)) { - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - this.allocationSizeAdapter.setValue(notification.getNewIntValue()); - break; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE : - this.initialValueAdapter.setValue(notification.getNewIntValue()); - break; - case JpaJavaMappingsPackage.JAVA_GENERATOR__NAME : - this.nameAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** initialization ********** - protected AnnotationElementAdapter buildAdapter(DeclarationAnnotationElementAdapter daea) { - return new ShortCircuitAnnotationElementAdapter(this.member, daea); - } - - protected IntAnnotationElementAdapter buildIntAdapter(DeclarationAnnotationElementAdapter daea) { - return new IntAnnotationElementAdapter(this.buildAdapter(daea)); - } - - protected abstract DeclarationAnnotationAdapter annotationAdapter(); - - protected abstract DeclarationAnnotationElementAdapter nameAdapter(); - - protected abstract DeclarationAnnotationElementAdapter initialValueAdapter(); - - protected abstract DeclarationAnnotationElementAdapter allocationSizeAdapter(); - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_GENERATOR; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGenerator_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_GENERATOR__NAME, oldName, name)); - } - - public int getInitialValue() { - return (this.getSpecifiedInitialValue() == -1) ? this.getDefaultInitialValue() : this.getSpecifiedInitialValue(); - } - - /** - * Returns the value of the 'Specified Initial Value' attribute. - * The default value is "-1". - * - *

- * If the meaning of the 'Specified Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Initial Value' attribute. - * @see #setSpecifiedInitialValue(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGenerator_SpecifiedInitialValue() - * @model default="-1" - * @generated - */ - public int getSpecifiedInitialValue() { - return specifiedInitialValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator#getSpecifiedInitialValue Specified Initial Value}' attribute. - * - * - * @param value the new value of the 'Specified Initial Value' attribute. - * @see #getSpecifiedInitialValue() - * @generated - */ - public void setSpecifiedInitialValue(int newSpecifiedInitialValue) { - int oldSpecifiedInitialValue = specifiedInitialValue; - specifiedInitialValue = newSpecifiedInitialValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE, oldSpecifiedInitialValue, specifiedInitialValue)); - } - - /** - * Returns the value of the 'Default Initial Value' attribute. - * - *

- * If the meaning of the 'Default Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Initial Value' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGenerator_DefaultInitialValue() - * @model changeable="false" - * @generated - */ - public int getDefaultInitialValue() { - return defaultInitialValue; - } - - public int getAllocationSize() { - return (this.getSpecifiedAllocationSize() == -1) ? this.getDefaultAllocationSize() : this.getSpecifiedAllocationSize(); - } - - /** - * Returns the value of the 'Specified Allocation Size' attribute. - * The default value is "-1". - * - *

- * If the meaning of the 'Specified Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Allocation Size' attribute. - * @see #setSpecifiedAllocationSize(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGenerator_SpecifiedAllocationSize() - * @model default="-1" - * @generated - */ - public int getSpecifiedAllocationSize() { - return specifiedAllocationSize; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator#getSpecifiedAllocationSize Specified Allocation Size}' attribute. - * - * - * @param value the new value of the 'Specified Allocation Size' attribute. - * @see #getSpecifiedAllocationSize() - * @generated - */ - public void setSpecifiedAllocationSize(int newSpecifiedAllocationSize) { - int oldSpecifiedAllocationSize = specifiedAllocationSize; - specifiedAllocationSize = newSpecifiedAllocationSize; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE, oldSpecifiedAllocationSize, specifiedAllocationSize)); - } - - /** - * Returns the value of the 'Default Allocation Size' attribute. - * - *

- * If the meaning of the 'Default Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Allocation Size' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIGenerator_DefaultAllocationSize() - * @model changeable="false" - * @generated - */ - public int getDefaultAllocationSize() { - return defaultAllocationSize; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATOR__NAME : - return getName(); - case JpaJavaMappingsPackage.JAVA_GENERATOR__INITIAL_VALUE : - return new Integer(getInitialValue()); - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE : - return new Integer(getSpecifiedInitialValue()); - case JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_INITIAL_VALUE : - return new Integer(getDefaultInitialValue()); - case JpaJavaMappingsPackage.JAVA_GENERATOR__ALLOCATION_SIZE : - return new Integer(getAllocationSize()); - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - return new Integer(getSpecifiedAllocationSize()); - case JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE : - return new Integer(getDefaultAllocationSize()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATOR__NAME : - setName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE : - setSpecifiedInitialValue(((Integer) newValue).intValue()); - return; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - setSpecifiedAllocationSize(((Integer) newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATOR__NAME : - setName(NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE : - setSpecifiedInitialValue(SPECIFIED_INITIAL_VALUE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - setSpecifiedAllocationSize(SPECIFIED_ALLOCATION_SIZE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_GENERATOR__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case JpaJavaMappingsPackage.JAVA_GENERATOR__INITIAL_VALUE : - return getInitialValue() != INITIAL_VALUE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE : - return specifiedInitialValue != SPECIFIED_INITIAL_VALUE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_INITIAL_VALUE : - return defaultInitialValue != DEFAULT_INITIAL_VALUE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_GENERATOR__ALLOCATION_SIZE : - return getAllocationSize() != ALLOCATION_SIZE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - return specifiedAllocationSize != SPECIFIED_ALLOCATION_SIZE_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE : - return defaultAllocationSize != DEFAULT_ALLOCATION_SIZE_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IGenerator.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_GENERATOR__NAME : - return JpaCoreMappingsPackage.IGENERATOR__NAME; - case JpaJavaMappingsPackage.JAVA_GENERATOR__INITIAL_VALUE : - return JpaCoreMappingsPackage.IGENERATOR__INITIAL_VALUE; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE : - return JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_INITIAL_VALUE; - case JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_INITIAL_VALUE : - return JpaCoreMappingsPackage.IGENERATOR__DEFAULT_INITIAL_VALUE; - case JpaJavaMappingsPackage.JAVA_GENERATOR__ALLOCATION_SIZE : - return JpaCoreMappingsPackage.IGENERATOR__ALLOCATION_SIZE; - case JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - return JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_ALLOCATION_SIZE; - case JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE : - return JpaCoreMappingsPackage.IGENERATOR__DEFAULT_ALLOCATION_SIZE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IGenerator.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IGENERATOR__NAME : - return JpaJavaMappingsPackage.JAVA_GENERATOR__NAME; - case JpaCoreMappingsPackage.IGENERATOR__INITIAL_VALUE : - return JpaJavaMappingsPackage.JAVA_GENERATOR__INITIAL_VALUE; - case JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_INITIAL_VALUE : - return JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE; - case JpaCoreMappingsPackage.IGENERATOR__DEFAULT_INITIAL_VALUE : - return JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_INITIAL_VALUE; - case JpaCoreMappingsPackage.IGENERATOR__ALLOCATION_SIZE : - return JpaJavaMappingsPackage.JAVA_GENERATOR__ALLOCATION_SIZE; - case JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_ALLOCATION_SIZE : - return JpaJavaMappingsPackage.JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE; - case JpaCoreMappingsPackage.IGENERATOR__DEFAULT_ALLOCATION_SIZE : - return JpaJavaMappingsPackage.JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", specifiedInitialValue: "); - result.append(specifiedInitialValue); - result.append(", defaultInitialValue: "); - result.append(defaultInitialValue); - result.append(", specifiedAllocationSize: "); - result.append(specifiedAllocationSize); - result.append(", defaultAllocationSize: "); - result.append(defaultAllocationSize); - result.append(')'); - return result.toString(); - } - - public ITextRange validationTextRange() { - return this.member.annotationTextRange(this.annotationAdapter()); - } - - // ********** java annotations -> persistence model ********** - public void updateFromJava(CompilationUnit astRoot) { - setName(this.nameAdapter.getValue(astRoot)); - setSpecifiedInitialValue(this.initialValueAdapter.getValue(astRoot)); - setSpecifiedAllocationSize(this.allocationSizeAdapter.getValue(astRoot)); - } - - // ********** static methods ********** - protected static DeclarationAnnotationElementAdapter buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName); - } - - protected static DeclarationAnnotationElementAdapter buildNumberAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, NumberStringExpressionConverter.instance()); - } -} // JavaGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java deleted file mode 100644 index f0b7e4ed76..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java +++ /dev/null @@ -1,767 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Id'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaId() - * @model kind="class" - * @generated - */ -public class JavaId extends JavaAttributeMapping implements IId -{ - private AnnotationAdapter generatedValueAnnotationAdapter; - - private AnnotationAdapter tableGeneratorAnnotationAdapter; - - private AnnotationAdapter sequenceGeneratorAnnotationAdapter; - - private final AnnotationAdapter temporalAnnotationAdapter; - - private final AnnotationElementAdapter temporalValueAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ID); - - private static final DeclarationAnnotationAdapter TEMPORAL_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TEMPORAL); - - private static final DeclarationAnnotationElementAdapter TEMPORAL_VALUE_ADAPTER = buildTemporalValueAdapter(); - - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - /** - * The cached value of the '{@link #getGeneratedValue() Generated Value}' containment reference. - * - * - * @see #getGeneratedValue() - * @generated - * @ordered - */ - protected IGeneratedValue generatedValue; - - /** - * The default value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected static final TemporalType TEMPORAL_EDEFAULT = TemporalType.NULL; - - /** - * The cached value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected TemporalType temporal = TEMPORAL_EDEFAULT; - - /** - * The cached value of the '{@link #getTableGenerator() Table Generator}' containment reference. - * - * - * @see #getTableGenerator() - * @generated - * @ordered - */ - protected ITableGenerator tableGenerator; - - /** - * The cached value of the '{@link #getSequenceGenerator() Sequence Generator}' containment reference. - * - * - * @see #getSequenceGenerator() - * @generated - * @ordered - */ - protected ISequenceGenerator sequenceGenerator; - - protected JavaId() { - throw new UnsupportedOperationException("Use JavaId(Attribute) instead"); - } - - protected JavaId(Attribute attribute) { - super(attribute); - this.column = JavaColumn.createColumnMappingColumn(buildColumnOwner(), getAttribute()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__COLUMN, null, null); - this.temporalAnnotationAdapter = new MemberAnnotationAdapter(this.getAttribute(), TEMPORAL_ADAPTER); - this.temporalValueAdapter = new ShortCircuitAnnotationElementAdapter(attribute, TEMPORAL_VALUE_ADAPTER); - this.generatedValueAnnotationAdapter = this.buildAnnotationAdapter(JavaGeneratedValue.DECLARATION_ANNOTATION_ADAPTER); - this.tableGeneratorAnnotationAdapter = this.buildAnnotationAdapter(JavaTableGenerator.DECLARATION_ANNOTATION_ADAPTER); - this.sequenceGeneratorAnnotationAdapter = this.buildAnnotationAdapter(JavaSequenceGenerator.DECLARATION_ANNOTATION_ADAPTER); - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IId.class)) { - case JpaCoreMappingsPackage.IID__TABLE_GENERATOR : - attributeChanged(notification.getNewValue(), this.tableGeneratorAnnotationAdapter); - break; - case JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR : - attributeChanged(notification.getNewValue(), this.sequenceGeneratorAnnotationAdapter); - break; - case JpaCoreMappingsPackage.IID__GENERATED_VALUE : - attributeChanged(notification.getNewValue(), this.generatedValueAnnotationAdapter); - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ID; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

- * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIId_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Generated Value' containment reference. - * - *

- * If the meaning of the 'Generated Value' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Generated Value' containment reference. - * @see #setGeneratedValue(IGeneratedValue) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIId_GeneratedValue() - * @model containment="true" - * @generated - */ - public IGeneratedValue getGeneratedValue() { - return generatedValue; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetGeneratedValue(IGeneratedValue newGeneratedValue, NotificationChain msgs) { - IGeneratedValue oldGeneratedValue = generatedValue; - generatedValue = newGeneratedValue; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE, oldGeneratedValue, newGeneratedValue); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId#getGeneratedValue Generated Value}' containment reference. - * - * - * @param value the new value of the 'Generated Value' containment reference. - * @see #getGeneratedValue() - * @generated - */ - public void setGeneratedValue(IGeneratedValue newGeneratedValue) { - if (newGeneratedValue != generatedValue) { - NotificationChain msgs = null; - if (generatedValue != null) - msgs = ((InternalEObject) generatedValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE, null, msgs); - if (newGeneratedValue != null) - msgs = ((InternalEObject) newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE, null, msgs); - msgs = basicSetGeneratedValue(newGeneratedValue, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE, newGeneratedValue, newGeneratedValue)); - } - - private static void attributeChanged(Object value, AnnotationAdapter annotationAdapter) { - Annotation annotation = annotationAdapter.getAnnotation(); - if (value == null) { - if (annotation != null) { - annotationAdapter.removeAnnotation(); - } - } - else { - if (annotation == null) { - annotationAdapter.newMarkerAnnotation(); - } - } - } - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

- * If the meaning of the 'Temporal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIId_Temporal() - * @model - * @generated - */ - public TemporalType getTemporal() { - return temporal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - public void setTemporalGen(TemporalType newTemporal) { - TemporalType oldTemporal = temporal; - temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__TEMPORAL, oldTemporal, temporal)); - } - - public void setTemporal(TemporalType newTemporal) { - if (newTemporal != TemporalType.NULL) { - if (this.temporalAnnotationAdapter.getAnnotation() == null) { - this.temporalAnnotationAdapter.newMarkerAnnotation(); - } - this.temporalValueAdapter.setValue(newTemporal.convertToJavaAnnotationValue()); - } - else if (this.temporalAnnotationAdapter.getAnnotation() != null) { - this.temporalAnnotationAdapter.removeAnnotation(); - } - setTemporalGen(newTemporal); - } - - /** - * Returns the value of the 'Table Generator' containment reference. - * - *

- * If the meaning of the 'Table Generator' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table Generator' containment reference. - * @see #setTableGenerator(ITableGenerator) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIId_TableGenerator() - * @model containment="true" - * @generated - */ - public ITableGenerator getTableGenerator() { - return tableGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTableGenerator(ITableGenerator newTableGenerator, NotificationChain msgs) { - ITableGenerator oldTableGenerator = tableGenerator; - tableGenerator = newTableGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR, oldTableGenerator, newTableGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId#getTableGenerator Table Generator}' containment reference. - * - * - * @param value the new value of the 'Table Generator' containment reference. - * @see #getTableGenerator() - * @generated - */ - public void setTableGenerator(ITableGenerator newTableGenerator) { - if (newTableGenerator != tableGenerator) { - NotificationChain msgs = null; - if (tableGenerator != null) - msgs = ((InternalEObject) tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR, null, msgs); - if (newTableGenerator != null) - msgs = ((InternalEObject) newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR, null, msgs); - msgs = basicSetTableGenerator(newTableGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR, newTableGenerator, newTableGenerator)); - } - - /** - * Returns the value of the 'Sequence Generator' containment reference. - * - *

- * If the meaning of the 'Sequence Generator' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Sequence Generator' containment reference. - * @see #setSequenceGenerator(ISequenceGenerator) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIId_SequenceGenerator() - * @model containment="true" - * @generated - */ - public ISequenceGenerator getSequenceGenerator() { - return sequenceGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSequenceGenerator(ISequenceGenerator newSequenceGenerator, NotificationChain msgs) { - ISequenceGenerator oldSequenceGenerator = sequenceGenerator; - sequenceGenerator = newSequenceGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId#getSequenceGenerator Sequence Generator}' containment reference. - * - * - * @param value the new value of the 'Sequence Generator' containment reference. - * @see #getSequenceGenerator() - * @generated - */ - public void setSequenceGenerator(ISequenceGenerator newSequenceGenerator) { - if (newSequenceGenerator != sequenceGenerator) { - NotificationChain msgs = null; - if (sequenceGenerator != null) - msgs = ((InternalEObject) sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR, null, msgs); - if (newSequenceGenerator != null) - msgs = ((InternalEObject) newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR, null, msgs); - msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ID__COLUMN : - return basicSetColumn(null, msgs); - case JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE : - return basicSetGeneratedValue(null, msgs); - case JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR : - return basicSetTableGenerator(null, msgs); - case JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR : - return basicSetSequenceGenerator(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ID__COLUMN : - return getColumn(); - case JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE : - return getGeneratedValue(); - case JpaJavaMappingsPackage.JAVA_ID__TEMPORAL : - return getTemporal(); - case JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR : - return getTableGenerator(); - case JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR : - return getSequenceGenerator(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE : - setGeneratedValue((IGeneratedValue) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ID__TEMPORAL : - setTemporal((TemporalType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE : - setGeneratedValue((IGeneratedValue) null); - return; - case JpaJavaMappingsPackage.JAVA_ID__TEMPORAL : - setTemporal(TEMPORAL_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) null); - return; - case JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ID__COLUMN : - return column != null; - case JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE : - return generatedValue != null; - case JpaJavaMappingsPackage.JAVA_ID__TEMPORAL : - return temporal != TEMPORAL_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR : - return tableGenerator != null; - case JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR : - return sequenceGenerator != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IId.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ID__COLUMN : - return JpaCoreMappingsPackage.IID__COLUMN; - case JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE : - return JpaCoreMappingsPackage.IID__GENERATED_VALUE; - case JpaJavaMappingsPackage.JAVA_ID__TEMPORAL : - return JpaCoreMappingsPackage.IID__TEMPORAL; - case JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR : - return JpaCoreMappingsPackage.IID__TABLE_GENERATOR; - case JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR : - return JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IId.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IID__COLUMN : - return JpaJavaMappingsPackage.JAVA_ID__COLUMN; - case JpaCoreMappingsPackage.IID__GENERATED_VALUE : - return JpaJavaMappingsPackage.JAVA_ID__GENERATED_VALUE; - case JpaCoreMappingsPackage.IID__TEMPORAL : - return JpaJavaMappingsPackage.JAVA_ID__TEMPORAL; - case JpaCoreMappingsPackage.IID__TABLE_GENERATOR : - return JpaJavaMappingsPackage.JAVA_ID__TABLE_GENERATOR; - case JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR : - return JpaJavaMappingsPackage.JAVA_ID__SEQUENCE_GENERATOR; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (temporal: "); - result.append(temporal); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.updateTemporalFromJava(astRoot); - this.getJavaColumn().updateFromJava(astRoot); - this.updateGeneratedValueFromJava(astRoot); - this.updateTableGeneratorFromJava(astRoot); - this.updateSequenceGeneratorFromJava(astRoot); - } - - private void updateGeneratedValueFromJava(CompilationUnit astRoot) { - if (this.generatedValueAnnotationAdapter.getAnnotation(astRoot) == null) { - if (getGeneratedValue() != null) { - setGeneratedValue(null); - } - } - else { - if (getGeneratedValue() == null) { - setGeneratedValue(createGeneratedValue()); - } - ((JavaGeneratedValue) getGeneratedValue()).updateFromJava(astRoot); - } - } - - private void updateTableGeneratorFromJava(CompilationUnit astRoot) { - if (this.tableGeneratorAnnotationAdapter.getAnnotation(astRoot) == null) { - if (getTableGenerator() != null) { - setTableGenerator(null); - } - } - else { - if (getTableGenerator() == null) { - setTableGenerator(createTableGenerator()); - } - ((JavaTableGenerator) getTableGenerator()).updateFromJava(astRoot); - } - } - - private void updateSequenceGeneratorFromJava(CompilationUnit astRoot) { - if (this.sequenceGeneratorAnnotationAdapter.getAnnotation(astRoot) == null) { - if (getSequenceGenerator() != null) { - setSequenceGenerator(null); - } - } - else { - if (getSequenceGenerator() == null) { - setSequenceGenerator(createSequenceGenerator()); - } - ((JavaSequenceGenerator) getSequenceGenerator()).updateFromJava(astRoot); - } - } - - /* - * The @Temporal annotation is a bit different than most JPA annotations. - * For some indecipherable reason it has no default value (e.g. TIMESTAMP). - * Also, it is *required* for any attribute declared with a type of - * java.util.Date or java.util.Calendar; otherwise, it is *prohibited*. - * As a result we allow a Basic mapping to have a null 'temporal', - * indicating that the annotation is completely missing, as opposed - * to the annotation being present but its value is invalid (e.g. - * @Temporal(FRIDAY)). - * - * TODO this comment is wrong now, revisit this with Brian at some point - */ - private void updateTemporalFromJava(CompilationUnit astRoot) { - if (this.temporalAnnotationAdapter.getAnnotation(astRoot) == null) { - setTemporalGen(TemporalType.NULL); - } - else { - setTemporalGen(TemporalType.fromJavaAnnotationValue(this.temporalValueAdapter.getValue(astRoot))); - } - } - - private JavaColumn getJavaColumn() { - return (JavaColumn) this.column; - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - result = this.getJavaColumn().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - return null; - } - - @Override - public String primaryKeyColumnName() { - return this.getColumn().getName(); - } - - public IGeneratedValue createGeneratedValue() { - return JpaJavaMappingsFactory.eINSTANCE.createJavaGeneratedValue(getAttribute()); - } - - public ISequenceGenerator createSequenceGenerator() { - return JpaJavaMappingsFactory.eINSTANCE.createJavaSequenceGenerator(getAttribute()); - } - - public ITableGenerator createTableGenerator() { - return JpaJavaMappingsFactory.eINSTANCE.createJavaTableGenerator(getAttribute()); - } - - @Override - public boolean isOverridableAttributeMapping() { - return true; - } - - @Override - public boolean isIdMapping() { - return true; - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildTemporalValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(TEMPORAL_ADAPTER, JPA.TEMPORAL__VALUE, false); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaIdProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaIdProvider.java deleted file mode 100644 index 7b77578c86..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaIdProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaIdProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaIdProvider INSTANCE = new JavaIdProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaIdProvider() { - super(); - } - - public String key() { - return IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaId(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaId.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinColumn.java deleted file mode 100644 index 76b27dce41..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinColumn.java +++ /dev/null @@ -1,517 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Join Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaJoinColumn() - * @model kind="class" - * @generated - */ -public class JavaJoinColumn extends AbstractJavaColumn implements IJoinColumn -{ - /** - * The default value of the '{@link #getReferencedColumnName() Referenced Column Name}' attribute. - * - * - * @see #getReferencedColumnName() - * @generated - * @ordered - */ - protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected String specifiedReferencedColumnName = SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected String defaultReferencedColumnName = DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT; - - private final IndexedAnnotationAdapter annotationAdapter; - - // hold this so we can get the 'referenced column name' text range - private final DeclarationAnnotationElementAdapter referencedColumnNameDeclarationAdapter; - - private final AnnotationElementAdapter referencedColumnNameAdapter; - - public static final SimpleDeclarationAnnotationAdapter SINGLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.JOIN_COLUMN); - - public static final SimpleDeclarationAnnotationAdapter MULTIPLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.JOIN_COLUMNS); - - protected JavaJoinColumn() { - super(); - throw new UnsupportedOperationException("Use JavaJoinColumn(Owner, Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - protected JavaJoinColumn(IJoinColumn.Owner owner, Member member, IndexedDeclarationAnnotationAdapter daa) { - super(owner, member, daa); - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, daa); - this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME); - this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter); - } - - @Override - protected String nameElementName() { - return JPA.JOIN_COLUMN__NAME; - } - - @Override - protected String columnDefinitionElementName() { - return JPA.JOIN_COLUMN__COLUMN_DEFINITION; - } - - @Override - protected String tableElementName() { - return JPA.JOIN_COLUMN__TABLE; - } - - @Override - protected String uniqueElementName() { - return JPA.JOIN_COLUMN__UNIQUE; - } - - @Override - protected String nullableElementName() { - return JPA.JOIN_COLUMN__NULLABLE; - } - - @Override - protected String insertableElementName() { - return JPA.JOIN_COLUMN__INSERTABLE; - } - - @Override - protected String updatableElementName() { - return JPA.JOIN_COLUMN__UPDATABLE; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IAbstractJoinColumn.class)) { - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - this.referencedColumnNameAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_JOIN_COLUMN; - } - - /** - * Returns the value of the 'Referenced Column Name' attribute. - * - *

- * If the meaning of the 'Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIJoinColumn_ReferencedColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getReferencedColumnName() { - return (this.specifiedReferencedColumnName == null) ? this.defaultReferencedColumnName : this.specifiedReferencedColumnName; - } - - /** - * Returns the value of the 'Specified Referenced Column Name' attribute. - * - *

- * If the meaning of the 'Specified Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Referenced Column Name' attribute. - * @see #setSpecifiedReferencedColumnName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractJoinColumn_SpecifiedReferencedColumnName() - * @model - * @generated - */ - public String getSpecifiedReferencedColumnName() { - return specifiedReferencedColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name' attribute. - * @see #getSpecifiedReferencedColumnName() - * @generated - */ - public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) { - String oldSpecifiedReferencedColumnName = specifiedReferencedColumnName; - specifiedReferencedColumnName = newSpecifiedReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME, oldSpecifiedReferencedColumnName, specifiedReferencedColumnName)); - } - - /** - * Returns the value of the 'Default Referenced Column Name' attribute. - * - *

- * If the meaning of the 'Default Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractJoinColumn_DefaultReferencedColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultReferencedColumnName() { - return defaultReferencedColumnName; - } - - protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) { - String oldDefaultReferencedColumnName = this.defaultReferencedColumnName; - this.defaultReferencedColumnName = newDefaultReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME, oldDefaultReferencedColumnName, newDefaultReferencedColumnName)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return getReferencedColumnName(); - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return getSpecifiedReferencedColumnName(); - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return getDefaultReferencedColumnName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName(SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return REFERENCED_COLUMN_NAME_EDEFAULT == null ? getReferencedColumnName() != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(getReferencedColumnName()); - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT == null ? specifiedReferencedColumnName != null : !SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT.equals(specifiedReferencedColumnName); - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT == null ? defaultReferencedColumnName != null : !DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT.equals(defaultReferencedColumnName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IJoinColumn.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IJoinColumn.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedReferencedColumnName: "); - result.append(specifiedReferencedColumnName); - result.append(", defaultReferencedColumnName: "); - result.append(defaultReferencedColumnName); - result.append(')'); - return result.toString(); - } - - @Override - public IJoinColumn.Owner getOwner() { - return (IJoinColumn.Owner) super.getOwner(); - } - - public Table dbReferencedColumnTable() { - return getOwner().dbReferencedColumnTable(); - } - - public Column dbReferencedColumn() { - Table table = this.dbReferencedColumnTable(); - return (table == null) ? null : table.columnNamed(this.getReferencedColumnName()); - } - - @Override - public boolean tableIsAllowed() { - return this.getOwner().tableIsAllowed(); - } - - public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot); - } - - private Iterator candidateReferencedColumnNames() { - Table table = this.getOwner().dbReferencedColumnTable(); - return (table != null) ? table.columnNames() : EmptyIterator. instance(); - } - - private Iterator candidateReferencedColumnNames(Filter filter) { - return new FilteringIterator(this.candidateReferencedColumnNames(), filter); - } - - private Iterator quotedCandidateReferencedColumnNames(Filter filter) { - return StringTools.quote(this.candidateReferencedColumnNames(filter)); - } - - @Override - public Iterator connectedCandidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.connectedCandidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.referencedColumnNameTouches(pos, astRoot)) { - return this.quotedCandidateReferencedColumnNames(filter); - } - return null; - } - - public boolean isReferencedColumnResolved() { - return dbReferencedColumn() != null; - } - - public ITextRange referencedColumnNameTextRange() { - return elementTextRange(this.referencedColumnNameDeclarationAdapter); - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.setSpecifiedReferencedColumnName(this.referencedColumnNameAdapter.getValue(astRoot)); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.setDefaultReferencedColumnName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY)); - this.setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_NAME_KEY)); - this.setDefaultTable((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_TABLE_KEY)); - } - - // ********** persistence model -> java annotations ********** - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - // ********** static methods ********** - static JavaJoinColumn createSingleRelationshipMappingJoinColumn(IJoinColumn.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaJoinColumn(owner, member, buildSingleRelationshipMappingAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildSingleRelationshipMappingAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.JOIN_COLUMN); - } - - static JavaJoinColumn createAssociationOverrideJoinColumn(DeclarationAnnotationAdapter associationOverrideAdapter, IJoinColumn.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaJoinColumn(owner, member, buildAssociationOverrideAnnotationAdapter(associationOverrideAdapter, index)); - } - - private static IndexedDeclarationAnnotationAdapter buildAssociationOverrideAnnotationAdapter(DeclarationAnnotationAdapter associationOverrideAdapter, int index) { - return new NestedIndexedDeclarationAnnotationAdapter(associationOverrideAdapter, JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN); - } - - static JavaJoinColumn createJoinTableJoinColumn(IJoinColumn.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaJoinColumn(owner, member, buildJoinTableAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildJoinTableAnnotationAdapter(int index) { - return new NestedIndexedDeclarationAnnotationAdapter(JavaJoinTable.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN); - } - - static JavaJoinColumn createJoinTableInverseJoinColumn(IJoinColumn.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaJoinColumn(owner, member, buildJoinTableInverseAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildJoinTableInverseAnnotationAdapter(int index) { - return new NestedIndexedDeclarationAnnotationAdapter(JavaJoinTable.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS, index, JPA.JOIN_COLUMN); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java deleted file mode 100644 index 60bbfddf6c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java +++ /dev/null @@ -1,822 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Join Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaJoinTable() - * @model kind="class" - * @generated - */ -public class JavaJoinTable extends AbstractJavaTable implements IJoinTable -{ - /** - * The cached value of the '{@link #getSpecifiedJoinColumns() Specified Join Columns}' containment reference list. - * - * - * @see #getSpecifiedJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedJoinColumns; - - /** - * The cached value of the '{@link #getDefaultJoinColumns() Default Join Columns}' containment reference list. - * - * - * @see #getDefaultJoinColumns() - * @generated - * @ordered - */ - protected EList defaultJoinColumns; - - /** - * The cached value of the '{@link #getSpecifiedInverseJoinColumns() Specified Inverse Join Columns}' containment reference list. - * - * - * @see #getSpecifiedInverseJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedInverseJoinColumns; - - /** - * The cached value of the '{@link #getDefaultInverseJoinColumns() Default Inverse Join Columns}' containment reference list. - * - * - * @see #getDefaultInverseJoinColumns() - * @generated - * @ordered - */ - protected EList defaultInverseJoinColumns; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.JOIN_TABLE); - - private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__NAME); - - private static final DeclarationAnnotationElementAdapter SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__SCHEMA); - - private static final DeclarationAnnotationElementAdapter CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__CATALOG); - - protected JavaJoinTable() { - super(); - throw new UnsupportedOperationException("Use JavaJoinTable(Owner, Member) instead"); - } - - protected JavaJoinTable(Owner owner, Member member) { - super(owner, member, DECLARATION_ANNOTATION_ADAPTER); - this.getDefaultJoinColumns().add(this.createJoinColumn(new JoinColumnOwner(this), member)); - this.getDefaultInverseJoinColumns().add(this.createJoinColumn(new InverseJoinColumnOwner(this), member)); - } - - // ********** AbstractJavaTable implementation ********** - @Override - protected DeclarationAnnotationElementAdapter nameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - // ignore the daa passed in, @JoinTable is never nested - return NAME_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter schemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - // ignore the daa passed in, @JoinTable is never nested - return SCHEMA_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter catalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - // ignore the daa passed in, @JoinTable is never nested - return CATALOG_ADAPTER; - } - - private IJoinColumn createJoinColumn(IJoinColumn.Owner joinColumnOwner, Member joinColumnMember) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaJoinColumn(joinColumnOwner, joinColumnMember); - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IJoinTable.class)) { - case JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - specifiedJoinColumnsChanged(notification); - break; - case JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - specifiedInverseJoinColumnsChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void specifiedJoinColumnsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - specifiedJoinColumnAdded(notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - case Notification.ADD_MANY : - specifiedJoinColumnsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - specifiedJoinColumnRemoved(notification.getPosition(), (IJoinColumn) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - specifiedJoinColumnsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - specifiedJoinColumnsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - specifiedJoinColumnSet(notification.getPosition(), (IJoinColumn) notification.getOldValue(), (IJoinColumn) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - specifiedJoinColumnMoved(notification.getOldIntValue(), notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void specifiedInverseJoinColumnsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - specifiedInverseJoinColumnAdded(notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - case Notification.ADD_MANY : - specifiedInverseJoinColumnsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - specifiedInverseJoinColumnRemoved(notification.getPosition(), (IJoinColumn) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - specifiedInverseJoinColumnsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - specifiedInverseJoinColumnsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - specifiedInverseJoinColumnSet(notification.getPosition(), (IJoinColumn) notification.getOldValue(), (IJoinColumn) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - specifiedInverseJoinColumnMoved(notification.getOldIntValue(), notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_JOIN_TABLE; - } - - public EList getJoinColumns() { - return this.getSpecifiedJoinColumns().isEmpty() ? this.getDefaultJoinColumns() : this.getSpecifiedJoinColumns(); - } - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIJoinTable_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedJoinColumns() { - if (specifiedJoinColumns == null) { - specifiedJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS); - } - return specifiedJoinColumns; - } - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIJoinTable_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultJoinColumns() { - if (defaultJoinColumns == null) { - defaultJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS); - } - return defaultJoinColumns; - } - - public EList getInverseJoinColumns() { - return this.getSpecifiedInverseJoinColumns().isEmpty() ? this.getDefaultInverseJoinColumns() : this.getSpecifiedInverseJoinColumns(); - } - - /** - * Returns the value of the 'Specified Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Specified Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIJoinTable_SpecifiedInverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedInverseJoinColumns() { - if (specifiedInverseJoinColumns == null) { - specifiedInverseJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS); - } - return specifiedInverseJoinColumns; - } - - /** - * Returns the value of the 'Default Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Default Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIJoinTable_DefaultInverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultInverseJoinColumns() { - if (defaultInverseJoinColumns == null) { - defaultInverseJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS); - } - return defaultInverseJoinColumns; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__JOIN_COLUMNS : - return ((InternalEList) getJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return ((InternalEList) getDefaultJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return ((InternalEList) getInverseJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedInverseJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return ((InternalEList) getDefaultInverseJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__JOIN_COLUMNS : - return getJoinColumns(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return getSpecifiedJoinColumns(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return getDefaultJoinColumns(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return getInverseJoinColumns(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return getSpecifiedInverseJoinColumns(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return getDefaultInverseJoinColumns(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - getSpecifiedJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - getDefaultJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - getSpecifiedInverseJoinColumns().clear(); - getSpecifiedInverseJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - getDefaultInverseJoinColumns().clear(); - getDefaultInverseJoinColumns().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - getSpecifiedInverseJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - getDefaultInverseJoinColumns().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__JOIN_COLUMNS : - return !getJoinColumns().isEmpty(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return specifiedJoinColumns != null && !specifiedJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return defaultJoinColumns != null && !defaultJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return !getInverseJoinColumns().isEmpty(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return specifiedInverseJoinColumns != null && !specifiedInverseJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return defaultInverseJoinColumns != null && !defaultInverseJoinColumns.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJoinTable.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__INVERSE_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJoinTable.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IJOIN_TABLE__JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_JOIN_TABLE__JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__INVERSE_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_JOIN_TABLE__INVERSE_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public IRelationshipMapping relationshipMapping() { - return (IRelationshipMapping) this.eContainer(); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.updateSpecifiedJoinColumnsFromJava(astRoot); - this.updateSpecifiedInverseJoinColumnsFromJava(astRoot); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - this.setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_TABLE_NAME_KEY)); - } - - public boolean isSpecified() { - return getMember().containsAnnotation(DECLARATION_ANNOTATION_ADAPTER); - } - - /** - * here we just worry about getting the join column lists the same size; - * then we delegate to the join columns to synch themselves up - */ - private void updateSpecifiedJoinColumnsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List joinColumns = this.getSpecifiedJoinColumns(); - int persSize = joinColumns.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaJoinColumn joinColumn = (JavaJoinColumn) joinColumns.get(i); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - joinColumn.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - joinColumns.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaJoinColumn joinColumn = this.createJavaJoinColumn(javaSize); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - this.getSpecifiedJoinColumns().add(joinColumn); - joinColumn.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * here we just worry about getting the inverse join column lists the same size; - * then we delegate to the join columns to synch themselves up - */ - private void updateSpecifiedInverseJoinColumnsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List inverseJoinColumns = this.getSpecifiedInverseJoinColumns(); - int persSize = inverseJoinColumns.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaJoinColumn inverseJoinColumn = (JavaJoinColumn) inverseJoinColumns.get(i); - if (inverseJoinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - inverseJoinColumn.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - inverseJoinColumns.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaJoinColumn inverseJoinColumn = this.createJavaInverseJoinColumn(javaSize); - if (inverseJoinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - this.getSpecifiedInverseJoinColumns().add(inverseJoinColumn); - inverseJoinColumn.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - // ********** jpa model -> java annotations ********** - //////////////////////////////////////////////////////// - /** - * slide over all the annotations that follow the new join column - */ - public void specifiedJoinColumnAdded(int index, IJoinColumn joinColumn) { - // JoinColumn was added to jpa model when updating from java, do not need - // to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaJoinColumn) joinColumn).annotation(getMember().astRoot()) == null) { - this.synchJoinColumnAnnotationsAfterAdd(index + 1); - ((JavaJoinColumn) joinColumn).newAnnotation(); - } - } - - // bjv look at this - public void specifiedJoinColumnsAdded(int index, List joinColumns) { - // JoinColumn was added to jpa model when updating from java, do not need - // to edit the java in this case. TODO is there a better way to handle this?? - if (!joinColumns.isEmpty() && ((JavaJoinColumn) joinColumns.get(0)).annotation(getMember().astRoot()) == null) { - this.synchJoinColumnAnnotationsAfterAdd(index + joinColumns.size()); - for (IJoinColumn joinColumn : joinColumns) { - ((JavaJoinColumn) joinColumn).newAnnotation(); - } - } - } - - public void specifiedJoinColumnRemoved(int index, IJoinColumn joinColumn) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - this.synchJoinColumnAnnotationsAfterRemove(index); - } - - public void specifiedJoinColumnsRemoved(int[] indexes, List joinColumns) { - for (IJoinColumn joinColumn : joinColumns) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - } - this.synchJoinColumnAnnotationsAfterRemove(indexes[0]); - } - - public void specifiedJoinColumnsCleared(List joinColumns) { - for (IJoinColumn joinColumn : joinColumns) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - } - } - - public void specifiedJoinColumnSet(int index, IJoinColumn oldJoinColumn, IJoinColumn newJoinColumn) { - ((JavaJoinColumn) newJoinColumn).newAnnotation(); - } - - public void specifiedJoinColumnMoved(int sourceIndex, int targetIndex, IJoinColumn joinColumn) { - List joinColumns = this.getSpecifiedJoinColumns(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchJoinColumnAnnotationsAfterAdd(int index) { - List joinColumns = this.getSpecifiedJoinColumns(); - for (int i = joinColumns.size(); i-- > index;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchJoinColumnAnnotationsAfterRemove(int index) { - List joinColumns = this.getSpecifiedJoinColumns(); - for (int i = index; i < joinColumns.size(); i++) { - this.synch(joinColumns.get(i), i); - } - } - - //////////////////////////////////////////////////////// - /** - * slide over all the annotations that follow the new inverse join column - */ - public void specifiedInverseJoinColumnAdded(int index, IJoinColumn inverseJoinColumn) { - if (((JavaJoinColumn) inverseJoinColumn).annotation(getMember().astRoot()) == null) { - this.synchInverseJoinColumnAnnotationsAfterAdd(index + 1); - ((JavaJoinColumn) inverseJoinColumn).newAnnotation(); - } - } - - public void specifiedInverseJoinColumnsAdded(int index, List inverseJoinColumns) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!inverseJoinColumns.isEmpty() && ((JavaJoinColumn) inverseJoinColumns.get(0)).annotation(getMember().astRoot()) == null) { - this.synchInverseJoinColumnAnnotationsAfterAdd(index + inverseJoinColumns.size()); - for (IJoinColumn inverseJoinColumn : inverseJoinColumns) { - ((JavaJoinColumn) inverseJoinColumn).newAnnotation(); - } - } - } - - public void specifiedInverseJoinColumnRemoved(int index, IJoinColumn inverseJoinColumn) { - ((JavaJoinColumn) inverseJoinColumn).removeAnnotation(); - this.synchInverseJoinColumnAnnotationsAfterRemove(index); - } - - public void specifiedInverseJoinColumnsRemoved(int[] indexes, List inverseJoinColumns) { - for (IJoinColumn inverseJoinColumn : inverseJoinColumns) { - ((JavaJoinColumn) inverseJoinColumn).removeAnnotation(); - } - this.synchInverseJoinColumnAnnotationsAfterRemove(indexes[0]); - } - - public void specifiedInverseJoinColumnsCleared(List inverseJoinColumns) { - for (IJoinColumn inverseJoinColumn : inverseJoinColumns) { - ((JavaJoinColumn) inverseJoinColumn).removeAnnotation(); - } - } - - public void specifiedInverseJoinColumnSet(int index, IJoinColumn oldInverseJoinColumn, IJoinColumn newInverseJoinColumn) { - ((JavaJoinColumn) newInverseJoinColumn).newAnnotation(); - } - - public void specifiedInverseJoinColumnMoved(int sourceIndex, int targetIndex, IJoinColumn inverseJoinColumn) { - List inverseJoinColumns = this.getSpecifiedInverseJoinColumns(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(inverseJoinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model inverse join columns, - * starting at the end of the list to prevent overlap - */ - private void synchInverseJoinColumnAnnotationsAfterAdd(int index) { - List inverseJoinColumns = this.getSpecifiedInverseJoinColumns(); - for (int i = inverseJoinColumns.size(); i-- > index;) { - this.synch(inverseJoinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model inverse join columns, - * starting at the specified index to prevent overlap - */ - private void synchInverseJoinColumnAnnotationsAfterRemove(int index) { - List inverseJoinColumns = this.getSpecifiedInverseJoinColumns(); - for (int i = index; i < inverseJoinColumns.size(); i++) { - this.synch(inverseJoinColumns.get(i), i); - } - } - - private void synch(IJoinColumn joinColumn, int index) { - ((JavaJoinColumn) joinColumn).moveAnnotation(index); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (IJoinColumn column : this.getJoinColumns()) { - result = ((JavaJoinColumn) column).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - for (IJoinColumn column : this.getInverseJoinColumns()) { - result = ((JavaJoinColumn) column).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - @Override - protected JavaUniqueConstraint createJavaUniqueConstraint(int index) { - return JavaUniqueConstraint.createJoinTableUniqueConstraint(new UniqueConstraintOwner(this), this.getMember(), index); - } - - // ********** IJoinTable implementation ********** - public IJoinColumn createJoinColumn(int index) { - return this.createJavaJoinColumn(index); - } - - private JavaJoinColumn createJavaJoinColumn(int index) { - return JavaJoinColumn.createJoinTableJoinColumn(new JoinColumnOwner(this), this.getMember(), index); - } - - public IJoinColumn createInverseJoinColumn(int index) { - return this.createJavaInverseJoinColumn(index); - } - - private JavaJoinColumn createJavaInverseJoinColumn(int index) { - return JavaJoinColumn.createJoinTableInverseJoinColumn(new InverseJoinColumnOwner(this), this.getMember(), index); - } - - public boolean containsSpecifiedJoinColumns() { - return !this.getSpecifiedJoinColumns().isEmpty(); - } - - public boolean containsSpecifiedInverseJoinColumns() { - return !this.getSpecifiedInverseJoinColumns().isEmpty(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java deleted file mode 100644 index 28f5a1e604..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; - -/** - * - * A representation of the model object 'Java Many To Many'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaManyToMany() - * @model kind="class" - * @generated - */ -public class JavaManyToMany extends JavaMultiRelationshipMapping - implements IManyToMany -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.MANY_TO_MANY); - - private static final DeclarationAnnotationElementAdapter TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__TARGET_ENTITY); - - private static final DeclarationAnnotationElementAdapter CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE); - - private static final DeclarationAnnotationElementAdapter FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__FETCH); - - private static final DeclarationAnnotationElementAdapter MAPPED_BY_ADAPTER = buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__MAPPED_BY); - - protected JavaManyToMany() { - throw new UnsupportedOperationException("Use JavaManyToMany(Attribute) instead"); - } - - protected JavaManyToMany(Attribute attribute) { - super(attribute); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_MANY_TO_MANY; - } - - public String getKey() { - return IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - // ********** JavaRelationshipMappingModelAdapter implementation ********** - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter targetEntityAdapter() { - return TARGET_ENTITY_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter cascadeAdapter() { - return CASCADE_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter fetchAdapter() { - return FETCH_ADAPTER; - } - - // ********** JavaMultiRelationshipMappingModelAdapter implementation ********** - @Override - protected DeclarationAnnotationElementAdapter mappedByAdapter() { - return MAPPED_BY_ADAPTER; - } - - // ********** INonOwningMapping implementation ********** - public boolean mappedByIsValid(IAttributeMapping mappedByMapping) { - String mappedByKey = mappedByMapping.getKey(); - return (mappedByKey == IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToManyProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToManyProvider.java deleted file mode 100644 index 783f54e186..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToManyProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaManyToManyProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaManyToManyProvider INSTANCE = new JavaManyToManyProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaManyToManyProvider() { - super(); - } - - public String key() { - return IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaManyToMany(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaManyToMany.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java deleted file mode 100644 index e54bf3f6fc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; - -/** - * - * A representation of the model object 'Java Many To One'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaManyToOne() - * @model kind="class" - * @generated - */ -public class JavaManyToOne extends JavaSingleRelationshipMapping - implements IManyToOne -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.MANY_TO_ONE); - - private static final DeclarationAnnotationElementAdapter TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__TARGET_ENTITY); - - private static final DeclarationAnnotationElementAdapter CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE); - - private static final DeclarationAnnotationElementAdapter FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__FETCH); - - private static final DeclarationAnnotationElementAdapter OPTIONAL_ADAPTER = buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__OPTIONAL); - - protected JavaManyToOne() { - throw new UnsupportedOperationException("Use JavaManyToOne(Attribute) instead"); - } - - protected JavaManyToOne(Attribute attribute) { - super(attribute); - } - - // ********** initialization ********** - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter targetEntityAdapter() { - return TARGET_ENTITY_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter cascadeAdapter() { - return CASCADE_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter fetchAdapter() { - return FETCH_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter optionalAdapter() { - return OPTIONAL_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_MANY_TO_ONE; - } - - public String getKey() { - return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public boolean isOverridableAssociationMapping() { - return true; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOneProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOneProvider.java deleted file mode 100644 index 52e0ab4aa9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOneProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaManyToOneProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaManyToOneProvider INSTANCE = new JavaManyToOneProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaManyToOneProvider() { - super(); - } - - public String key() { - return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaManyToOne(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaManyToOne.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java deleted file mode 100644 index ec505b2f52..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java +++ /dev/null @@ -1,330 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.TypeLiteral; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Java Mapped Superclass'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaMappedSuperclass() - * @model kind="class" - * @generated - */ -public class JavaMappedSuperclass extends JavaTypeMapping - implements IMappedSuperclass -{ - /** - * The default value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected static final String ID_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected String idClass = ID_CLASS_EDEFAULT; - - private final AnnotationAdapter idClassAnnotationAdapter; - - private final AnnotationElementAdapter idClassValueAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.MAPPED_SUPERCLASS); - - public static final DeclarationAnnotationAdapter ID_CLASS_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ID_CLASS); - - private static final DeclarationAnnotationElementAdapter ID_CLASS_VALUE_ADAPTER = buildIdClassValueAdapter(); - - protected JavaMappedSuperclass() { - throw new UnsupportedOperationException("Use JavaMappedSuperclass(Type) instead"); - } - - protected JavaMappedSuperclass(Type type) { - super(type); - this.idClassAnnotationAdapter = new MemberAnnotationAdapter(this.getType(), ID_CLASS_ADAPTER); - this.idClassValueAdapter = new ShortCircuitAnnotationElementAdapter(this.getType(), ID_CLASS_VALUE_ADAPTER); - } - - @Override - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IMappedSuperclass.class)) { - case JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS : - String newIdClass = (String) notification.getNewValue(); - if (newIdClass == null) { - this.idClassAnnotationAdapter.removeAnnotation(); - } - else { - this.idClassValueAdapter.setValue(newIdClass); - } - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_MAPPED_SUPERCLASS; - } - - /** - * Returns the value of the 'Id Class' attribute. - * - *

- * If the meaning of the 'Id Class' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Id Class' attribute. - * @see #setIdClass(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMappedSuperclass_IdClass() - * @model - * @generated - */ - public String getIdClass() { - return idClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass#getIdClass Id Class}' attribute. - * - * - * @param value the new value of the 'Id Class' attribute. - * @see #getIdClass() - * @generated - */ - public void setIdClass(String newIdClass) { - String oldIdClass = idClass; - idClass = newIdClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS, oldIdClass, idClass)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS : - return getIdClass(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS : - setIdClass((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS : - setIdClass(ID_CLASS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS : - return ID_CLASS_EDEFAULT == null ? idClass != null : !ID_CLASS_EDEFAULT.equals(idClass); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IMappedSuperclass.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS : - return JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IMappedSuperclass.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS : - return JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS__ID_CLASS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (idClass: "); - result.append(idClass); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY; - } - - @Override - public Iterator overridableAttributeNames() { - return this.namesOf(this.overridableAttributes()); - } - - private Iterator overridableAttributes() { - return new FilteringIterator(this.getPersistentType().attributes()) { - @Override - protected boolean accept(Object o) { - return ((IPersistentAttribute) o).isOverridableAttribute(); - } - }; - } - - @Override - public Iterator overridableAssociationNames() { - return this.namesOf(this.overridableAssociations()); - } - - private Iterator overridableAssociations() { - return new FilteringIterator(this.getPersistentType().attributes()) { - @Override - protected boolean accept(Object o) { - return ((IPersistentAttribute) o).isOverridableAssociation(); - } - }; - } - - private Iterator namesOf(Iterator attributes) { - return new TransformationIterator(attributes) { - @Override - protected String transform(IPersistentAttribute attribute) { - return attribute.getName(); - } - }; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.updateIdClassFromJava(astRoot); - } - - private void updateIdClassFromJava(CompilationUnit astRoot) { - if (this.idClassAnnotationAdapter.getAnnotation(astRoot) == null) { - this.setIdClass(null); - } - else { - this.setIdClass(this.idClassValueAdapter.getValue(astRoot)); - } - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildIdClassValueAdapter() { - return new ConversionDeclarationAnnotationElementAdapter(ID_CLASS_ADAPTER, JPA.ID_CLASS__VALUE, false, SimpleTypeStringExpressionConverter.instance()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclassProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclassProvider.java deleted file mode 100644 index b149fcabc7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclassProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -/** - * - */ -public class JavaMappedSuperclassProvider - implements IJavaTypeMappingProvider -{ - - // singleton - private static final JavaMappedSuperclassProvider INSTANCE = new JavaMappedSuperclassProvider(); - - /** - * Return the singleton. - */ - public static IJavaTypeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaMappedSuperclassProvider() { - super(); - } - - public String key() { - return IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY; - } - - public IJavaTypeMapping buildMapping(Type type) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaMappedSuperclass(type); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaMappedSuperclass.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java deleted file mode 100644 index c843c474e6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java +++ /dev/null @@ -1,811 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Multi Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaMultiRelationshipMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaMultiRelationshipMapping - extends JavaRelationshipMapping implements IMultiRelationshipMapping -{ - /** - * The default value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected static final String MAPPED_BY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected String mappedBy = MAPPED_BY_EDEFAULT; - - /** - * The default value of the '{@link #getOrderBy() Order By}' attribute. - * - * - * @see #getOrderBy() - * @generated - * @ordered - */ - protected static final String ORDER_BY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getOrderBy() Order By}' attribute. - * - * - * @see #getOrderBy() - * @generated - * @ordered - */ - protected String orderBy = ORDER_BY_EDEFAULT; - - /** - * The default value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected static final DefaultLazyFetchType FETCH_EDEFAULT = DefaultLazyFetchType.DEFAULT; - - /** - * The cached value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected DefaultLazyFetchType fetch = FETCH_EDEFAULT; - - /** - * The cached value of the '{@link #getJoinTable() Join Table}' containment reference. - * - * - * @see #getJoinTable() - * @generated - * @ordered - */ - protected IJoinTable joinTable; - - /** - * The default value of the '{@link #getMapKey() Map Key}' attribute. - * - * - * @see #getMapKey() - * @generated - * @ordered - */ - protected static final String MAP_KEY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMapKey() Map Key}' attribute. - * - * - * @see #getMapKey() - * @generated - * @ordered - */ - protected String mapKey = MAP_KEY_EDEFAULT; - - private final AnnotationElementAdapter mappedByAdapter; - - /* - * The @OrderBy annotation is a bit wack: - * - no annotation at all means "no ordering" - * - an annotation with no 'value' means "order by ascending primary key" - * - an annotation with a 'value' means "order by the settings in the 'value' string" - */ - private final AnnotationAdapter orderByAnnotationAdapter; - - private final AnnotationElementAdapter orderByValueAdapter; - - public static final DeclarationAnnotationAdapter ORDER_BY_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ORDER_BY); - - private static final DeclarationAnnotationElementAdapter ORDER_BY_VALUE_ADAPTER = buildOrderByValueAdapter(); - - private final AnnotationAdapter mapKeyAnnotationAdapter; - - private final AnnotationElementAdapter mapKeyNameAdapter; - - public static final DeclarationAnnotationAdapter MAP_KEY_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.MAP_KEY); - - private static final DeclarationAnnotationElementAdapter MAP_KEY_NAME_ADAPTER = buildMapKeyNameAdapter(); - - protected JavaMultiRelationshipMapping() { - throw new UnsupportedOperationException("Use JavaMultiRelationshipMapping(Attribute) instead"); - } - - protected JavaMultiRelationshipMapping(Attribute attribute) { - super(attribute); - this.mappedByAdapter = this.buildAnnotationElementAdapter(this.mappedByAdapter()); - this.orderByAnnotationAdapter = new MemberAnnotationAdapter(attribute, ORDER_BY_ADAPTER); - this.orderByValueAdapter = new ShortCircuitAnnotationElementAdapter(attribute, ORDER_BY_VALUE_ADAPTER); - this.mapKeyAnnotationAdapter = new MemberAnnotationAdapter(attribute, MAP_KEY_ADAPTER); - this.mapKeyNameAdapter = new ShortCircuitAnnotationElementAdapter(attribute, MAP_KEY_NAME_ADAPTER); - this.joinTable = JpaJavaMappingsFactory.eINSTANCE.createJavaJoinTable(buildOwner(), attribute); - ((InternalEObject) this.joinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, null, null); - } - - /** - * return the Java adapter's 'mappedBy' element adapter config - */ - protected abstract DeclarationAnnotationElementAdapter mappedByAdapter(); - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(INonOwningMapping.class)) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - this.mappedByAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - switch (notification.getFeatureID(IMultiRelationshipMapping.class)) { - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : - String orderBy = (String) notification.getNewValue(); - if (orderBy == null) { - this.orderByAnnotationAdapter.removeAnnotation(); - } - else if ("".equals(orderBy)) { - Annotation orderByAnnotation = this.orderByAnnotationAdapter.getAnnotation(); - if (orderByAnnotation != null) { - // if the value is already "", then leave it alone (short circuit java change cycle) - if (!"".equals(orderByValueAdapter.getValue())) { - this.orderByValueAdapter.setValue(null); - } - } - else { - this.orderByAnnotationAdapter.newMarkerAnnotation(); - } - } - else { - this.orderByValueAdapter.setValue(orderBy); - } - break; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : - String mk = (String) notification.getNewValue(); - if (mk == null) { - this.mapKeyAnnotationAdapter.removeAnnotation(); - } - else { - this.mapKeyNameAdapter.setValue(mk); - } - break; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH : - this.getFetchAdapter().setValue(((DefaultLazyFetchType) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - default : - break; - } - } - - private ITable.Owner buildOwner() { - return new ITable.Owner() { - public ITextRange validationTextRange() { - return JavaMultiRelationshipMapping.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return JavaMultiRelationshipMapping.this.typeMapping(); - } - }; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_MULTI_RELATIONSHIP_MAPPING; - } - - /** - * Returns the value of the 'Mapped By' attribute. - * - *

- * If the meaning of the 'Mapped By' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Mapped By' attribute. - * @see #setMappedBy(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINonOwningMapping_MappedBy() - * @model - * @generated - */ - public String getMappedBy() { - return mappedBy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping#getMappedBy Mapped By}' attribute. - * - * - * @param value the new value of the 'Mapped By' attribute. - * @see #getMappedBy() - * @generated - */ - public void setMappedBy(String newMappedBy) { - String oldMappedBy = mappedBy; - mappedBy = newMappedBy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY, oldMappedBy, mappedBy)); - } - - /** - * Returns the value of the 'Order By' attribute. - * - *

- * If the meaning of the 'Order By' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Order By' attribute. - * @see #setOrderBy(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMultiRelationshipMapping_OrderBy() - * @model unique="false" ordered="false" - * @generated - */ - public String getOrderBy() { - return orderBy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping#getOrderBy Order By}' attribute. - * - * - * @param value the new value of the 'Order By' attribute. - * @see #getOrderBy() - * @generated - */ - public void setOrderBy(String newOrderBy) { - String oldOrderBy = orderBy; - orderBy = newOrderBy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY, oldOrderBy, orderBy)); - } - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated NOT - */ - public boolean isNoOrdering() { - return getOrderBy() == null; - } - - /** - * - * - * @model - * @generated NOT - */ - public void setNoOrdering() { - setOrderBy(null); - } - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated NOT - */ - public boolean isOrderByPk() { - return "".equals(getOrderBy()); - } - - /** - * - * - * @model - * @generated NOT - */ - public void setOrderByPk() { - setOrderBy(""); - } - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated NOT - */ - public boolean isCustomOrdering() { - return ! StringTools.stringIsEmpty(getOrderBy()); - } - - public ITextRange mappedByTextRange() { - return this.elementTextRange(this.mappedByAdapter()); - } - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType}. - * - *

- * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see #setFetch(DefaultLazyFetchType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMultiRelationshipMapping_Fetch() - * @model - * @generated - */ - public DefaultLazyFetchType getFetch() { - return fetch; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see #getFetch() - * @generated - */ - public void setFetch(DefaultLazyFetchType newFetch) { - DefaultLazyFetchType oldFetch = fetch; - fetch = newFetch == null ? FETCH_EDEFAULT : newFetch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH, oldFetch, fetch)); - } - - /** - * Returns the value of the 'Join Table' containment reference. - * - *

- * If the meaning of the 'Join Table' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Join Table' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMultiRelationshipMapping_JoinTable() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IJoinTable getJoinTable() { - return joinTable; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetJoinTable(IJoinTable newJoinTable, NotificationChain msgs) { - IJoinTable oldJoinTable = joinTable; - joinTable = newJoinTable; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, oldJoinTable, newJoinTable); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - public boolean isJoinTableSpecified() { - return getJavaJoinTable().isSpecified(); - } - - /** - * Returns the value of the 'Map Key' attribute. - * - *

- * If the meaning of the 'Map Key' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Map Key' attribute. - * @see #setMapKey(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMultiRelationshipMapping_MapKey() - * @model - * @generated - */ - public String getMapKey() { - return mapKey; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping#getMapKey Map Key}' attribute. - * - * - * @param value the new value of the 'Map Key' attribute. - * @see #getMapKey() - * @generated - */ - public void setMapKey(String newMapKey) { - String oldMapKey = mapKey; - mapKey = newMapKey; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY, oldMapKey, mapKey)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : - return basicSetJoinTable(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : - return getMappedBy(); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return getOrderBy(); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : - return getFetch(); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : - return getJoinTable(); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : - return getMapKey(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : - setMappedBy((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - setOrderBy((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : - setFetch((DefaultLazyFetchType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : - setMapKey((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : - setMappedBy(MAPPED_BY_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - setOrderBy(ORDER_BY_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : - setFetch(FETCH_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : - setMapKey(MAP_KEY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : - return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : - return fetch != FETCH_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : - return joinTable != null; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : - return MAP_KEY_EDEFAULT == null ? mapKey != null : !MAP_KEY_EDEFAULT.equals(mapKey); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : - return JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IMultiRelationshipMapping.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IMultiRelationshipMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH : - return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : - return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : - return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mappedBy: "); - result.append(mappedBy); - result.append(", orderBy: "); - result.append(orderBy); - result.append(", fetch: "); - result.append(fetch); - result.append(", mapKey: "); - result.append(mapKey); - result.append(')'); - return result.toString(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - // TODO - // if (isOrderByPk()) { - // refreshDefaultOrderBy(defaultsContext); - // } - } - - //primary key ordering when just the @OrderBy annotation is present - protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) { - IEntity targetEntity = getResolvedTargetEntity(); - if (targetEntity != null) { - setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC"); - } - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setMappedBy(this.mappedByAdapter.getValue(astRoot)); - updateOrderByFromJava(astRoot); - this.getJavaJoinTable().updateFromJava(astRoot); - updateMapKeyFromJava(astRoot); - } - - private void updateOrderByFromJava(CompilationUnit astRoot) { - String orderBy = this.orderByValueAdapter.getValue(astRoot); - if (orderBy == null) { - if (orderByAnnotation(astRoot) == null) { - this.setNoOrdering(); - } - else { - this.setOrderByPk(); - } - } - else if ("".equals(orderBy)) { - this.setOrderByPk(); - } - else { - this.setOrderBy(orderBy); - } - } - - private Annotation orderByAnnotation(CompilationUnit astRoot) { - return this.orderByAnnotationAdapter.getAnnotation(astRoot); - } - - private void updateMapKeyFromJava(CompilationUnit astRoot) { - this.setMapKey(this.mapKeyNameAdapter.getValue(astRoot)); - } - - private JavaJoinTable getJavaJoinTable() { - return (JavaJoinTable) this.joinTable; - } - - @Override - protected void updateFetchFromJava(CompilationUnit astRoot) { - setFetch(DefaultLazyFetchType.fromJavaAnnotationValue(this.getFetchAdapter().getValue(astRoot))); - } - - private boolean mappedByTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.mappedByAdapter(), pos, astRoot); - } - - private boolean mapKeyNameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(MAP_KEY_NAME_ADAPTER, pos, astRoot); - } - - public Iterator candidateMapKeyNames() { - return this.allTargetEntityAttributeNames(); - } - - protected Iterator candidateMapKeyNames(Filter filter) { - return new FilteringIterator(this.candidateMapKeyNames(), filter); - } - - protected Iterator quotedCandidateMapKeyNames(Filter filter) { - return StringTools.quote(this.candidateMapKeyNames(filter)); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - result = this.getJavaJoinTable().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.mappedByTouches(pos, astRoot)) { - return this.quotedCandidateMappedByAttributeNames(filter); - } - if (this.mapKeyNameTouches(pos, astRoot)) { - return this.quotedCandidateMapKeyNames(filter); - } - return null; - } - - /** - * extract the element type from the specified container signature and - * convert it into a reference entity type name; - * return null if the type is not a valid reference entity type (e.g. it's - * another container or an array or a primitive or other Basic type) - */ - @Override - protected String javaDefaultTargetEntity(String signature) { - String typeName = super.javaDefaultTargetEntity(signature); - return typeNamedIsContainer(typeName) ? this.javaDefaultTargetEntityFromContainer(signature) : null; - } - - protected String javaDefaultTargetEntityFromContainer(String signature) { - String[] parmSignatures = Signature.getTypeArguments(signature); - if ((parmSignatures == null) || (parmSignatures.length != 1)) { - return null; - } - String elementSignature = parmSignatures[0]; - String elementTypeName = buildReferenceEntityTypeName(elementSignature, jdtType()); - return typeNamedIsContainer(elementTypeName) ? null : elementTypeName; - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildOrderByValueAdapter() { - return ConversionDeclarationAnnotationElementAdapter.forStrings(ORDER_BY_ADAPTER, JPA.ORDER_BY__VALUE, false); - } - - private static DeclarationAnnotationElementAdapter buildMapKeyNameAdapter() { - return ConversionDeclarationAnnotationElementAdapter.forStrings(MAP_KEY_ADAPTER, JPA.MAP_KEY__NAME, false); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java deleted file mode 100644 index 61b7da6e2d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java +++ /dev/null @@ -1,528 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.BooleanLiteral; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.NumberLiteral; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.BooleanStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.NumberStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Named Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedColumn() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaNamedColumn extends JavaEObject - implements INamedColumn -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected String specifiedName = SPECIFIED_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected static final String DEFAULT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected String defaultName = DEFAULT_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getColumnDefinition() Column Definition}' attribute. - * - * - * @see #getColumnDefinition() - * @generated - * @ordered - */ - protected static final String COLUMN_DEFINITION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnDefinition() Column Definition}' attribute. - * - * - * @see #getColumnDefinition() - * @generated - * @ordered - */ - protected String columnDefinition = COLUMN_DEFINITION_EDEFAULT; - - private final Owner owner; - - private final Member member; - - // hold this so we can get the annotation's text range - private final DeclarationAnnotationAdapter daa; - - // hold this so we can get the 'name' text range - private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; - - private final AnnotationElementAdapter nameAdapter; - - private final AnnotationElementAdapter columnDefinitionAdapter; - - protected JavaNamedColumn() { - super(); - throw new UnsupportedOperationException("Use JavaNamedColumn(Owner, Member, DeclarationAnnotationAdapter) instead"); - } - - protected JavaNamedColumn(Owner owner, Member member, DeclarationAnnotationAdapter daa) { - super(); - this.owner = owner; - this.member = member; - this.daa = daa; - this.nameDeclarationAdapter = this.buildStringElementAdapter(this.nameElementName()); - this.nameAdapter = this.buildShortCircuitElementAdapter(this.nameDeclarationAdapter); - this.columnDefinitionAdapter = this.buildShortCircuitStringElementAdapter(this.columnDefinitionElementName()); - } - - protected DeclarationAnnotationElementAdapter buildStringElementAdapter(String elementName) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName); - } - - protected DeclarationAnnotationElementAdapter buildBooleanElementAdapter(String elementName) { - return new ConversionDeclarationAnnotationElementAdapter(this.daa, elementName, BooleanStringExpressionConverter.instance()); - } - - protected DeclarationAnnotationElementAdapter buildIntElementAdapter(String elementName) { - return new ConversionDeclarationAnnotationElementAdapter(this.daa, elementName, NumberStringExpressionConverter.instance()); - } - - protected AnnotationElementAdapter buildShortCircuitElementAdapter(DeclarationAnnotationElementAdapter daea) { - return new ShortCircuitAnnotationElementAdapter(this.member, daea); - } - - protected AnnotationElementAdapter buildShortCircuitStringElementAdapter(String elementName) { - return this.buildShortCircuitElementAdapter(this.buildStringElementAdapter(elementName)); - } - - protected AnnotationElementAdapter buildShortCircuitBooleanElementAdapter(String elementName) { - return this.buildShortCircuitElementAdapter(this.buildBooleanElementAdapter(elementName)); - } - - protected IntAnnotationElementAdapter buildShortCircuitIntElementAdapter(String elementName) { - return new IntAnnotationElementAdapter(this.buildShortCircuitElementAdapter(this.buildIntElementAdapter(elementName))); - } - - protected abstract String nameElementName(); - - protected abstract String columnDefinitionElementName(); - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(INamedColumn.class)) { - case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_NAME : - this.nameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_COLUMN__COLUMN_DEFINITION : - this.columnDefinitionAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_NAMED_COLUMN; - } - - public String getName() { - return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName(); - } - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

- * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINamedColumn_SpecifiedName() - * @model - * @generated - */ - public String getSpecifiedName() { - return specifiedName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - public void setSpecifiedName(String newSpecifiedName) { - String oldSpecifiedName = specifiedName; - specifiedName = newSpecifiedName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); - } - - //TODO should we allow setting through the ecore, that would make this method - //public and part of the ITable api. only the model needs to be setting the default, - //but the ui needs to be listening for changes to the default. - protected void setDefaultName(String newDefaultName) { - String oldDefaultName = this.defaultName; - this.defaultName = newDefaultName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__DEFAULT_NAME, oldDefaultName, this.defaultName)); - } - - /** - * Returns the value of the 'Default Name' attribute. - * - *

- * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINamedColumn_DefaultName() - * @model changeable="false" - * @generated - */ - public String getDefaultName() { - return defaultName; - } - - /** - * Returns the value of the 'Column Definition' attribute. - * - *

- * If the meaning of the 'Column Definition' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Definition' attribute. - * @see #setColumnDefinition(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINamedColumn_ColumnDefinition() - * @model - * @generated - */ - public String getColumnDefinition() { - return columnDefinition; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn#getColumnDefinition Column Definition}' attribute. - * - * - * @param value the new value of the 'Column Definition' attribute. - * @see #getColumnDefinition() - * @generated - */ - public void setColumnDefinition(String newColumnDefinition) { - String oldColumnDefinition = columnDefinition; - columnDefinition = newColumnDefinition; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION, oldColumnDefinition, columnDefinition)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__NAME : - return getName(); - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME : - return getSpecifiedName(); - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__DEFAULT_NAME : - return getDefaultName(); - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION : - return getColumnDefinition(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME : - setSpecifiedName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION : - setColumnDefinition((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME : - setSpecifiedName(SPECIFIED_NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION : - setColumnDefinition(COLUMN_DEFINITION_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME : - return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__DEFAULT_NAME : - return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION : - return COLUMN_DEFINITION_EDEFAULT == null ? columnDefinition != null : !COLUMN_DEFINITION_EDEFAULT.equals(columnDefinition); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INamedColumn.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__NAME : - return JpaCoreMappingsPackage.INAMED_COLUMN__NAME; - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME : - return JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME; - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__DEFAULT_NAME : - return JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME; - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION : - return JpaCoreMappingsPackage.INAMED_COLUMN__COLUMN_DEFINITION; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INamedColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INAMED_COLUMN__NAME : - return JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__NAME; - case JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME : - return JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__SPECIFIED_NAME; - case JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME : - return JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__DEFAULT_NAME; - case JpaCoreMappingsPackage.INAMED_COLUMN__COLUMN_DEFINITION : - return JpaJavaMappingsPackage.JAVA_NAMED_COLUMN__COLUMN_DEFINITION; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedName: "); - result.append(specifiedName); - result.append(", defaultName: "); - result.append(defaultName); - result.append(", columnDefinition: "); - result.append(columnDefinition); - result.append(')'); - return result.toString(); - } - - public Owner getOwner() { - return this.owner; - } - - public ITextRange validationTextRange() { - ITextRange textRange = this.member.annotationTextRange(this.daa); - return (textRange != null) ? textRange : this.owner.validationTextRange(); - } - - protected ITextRange elementTextRange(DeclarationAnnotationElementAdapter elementAdapter) { - return this.elementTextRange(this.member.annotationElementTextRange(elementAdapter)); - } - - protected ITextRange elementTextRange(DeclarationAnnotationElementAdapter elementAdapter, CompilationUnit astRoot) { - return this.elementTextRange(this.member.annotationElementTextRange(elementAdapter, astRoot)); - } - - public ITextRange nameTextRange() { - return this.elementTextRange(this.nameDeclarationAdapter); - } - - public ITextRange nameTextRange(CompilationUnit astRoot) { - return this.elementTextRange(this.nameDeclarationAdapter, astRoot); - } - - public boolean nameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot); - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos, CompilationUnit astRoot) { - return this.elementTouches(this.member.annotationElementTextRange(elementAdapter, astRoot), pos); - } - - public void updateFromJava(CompilationUnit astRoot) { - this.setSpecifiedName(this.nameAdapter.getValue(astRoot)); - this.setColumnDefinition(this.columnDefinitionAdapter.getValue(astRoot)); - } - - public Column dbColumn() { - Table table = this.dbTable(); - return (table == null) ? null : table.columnNamed(this.getName()); - } - - public Table dbTable() { - return this.owner.dbTable(this.tableName()); - } - - /** - * Return the name of the column's table. - */ - protected abstract String tableName(); - - public boolean isResolved() { - return this.dbColumn() != null; - } - - @Override - public Iterator connectedCandidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.connectedCandidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.nameTouches(pos, astRoot)) { - return this.quotedCandidateNames(filter); - } - return null; - } - - private Iterator candidateNames() { - Table dbTable = this.dbTable(); - return (dbTable != null) ? dbTable.columnNames() : EmptyIterator. instance(); - } - - private Iterator candidateNames(Filter filter) { - return new FilteringIterator(this.candidateNames(), filter); - } - - private Iterator quotedCandidateNames(Filter filter) { - return StringTools.quote(this.candidateNames(filter)); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedNativeQuery.java deleted file mode 100644 index e34850a2cd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedNativeQuery.java +++ /dev/null @@ -1,354 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Named Native Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedNativeQuery() - * @model kind="class" - * @generated - */ -public class JavaNamedNativeQuery extends JavaAbstractQuery - implements INamedNativeQuery -{ - /** - * The default value of the '{@link #getResultClass() Result Class}' attribute. - * - * - * @see #getResultClass() - * @generated - * @ordered - */ - protected static final String RESULT_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResultClass() Result Class}' attribute. - * - * - * @see #getResultClass() - * @generated - * @ordered - */ - protected String resultClass = RESULT_CLASS_EDEFAULT; - - /** - * The default value of the '{@link #getResultSetMapping() Result Set Mapping}' attribute. - * - * - * @see #getResultSetMapping() - * @generated - * @ordered - */ - protected static final String RESULT_SET_MAPPING_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResultSetMapping() Result Set Mapping}' attribute. - * - * - * @see #getResultSetMapping() - * @generated - * @ordered - */ - protected String resultSetMapping = RESULT_SET_MAPPING_EDEFAULT; - - public static final SimpleDeclarationAnnotationAdapter SINGLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.NAMED_NATIVE_QUERY); - - public static final SimpleDeclarationAnnotationAdapter MULTIPLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.NAMED_NATIVE_QUERIES); - - private final AnnotationElementAdapter resultClassAdapter; - - private final AnnotationElementAdapter resultSetMappingAdapter; - - protected JavaNamedNativeQuery() { - throw new UnsupportedOperationException("Use JavaNamedNativeQuery(Member) instead"); - } - - protected JavaNamedNativeQuery(Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(member, idaa); - this.resultClassAdapter = this.buildAdapter(resultClassAdapter(idaa)); - this.resultSetMappingAdapter = this.buildAdapter(resultSetMappingAdapter(idaa)); - } - - // ********** initialization ********** - protected DeclarationAnnotationElementAdapter resultClassAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.NAMED_NATIVE_QUERY__RESULT_CLASS); - } - - protected DeclarationAnnotationElementAdapter resultSetMappingAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.NAMED_NATIVE_QUERY__RESULT_SET_MAPPING); - } - - @Override - protected String nameElementName() { - return JPA.NAMED_NATIVE_QUERY__NAME; - } - - @Override - protected String queryElementName() { - return JPA.NAMED_NATIVE_QUERY__QUERY; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(INamedNativeQuery.class)) { - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_CLASS : - this.resultClassAdapter.setValue((String) notification.getNewValue()); - break; - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - this.resultSetMappingAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_NAMED_NATIVE_QUERY; - } - - /** - * Returns the value of the 'Result Class' attribute. - * - *

- * If the meaning of the 'Result Class' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Result Class' attribute. - * @see #setResultClass(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINamedNativeQuery_ResultClass() - * @model - * @generated - */ - public String getResultClass() { - return resultClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery#getResultClass Result Class}' attribute. - * - * - * @param value the new value of the 'Result Class' attribute. - * @see #getResultClass() - * @generated - */ - public void setResultClass(String newResultClass) { - String oldResultClass = resultClass; - resultClass = newResultClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS, oldResultClass, resultClass)); - } - - /** - * Returns the value of the 'Result Set Mapping' attribute. - * - *

- * If the meaning of the 'Result Set Mapping' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Result Set Mapping' attribute. - * @see #setResultSetMapping(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINamedNativeQuery_ResultSetMapping() - * @model - * @generated - */ - public String getResultSetMapping() { - return resultSetMapping; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery#getResultSetMapping Result Set Mapping}' attribute. - * - * - * @param value the new value of the 'Result Set Mapping' attribute. - * @see #getResultSetMapping() - * @generated - */ - public void setResultSetMapping(String newResultSetMapping) { - String oldResultSetMapping = resultSetMapping; - resultSetMapping = newResultSetMapping; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING, oldResultSetMapping, resultSetMapping)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS : - return getResultClass(); - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return getResultSetMapping(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS : - setResultClass((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - setResultSetMapping((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS : - setResultClass(RESULT_CLASS_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - setResultSetMapping(RESULT_SET_MAPPING_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS : - return RESULT_CLASS_EDEFAULT == null ? resultClass != null : !RESULT_CLASS_EDEFAULT.equals(resultClass); - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return RESULT_SET_MAPPING_EDEFAULT == null ? resultSetMapping != null : !RESULT_SET_MAPPING_EDEFAULT.equals(resultSetMapping); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INamedNativeQuery.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS : - return JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_CLASS; - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_SET_MAPPING; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INamedNativeQuery.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_CLASS : - return JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS; - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (resultClass: "); - result.append(resultClass); - result.append(", resultSetMapping: "); - result.append(resultSetMapping); - result.append(')'); - return result.toString(); - } - - @Override - protected void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.setResultClass(this.resultClassAdapter.getValue(astRoot)); - this.setResultSetMapping(this.resultSetMappingAdapter.getValue(astRoot)); - } - - @Override - protected JavaQueryHint createJavaQueryHint(int index) { - return JavaQueryHint.createNamedNativeQueryQueryHint(this.getDeclarationAnnotationAdapter(), this.getMember(), index); - } - - // ********** static methods ********** - static JavaNamedNativeQuery createJavaNamedNativeQuery(Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaNamedNativeQuery(member, buildAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.NAMED_NATIVE_QUERY); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedQuery.java deleted file mode 100644 index e7dd0a260a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedQuery.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; - -/** - * - * A representation of the model object 'Java Named Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedQuery() - * @model kind="class" - * @generated - */ -public class JavaNamedQuery extends JavaAbstractQuery implements INamedQuery -{ - public static final SimpleDeclarationAnnotationAdapter SINGLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.NAMED_QUERY); - - public static final SimpleDeclarationAnnotationAdapter MULTIPLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.NAMED_QUERIES); - - protected JavaNamedQuery() { - throw new UnsupportedOperationException("Use JavaNamedQuery(Member) instead"); - } - - protected JavaNamedQuery(Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(member, idaa); - } - - @Override - protected String nameElementName() { - return JPA.NAMED_QUERY__NAME; - } - - @Override - protected String queryElementName() { - return JPA.NAMED_QUERY__QUERY; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_NAMED_QUERY; - } - - @Override - protected JavaQueryHint createJavaQueryHint(int index) { - return JavaQueryHint.createNamedQueryQueryHint(this.getDeclarationAnnotationAdapter(), this.getMember(), index); - } - - // ********** static methods ********** - static JavaNamedQuery createJavaNamedQuery(Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaNamedQuery(member, buildAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.NAMED_QUERY); - } -} // JavaNamedQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMapping.java deleted file mode 100644 index b9552c7ed5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMapping.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NullDeclarationAnnotationAdapter; - -/** - * - * A representation of the model object 'Java Null Attribute Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNullAttributeMapping() - * @model kind="class" - * @generated - */ -public class JavaNullAttributeMapping extends JavaAttributeMapping -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = NullDeclarationAnnotationAdapter.instance(); - - protected JavaNullAttributeMapping() { - throw new UnsupportedOperationException("Use JavaNullAttributeMapping(Attribute) instead"); - } - - protected JavaNullAttributeMapping(Attribute attribute) { - super(attribute); - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_NULL_ATTRIBUTE_MAPPING; - } - - public String getKey() { - return null; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMappingProvider.java deleted file mode 100644 index 0c35b5f466..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMappingProvider.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * This mapping provider implementation is used to create a JavaNullAttributeMapping. - * A JavaNullAttributeMapping should be used when no "mapping" annotation - * exists on a Java attribute *and* no default mapping applies. - */ -public class JavaNullAttributeMappingProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaNullAttributeMappingProvider INSTANCE = new JavaNullAttributeMappingProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaNullAttributeMappingProvider() { - super(); - } - - public String key() { - return null; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaNullAttributeMapping(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaNullAttributeMapping.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMapping.java deleted file mode 100644 index aa20d185bd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMapping.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NullDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -/** - * - * A representation of the model object 'Java Null Type Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNullTypeMapping() - * @model kind="class" - * @generated - */ -public class JavaNullTypeMapping extends JavaTypeMapping -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = NullDeclarationAnnotationAdapter.instance(); - - /** - * - * - * @generated - */ - protected JavaNullTypeMapping() { - super(); - } - - protected JavaNullTypeMapping(Type type) { - super(type); - } - - @Override - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_NULL_TYPE_MAPPING; - } - - public String getKey() { - return null; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMappingProvider.java deleted file mode 100644 index 3e12a969f2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMappingProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -/** - * This mapping provider implementation is used to create a JavaNullAttributeMapping. - * A JavaNullAttributeMapping should be used when no "mapping" annotation - * exists on a Java type. - */ -public class JavaNullTypeMappingProvider - implements IJavaTypeMappingProvider -{ - - // singleton - private static final JavaNullTypeMappingProvider INSTANCE = new JavaNullTypeMappingProvider(); - - /** - * Return the singleton. - */ - public static IJavaTypeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaNullTypeMappingProvider() { - super(); - } - - public String key() { - return null; - } - - public IJavaTypeMapping buildMapping(Type type) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaNullTypeMapping(type); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaNullTypeMapping.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java deleted file mode 100644 index 83359ca2f4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; - -/** - * - * A representation of the model object 'Java One To Many'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOneToMany() - * @model kind="class" - * @generated - */ -public class JavaOneToMany extends JavaMultiRelationshipMapping - implements IOneToMany -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ONE_TO_MANY); - - private static final DeclarationAnnotationElementAdapter TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__TARGET_ENTITY); - - private static final DeclarationAnnotationElementAdapter CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE); - - private static final DeclarationAnnotationElementAdapter FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__FETCH); - - private static final DeclarationAnnotationElementAdapter MAPPED_BY_ADAPTER = buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__MAPPED_BY); - - protected JavaOneToMany() { - throw new UnsupportedOperationException("Use JavaOneToMany(Attribute) instead"); - } - - protected JavaOneToMany(Attribute attribute) { - super(attribute); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ONE_TO_MANY; - } - - public String getKey() { - return IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - // ********** JavaRelationshipMappingModelAdapter implementation ********** - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter targetEntityAdapter() { - return TARGET_ENTITY_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter cascadeAdapter() { - return CASCADE_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter fetchAdapter() { - return FETCH_ADAPTER; - } - - // ********** JavaMultiRelationshipMappingModelAdapter implementation ********** - @Override - protected DeclarationAnnotationElementAdapter mappedByAdapter() { - return MAPPED_BY_ADAPTER; - } - - // ********** INonOwningMapping implementation ********** - public boolean mappedByIsValid(IAttributeMapping mappedByMapping) { - String mappedByKey = mappedByMapping.getKey(); - return (mappedByKey == IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToManyProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToManyProvider.java deleted file mode 100644 index c817ce8638..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToManyProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaOneToManyProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaOneToManyProvider INSTANCE = new JavaOneToManyProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaOneToManyProvider() { - super(); - } - - public String key() { - return IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaOneToMany(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaOneToMany.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java deleted file mode 100644 index 7c21f6d8fd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java +++ /dev/null @@ -1,328 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java One To One'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOneToOne() - * @model kind="class" - * @generated - */ -public class JavaOneToOne extends JavaSingleRelationshipMapping - implements IOneToOne -{ - /** - * The default value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected static final String MAPPED_BY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected String mappedBy = MAPPED_BY_EDEFAULT; - - private AnnotationElementAdapter mappedByAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ONE_TO_ONE); - - private static final DeclarationAnnotationElementAdapter TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__TARGET_ENTITY); - - private static final DeclarationAnnotationElementAdapter CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE); - - private static final DeclarationAnnotationElementAdapter FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__FETCH); - - private static final DeclarationAnnotationElementAdapter OPTIONAL_ADAPTER = buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__OPTIONAL); - - private static final DeclarationAnnotationElementAdapter MAPPED_BY_ADAPTER = buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__MAPPED_BY); - - protected JavaOneToOne() { - throw new UnsupportedOperationException("Use JavaOneToOne(Attribute) instead"); - } - - protected JavaOneToOne(Attribute attribute) { - super(attribute); - this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(INonOwningMapping.class)) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - this.mappedByAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** initialization ********** - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter targetEntityAdapter() { - return TARGET_ENTITY_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter cascadeAdapter() { - return CASCADE_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter fetchAdapter() { - return FETCH_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter optionalAdapter() { - return OPTIONAL_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ONE_TO_ONE; - } - - /** - * Returns the value of the 'Mapped By' attribute. - * - *

- * If the meaning of the 'Mapped By' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Mapped By' attribute. - * @see #setMappedBy(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getINonOwningMapping_MappedBy() - * @model - * @generated - */ - public String getMappedBy() { - return mappedBy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne#getMappedBy Mapped By}' attribute. - * - * - * @param value the new value of the 'Mapped By' attribute. - * @see #getMappedBy() - * @generated - */ - public void setMappedBy(String newMappedBy) { - String oldMappedBy = mappedBy; - mappedBy = newMappedBy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY, oldMappedBy, mappedBy)); - } - - public boolean mappedByIsValid(IAttributeMapping mappedByMapping) { - String mappedByKey = mappedByMapping.getKey(); - return (mappedByKey == IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); - } - - public ITextRange mappedByTextRange() { - return this.elementTextRange(MAPPED_BY_ADAPTER); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY : - return getMappedBy(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY : - setMappedBy((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY : - setMappedBy(MAPPED_BY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY : - return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY : - return JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IOneToOne.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - return JpaJavaMappingsPackage.JAVA_ONE_TO_ONE__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IOneToOne.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mappedBy: "); - result.append(mappedBy); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setMappedBy(this.mappedByAdapter.getValue(astRoot)); - } - - public boolean mappedByTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.mappedByTouches(pos, astRoot)) { - return this.quotedCandidateMappedByAttributeNames(filter); - } - return null; - } - - @Override - public boolean isOverridableAssociationMapping() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOneProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOneProvider.java deleted file mode 100644 index e6ddbd7123..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOneProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaOneToOneProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaOneToOneProvider INSTANCE = new JavaOneToOneProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaOneToOneProvider() { - super(); - } - - public String key() { - return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaOneToOne(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaOneToOne.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOverride.java deleted file mode 100644 index 56c394de6c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOverride.java +++ /dev/null @@ -1,331 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Override'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOverride() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaOverride extends JavaEObject implements IOverride -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - private final Owner owner; - - private final Member member; - - private final IndexedDeclarationAnnotationAdapter daa; - - private final IndexedAnnotationAdapter annotationAdapter; - - private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; - - private final AnnotationElementAdapter nameAdapter; - - protected JavaOverride() { - throw new UnsupportedOperationException("use JavaAttributeOverride(Owner, Member, IndexedDeclarationAnnotationAdapter)"); - } - - protected JavaOverride(Owner owner, Member member, IndexedDeclarationAnnotationAdapter daa) { - super(); - this.owner = owner; - this.member = member; - this.daa = daa; - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, daa); - this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, this.nameElementName()); - this.nameAdapter = new ShortCircuitAnnotationElementAdapter(this.member, this.nameDeclarationAdapter); - } - - protected abstract String nameElementName(); - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_OVERRIDE; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIOverride_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setNameGen(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME, oldName, name)); - } - - public void setName(String newName) { - setNameGen(newName); - if (!this.isVirtual()) { - setNameInJava(newName); - } - } - - private void setNameInJava(String newName) { - this.nameAdapter.setValue(newName); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME : - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME : - setName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME : - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IOverride.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME : - return JpaCoreMappingsPackage.IOVERRIDE__NAME; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IOverride.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IOVERRIDE__NAME : - return JpaJavaMappingsPackage.JAVA_OVERRIDE__NAME; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @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 boolean isVirtual() { - return getOwner().isVirtual(this); - } - - public Owner getOwner() { - return this.owner; - } - - protected Member getMember() { - return this.member; - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos, CompilationUnit astRoot) { - return this.elementTouches(this.member.annotationElementTextRange(elementAdapter, astRoot), pos); - } - - public boolean nameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot); - } - - protected abstract Iterator candidateNames(); - - private Iterator candidateNames(Filter filter) { - return new FilteringIterator(this.candidateNames(), filter); - } - - private Iterator quotedCandidateNames(Filter filter) { - return StringTools.quote(this.candidateNames(filter)); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.nameTouches(pos, astRoot)) { - return this.quotedCandidateNames(filter); - } - return null; - } - - public void updateFromJava(CompilationUnit astRoot) { - setName(this.nameAdapter.getValue(astRoot)); - } - - // ********** persistence model -> java annotations ********** - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - public ITextRange validationTextRange() { - ITextRange textRange = this.member.annotationTextRange(this.daa); - return (textRange == null) ? getOwner().validationTextRange() : textRange; - } - - protected IndexedDeclarationAnnotationAdapter getDeclarationAnnotationAdapter() { - return this.daa; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaPrimaryKeyJoinColumn.java deleted file mode 100644 index 3232c34b2c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaPrimaryKeyJoinColumn.java +++ /dev/null @@ -1,474 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Primary Key Join Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaPrimaryKeyJoinColumn() - * @model kind="class" - * @generated - */ -public class JavaPrimaryKeyJoinColumn extends JavaNamedColumn - implements IPrimaryKeyJoinColumn -{ - private final IndexedAnnotationAdapter annotationAdapter; - - // hold this so we can get the 'referenced column name' text range - private final DeclarationAnnotationElementAdapter referencedColumnNameDeclarationAdapter; - - private final AnnotationElementAdapter referencedColumnNameAdapter; - - public static final SimpleDeclarationAnnotationAdapter SINGLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.PRIMARY_KEY_JOIN_COLUMN); - - public static final SimpleDeclarationAnnotationAdapter MULTIPLE_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.PRIMARY_KEY_JOIN_COLUMNS); - - /** - * The default value of the '{@link #getReferencedColumnName() Referenced Column Name}' attribute. - * - * - * @see #getReferencedColumnName() - * @generated - * @ordered - */ - protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected String specifiedReferencedColumnName = SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected String defaultReferencedColumnName = DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT; - - protected JavaPrimaryKeyJoinColumn() { - throw new UnsupportedOperationException(); - } - - protected JavaPrimaryKeyJoinColumn(IAbstractJoinColumn.Owner owner, Member member, IndexedDeclarationAnnotationAdapter daa) { - super(owner, member, daa); - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, daa); - this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(JPA.PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME); - this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter); - } - - @Override - protected String nameElementName() { - return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME; - } - - @Override - protected String columnDefinitionElementName() { - return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION; - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IAbstractJoinColumn.class)) { - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - this.referencedColumnNameAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_PRIMARY_KEY_JOIN_COLUMN; - } - - /** - * Returns the value of the 'Referenced Column Name' attribute. - * - *

- * If the meaning of the 'Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIPrimaryKeyJoinColumn_ReferencedColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getReferencedColumnName() { - return (this.specifiedReferencedColumnName == null) ? this.defaultReferencedColumnName : this.specifiedReferencedColumnName; - } - - /** - * Returns the value of the 'Specified Referenced Column Name' attribute. - * - *

- * If the meaning of the 'Specified Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Referenced Column Name' attribute. - * @see #setSpecifiedReferencedColumnName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractJoinColumn_SpecifiedReferencedColumnName() - * @model - * @generated - */ - public String getSpecifiedReferencedColumnName() { - return specifiedReferencedColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name' attribute. - * @see #getSpecifiedReferencedColumnName() - * @generated - */ - public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) { - String oldSpecifiedReferencedColumnName = specifiedReferencedColumnName; - specifiedReferencedColumnName = newSpecifiedReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME, oldSpecifiedReferencedColumnName, specifiedReferencedColumnName)); - } - - /** - * Returns the value of the 'Default Referenced Column Name' attribute. - * - *

- * If the meaning of the 'Default Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIAbstractJoinColumn_DefaultReferencedColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultReferencedColumnName() { - return defaultReferencedColumnName; - } - - protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) { - String oldDefaultReferencedColumnName = this.defaultReferencedColumnName; - this.defaultReferencedColumnName = newDefaultReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME, oldDefaultReferencedColumnName, newDefaultReferencedColumnName)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return getReferencedColumnName(); - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return getSpecifiedReferencedColumnName(); - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return getDefaultReferencedColumnName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName(SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return REFERENCED_COLUMN_NAME_EDEFAULT == null ? getReferencedColumnName() != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(getReferencedColumnName()); - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT == null ? specifiedReferencedColumnName != null : !SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT.equals(specifiedReferencedColumnName); - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT == null ? defaultReferencedColumnName != null : !DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT.equals(defaultReferencedColumnName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IPrimaryKeyJoinColumn.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IPrimaryKeyJoinColumn.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedReferencedColumnName: "); - result.append(specifiedReferencedColumnName); - result.append(", defaultReferencedColumnName: "); - result.append(defaultReferencedColumnName); - result.append(')'); - return result.toString(); - } - - @Override - public IAbstractJoinColumn.Owner getOwner() { - return (IAbstractJoinColumn.Owner) super.getOwner(); - } - - @Override - protected String tableName() { - return this.getOwner().getTypeMapping().getTableName(); - } - - public Column dbReferencedColumn() { - Table table = this.dbReferencedColumnTable(); - return (table == null) ? null : table.columnNamed(this.getReferencedColumnName()); - } - - public Table dbReferencedColumnTable() { - return getOwner().dbReferencedColumnTable(); - } - - public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot); - } - - private Iterator candidateReferencedColumnNames() { - Table table = this.getOwner().dbReferencedColumnTable(); - return (table != null) ? table.columnNames() : EmptyIterator. instance(); - } - - private Iterator candidateReferencedColumnNames(Filter filter) { - return new FilteringIterator(this.candidateReferencedColumnNames(), filter); - } - - private Iterator quotedCandidateReferencedColumnNames(Filter filter) { - return StringTools.quote(this.candidateReferencedColumnNames(filter)); - } - - @Override - public Iterator connectedCandidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.connectedCandidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.referencedColumnNameTouches(pos, astRoot)) { - return this.quotedCandidateReferencedColumnNames(filter); - } - return null; - } - - public boolean isReferencedColumnResolved() { - return dbReferencedColumn() != null; - } - - public ITextRange referencedColumnNameTextRange() { - return elementTextRange(this.referencedColumnNameDeclarationAdapter); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultReferencedColumnName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY)); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_NAME_KEY)); - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setSpecifiedReferencedColumnName(this.referencedColumnNameAdapter.getValue(astRoot)); - } - - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - // ********** static methods ********** - static JavaPrimaryKeyJoinColumn createSecondaryTableJoinColumn(DeclarationAnnotationAdapter secondaryTableAdapter, IAbstractJoinColumn.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaPrimaryKeyJoinColumn(owner, member, buildSecondaryTableAnnotationAdapter(secondaryTableAdapter, index)); - } - - private static IndexedDeclarationAnnotationAdapter buildSecondaryTableAnnotationAdapter(DeclarationAnnotationAdapter secondaryTableAdapter, int index) { - return new NestedIndexedDeclarationAnnotationAdapter(secondaryTableAdapter, JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS, index, JPA.PRIMARY_KEY_JOIN_COLUMN); - } - - static JavaPrimaryKeyJoinColumn createEntityPrimaryKeyJoinColumn(IAbstractJoinColumn.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaPrimaryKeyJoinColumn(owner, member, buildEntityPrimaryKeyJoinColumnAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildEntityPrimaryKeyJoinColumnAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.PRIMARY_KEY_JOIN_COLUMN); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaQueryHint.java deleted file mode 100644 index 4e445f2bbc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaQueryHint.java +++ /dev/null @@ -1,384 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Query Hint'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaQueryHint() - * @model kind="class" - * @generated - */ -public class JavaQueryHint extends JavaEObject implements IQueryHint -{ - private final Member member; - - // hold this so we can get the annotation's text range - private final IndexedDeclarationAnnotationAdapter idaa; - - private final IndexedAnnotationAdapter annotationAdapter; - - private final AnnotationElementAdapter nameAdapter; - - private final AnnotationElementAdapter valueAdapter; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - protected JavaQueryHint() { - throw new UnsupportedOperationException("Use JavaQueryHint(Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - protected JavaQueryHint(Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(); - this.member = member; - this.idaa = idaa; - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); - this.nameAdapter = this.buildAdapter(nameAdapter(idaa)); - this.valueAdapter = this.buildAdapter(valueAdapter(idaa)); - } - - // ********** initialization ********** - protected AnnotationElementAdapter buildAdapter(DeclarationAnnotationElementAdapter daea) { - return new ShortCircuitAnnotationElementAdapter(this.member, daea); - } - - protected DeclarationAnnotationElementAdapter nameAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.QUERY_HINT__NAME); - } - - protected DeclarationAnnotationElementAdapter valueAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.QUERY_HINT__VALUE); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IQueryHint.class)) { - case JpaCoreMappingsPackage.IQUERY_HINT__NAME : - this.nameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaCoreMappingsPackage.IQUERY_HINT__VALUE : - this.valueAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_QUERY_HINT; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIQueryHint_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME, oldName, name)); - } - - /** - * Returns the value of the 'Value' attribute. - * - *

- * If the meaning of the 'Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIQueryHint_Value() - * @model - * @generated - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME : - return getName(); - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE : - return getValue(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME : - setName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE : - setValue((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME : - setName(NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE : - setValue(VALUE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE : - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IQueryHint.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME : - return JpaCoreMappingsPackage.IQUERY_HINT__NAME; - case JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE : - return JpaCoreMappingsPackage.IQUERY_HINT__VALUE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IQueryHint.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IQUERY_HINT__NAME : - return JpaJavaMappingsPackage.JAVA_QUERY_HINT__NAME; - case JpaCoreMappingsPackage.IQUERY_HINT__VALUE : - return JpaJavaMappingsPackage.JAVA_QUERY_HINT__VALUE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", value: "); - result.append(value); - result.append(')'); - return result.toString(); - } - - // ********* IJpaSourceObject implementation *********** - public ITextRange validationTextRange() { - return this.member.annotationTextRange(this.idaa); - } - - protected void updateFromJava(CompilationUnit astRoot) { - this.setName(this.nameAdapter.getValue(astRoot)); - this.setValue(this.valueAdapter.getValue(astRoot)); - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - // ********** persistence model -> java annotations ********** - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - // ********** static methods ********** - static JavaQueryHint createNamedQueryQueryHint(DeclarationAnnotationAdapter namedQueryAdapter, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaQueryHint(member, buildNamedQueryQueryHintAnnotationAdapter(namedQueryAdapter, index)); - } - - private static IndexedDeclarationAnnotationAdapter buildNamedQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedQueryAdapter, int index) { - return new NestedIndexedDeclarationAnnotationAdapter(namedQueryAdapter, JPA.NAMED_QUERY__HINTS, index, JPA.QUERY_HINT); - } - - static JavaQueryHint createNamedNativeQueryQueryHint(DeclarationAnnotationAdapter namedNativeQueryAdapter, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaQueryHint(member, buildNamedNativeQueryQueryHintAnnotationAdapter(namedNativeQueryAdapter, index)); - } - - private static IndexedDeclarationAnnotationAdapter buildNamedNativeQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) { - return new NestedIndexedDeclarationAnnotationAdapter(namedNativeQueryAdapter, JPA.NAMED_NATIVE_QUERY__HINTS, index, JPA.QUERY_HINT); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java deleted file mode 100644 index 9deacff895..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java +++ /dev/null @@ -1,687 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumArrayDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.StringExpressionConverter; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.RelationshipMappingTools; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaRelationshipMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaRelationshipMapping extends JavaAttributeMapping - implements IRelationshipMapping -{ - private AnnotationElementAdapter targetEntityAdapter; - - /** - * all the relationship mappings have a 'fetch' setting; - * but the 1:1 and m:1 mappings have a default of EAGER, - * while the 1:m and m:m mappings have a default of LAZY - */ - private AnnotationElementAdapter fetchAdapter; - - /** - * The default value of the '{@link #getTargetEntity() Target Entity}' attribute. - * - * - * @see #getTargetEntity() - * @generated - * @ordered - */ - protected static final String TARGET_ENTITY_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedTargetEntity() Specified Target Entity}' attribute. - * - * - * @see #getSpecifiedTargetEntity() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TARGET_ENTITY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedTargetEntity() Specified Target Entity}' attribute. - * - * - * @see #getSpecifiedTargetEntity() - * @generated - * @ordered - */ - protected String specifiedTargetEntity = SPECIFIED_TARGET_ENTITY_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultTargetEntity() Default Target Entity}' attribute. - * - * - * @see #getDefaultTargetEntity() - * @generated - * @ordered - */ - protected static final String DEFAULT_TARGET_ENTITY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultTargetEntity() Default Target Entity}' attribute. - * - * - * @see #getDefaultTargetEntity() - * @generated - * @ordered - */ - protected String defaultTargetEntity = DEFAULT_TARGET_ENTITY_EDEFAULT; - - /** - * The cached value of the '{@link #getResolvedTargetEntity() Resolved Target Entity}' reference. - * - * - * @see #getResolvedTargetEntity() - * @generated - * @ordered - */ - protected IEntity resolvedTargetEntity; - - /** - * The cached value of the '{@link #getCascade() Cascade}' containment reference. - * - * - * @see #getCascade() - * @generated - * @ordered - */ - protected ICascade cascade; - - protected JavaRelationshipMapping() { - throw new UnsupportedOperationException("Use JavaRelationshipMapping(Attribute) instead"); - } - - protected JavaRelationshipMapping(Attribute attribute) { - super(attribute); - this.targetEntityAdapter = this.buildAnnotationElementAdapter(this.targetEntityAdapter()); - this.fetchAdapter = this.buildAnnotationElementAdapter(this.fetchAdapter()); - } - - protected AnnotationElementAdapter buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter daea) { - return new ShortCircuitAnnotationElementAdapter(this.getAttribute(), daea); - } - - /** - * return the Java adapter's 'targetEntity' element adapter config - */ - protected abstract DeclarationAnnotationElementAdapter targetEntityAdapter(); - - /** - * return the Java adapter's 'cascade' element adapter config - */ - protected abstract DeclarationAnnotationElementAdapter cascadeAdapter(); - - /** - * return the Java adapter's 'fetch' element adapter config - */ - protected abstract DeclarationAnnotationElementAdapter fetchAdapter(); - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IRelationshipMapping.class)) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - this.targetEntityAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - if (notification.getNewValue() == null && notification.getOldValue() != null) { - ((JavaCascade) notification.getOldValue()).getCascadeAdapter().setValue(null); - } - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_RELATIONSHIP_MAPPING; - } - - /** - * Returns the value of the 'Target Entity' attribute. - * - *

- * If the meaning of the 'Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Target Entity' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIRelationshipMapping_TargetEntity() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getTargetEntity() { - return (this.getSpecifiedTargetEntity() == null) ? getDefaultTargetEntity() : this.getSpecifiedTargetEntity(); - } - - /** - * Returns the value of the 'Specified Target Entity' attribute. - * - *

- * If the meaning of the 'Specified Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Target Entity' attribute. - * @see #setSpecifiedTargetEntity(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIRelationshipMapping_SpecifiedTargetEntity() - * @model - * @generated - */ - public String getSpecifiedTargetEntity() { - return specifiedTargetEntity; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping#getSpecifiedTargetEntity Specified Target Entity}' attribute. - * - * - * @param value the new value of the 'Specified Target Entity' attribute. - * @see #getSpecifiedTargetEntity() - * @generated - */ - public void setSpecifiedTargetEntity(String newSpecifiedTargetEntity) { - String oldSpecifiedTargetEntity = specifiedTargetEntity; - specifiedTargetEntity = newSpecifiedTargetEntity; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY, oldSpecifiedTargetEntity, specifiedTargetEntity)); - } - - /** - * Returns the value of the 'Default Target Entity' attribute. - * - *

- * If the meaning of the 'Default Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Target Entity' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIRelationshipMapping_DefaultTargetEntity() - * @model changeable="false" - * @generated - */ - public String getDefaultTargetEntity() { - return defaultTargetEntity; - } - - protected void setDefaultTargetEntity(String newDefaultTargetEntity) { - String oldDefaultTargetEntity = this.defaultTargetEntity; - this.defaultTargetEntity = newDefaultTargetEntity; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY, oldDefaultTargetEntity, this.defaultTargetEntity)); - } - - /** - * Returns the value of the 'Resolved Target Entity' reference. - * - *

- * If the meaning of the 'Resolved Target Entity' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Resolved Target Entity' reference. - * @see #setResolvedTargetEntity(IEntity) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIRelationshipMapping_ResolvedTargetEntity() - * @model - * @generated - */ - public IEntity getResolvedTargetEntity() { - if (resolvedTargetEntity != null && resolvedTargetEntity.eIsProxy()) { - InternalEObject oldResolvedTargetEntity = (InternalEObject) resolvedTargetEntity; - resolvedTargetEntity = (IEntity) eResolveProxy(oldResolvedTargetEntity); - if (resolvedTargetEntity != oldResolvedTargetEntity) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY, oldResolvedTargetEntity, resolvedTargetEntity)); - } - } - return resolvedTargetEntity; - } - - /** - * - * - * @generated - */ - public IEntity basicGetResolvedTargetEntity() { - return resolvedTargetEntity; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping#getResolvedTargetEntity Resolved Target Entity}' reference. - * - * - * @param value the new value of the 'Resolved Target Entity' reference. - * @see #getResolvedTargetEntity() - * @generated - */ - public void setResolvedTargetEntity(IEntity newResolvedTargetEntity) { - IEntity oldResolvedTargetEntity = resolvedTargetEntity; - resolvedTargetEntity = newResolvedTargetEntity; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY, oldResolvedTargetEntity, resolvedTargetEntity)); - } - - /** - * Returns the value of the 'Cascade' containment reference. - * - *

- * If the meaning of the 'Cascade' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Cascade' containment reference. - * @see #setCascade(ICascade) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIRelationshipMapping_Cascade() - * @model containment="true" - * @generated - */ - public ICascade getCascade() { - return cascade; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetCascade(ICascade newCascade, NotificationChain msgs) { - ICascade oldCascade = cascade; - cascade = newCascade; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, oldCascade, newCascade); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping#getCascade Cascade}' containment reference. - * - * - * @param value the new value of the 'Cascade' containment reference. - * @see #getCascade() - * @generated - */ - public void setCascade(ICascade newCascade) { - if (newCascade != cascade) { - NotificationChain msgs = null; - if (cascade != null) - msgs = ((InternalEObject) cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, null, msgs); - if (newCascade != null) - msgs = ((InternalEObject) newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, null, msgs); - msgs = basicSetCascade(newCascade, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, newCascade, newCascade)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - return basicSetCascade(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY : - return getTargetEntity(); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return getSpecifiedTargetEntity(); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return getDefaultTargetEntity(); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - if (resolve) - return getResolvedTargetEntity(); - return basicGetResolvedTargetEntity(); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - return getCascade(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - setSpecifiedTargetEntity((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - setResolvedTargetEntity((IEntity) newValue); - return; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - setCascade((ICascade) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - setSpecifiedTargetEntity(SPECIFIED_TARGET_ENTITY_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - setResolvedTargetEntity((IEntity) null); - return; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - setCascade((ICascade) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY : - return TARGET_ENTITY_EDEFAULT == null ? getTargetEntity() != null : !TARGET_ENTITY_EDEFAULT.equals(getTargetEntity()); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return SPECIFIED_TARGET_ENTITY_EDEFAULT == null ? specifiedTargetEntity != null : !SPECIFIED_TARGET_ENTITY_EDEFAULT.equals(specifiedTargetEntity); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return DEFAULT_TARGET_ENTITY_EDEFAULT == null ? defaultTargetEntity != null : !DEFAULT_TARGET_ENTITY_EDEFAULT.equals(defaultTargetEntity); - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - return resolvedTargetEntity != null; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - return cascade != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IRelationshipMapping.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__TARGET_ENTITY; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IRelationshipMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__TARGET_ENTITY : - return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE : - return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedTargetEntity: "); - result.append(specifiedTargetEntity); - result.append(", defaultTargetEntity: "); - result.append(defaultTargetEntity); - result.append(')'); - return result.toString(); - } - - public String fullyQualifiedTargetEntity() { - return (getTargetEntity() == null) ? null : JDTTools.resolve(getTargetEntity(), this.jdtType()); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setDefaultTargetEntity(this.javaDefaultTargetEntity()); - setSpecifiedTargetEntity(this.targetEntityAdapter.getValue(astRoot)); - this.updateFetchFromJava(astRoot); - if (this.cascade != null) { - ((JavaCascade) this.cascade).updateFromJava(astRoot); - } - else if (cascadeAdapter().expression(getAttribute().modifiedDeclaration()) != null) { - setCascade(createCascade()); - ((JavaCascade) this.cascade).updateFromJava(astRoot); - } - } - - /** - * delegate to subclasses because there are different 'fetch' - * defaults across the subclasses - */ - protected abstract void updateFetchFromJava(CompilationUnit astRoot); - - /** - * the default 'targetEntity' is calculated from the attribute type; - * return null if the attribute type cannot possibly be an entity - */ - protected String javaDefaultTargetEntity() { - return this.javaDefaultTargetEntity(this.getAttribute().typeSignature()); - } - - protected String javaDefaultTargetEntity(String signature) { - return buildReferenceEntityTypeName(signature, jdtType()); - } - - // TODO Embeddable??? - public static String buildReferenceEntityTypeName(String signature, IType jdtType) { - if (Signature.getArrayCount(signature) > 0) { - return null; // arrays cannot be entities - } - return JDTTools.resolve(Signature.toString(signature), jdtType); - } - - public IEntity getEntity() { - ITypeMapping typeMapping = typeMapping(); - if (typeMapping instanceof IEntity) { - return (IEntity) typeMapping; - } - return null; - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - String targetEntityName = fullyQualifiedTargetEntity(); - if (targetEntityName != null) { - IPersistentType persistentType = defaultsContext.persistentType(targetEntityName); - if (persistentType != null) { - if (persistentType.getMapping() instanceof IEntity) { - setResolvedTargetEntity((IEntity) persistentType.getMapping()); - return; - } - } - } - setResolvedTargetEntity(null); - } - - public Iterator allTargetEntityAttributeNames() { - IEntity targetEntity = this.getResolvedTargetEntity(); - return (targetEntity == null) ? EmptyIterator. instance() : targetEntity.getPersistentType().allAttributeNames(); - } - - public Iterator candidateMappedByAttributeNames() { - return this.allTargetEntityAttributeNames(); - } - - protected Iterator candidateMappedByAttributeNames(Filter filter) { - return new FilteringIterator(this.candidateMappedByAttributeNames(), filter); - } - - protected Iterator quotedCandidateMappedByAttributeNames(Filter filter) { - return StringTools.quote(this.candidateMappedByAttributeNames(filter)); - } - - public ICascade createCascade() { - return JpaJavaMappingsFactory.eINSTANCE.createJavaCascade(getAttribute(), cascadeAdapter()); - } - - // ********** convenience methods ********** - protected AnnotationElementAdapter getFetchAdapter() { - return this.fetchAdapter; - } - - // ********** static methods ********** - protected static DeclarationAnnotationElementAdapter buildTargetEntityAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - // TODO what about QualifiedType? - return buildAnnotationElementAdapter(annotationAdapter, elementName, SimpleTypeStringExpressionConverter.instance()); - } - - protected static DeclarationAnnotationElementAdapter buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return buildAnnotationElementAdapter(annotationAdapter, elementName, StringExpressionConverter.instance()); - } - - protected static DeclarationAnnotationElementAdapter buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter converter) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false, converter); - } - - protected static DeclarationAnnotationElementAdapter buildEnumAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return new EnumDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false); - } - - protected static DeclarationAnnotationElementAdapter buildEnumArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return new EnumArrayDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false); - } - - public boolean targetEntityIsValid(String targetEntity) { - return RelationshipMappingTools.targetEntityIsValid(targetEntity); - } - - /** - * return whether the specified non-array type is one of the container - * types allowed by the JPA spec - */ - public static boolean typeNamedIsContainer(String typeName) { - return CollectionTools.contains(CONTAINER_TYPE_NAMES, typeName); - } - - private static final String[] CONTAINER_TYPE_NAMES = { - java.util.Collection.class.getName(), - java.util.Set.class.getName(), - java.util.List.class.getName(), - java.util.Map.class.getName() - }; -} // JavaRelationshipMapping diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java deleted file mode 100644 index ecad438a58..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java +++ /dev/null @@ -1,553 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Secondary Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSecondaryTable() - * @model kind="class" - * @generated - */ -public class JavaSecondaryTable extends AbstractJavaTable - implements ISecondaryTable -{ - /** - * The cached value of the '{@link #getSpecifiedPrimaryKeyJoinColumns() Specified Primary Key Join Columns}' containment reference list. - * - * - * @see #getSpecifiedPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedPrimaryKeyJoinColumns; - - /** - * The cached value of the '{@link #getDefaultPrimaryKeyJoinColumns() Default Primary Key Join Columns}' containment reference list. - * - * - * @see #getDefaultPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList defaultPrimaryKeyJoinColumns; - - private final IndexedAnnotationAdapter annotationAdapter; - - protected JavaSecondaryTable() { - super(); - throw new UnsupportedOperationException("Use JavaSecondaryTable(Owner, Member, int) instead"); - } - - public JavaSecondaryTable(Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(owner, member, idaa); - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); - this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(0)); - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(ISecondaryTable.class)) { - case JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - specifiedPKJoinColumnsChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void specifiedPKJoinColumnsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - specifiedPKJoinColumnAdded(notification.getPosition(), (IPrimaryKeyJoinColumn) notification.getNewValue()); - break; - case Notification.ADD_MANY : - specifiedPKJoinColumnsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - specifiedPKJoinColumnRemoved(notification.getPosition(), (IPrimaryKeyJoinColumn) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - specifiedPKJoinColumnsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - specifiedPKJoinColumnsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - specifiedPKJoinColumnSet(notification.getPosition(), (IPrimaryKeyJoinColumn) notification.getOldValue(), (IPrimaryKeyJoinColumn) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - specifiedPKJoinColumnMoved(notification.getOldIntValue(), notification.getPosition(), (IPrimaryKeyJoinColumn) notification.getNewValue()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_SECONDARY_TABLE; - } - - public EList getPrimaryKeyJoinColumns() { - return this.getSpecifiedPrimaryKeyJoinColumns().isEmpty() ? this.getDefaultPrimaryKeyJoinColumns() : this.getSpecifiedPrimaryKeyJoinColumns(); - } - - /** - * Returns the value of the 'Specified Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

- * If the meaning of the 'Specified Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISecondaryTable_SpecifiedPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedPrimaryKeyJoinColumns() { - if (specifiedPrimaryKeyJoinColumns == null) { - specifiedPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS); - } - return specifiedPrimaryKeyJoinColumns; - } - - /** - * Returns the value of the 'Default Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

- * If the meaning of the 'Default Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISecondaryTable_DefaultPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getDefaultPrimaryKeyJoinColumns() { - if (defaultPrimaryKeyJoinColumns == null) { - defaultPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS); - } - return defaultPrimaryKeyJoinColumns; - } - - public ITypeMapping typeMapping() { - return (ITypeMapping) eContainer(); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getDefaultPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return getPrimaryKeyJoinColumns(); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return getSpecifiedPrimaryKeyJoinColumns(); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return getDefaultPrimaryKeyJoinColumns(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - getSpecifiedPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - getDefaultPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return !getPrimaryKeyJoinColumns().isEmpty(); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return specifiedPrimaryKeyJoinColumns != null && !specifiedPrimaryKeyJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return defaultPrimaryKeyJoinColumns != null && !defaultPrimaryKeyJoinColumns.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ISecondaryTable.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ISecondaryTable.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - @Override - protected void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.updateSpecifiedPrimaryKeyJoinColumnsFromJava(astRoot); - } - - /** - * here we just worry about getting the join column lists the same size; - * then we delegate to the join columns to synch themselves up - */ - private void updateSpecifiedPrimaryKeyJoinColumnsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List joinColumns = getSpecifiedPrimaryKeyJoinColumns(); - int persSize = joinColumns.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaPrimaryKeyJoinColumn joinColumn = (JavaPrimaryKeyJoinColumn) joinColumns.get(i); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - joinColumn.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - joinColumns.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaPrimaryKeyJoinColumn joinColumn = this.createJavaPrimaryKeyJoinColumn(javaSize); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedPrimaryKeyJoinColumns().add(joinColumn); - joinColumn.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - @Override - protected void setDefaultName(String newDefaultName) { - throw new UnsupportedOperationException("No default name for a secondary table"); - } - - // ********** AbstractJavaTable implementation ********** - @Override - protected DeclarationAnnotationElementAdapter nameAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.SECONDARY_TABLE__NAME); - } - - @Override - protected DeclarationAnnotationElementAdapter schemaAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.SECONDARY_TABLE__SCHEMA); - } - - @Override - protected DeclarationAnnotationElementAdapter catalogAdapter(DeclarationAnnotationAdapter daa) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.SECONDARY_TABLE__CATALOG); - } - - public IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index) { - return this.createJavaPrimaryKeyJoinColumn(index); - } - - private JavaPrimaryKeyJoinColumn createJavaPrimaryKeyJoinColumn(int index) { - return JavaPrimaryKeyJoinColumn.createSecondaryTableJoinColumn(this.getDeclarationAnnotationAdapter(), buildPkJoinColumnOwner(), this.getMember(), index); - } - - protected IAbstractJoinColumn.Owner buildPkJoinColumnOwner() { - return new ISecondaryTable.PrimaryKeyJoinColumnOwner(this); - } - - public boolean containsSpecifiedPrimaryKeyJoinColumns() { - return !this.getSpecifiedPrimaryKeyJoinColumns().isEmpty(); - } - - @Override - protected JavaUniqueConstraint createJavaUniqueConstraint(int index) { - return JavaUniqueConstraint.createSecondaryTableUniqueConstraint(new UniqueConstraintOwner(this), this.getDeclarationAnnotationAdapter(), getMember(), index); - } - - // ********** persistence model -> java annotations ********** - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - // ********** jpa model -> java annotations ********** - /** - * slide over all the annotations that follow the new join column - */ - public void specifiedPKJoinColumnAdded(int index, IPrimaryKeyJoinColumn joinColumn) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaPrimaryKeyJoinColumn) joinColumn).annotation(getMember().astRoot()) == null) { - this.synchPKJoinColumnAnnotationsAfterAdd(index + 1); - ((JavaPrimaryKeyJoinColumn) joinColumn).newAnnotation(); - } - } - - // bjv look at this - public void specifiedPKJoinColumnsAdded(int index, List joinColumns) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!joinColumns.isEmpty() && ((JavaPrimaryKeyJoinColumn) joinColumns.get(0)).annotation(getMember().astRoot()) == null) { - this.synchPKJoinColumnAnnotationsAfterAdd(index + joinColumns.size()); - for (IPrimaryKeyJoinColumn joinColumn : joinColumns) { - ((JavaPrimaryKeyJoinColumn) joinColumn).newAnnotation(); - } - } - } - - public void specifiedPKJoinColumnRemoved(int index, IPrimaryKeyJoinColumn joinColumn) { - ((JavaPrimaryKeyJoinColumn) joinColumn).removeAnnotation(); - this.synchPKJoinColumnAnnotationsAfterRemove(index); - } - - public void specifiedPKJoinColumnsRemoved(int[] indexes, List joinColumns) { - for (IPrimaryKeyJoinColumn joinColumn : joinColumns) { - ((JavaPrimaryKeyJoinColumn) joinColumn).removeAnnotation(); - } - this.synchPKJoinColumnAnnotationsAfterRemove(indexes[0]); - } - - public void specifiedPKJoinColumnsCleared(List joinColumns) { - for (IPrimaryKeyJoinColumn joinColumn : joinColumns) { - ((JavaPrimaryKeyJoinColumn) joinColumn).removeAnnotation(); - } - } - - public void specifiedPKJoinColumnSet(int index, IPrimaryKeyJoinColumn oldJoinColumn, IPrimaryKeyJoinColumn newJoinColumn) { - ((JavaPrimaryKeyJoinColumn) newJoinColumn).newAnnotation(); - } - - public void specifiedPKJoinColumnMoved(int sourceIndex, int targetIndex, IPrimaryKeyJoinColumn joinColumn) { - List joinColumns = this.getSpecifiedPrimaryKeyJoinColumns(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchPKJoinColumnAnnotationsAfterAdd(int index) { - List joinColumns = this.getSpecifiedPrimaryKeyJoinColumns(); - for (int i = joinColumns.size(); i-- > index;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchPKJoinColumnAnnotationsAfterRemove(int index) { - List joinColumns = this.getSpecifiedPrimaryKeyJoinColumns(); - for (int i = index; i < joinColumns.size(); i++) { - this.synch(joinColumns.get(i), i); - } - } - - private void synch(IPrimaryKeyJoinColumn joinColumn, int index) { - ((JavaPrimaryKeyJoinColumn) joinColumn).moveAnnotation(index); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (IPrimaryKeyJoinColumn column : this.getPrimaryKeyJoinColumns()) { - result = ((JavaPrimaryKeyJoinColumn) column).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - // ********** static methods ********** - static JavaSecondaryTable createJavaSecondaryTable(Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaSecondaryTable(owner, member, buildDeclarationAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildDeclarationAnnotationAdapter(int index) { - return new CombinationIndexedDeclarationAnnotationAdapter(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES, index); - } -} // JavaSecondaryTable diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSequenceGenerator.java deleted file mode 100644 index 28bce2778d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSequenceGenerator.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Java Sequence Generator'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSequenceGenerator() - * @model kind="class" - * @generated - */ -public class JavaSequenceGenerator extends JavaGenerator - implements ISequenceGenerator -{ - private final AnnotationElementAdapter sequenceNameAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.SEQUENCE_GENERATOR); - - private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__NAME); - - private static final DeclarationAnnotationElementAdapter INITIAL_VALUE_ADAPTER = buildNumberAdapter(JPA.SEQUENCE_GENERATOR__INITIAL_VALUE); - - private static final DeclarationAnnotationElementAdapter ALLOCATION_SIZE_ADAPTER = buildNumberAdapter(JPA.SEQUENCE_GENERATOR__ALLOCATION_SIZE); - - private static final DeclarationAnnotationElementAdapter SEQUENCE_NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__SEQUENCE_NAME); - - /** - * The default value of the '{@link #getSequenceName() Sequence Name}' attribute. - * - * - * @see #getSequenceName() - * @generated - * @ordered - */ - protected static final String SEQUENCE_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSequenceName() Specified Sequence Name}' attribute. - * - * - * @see #getSpecifiedSequenceName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SEQUENCE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSequenceName() Specified Sequence Name}' attribute. - * - * - * @see #getSpecifiedSequenceName() - * @generated - * @ordered - */ - protected String specifiedSequenceName = SPECIFIED_SEQUENCE_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSequenceName() Default Sequence Name}' attribute. - * - * - * @see #getDefaultSequenceName() - * @generated - * @ordered - */ - protected static final String DEFAULT_SEQUENCE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSequenceName() Default Sequence Name}' attribute. - * - * - * @see #getDefaultSequenceName() - * @generated - * @ordered - */ - protected String defaultSequenceName = DEFAULT_SEQUENCE_NAME_EDEFAULT; - - protected JavaSequenceGenerator() { - throw new UnsupportedOperationException("Use JavaSequenceGenerator(Member) instead"); - } - - protected JavaSequenceGenerator(Member member) { - super(member); - this.sequenceNameAdapter = this.buildAdapter(SEQUENCE_NAME_ADAPTER); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(ISequenceGenerator.class)) { - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - this.sequenceNameAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** initialization ********** - @Override - protected DeclarationAnnotationAdapter annotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter nameAdapter() { - return NAME_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter initialValueAdapter() { - return INITIAL_VALUE_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter allocationSizeAdapter() { - return ALLOCATION_SIZE_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_SEQUENCE_GENERATOR; - } - - public String getSequenceName() { - return (this.getSpecifiedSequenceName() == null) ? getDefaultSequenceName() : this.getSpecifiedSequenceName(); - } - - /** - * Returns the value of the 'Specified Sequence Name' attribute. - * - *

- * If the meaning of the 'Specified Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Sequence Name' attribute. - * @see #setSpecifiedSequenceName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISequenceGenerator_SpecifiedSequenceName() - * @model - * @generated - */ - public String getSpecifiedSequenceName() { - return specifiedSequenceName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator#getSpecifiedSequenceName Specified Sequence Name}' attribute. - * - * - * @param value the new value of the 'Specified Sequence Name' attribute. - * @see #getSpecifiedSequenceName() - * @generated - */ - public void setSpecifiedSequenceName(String newSpecifiedSequenceName) { - String oldSpecifiedSequenceName = specifiedSequenceName; - specifiedSequenceName = newSpecifiedSequenceName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME, oldSpecifiedSequenceName, specifiedSequenceName)); - } - - /** - * Returns the value of the 'Default Sequence Name' attribute. - * - *

- * If the meaning of the 'Default Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Sequence Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISequenceGenerator_DefaultSequenceName() - * @model changeable="false" - * @generated - */ - public String getDefaultSequenceName() { - return defaultSequenceName; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SEQUENCE_NAME : - return getSequenceName(); - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return getSpecifiedSequenceName(); - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return getDefaultSequenceName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - setSpecifiedSequenceName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - setSpecifiedSequenceName(SPECIFIED_SEQUENCE_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SEQUENCE_NAME : - return SEQUENCE_NAME_EDEFAULT == null ? getSequenceName() != null : !SEQUENCE_NAME_EDEFAULT.equals(getSequenceName()); - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return SPECIFIED_SEQUENCE_NAME_EDEFAULT == null ? specifiedSequenceName != null : !SPECIFIED_SEQUENCE_NAME_EDEFAULT.equals(specifiedSequenceName); - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return DEFAULT_SEQUENCE_NAME_EDEFAULT == null ? defaultSequenceName != null : !DEFAULT_SEQUENCE_NAME_EDEFAULT.equals(defaultSequenceName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ISequenceGenerator.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SEQUENCE_NAME : - return JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SEQUENCE_NAME; - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME; - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ISequenceGenerator.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SEQUENCE_NAME : - return JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SEQUENCE_NAME; - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME; - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedSequenceName: "); - result.append(specifiedSequenceName); - result.append(", defaultSequenceName: "); - result.append(defaultSequenceName); - result.append(')'); - return result.toString(); - } - - // ********** java annotations -> persistence model ********** - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setSpecifiedSequenceName(this.sequenceNameAdapter.getValue(astRoot)); - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildAdapter(String elementName) { - return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName); - } - - private static DeclarationAnnotationElementAdapter buildNumberAdapter(String elementName) { - return buildNumberAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName); - } -} // JavaSequenceGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSingleRelationshipMapping.java deleted file mode 100644 index e6c7239620..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSingleRelationshipMapping.java +++ /dev/null @@ -1,686 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.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.dom.BooleanLiteral; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.BooleanStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Single Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSingleRelationshipMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class JavaSingleRelationshipMapping - extends JavaRelationshipMapping implements ISingleRelationshipMapping -{ - private AnnotationElementAdapter optionalAdapter; - - /** - * The default value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected static final DefaultEagerFetchType FETCH_EDEFAULT = DefaultEagerFetchType.DEFAULT; - - /** - * The cached value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected DefaultEagerFetchType fetch = FETCH_EDEFAULT; - - /** - * The cached value of the '{@link #getSpecifiedJoinColumns() Specified Join Columns}' containment reference list. - * - * - * @see #getSpecifiedJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedJoinColumns; - - /** - * The cached value of the '{@link #getDefaultJoinColumns() Default Join Columns}' containment reference list. - * - * - * @see #getDefaultJoinColumns() - * @generated - * @ordered - */ - protected EList defaultJoinColumns; - - /** - * The default value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean OPTIONAL_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected DefaultTrueBoolean optional = OPTIONAL_EDEFAULT; - - protected JavaSingleRelationshipMapping() { - throw new UnsupportedOperationException("Use JavaSingleRelationshipMapping(Attribute) instead"); - } - - protected JavaSingleRelationshipMapping(Attribute attribute) { - super(attribute); - this.optionalAdapter = this.buildAnnotationElementAdapter(this.optionalAdapter()); - this.getDefaultJoinColumns().add(this.createJoinColumn(new ISingleRelationshipMapping.JoinColumnOwner(this), attribute)); - } - - private IJoinColumn createJoinColumn(IJoinColumn.Owner joinColumnOwner, Member member) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaJoinColumn(joinColumnOwner, member); - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(ISingleRelationshipMapping.class)) { - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - this.optionalAdapter.setValue(((DefaultTrueBoolean) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - specifiedJoinColumnsChanged(notification); - break; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH : - this.getFetchAdapter().setValue(((DefaultEagerFetchType) notification.getNewValue()).convertToJavaAnnotationValue()); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void specifiedJoinColumnsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - specifiedJoinColumnAdded(notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - case Notification.ADD_MANY : - specifiedJoinColumnsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - specifiedJoinColumnRemoved(notification.getPosition(), (IJoinColumn) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - specifiedJoinColumnsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - specifiedJoinColumnsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - specifiedJoinColumnSet(notification.getPosition(), (IJoinColumn) notification.getOldValue(), (IJoinColumn) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - specifiedJoinColumnMoved(notification.getOldIntValue(), notification.getPosition(), (IJoinColumn) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** jpa model -> java annotations ********** - /** - * slide over all the annotations that follow the new join column - */ - public void specifiedJoinColumnAdded(int index, IJoinColumn joinColumn) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaJoinColumn) joinColumn).annotation(getAttribute().astRoot()) == null) { - this.synchJoinColumnAnnotationsAfterAdd(index + 1); - ((JavaJoinColumn) joinColumn).newAnnotation(); - } - } - - public void specifiedJoinColumnsAdded(int index, List joinColumns) { - //JoinColumn was added to persistence model when udating from java, do not need - //to edit the java in this case. TODO is there a better way to handle this?? - if (!joinColumns.isEmpty() && ((JavaJoinColumn) joinColumns.get(0)).annotation(getAttribute().astRoot()) == null) { - this.synchJoinColumnAnnotationsAfterAdd(index + joinColumns.size()); - for (Iterator stream = joinColumns.iterator(); stream.hasNext();) { - JavaJoinColumn joinColumn = (JavaJoinColumn) stream.next(); - joinColumn.newAnnotation(); - } - } - } - - public void specifiedJoinColumnRemoved(int index, IJoinColumn joinColumn) { - ((JavaJoinColumn) joinColumn).removeAnnotation(); - this.synchJoinColumnAnnotationsAfterRemove(index); - } - - public void specifiedJoinColumnsRemoved(int[] indexes, List joinColumns) { - for (Iterator stream = joinColumns.iterator(); stream.hasNext();) { - JavaJoinColumn joinColumn = (JavaJoinColumn) stream.next(); - joinColumn.removeAnnotation(); - } - this.synchJoinColumnAnnotationsAfterRemove(indexes[0]); - } - - public void specifiedJoinColumnsCleared(List joinColumns) { - for (Iterator stream = joinColumns.iterator(); stream.hasNext();) { - JavaJoinColumn joinColumn = (JavaJoinColumn) stream.next(); - joinColumn.removeAnnotation(); - } - } - - public void specifiedJoinColumnSet(int index, IJoinColumn oldJoinColumn, IJoinColumn newJoinColumn) { - ((JavaJoinColumn) newJoinColumn).newAnnotation(); - } - - public void specifiedJoinColumnMoved(int sourceIndex, int targetIndex, IJoinColumn joinColumn) { - List joinColumns = getSpecifiedJoinColumns(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchJoinColumnAnnotationsAfterAdd(int index) { - List joinColumns = getSpecifiedJoinColumns(); - for (int i = joinColumns.size(); i-- > index;) { - this.synch(joinColumns.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchJoinColumnAnnotationsAfterRemove(int index) { - List joinColumns = getSpecifiedJoinColumns(); - for (int i = index; i < joinColumns.size(); i++) { - this.synch(joinColumns.get(i), i); - } - } - - private void synch(IJoinColumn joinColumn, int index) { - ((JavaJoinColumn) joinColumn).moveAnnotation(index); - } - - /** - * return the Java adapter's 'optional' element adapter config - */ - protected abstract DeclarationAnnotationElementAdapter optionalAdapter(); - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_SINGLE_RELATIONSHIP_MAPPING; - } - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType}. - * - *

- * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #setFetch(DefaultEagerFetchType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISingleRelationshipMapping_Fetch() - * @model - * @generated - */ - public DefaultEagerFetchType getFetch() { - return fetch; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #getFetch() - * @generated - */ - public void setFetch(DefaultEagerFetchType newFetch) { - DefaultEagerFetchType oldFetch = fetch; - fetch = newFetch == null ? FETCH_EDEFAULT : newFetch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH, oldFetch, fetch)); - } - - public EList getJoinColumns() { - return this.getSpecifiedJoinColumns().isEmpty() ? this.getDefaultJoinColumns() : this.getSpecifiedJoinColumns(); - } - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISingleRelationshipMapping_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedJoinColumns() { - if (specifiedJoinColumns == null) { - specifiedJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS); - } - return specifiedJoinColumns; - } - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISingleRelationshipMapping_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultJoinColumns() { - if (defaultJoinColumns == null) { - defaultJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS); - } - return defaultJoinColumns; - } - - /** - * Returns the value of the 'Optional' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Optional' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setOptional(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getISingleRelationshipMapping_Optional() - * @model - * @generated - */ - public DefaultTrueBoolean getOptional() { - return optional; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping#getOptional Optional}' attribute. - * - * - * @param value the new value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getOptional() - * @generated - */ - public void setOptional(DefaultTrueBoolean newOptional) { - DefaultTrueBoolean oldOptional = optional; - optional = newOptional == null ? OPTIONAL_EDEFAULT : newOptional; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL, oldOptional, optional)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return ((InternalEList) getJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedJoinColumns()).basicRemove(otherEnd, msgs); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return ((InternalEList) getDefaultJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH : - return getFetch(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return getJoinColumns(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return getSpecifiedJoinColumns(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return getDefaultJoinColumns(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return getOptional(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH : - setFetch((DefaultEagerFetchType) newValue); - return; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - getSpecifiedJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - getDefaultJoinColumns().addAll((Collection) newValue); - return; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - setOptional((DefaultTrueBoolean) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH : - setFetch(FETCH_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - return; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - setOptional(OPTIONAL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH : - return fetch != FETCH_EDEFAULT; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return !getJoinColumns().isEmpty(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return specifiedJoinColumns != null && !specifiedJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return defaultJoinColumns != null && !defaultJoinColumns.isEmpty(); - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return optional != OPTIONAL_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ISingleRelationshipMapping.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ISingleRelationshipMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH : - return JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fetch: "); - result.append(fetch); - result.append(", optional: "); - result.append(optional); - result.append(')'); - return result.toString(); - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.updateFetchFromJava(astRoot); - this.updateSpecifiedJoinColumnsFromJava(astRoot); - this.setOptional(DefaultTrueBoolean.fromJavaAnnotationValue(this.optionalAdapter.getValue(astRoot))); - } - - /** - * here we just worry about getting the join column lists the same size; - * then we delegate to the join columns to synch themselves up - */ - private void updateSpecifiedJoinColumnsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List joinColumns = getSpecifiedJoinColumns(); - int persSize = joinColumns.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaJoinColumn joinColumn = (JavaJoinColumn) joinColumns.get(i); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - joinColumn.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - joinColumns.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaJoinColumn joinColumn = this.createJavaJoinColumn(javaSize); - if (joinColumn.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - getSpecifiedJoinColumns().add(joinColumn); - joinColumn.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - @Override - protected void updateFetchFromJava(CompilationUnit astRoot) { - setFetch(DefaultEagerFetchType.fromJavaAnnotationValue(this.getFetchAdapter().getValue(astRoot))); - } - - /** - * extend to eliminate any "container" types - */ - @Override - protected String javaDefaultTargetEntity() { - String typeName = super.javaDefaultTargetEntity(); - // if the attribute is a container, don't use it - return typeNamedIsContainer(typeName) ? null : typeName; - } - - public boolean containsSpecifiedJoinColumns() { - return !this.getSpecifiedJoinColumns().isEmpty(); - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - for (IJoinColumn column : this.getJoinColumns()) { - result = ((JavaJoinColumn) column).candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - } - return null; - } - - public IJoinColumn createJoinColumn(int index) { - return this.createJavaJoinColumn(index); - } - - private JavaJoinColumn createJavaJoinColumn(int index) { - return JavaJoinColumn.createSingleRelationshipMappingJoinColumn(new JoinColumnOwner(this), this.getAttribute(), index); - } - - // ********** static methods ********** - protected static DeclarationAnnotationElementAdapter buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false, BooleanStringExpressionConverter.instance()); - } -} // JavaSingleRelationshipMapping diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java deleted file mode 100644 index 85f8693b50..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - * A representation of the model object 'Java Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTable() - * @model kind="class" - * @generated - */ -public class JavaTable extends AbstractJavaTable -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TABLE); - - private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__NAME); - - private static final DeclarationAnnotationElementAdapter SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__SCHEMA); - - private static final DeclarationAnnotationElementAdapter CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__CATALOG); - - protected JavaTable() { - super(); - throw new UnsupportedOperationException("Use JavaSecondaryTable(Owner, Member) instead"); - } - - protected JavaTable(Owner owner, Member member) { - super(owner, member, DECLARATION_ANNOTATION_ADAPTER); - } - - @Override - protected DeclarationAnnotationElementAdapter nameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - // ignore the daa passed in, @Table is never nested - return NAME_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter schemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - // ignore the daa passed in, @Table is never nested - return SCHEMA_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter catalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - // ignore the daa passed in, @Table is never nested - return CATALOG_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_TABLE; - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - this.setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY)); - } - - @Override - protected JavaUniqueConstraint createJavaUniqueConstraint(int index) { - return JavaUniqueConstraint.createTableUniqueConstraint(new UniqueConstraintOwner(this), this.getMember(), index); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java deleted file mode 100644 index d6377e8463..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java +++ /dev/null @@ -1,1350 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.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.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'Java Table Generator'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTableGenerator() - * @model kind="class" - * @generated - */ -public class JavaTableGenerator extends JavaGenerator - implements ITableGenerator -{ - private final AnnotationElementAdapter tableAdapter; - - private final AnnotationElementAdapter catalogAdapter; - - private final AnnotationElementAdapter schemaAdapter; - - private final AnnotationElementAdapter pkColumnNameAdapter; - - private final AnnotationElementAdapter valueColumnNameAdapter; - - private final AnnotationElementAdapter pkColumnValueAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TABLE_GENERATOR); - - private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__NAME); - - private static final DeclarationAnnotationElementAdapter INITIAL_VALUE_ADAPTER = buildNumberAdapter(JPA.TABLE_GENERATOR__INITIAL_VALUE); - - private static final DeclarationAnnotationElementAdapter ALLOCATION_SIZE_ADAPTER = buildNumberAdapter(JPA.TABLE_GENERATOR__ALLOCATION_SIZE); - - private static final DeclarationAnnotationElementAdapter TABLE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__TABLE); - - private static final DeclarationAnnotationElementAdapter CATALOG_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__CATALOG); - - private static final DeclarationAnnotationElementAdapter SCHEMA_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__SCHEMA); - - private static final DeclarationAnnotationElementAdapter PK_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_NAME); - - private static final DeclarationAnnotationElementAdapter VALUE_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME); - - private static final DeclarationAnnotationElementAdapter PK_COLUMN_VALUE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE); - - /** - * The default value of the '{@link #getTable() Table}' attribute. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected static final String TABLE_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected String specifiedTable = SPECIFIED_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected static final String DEFAULT_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected String defaultTable = DEFAULT_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getCatalog() Catalog}' attribute. - * - * - * @see #getCatalog() - * @generated - * @ordered - */ - protected static final String CATALOG_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected static final String SPECIFIED_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected String specifiedCatalog = SPECIFIED_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected static final String DEFAULT_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected String defaultCatalog = DEFAULT_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected String specifiedSchema = SPECIFIED_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected static final String DEFAULT_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getPkColumnName() Pk Column Name}' attribute. - * - * - * @see #getPkColumnName() - * @generated - * @ordered - */ - protected static final String PK_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedPkColumnName() Specified Pk Column Name}' attribute. - * - * - * @see #getSpecifiedPkColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_PK_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedPkColumnName() Specified Pk Column Name}' attribute. - * - * - * @see #getSpecifiedPkColumnName() - * @generated - * @ordered - */ - protected String specifiedPkColumnName = SPECIFIED_PK_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultPkColumnName() Default Pk Column Name}' attribute. - * - * - * @see #getDefaultPkColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_PK_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultPkColumnName() Default Pk Column Name}' attribute. - * - * - * @see #getDefaultPkColumnName() - * @generated - * @ordered - */ - protected String defaultPkColumnName = DEFAULT_PK_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getValueColumnName() Value Column Name}' attribute. - * - * - * @see #getValueColumnName() - * @generated - * @ordered - */ - protected static final String VALUE_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedValueColumnName() Specified Value Column Name}' attribute. - * - * - * @see #getSpecifiedValueColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedValueColumnName() Specified Value Column Name}' attribute. - * - * - * @see #getSpecifiedValueColumnName() - * @generated - * @ordered - */ - protected String specifiedValueColumnName = SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultValueColumnName() Default Value Column Name}' attribute. - * - * - * @see #getDefaultValueColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_VALUE_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultValueColumnName() Default Value Column Name}' attribute. - * - * - * @see #getDefaultValueColumnName() - * @generated - * @ordered - */ - protected String defaultValueColumnName = DEFAULT_VALUE_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPkColumnValue() Pk Column Value}' attribute. - * - * - * @see #getPkColumnValue() - * @generated - * @ordered - */ - protected static final String PK_COLUMN_VALUE_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedPkColumnValue() Specified Pk Column Value}' attribute. - * - * - * @see #getSpecifiedPkColumnValue() - * @generated - * @ordered - */ - protected static final String SPECIFIED_PK_COLUMN_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedPkColumnValue() Specified Pk Column Value}' attribute. - * - * - * @see #getSpecifiedPkColumnValue() - * @generated - * @ordered - */ - protected String specifiedPkColumnValue = SPECIFIED_PK_COLUMN_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultPkColumnValue() Default Pk Column Value}' attribute. - * - * - * @see #getDefaultPkColumnValue() - * @generated - * @ordered - */ - protected static final String DEFAULT_PK_COLUMN_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultPkColumnValue() Default Pk Column Value}' attribute. - * - * - * @see #getDefaultPkColumnValue() - * @generated - * @ordered - */ - protected String defaultPkColumnValue = DEFAULT_PK_COLUMN_VALUE_EDEFAULT; - - /** - * The cached value of the '{@link #getUniqueConstraints() Unique Constraints}' containment reference list. - * - * - * @see #getUniqueConstraints() - * @generated - * @ordered - */ - protected EList uniqueConstraints; - - protected JavaTableGenerator() { - throw new UnsupportedOperationException("Use JavaTableGenerator(Member) instead"); - } - - protected JavaTableGenerator(Member member) { - super(member); - this.tableAdapter = this.buildAdapter(TABLE_ADAPTER); - this.catalogAdapter = this.buildAdapter(CATALOG_ADAPTER); - this.schemaAdapter = this.buildAdapter(SCHEMA_ADAPTER); - this.pkColumnNameAdapter = this.buildAdapter(PK_COLUMN_NAME_ADAPTER); - this.valueColumnNameAdapter = this.buildAdapter(VALUE_COLUMN_NAME_ADAPTER); - this.pkColumnValueAdapter = this.buildAdapter(PK_COLUMN_VALUE_ADAPTER); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(ITableGenerator.class)) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE : - this.tableAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG : - this.catalogAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA : - this.schemaAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - this.valueColumnNameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - this.pkColumnNameAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - this.pkColumnValueAdapter.setValue((String) notification.getNewValue()); - break; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - uniqueConstraintsChanged(notification); - break; - default : - break; - } - } - - @SuppressWarnings("unchecked") - void uniqueConstraintsChanged(Notification notification) { - switch (notification.getEventType()) { - case Notification.ADD : - uniqueConstraintAdded(notification.getPosition(), (IUniqueConstraint) notification.getNewValue()); - break; - case Notification.ADD_MANY : - uniqueConstraintsAdded(notification.getPosition(), (List) notification.getNewValue()); - break; - case Notification.REMOVE : - uniqueConstraintRemoved(notification.getPosition(), (IUniqueConstraint) notification.getOldValue()); - break; - case Notification.REMOVE_MANY : - if (notification.getPosition() == Notification.NO_INDEX) { - uniqueConstraintsCleared((List) notification.getOldValue()); - } - else { - // Notification.getNewValue() returns an array of the positions of objects that were removed - uniqueConstraintsRemoved((int[]) notification.getNewValue(), (List) notification.getOldValue()); - } - break; - case Notification.SET : - if (!notification.isTouch()) { - uniqueConstraintSet(notification.getPosition(), (IUniqueConstraint) notification.getOldValue(), (IUniqueConstraint) notification.getNewValue()); - } - break; - case Notification.MOVE : - // Notification.getOldValue() returns the source index - // Notification.getPositon() returns the target index - // Notification.getNewValue() returns the moved object - uniqueConstraintMoved(notification.getOldIntValue(), notification.getPosition(), (IUniqueConstraint) notification.getNewValue()); - break; - default : - break; - } - } - - // ********** initialization ********** - @Override - protected DeclarationAnnotationAdapter annotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter nameAdapter() { - return NAME_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter initialValueAdapter() { - return INITIAL_VALUE_ADAPTER; - } - - @Override - protected DeclarationAnnotationElementAdapter allocationSizeAdapter() { - return ALLOCATION_SIZE_ADAPTER; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_TABLE_GENERATOR; - } - - public String getTable() { - return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable(); - } - - /** - * Returns the value of the 'Specified Table' attribute. - * - *

- * If the meaning of the 'Specified Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Table' attribute. - * @see #setSpecifiedTable(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_SpecifiedTable() - * @model - * @generated - */ - public String getSpecifiedTable() { - return specifiedTable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator#getSpecifiedTable Specified Table}' attribute. - * - * - * @param value the new value of the 'Specified Table' attribute. - * @see #getSpecifiedTable() - * @generated - */ - public void setSpecifiedTable(String newSpecifiedTable) { - String oldSpecifiedTable = specifiedTable; - specifiedTable = newSpecifiedTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE, oldSpecifiedTable, specifiedTable)); - } - - /** - * Returns the value of the 'Default Table' attribute. - * - *

- * If the meaning of the 'Default Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Table' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_DefaultTable() - * @model changeable="false" - * @generated - */ - public String getDefaultTable() { - return defaultTable; - } - - public String getCatalog() { - return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog(); - } - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

- * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_SpecifiedCatalog() - * @model - * @generated - */ - public String getSpecifiedCatalog() { - return specifiedCatalog; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - public void setSpecifiedCatalog(String newSpecifiedCatalog) { - String oldSpecifiedCatalog = specifiedCatalog; - specifiedCatalog = newSpecifiedCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG, oldSpecifiedCatalog, specifiedCatalog)); - } - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

- * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_DefaultCatalog() - * @model changeable="false" - * @generated - */ - public String getDefaultCatalog() { - return defaultCatalog; - } - - public String getSchema() { - return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema(); - } - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

- * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_SpecifiedSchema() - * @model - * @generated - */ - public String getSpecifiedSchema() { - return specifiedSchema; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - public void setSpecifiedSchema(String newSpecifiedSchema) { - String oldSpecifiedSchema = specifiedSchema; - specifiedSchema = newSpecifiedSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA, oldSpecifiedSchema, specifiedSchema)); - } - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

- * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_DefaultSchema() - * @model changeable="false" - * @generated - */ - public String getDefaultSchema() { - return defaultSchema; - } - - protected void setDefaultSchema(String newDefaultSchema) { - String oldDefaultSchema = this.defaultSchema; - this.defaultSchema = newDefaultSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_SCHEMA, oldDefaultSchema, this.defaultSchema)); - } - - public String getPkColumnName() { - return (this.getSpecifiedPkColumnName() == null) ? getDefaultPkColumnName() : this.getSpecifiedPkColumnName(); - } - - /** - * Returns the value of the 'Specified Pk Column Name' attribute. - * - *

- * If the meaning of the 'Specified Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Pk Column Name' attribute. - * @see #setSpecifiedPkColumnName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_SpecifiedPkColumnName() - * @model - * @generated - */ - public String getSpecifiedPkColumnName() { - return specifiedPkColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator#getSpecifiedPkColumnName Specified Pk Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Pk Column Name' attribute. - * @see #getSpecifiedPkColumnName() - * @generated - */ - public void setSpecifiedPkColumnName(String newSpecifiedPkColumnName) { - String oldSpecifiedPkColumnName = specifiedPkColumnName; - specifiedPkColumnName = newSpecifiedPkColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME, oldSpecifiedPkColumnName, specifiedPkColumnName)); - } - - /** - * Returns the value of the 'Default Pk Column Name' attribute. - * - *

- * If the meaning of the 'Default Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Pk Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_DefaultPkColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultPkColumnName() { - return defaultPkColumnName; - } - - public String getValueColumnName() { - return (this.getSpecifiedValueColumnName() == null) ? getDefaultValueColumnName() : this.getSpecifiedValueColumnName(); - } - - /** - * Returns the value of the 'Specified Value Column Name' attribute. - * - *

- * If the meaning of the 'Specified Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Value Column Name' attribute. - * @see #setSpecifiedValueColumnName(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_SpecifiedValueColumnName() - * @model - * @generated - */ - public String getSpecifiedValueColumnName() { - return specifiedValueColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator#getSpecifiedValueColumnName Specified Value Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Value Column Name' attribute. - * @see #getSpecifiedValueColumnName() - * @generated - */ - public void setSpecifiedValueColumnName(String newSpecifiedValueColumnName) { - String oldSpecifiedValueColumnName = specifiedValueColumnName; - specifiedValueColumnName = newSpecifiedValueColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME, oldSpecifiedValueColumnName, specifiedValueColumnName)); - } - - /** - * Returns the value of the 'Default Value Column Name' attribute. - * - *

- * If the meaning of the 'Default Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Value Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_DefaultValueColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultValueColumnName() { - return defaultValueColumnName; - } - - public String getPkColumnValue() { - return (this.getSpecifiedPkColumnValue() == null) ? getDefaultPkColumnValue() : this.getSpecifiedPkColumnValue(); - } - - /** - * Returns the value of the 'Specified Pk Column Value' attribute. - * - *

- * If the meaning of the 'Specified Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Pk Column Value' attribute. - * @see #setSpecifiedPkColumnValue(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_SpecifiedPkColumnValue() - * @model - * @generated - */ - public String getSpecifiedPkColumnValue() { - return specifiedPkColumnValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator#getSpecifiedPkColumnValue Specified Pk Column Value}' attribute. - * - * - * @param value the new value of the 'Specified Pk Column Value' attribute. - * @see #getSpecifiedPkColumnValue() - * @generated - */ - public void setSpecifiedPkColumnValue(String newSpecifiedPkColumnValue) { - String oldSpecifiedPkColumnValue = specifiedPkColumnValue; - specifiedPkColumnValue = newSpecifiedPkColumnValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE, oldSpecifiedPkColumnValue, specifiedPkColumnValue)); - } - - /** - * Returns the value of the 'Default Pk Column Value' attribute. - * - *

- * If the meaning of the 'Default Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Pk Column Value' attribute. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_DefaultPkColumnValue() - * @model changeable="false" - * @generated - */ - public String getDefaultPkColumnValue() { - return defaultPkColumnValue; - } - - /** - * Returns the value of the 'Unique Constraints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}. - * - *

- * If the meaning of the 'Unique Constraints' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Unique Constraints' containment reference list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_UniqueConstraints() - * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true" - * @generated - */ - public EList getUniqueConstraints() { - if (uniqueConstraints == null) { - uniqueConstraints = new EObjectContainmentEList(IUniqueConstraint.class, this, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS); - } - return uniqueConstraints; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return ((InternalEList) getUniqueConstraints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__TABLE : - return getTable(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE : - return getSpecifiedTable(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_TABLE : - return getDefaultTable(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__CATALOG : - return getCatalog(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG : - return getSpecifiedCatalog(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_CATALOG : - return getDefaultCatalog(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SCHEMA : - return getSchema(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA : - return getSpecifiedSchema(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_SCHEMA : - return getDefaultSchema(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_NAME : - return getPkColumnName(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return getSpecifiedPkColumnName(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return getDefaultPkColumnName(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__VALUE_COLUMN_NAME : - return getValueColumnName(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return getSpecifiedValueColumnName(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return getDefaultValueColumnName(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_VALUE : - return getPkColumnValue(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return getSpecifiedPkColumnValue(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return getDefaultPkColumnValue(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return getUniqueConstraints(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE : - setSpecifiedTable((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG : - setSpecifiedCatalog((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA : - setSpecifiedSchema((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - setSpecifiedPkColumnName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - setSpecifiedValueColumnName((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - setSpecifiedPkColumnValue((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - getUniqueConstraints().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE : - setSpecifiedTable(SPECIFIED_TABLE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG : - setSpecifiedCatalog(SPECIFIED_CATALOG_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA : - setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - setSpecifiedPkColumnName(SPECIFIED_PK_COLUMN_NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - setSpecifiedValueColumnName(SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - setSpecifiedPkColumnValue(SPECIFIED_PK_COLUMN_VALUE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__TABLE : - return TABLE_EDEFAULT == null ? getTable() != null : !TABLE_EDEFAULT.equals(getTable()); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE : - return SPECIFIED_TABLE_EDEFAULT == null ? specifiedTable != null : !SPECIFIED_TABLE_EDEFAULT.equals(specifiedTable); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_TABLE : - return DEFAULT_TABLE_EDEFAULT == null ? defaultTable != null : !DEFAULT_TABLE_EDEFAULT.equals(defaultTable); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__CATALOG : - return CATALOG_EDEFAULT == null ? getCatalog() != null : !CATALOG_EDEFAULT.equals(getCatalog()); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG : - return SPECIFIED_CATALOG_EDEFAULT == null ? specifiedCatalog != null : !SPECIFIED_CATALOG_EDEFAULT.equals(specifiedCatalog); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_CATALOG : - return DEFAULT_CATALOG_EDEFAULT == null ? defaultCatalog != null : !DEFAULT_CATALOG_EDEFAULT.equals(defaultCatalog); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SCHEMA : - return SCHEMA_EDEFAULT == null ? getSchema() != null : !SCHEMA_EDEFAULT.equals(getSchema()); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA : - return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_SCHEMA : - return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_NAME : - return PK_COLUMN_NAME_EDEFAULT == null ? getPkColumnName() != null : !PK_COLUMN_NAME_EDEFAULT.equals(getPkColumnName()); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return SPECIFIED_PK_COLUMN_NAME_EDEFAULT == null ? specifiedPkColumnName != null : !SPECIFIED_PK_COLUMN_NAME_EDEFAULT.equals(specifiedPkColumnName); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return DEFAULT_PK_COLUMN_NAME_EDEFAULT == null ? defaultPkColumnName != null : !DEFAULT_PK_COLUMN_NAME_EDEFAULT.equals(defaultPkColumnName); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__VALUE_COLUMN_NAME : - return VALUE_COLUMN_NAME_EDEFAULT == null ? getValueColumnName() != null : !VALUE_COLUMN_NAME_EDEFAULT.equals(getValueColumnName()); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT == null ? specifiedValueColumnName != null : !SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT.equals(specifiedValueColumnName); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return DEFAULT_VALUE_COLUMN_NAME_EDEFAULT == null ? defaultValueColumnName != null : !DEFAULT_VALUE_COLUMN_NAME_EDEFAULT.equals(defaultValueColumnName); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_VALUE : - return PK_COLUMN_VALUE_EDEFAULT == null ? getPkColumnValue() != null : !PK_COLUMN_VALUE_EDEFAULT.equals(getPkColumnValue()); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return SPECIFIED_PK_COLUMN_VALUE_EDEFAULT == null ? specifiedPkColumnValue != null : !SPECIFIED_PK_COLUMN_VALUE_EDEFAULT.equals(specifiedPkColumnValue); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return DEFAULT_PK_COLUMN_VALUE_EDEFAULT == null ? defaultPkColumnValue != null : !DEFAULT_PK_COLUMN_VALUE_EDEFAULT.equals(defaultPkColumnValue); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return uniqueConstraints != null && !uniqueConstraints.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ITableGenerator.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__TABLE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__TABLE; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_TABLE; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_TABLE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_TABLE; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__CATALOG : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__CATALOG; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_CATALOG; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_CATALOG : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_CATALOG; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SCHEMA : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SCHEMA; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_SCHEMA; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_SCHEMA : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_SCHEMA; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__VALUE_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__VALUE_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_VALUE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_VALUE; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE; - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ITableGenerator.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ITABLE_GENERATOR__TABLE : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__TABLE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_TABLE : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_TABLE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_TABLE : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_TABLE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__CATALOG : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__CATALOG; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_CATALOG : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_CATALOG : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_CATALOG; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SCHEMA : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SCHEMA; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_SCHEMA : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_SCHEMA : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_SCHEMA; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__VALUE_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__VALUE_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_VALUE : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__PK_COLUMN_VALUE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedTable: "); - result.append(specifiedTable); - result.append(", defaultTable: "); - result.append(defaultTable); - result.append(", specifiedCatalog: "); - result.append(specifiedCatalog); - result.append(", defaultCatalog: "); - result.append(defaultCatalog); - result.append(", specifiedSchema: "); - result.append(specifiedSchema); - result.append(", defaultSchema: "); - result.append(defaultSchema); - result.append(", specifiedPkColumnName: "); - result.append(specifiedPkColumnName); - result.append(", defaultPkColumnName: "); - result.append(defaultPkColumnName); - result.append(", specifiedValueColumnName: "); - result.append(specifiedValueColumnName); - result.append(", defaultValueColumnName: "); - result.append(defaultValueColumnName); - result.append(", specifiedPkColumnValue: "); - result.append(specifiedPkColumnValue); - result.append(", defaultPkColumnValue: "); - result.append(defaultPkColumnValue); - result.append(')'); - return result.toString(); - } - - // ********** java annotations -> persistence model ********** - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - setSpecifiedTable(this.tableAdapter.getValue(astRoot)); - setSpecifiedCatalog(this.catalogAdapter.getValue(astRoot)); - setSpecifiedSchema(this.schemaAdapter.getValue(astRoot)); - setSpecifiedPkColumnName(this.pkColumnNameAdapter.getValue(astRoot)); - setSpecifiedValueColumnName(this.valueColumnNameAdapter.getValue(astRoot)); - setSpecifiedPkColumnValue(this.pkColumnValueAdapter.getValue(astRoot)); - this.updateUniqueConstraintsFromJava(astRoot); - } - - /** - * here we just worry about getting the unique constraints lists the same size; - * then we delegate to the unique constraints to synch themselves up - */ - private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) { - // synchronize the model join columns with the Java source - List constraints = this.getUniqueConstraints(); - int persSize = constraints.size(); - int javaSize = 0; - boolean allJavaAnnotationsFound = false; - for (int i = 0; i < persSize; i++) { - JavaUniqueConstraint uniqueConstraint = (JavaUniqueConstraint) constraints.get(i); - if (uniqueConstraint.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - break; // no need to go any further - } - uniqueConstraint.updateFromJava(astRoot); - javaSize++; - } - if (allJavaAnnotationsFound) { - // remove any model join columns beyond those that correspond to the Java annotations - while (persSize > javaSize) { - persSize--; - constraints.remove(persSize); - } - } - else { - // add new model join columns until they match the Java annotations - while (!allJavaAnnotationsFound) { - JavaUniqueConstraint uniqueConstraint = this.createJavaUniqueConstraint(javaSize); - if (uniqueConstraint.annotation(astRoot) == null) { - allJavaAnnotationsFound = true; - } - else { - this.getUniqueConstraints().add(uniqueConstraint); - uniqueConstraint.updateFromJava(astRoot); - javaSize++; - } - } - } - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultSchema((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY)); - } - - public IUniqueConstraint createUniqueConstraint(int index) { - return createJavaUniqueConstraint(index); - } - - protected JavaUniqueConstraint createJavaUniqueConstraint(int index) { - return JavaUniqueConstraint.createTableGeneratorUniqueConstraint(new UniqueConstraintOwner(this), this.getMember(), index); - } - - public Table dbTable() { - Schema schema = this.dbSchema(); - return (schema == null) ? null : schema.tableNamed(this.getTable()); - } - - public Schema dbSchema() { - return this.database().schemaNamed(this.getSchema()); - } - - // ********** jpa model -> java annotations ********** - //////////////////////////////////////////////////////// - /** - * slide over all the annotations that follow the new join column - */ - public void uniqueConstraintAdded(int index, IUniqueConstraint uniqueConstraint) { - // JoinColumn was added to jpa model when updating from java, do not need - // to edit the java in this case. TODO is there a better way to handle this?? - if (((JavaUniqueConstraint) uniqueConstraint).annotation(getMember().astRoot()) == null) { - this.synchUniqueConstraintAnnotationsAfterAdd(index + 1); - ((JavaUniqueConstraint) uniqueConstraint).newAnnotation(); - } - } - - // bjv look at this - public void uniqueConstraintsAdded(int index, List constraints) { - // JoinColumn was added to jpa model when updating from java, do not need - // to edit the java in this case. TODO is there a better way to handle this?? - if (!constraints.isEmpty() && ((JavaUniqueConstraint) constraints.get(0)).annotation(getMember().astRoot()) == null) { - this.synchUniqueConstraintAnnotationsAfterAdd(index + constraints.size()); - for (IUniqueConstraint uniqueConstraint : constraints) { - ((JavaUniqueConstraint) uniqueConstraint).newAnnotation(); - } - } - } - - public void uniqueConstraintRemoved(int index, IUniqueConstraint uniqueConstraint) { - ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation(); - this.synchUniqueConstraintAnnotationsAfterRemove(index); - } - - public void uniqueConstraintsRemoved(int[] indexes, List constraints) { - for (IUniqueConstraint uniqueConstraint : constraints) { - ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation(); - } - this.synchUniqueConstraintAnnotationsAfterRemove(indexes[0]); - } - - public void uniqueConstraintsCleared(List constraints) { - for (IUniqueConstraint uniqueConstraint : constraints) { - ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation(); - } - } - - public void uniqueConstraintSet(int index, IUniqueConstraint oldUniqueConstraint, IUniqueConstraint newUniqueConstraint) { - ((JavaUniqueConstraint) newUniqueConstraint).newAnnotation(); - } - - public void uniqueConstraintMoved(int sourceIndex, int targetIndex, IUniqueConstraint uniqueConstraint) { - List constraints = this.getUniqueConstraints(); - int begin = Math.min(sourceIndex, targetIndex); - int end = Math.max(sourceIndex, targetIndex); - for (int i = begin; i-- > end;) { - this.synch(constraints.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the end of the list to prevent overlap - */ - private void synchUniqueConstraintAnnotationsAfterAdd(int index) { - List constraints = this.getUniqueConstraints(); - for (int i = constraints.size(); i-- > index;) { - this.synch(constraints.get(i), i); - } - } - - /** - * synchronize the annotations with the model join columns, - * starting at the specified index to prevent overlap - */ - private void synchUniqueConstraintAnnotationsAfterRemove(int index) { - List joinColumns = this.getUniqueConstraints(); - for (int i = index; i < joinColumns.size(); i++) { - this.synch(joinColumns.get(i), i); - } - } - - private void synch(IUniqueConstraint uniqueConstraint, int index) { - ((JavaUniqueConstraint) uniqueConstraint).moveAnnotation(index); - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildAdapter(String elementName) { - return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName); - } - - private static DeclarationAnnotationElementAdapter buildNumberAdapter(String elementName) { - return buildNumberAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName); - } -} // JavaTableGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransient.java deleted file mode 100644 index da9c6501f5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransient.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.ITransient; - -/** - * - * A representation of the model object 'Java Transient'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTransient() - * @model kind="class" - * @generated - */ -public class JavaTransient extends JavaAttributeMapping implements ITransient -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TRANSIENT); - - protected JavaTransient() { - throw new UnsupportedOperationException("Use JavaTransient(Attribute) instead"); - } - - protected JavaTransient(Attribute attribute) { - super(attribute); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_TRANSIENT; - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - public String getKey() { - return IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransientProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransientProvider.java deleted file mode 100644 index 79b7de88a7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransientProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaTransientProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaTransientProvider INSTANCE = new JavaTransientProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaTransientProvider() { - super(); - } - - public String key() { - return IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaTransient(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaTransient.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTypeMapping.java deleted file mode 100644 index ed2ae488fe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTypeMapping.java +++ /dev/null @@ -1,264 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -/** - * - * A representation of the model object 'Java Type Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTypeMapping() - * @model kind="class" abstract="true" - * @generated - */ -//TODO need a way to morph between mapping types to save any information that is -//comming to the different TypeMappings. For java, we do not know the other types -//of mappings since they are defined in an extension point so we can do this the same -//way as xml. -public abstract class JavaTypeMapping extends JavaEObject - implements IJavaTypeMapping -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getTableName() Table Name}' attribute. - * - * - * @see #getTableName() - * @generated - * @ordered - */ - protected static final String TABLE_NAME_EDEFAULT = null; - - private Type type; - - /** - * - * - * @generated - */ - protected JavaTypeMapping() { - super(); - } - - protected JavaTypeMapping(Type type) { - super(); - this.type = type; - } - - /** - * Return the declaration adapter for the mapping's annotation. - */ - protected abstract DeclarationAnnotationAdapter declarationAnnotationAdapter(); - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_TYPE_MAPPING; - } - - public String getName() { - return this.getType().getName(); - } - - public String getTableName() { - return this.getType().getName(); - } - - /** - * - * - * @model - * @generated - */ - public void initialize() { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - public IPersistentType getPersistentType() { - return (IPersistentType) this.eContainer(); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__NAME : - return getName(); - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__TABLE_NAME : - return getTableName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__TABLE_NAME : - return TABLE_NAME_EDEFAULT == null ? getTableName() != null : !TABLE_NAME_EDEFAULT.equals(getTableName()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ITypeMapping.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__NAME : - return JpaCorePackage.ITYPE_MAPPING__NAME; - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__TABLE_NAME : - return JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - default : - return -1; - } - } - if (baseClass == IJavaTypeMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ITypeMapping.class) { - switch (baseFeatureID) { - case JpaCorePackage.ITYPE_MAPPING__NAME : - return JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__NAME; - case JpaCorePackage.ITYPE_MAPPING__TABLE_NAME : - return JpaJavaMappingsPackage.JAVA_TYPE_MAPPING__TABLE_NAME; - default : - return -1; - } - } - if (baseClass == IJavaTypeMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public void updateFromJava(CompilationUnit astRoot) { - // do nothing - } - - public Type getType() { - return this.type; - } - - public ITextRange validationTextRange() { - ITextRange textRange = this.type.annotationTextRange(this.declarationAnnotationAdapter()); - return (textRange != null) ? textRange : this.getPersistentType().validationTextRange(); - } - - public Table primaryDbTable() { - return null; - } - - public Table dbTable(String tableName) { - return null; - } - - public Schema dbSchema() { - return null; - } - - public boolean attributeMappingKeyAllowed(String attributeMappingKey) { - return true; - } - - public Iterator associatedTables() { - return EmptyIterator.instance(); - } - - public Iterator associatedTableNamesIncludingInherited() { - return EmptyIterator.instance(); - } - - public Iterator associatedTablesIncludingInherited() { - return EmptyIterator.instance(); - } - - public Iterator overridableAssociationNames() { - return EmptyIterator.instance(); - } - - public Iterator overridableAttributeNames() { - return EmptyIterator.instance(); - } - - public Iterator allOverridableAttributeNames() { - return EmptyIterator.instance(); - } - - public Iterator allOverridableAssociationNames() { - return EmptyIterator.instance(); - } - - public boolean tableNameIsInvalid(String tableName) { - return false; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java deleted file mode 100644 index a3cd6e981f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java +++ /dev/null @@ -1,369 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Collection; -import java.util.Iterator; -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.util.EDataTypeUniqueEList; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.ArrayInitializer; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitArrayAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.StringArrayExpressionConverter; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * - * A representation of the model object 'Java Unique Constraint'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint() - * @model kind="class" - * @generated - */ -public class JavaUniqueConstraint extends JavaEObject - implements IUniqueConstraint -{ - /** - * The cached value of the '{@link #getColumnNames() Column Names}' attribute list. - * - * - * @see #getColumnNames() - * @generated - * @ordered - */ - protected EList columnNames; - - private final IUniqueConstraint.Owner owner; - - private final Member member; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.UNIQUE_CONSTRAINT); - - private final IndexedDeclarationAnnotationAdapter idaa; - - private final IndexedAnnotationAdapter annotationAdapter; - - private final DeclarationAnnotationElementAdapter columnNamesDeclarationAdapter; - - private final AnnotationElementAdapter columnNamesAdapter; - - protected JavaUniqueConstraint() { - super(); - throw new UnsupportedOperationException("Use JavaUniqueConstraint(IUniqueConstraint.Owner, Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - protected JavaUniqueConstraint(IUniqueConstraint.Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(); - this.owner = owner; - this.member = member; - this.idaa = idaa; - this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); - this.columnNamesDeclarationAdapter = buildArrayAnnotationElementAdapter(idaa, JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES); - this.columnNamesAdapter = this.buildAnnotationElementAdapter(this.columnNamesDeclarationAdapter); - } - - protected AnnotationElementAdapter buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter daea) { - return new ShortCircuitArrayAnnotationElementAdapter(this.member, daea); - } - - protected static DeclarationAnnotationElementAdapter buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, StringArrayExpressionConverter.forStringLiterals()); - } - - protected static DeclarationAnnotationElementAdapter buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter converter) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false, converter); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IUniqueConstraint.class)) { - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES : - this.columnNamesAdapter.setValue((String[]) getColumnNames().toArray()); - break; - default : - break; - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_UNIQUE_CONSTRAINT; - } - - /** - * Returns the value of the 'Column Names' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Column Names' attribute list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Names' attribute list. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIUniqueConstraint_ColumnNames() - * @model type="java.lang.String" - * @generated - */ - public EList getColumnNames() { - if (columnNames == null) { - columnNames = new EDataTypeUniqueEList(String.class, this, JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES); - } - return columnNames; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES : - return getColumnNames(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES : - getColumnNames().clear(); - getColumnNames().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES : - getColumnNames().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES : - return columnNames != null && !columnNames.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IUniqueConstraint.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES : - return JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IUniqueConstraint.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES : - return JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @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(); - } - - public IUniqueConstraint.Owner getOwner() { - return this.owner; - } - - public ITextRange validationTextRange() { - return this.member.annotationTextRange(this.idaa); - } - - protected boolean elementTouches(DeclarationAnnotationElementAdapter elementAdapter, int pos, CompilationUnit astRoot) { - return this.elementTouches(this.member.annotationElementTextRange(elementAdapter, astRoot), pos); - } - - private boolean columnNamesTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.columnNamesDeclarationAdapter, pos, astRoot); - } - - private Iterator candidateColumnNames() { - return this.getOwner().candidateUniqueConstraintColumnNames(); - } - - private Iterator candidateColumnNames(Filter filter) { - return new FilteringIterator(this.candidateColumnNames(), filter); - } - - private Iterator quotedCandidateColumnNames(Filter filter) { - return StringTools.quote(this.candidateColumnNames(filter)); - } - - @Override - public Iterator connectedCandidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.connectedCandidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - if (this.columnNamesTouches(pos, astRoot)) { - return this.quotedCandidateColumnNames(filter); - } - return null; - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - public void updateFromJava(CompilationUnit astRoot) { - updateColumnNamesFromJava(astRoot); - } - - private void updateColumnNamesFromJava(CompilationUnit astRoot) { - String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot); - CollectionTools.retainAll(getColumnNames(), javaColumnNames); - for (int i = 0; i < javaColumnNames.length; i++) { - String columnName = javaColumnNames[i]; - if (!getColumnNames().contains(columnName)) { - getColumnNames().add(columnName); - } - } - } - - // ********** persistence model -> java annotations ********** - void moveAnnotation(int newIndex) { - this.annotationAdapter.moveAnnotation(newIndex); - } - - void newAnnotation() { - this.annotationAdapter.newMarkerAnnotation(); - } - - void removeAnnotation() { - this.annotationAdapter.removeAnnotation(); - } - - // ********** static methods ********** - static JavaUniqueConstraint createSecondaryTableUniqueConstraint(IUniqueConstraint.Owner owner, DeclarationAnnotationAdapter declarationAnnotationAdapter, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(owner, member, buildSecondaryTableUniqueConstraintAnnotationAdapter(declarationAnnotationAdapter, index)); - } - - private static IndexedDeclarationAnnotationAdapter buildSecondaryTableUniqueConstraintAnnotationAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter, int index) { - return new NestedIndexedDeclarationAnnotationAdapter(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT); - } - - static JavaUniqueConstraint createJoinTableUniqueConstraint(IUniqueConstraint.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(owner, member, buildJoinTableUniqueConstraintAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildJoinTableUniqueConstraintAnnotationAdapter(int index) { - return new NestedIndexedDeclarationAnnotationAdapter(JavaJoinTable.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT); - } - - static JavaUniqueConstraint createTableUniqueConstraint(IUniqueConstraint.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(owner, member, buildTableUniqueConstraintAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildTableUniqueConstraintAnnotationAdapter(int index) { - return new NestedIndexedDeclarationAnnotationAdapter(JavaTable.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT); - } - - static JavaUniqueConstraint createTableGeneratorUniqueConstraint(IUniqueConstraint.Owner owner, Member member, int index) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(owner, member, buildTableGeneratorUniqueConstraintAnnotationAdapter(index)); - } - - private static IndexedDeclarationAnnotationAdapter buildTableGeneratorUniqueConstraintAnnotationAdapter(int index) { - return new NestedIndexedDeclarationAnnotationAdapter(JavaTableGenerator.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersion.java deleted file mode 100644 index 4153281e73..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersion.java +++ /dev/null @@ -1,396 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; -import org.eclipse.jpt.utility.internal.Filter; - -/** - * - * A representation of the model object 'Java Version'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaVersion() - * @model kind="class" - * @generated - */ -public class JavaVersion extends JavaAttributeMapping implements IVersion -{ - private final AnnotationAdapter temporalAnnotationAdapter; - - private final AnnotationElementAdapter temporalValueAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.VERSION); - - private static final DeclarationAnnotationAdapter TEMPORAL_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TEMPORAL); - - private static final DeclarationAnnotationElementAdapter TEMPORAL_VALUE_ADAPTER = buildTemporalValueAdapter(); - - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - /** - * The default value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected static final TemporalType TEMPORAL_EDEFAULT = TemporalType.NULL; - - /** - * The cached value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected TemporalType temporal = TEMPORAL_EDEFAULT; - - protected JavaVersion() { - throw new UnsupportedOperationException("Use JavaVersion(Attribute) instead"); - } - - protected JavaVersion(Attribute attribute) { - super(attribute); - this.column = JavaColumn.createColumnMappingColumn(buildColumnOwner(), getAttribute()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_VERSION__COLUMN, null, null); - this.temporalAnnotationAdapter = new MemberAnnotationAdapter(this.getAttribute(), TEMPORAL_ADAPTER); - this.temporalValueAdapter = new ShortCircuitAnnotationElementAdapter(attribute, TEMPORAL_VALUE_ADAPTER); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_VERSION; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

- * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIVersion_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_VERSION__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

- * If the meaning of the 'Temporal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIVersion_Temporal() - * @model - * @generated - */ - public TemporalType getTemporal() { - return temporal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - public void setTemporalGen(TemporalType newTemporal) { - TemporalType oldTemporal = temporal; - temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL, oldTemporal, temporal)); - } - - public void setTemporal(TemporalType newTemporal) { - if (newTemporal != TemporalType.NULL) { - if (this.temporalAnnotationAdapter.getAnnotation() == null) { - this.temporalAnnotationAdapter.newMarkerAnnotation(); - } - this.temporalValueAdapter.setValue(newTemporal.convertToJavaAnnotationValue()); - } - else if (this.temporalAnnotationAdapter.getAnnotation() != null) { - this.temporalAnnotationAdapter.removeAnnotation(); - } - setTemporalGen(newTemporal); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_VERSION__COLUMN : - return basicSetColumn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_VERSION__COLUMN : - return getColumn(); - case JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL : - return getTemporal(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL : - setTemporal((TemporalType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL : - setTemporal(TEMPORAL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_VERSION__COLUMN : - return column != null; - case JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL : - return temporal != TEMPORAL_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IVersion.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_VERSION__COLUMN : - return JpaCoreMappingsPackage.IVERSION__COLUMN; - case JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL : - return JpaCoreMappingsPackage.IVERSION__TEMPORAL; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IVersion.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IVERSION__COLUMN : - return JpaJavaMappingsPackage.JAVA_VERSION__COLUMN; - case JpaCoreMappingsPackage.IVERSION__TEMPORAL : - return JpaJavaMappingsPackage.JAVA_VERSION__TEMPORAL; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (temporal: "); - result.append(temporal); - result.append(')'); - return result.toString(); - } - - @Override - protected DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return DECLARATION_ANNOTATION_ADAPTER; - } - - public String getKey() { - return IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public void updateFromJava(CompilationUnit astRoot) { - super.updateFromJava(astRoot); - this.updateTemporalFromJava(astRoot); - this.getJavaColumn().updateFromJava(astRoot); - } - - /* - * The @Temporal annotation is a bit different than most JPA annotations. - * For some indecipherable reason it has no default value (e.g. TIMESTAMP). - * Also, it is *required* for any attribute declared with a type of - * java.util.Date or java.util.Calendar; otherwise, it is *prohibited*. - * As a result we allow a Basic mapping to have a null 'temporal', - * indicating that the annotation is completely missing, as opposed - * to the annotation being present but its value is invalid (e.g. - * @Temporal(FRIDAY)). - * - * TODO this comment is wrong now, revisit this with Brian at some point - */ - private void updateTemporalFromJava(CompilationUnit astRoot) { - if (this.temporalAnnotationAdapter.getAnnotation(astRoot) == null) { - setTemporalGen(TemporalType.NULL); - } - else { - setTemporalGen(TemporalType.fromJavaAnnotationValue(this.temporalValueAdapter.getValue(astRoot))); - } - } - - private JavaColumn getJavaColumn() { - return (JavaColumn) this.column; - } - - @Override - public Iterator candidateValuesFor(int pos, Filter filter, CompilationUnit astRoot) { - Iterator result = super.candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - result = this.getJavaColumn().candidateValuesFor(pos, filter, astRoot); - if (result != null) { - return result; - } - return null; - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter buildTemporalValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(TEMPORAL_ADAPTER, JPA.TEMPORAL__VALUE, false); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersionProvider.java deleted file mode 100644 index cd556bb4ce..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersionProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMappingProvider; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - */ -public class JavaVersionProvider - implements IJavaAttributeMappingProvider -{ - - // singleton - private static final JavaVersionProvider INSTANCE = new JavaVersionProvider(); - - /** - * Return the singleton. - */ - public static IJavaAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private JavaVersionProvider() { - super(); - } - - public String key() { - return IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY; - } - - public boolean defaultApplies(Attribute attribute, DefaultsContext defaultsContext) { - return false; - } - - public IJavaAttributeMapping buildMapping(Attribute attribute) { - return JpaJavaMappingsFactory.eINSTANCE.createJavaVersion(attribute); - } - - public DeclarationAnnotationAdapter declarationAnnotationAdapter() { - return JavaVersion.DECLARATION_ANNOTATION_ADAPTER; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java deleted file mode 100644 index cd845074d4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java +++ /dev/null @@ -1,499 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.NullDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.INamedColumn.Owner; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage - * @generated - */ -public class JpaJavaMappingsFactory extends EFactoryImpl -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final JpaJavaMappingsFactory eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static JpaJavaMappingsFactory init() { - try { - JpaJavaMappingsFactory theJpaJavaMappingsFactory = (JpaJavaMappingsFactory) EPackage.Registry.INSTANCE.getEFactory("jpt.core.java.mappings.xmi"); - if (theJpaJavaMappingsFactory != null) { - return theJpaJavaMappingsFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new JpaJavaMappingsFactory(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public JpaJavaMappingsFactory() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case JpaJavaMappingsPackage.JAVA_ENTITY : - return createJavaEntity(); - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS : - return createJavaMappedSuperclass(); - case JpaJavaMappingsPackage.JAVA_EMBEDDABLE : - return createJavaEmbeddable(); - case JpaJavaMappingsPackage.JAVA_NULL_TYPE_MAPPING : - return createJavaNullTypeMapping(); - case JpaJavaMappingsPackage.JAVA_BASIC : - return createJavaBasic(); - case JpaJavaMappingsPackage.JAVA_ID : - return createJavaId(); - case JpaJavaMappingsPackage.JAVA_TRANSIENT : - return createJavaTransient(); - case JpaJavaMappingsPackage.JAVA_VERSION : - return createJavaVersion(); - case JpaJavaMappingsPackage.JAVA_EMBEDDED_ID : - return createJavaEmbeddedId(); - case JpaJavaMappingsPackage.JAVA_EMBEDDED : - return createJavaEmbedded(); - case JpaJavaMappingsPackage.JAVA_MANY_TO_ONE : - return createJavaManyToOne(); - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE : - return createJavaOneToOne(); - case JpaJavaMappingsPackage.JAVA_ONE_TO_MANY : - return createJavaOneToMany(); - case JpaJavaMappingsPackage.JAVA_MANY_TO_MANY : - return createJavaManyToMany(); - case JpaJavaMappingsPackage.JAVA_NULL_ATTRIBUTE_MAPPING : - return createJavaNullAttributeMapping(); - case JpaJavaMappingsPackage.JAVA_TABLE : - return createJavaTable(); - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE : - return createJavaSecondaryTable(); - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE : - return createJavaJoinTable(); - case JpaJavaMappingsPackage.JAVA_COLUMN : - return createJavaColumn(); - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN : - return createJavaJoinColumn(); - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE : - return createJavaAttributeOverride(); - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE : - return createJavaAssociationOverride(); - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN : - return createJavaDiscriminatorColumn(); - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN : - return createJavaPrimaryKeyJoinColumn(); - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE : - return createJavaGeneratedValue(); - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR : - return createJavaTableGenerator(); - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR : - return createJavaSequenceGenerator(); - case JpaJavaMappingsPackage.JAVA_NAMED_QUERY : - return createJavaNamedQuery(); - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY : - return createJavaNamedNativeQuery(); - case JpaJavaMappingsPackage.JAVA_QUERY_HINT : - return createJavaQueryHint(); - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT : - return createJavaUniqueConstraint(); - case JpaJavaMappingsPackage.JAVA_CASCADE : - return createJavaCascade(); - default : - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - public JavaEntity createJavaEntity() { - throw new UnsupportedOperationException("Use createJavaEntity(Type) instead"); - } - - public JavaEntity createJavaEntity(Type type) { - JavaEntity javaEntity = new JavaEntity(type); - return javaEntity; - } - - public JavaMappedSuperclass createJavaMappedSuperclass() { - throw new UnsupportedOperationException("Use createJavaMappedSuperclass(Type) instead"); - } - - public JavaEmbeddable createJavaEmbeddable() { - throw new UnsupportedOperationException("Use createJavaEmbeddable(Type) instead"); - } - - public JavaEmbeddable createJavaEmbeddable(Type type) { - JavaEmbeddable javaEmbeddable = new JavaEmbeddable(type); - return javaEmbeddable; - } - - public JavaMappedSuperclass createJavaMappedSuperclass(Type type) { - JavaMappedSuperclass javaMappedSuperclass = new JavaMappedSuperclass(type); - return javaMappedSuperclass; - } - - public JavaNullTypeMapping createJavaNullTypeMapping() { - throw new UnsupportedOperationException("Use createJavaNullTypeMapping(Type) instead"); - } - - public JavaNullTypeMapping createJavaNullTypeMapping(Type type) { - JavaNullTypeMapping javaNullTypeMapping = new JavaNullTypeMapping(type); - return javaNullTypeMapping; - } - - public JavaNullAttributeMapping createJavaNullAttributeMapping() { - throw new UnsupportedOperationException("Use createJavaNullAttributeMapping(Attribute) instead"); - } - - public JavaNullAttributeMapping createJavaNullAttributeMapping(Attribute attribute) { - JavaNullAttributeMapping javaNullAttributeMapping = new JavaNullAttributeMapping(attribute); - return javaNullAttributeMapping; - } - - public JavaBasic createJavaBasic() { - throw new UnsupportedOperationException("Use createJavaBasic(Attribute) instead"); - } - - public JavaBasic createJavaBasic(Attribute attribute) { - JavaBasic javaBasic = new JavaBasic(attribute); - return javaBasic; - } - - public JavaId createJavaId() { - throw new UnsupportedOperationException("Use createJavaId(Attribute) instead"); - } - - public JavaTransient createJavaTransient() { - throw new UnsupportedOperationException("Use createJavaTransient(Attribute) instead"); - } - - public JavaVersion createJavaVersion() { - throw new UnsupportedOperationException("Use createJavaVersion(Attribute) instead"); - } - - public JavaVersion createJavaVersion(Attribute attribute) { - JavaVersion javaVersion = new JavaVersion(attribute); - return javaVersion; - } - - public JavaEmbeddedId createJavaEmbeddedId() { - throw new UnsupportedOperationException("Use createJavaEmbeddedId(Attribute) instead"); - } - - public JavaEmbeddedId createJavaEmbeddedId(Attribute attribute) { - JavaEmbeddedId javaEmbeddedId = new JavaEmbeddedId(attribute); - return javaEmbeddedId; - } - - public JavaEmbedded createJavaEmbedded() { - throw new UnsupportedOperationException("Use createJavaEmbedded(Attribute) instead"); - } - - public JavaEmbedded createJavaEmbedded(Attribute attribute) { - JavaEmbedded javaEmbedded = new JavaEmbedded(attribute); - return javaEmbedded; - } - - public JavaTransient createJavaTransient(Attribute attribute) { - JavaTransient javaTransient = new JavaTransient(attribute); - return javaTransient; - } - - public JavaId createJavaId(Attribute attribute) { - JavaId javaId = new JavaId(attribute); - return javaId; - } - - public JavaTable createJavaTable() { - throw new UnsupportedOperationException("Use createJavaTable(ITable.Owner, Member) instead"); - } - - public JavaTable createJavaTable(ITable.Owner owner, Member member) { - JavaTable javaTable = new JavaTable(owner, member); - return javaTable; - } - - public JavaColumn createJavaColumn() { - throw new UnsupportedOperationException("Use createJavaColumn(Member ) instead"); - } - - public JavaOneToMany createJavaOneToMany() { - throw new UnsupportedOperationException("Use createJavaOneToMany(Attribute) instead"); - } - - /** - * - * - * @generated - */ - public JavaManyToMany createJavaManyToMany() { - JavaManyToMany javaManyToMany = new JavaManyToMany(); - return javaManyToMany; - } - - public JavaManyToMany createJavaManyToMany(Attribute attribute) { - JavaManyToMany javaManyToMany = new JavaManyToMany(attribute); - return javaManyToMany; - } - - /** - * - * - * @generated - */ - public JavaJoinTable createJavaJoinTable() { - JavaJoinTable javaJoinTable = new JavaJoinTable(); - return javaJoinTable; - } - - public JavaJoinTable createJavaJoinTable(ITable.Owner owner, Member member) { - JavaJoinTable javaJoinTable = new JavaJoinTable(owner, member); - return javaJoinTable; - } - - /** - * - * - * @generated - */ - public JavaJoinColumn createJavaJoinColumn() { - JavaJoinColumn javaJoinColumn = new JavaJoinColumn(); - return javaJoinColumn; - } - - public JavaAttributeOverride createJavaAttributeOverride() { - throw new UnsupportedOperationException(); - } - - public JavaAttributeOverride createJavaAttributeOverride(IOverride.Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaAttributeOverride javaAttributeOverride = new JavaAttributeOverride(owner, member, idaa); - return javaAttributeOverride; - } - - public JavaAttributeOverride createJavaAttributeOverride(IOverride.Owner owner, Member member) { - return this.createJavaAttributeOverride(owner, member, NullDeclarationAnnotationAdapter.instance()); - } - - public JavaAssociationOverride createJavaAssociationOverride() { - throw new UnsupportedOperationException(); - } - - public JavaAssociationOverride createJavaAssociationOverride(IOverride.Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaAssociationOverride javaAssociationOverride = new JavaAssociationOverride(owner, member, idaa); - return javaAssociationOverride; - } - - public JavaAssociationOverride createJavaAssociationOverride(IOverride.Owner owner, Member member) { - return this.createJavaAssociationOverride(owner, member, NullDeclarationAnnotationAdapter.instance()); - } - - public JavaDiscriminatorColumn createJavaDiscriminatorColumn() { - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated - */ - public JavaPrimaryKeyJoinColumn createJavaPrimaryKeyJoinColumn() { - JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn = new JavaPrimaryKeyJoinColumn(); - return javaPrimaryKeyJoinColumn; - } - - public JavaGeneratedValue createJavaGeneratedValue() { - throw new UnsupportedOperationException("Use createJavaGeneratedValue(Member) instead"); - } - - public JavaGeneratedValue createJavaGeneratedValue(Member member) { - JavaGeneratedValue javaGeneratedValue = new JavaGeneratedValue(member); - return javaGeneratedValue; - } - - public JavaTableGenerator createJavaTableGenerator() { - throw new UnsupportedOperationException("Use createJavaTableGenerator(Member) instead"); - } - - public JavaTableGenerator createJavaTableGenerator(Member member) { - JavaTableGenerator javaTableGenerator = new JavaTableGenerator(member); - return javaTableGenerator; - } - - public JavaSequenceGenerator createJavaSequenceGenerator() { - throw new UnsupportedOperationException("Use createJavaSequenceGenerator(Member) instead"); - } - - public JavaNamedQuery createJavaNamedQuery() { - throw new UnsupportedOperationException("Use createJavaNamedQuery(Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - public JavaNamedQuery createJavaNamedQuery(Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaNamedQuery javaNamedQuery = new JavaNamedQuery(member, idaa); - return javaNamedQuery; - } - - public JavaNamedNativeQuery createJavaNamedNativeQuery() { - throw new UnsupportedOperationException("Use createJavaNamedNativeQuery(Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - public JavaNamedNativeQuery createJavaNamedNativeQuery(Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaNamedNativeQuery javaNamedNativeQuery = new JavaNamedNativeQuery(member, idaa); - return javaNamedNativeQuery; - } - - public JavaQueryHint createJavaQueryHint() { - throw new UnsupportedOperationException("Use createJavaQueryHint(Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - public JavaUniqueConstraint createJavaUniqueConstraint() { - throw new UnsupportedOperationException("Use createJavaUniqueConstraint(Member, IndexedDeclarationAnnotationAdapter) instead"); - } - - public JavaCascade createJavaCascade() { - throw new UnsupportedOperationException("Use createJavaCascade(Attribute, DeclarationAnnotationElementAdapter) instead"); - } - - public JavaCascade createJavaCascade(Attribute attribute, DeclarationAnnotationElementAdapter cascadeAdapter) { - JavaCascade javaCascade = new JavaCascade(attribute, cascadeAdapter); - return javaCascade; - } - - public JavaUniqueConstraint createJavaUniqueConstraint(IUniqueConstraint.Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaUniqueConstraint javaUniqueConstraint = new JavaUniqueConstraint(owner, member, idaa); - return javaUniqueConstraint; - } - - public JavaQueryHint createJavaQueryHint(Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaQueryHint javaQueryHint = new JavaQueryHint(member, idaa); - return javaQueryHint; - } - - public JavaSequenceGenerator createJavaSequenceGenerator(Member member) { - JavaSequenceGenerator javaSequenceGenerator = new JavaSequenceGenerator(member); - return javaSequenceGenerator; - } - - public JavaPrimaryKeyJoinColumn createJavaPrimaryKeyJoinColumn(IAbstractJoinColumn.Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn = new JavaPrimaryKeyJoinColumn(owner, member, idaa); - return javaPrimaryKeyJoinColumn; - } - - public JavaSecondaryTable createJavaSecondaryTable() { - throw new UnsupportedOperationException(); - } - - public JavaSecondaryTable createJavaSecondaryTable(ITable.Owner owner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaSecondaryTable javaSecondaryTable = new JavaSecondaryTable(owner, member, idaa); - return javaSecondaryTable; - } - - public JavaDiscriminatorColumn createJavaDiscriminatorColumn(Owner owner, Type type, DeclarationAnnotationAdapter daa) { - JavaDiscriminatorColumn javaDiscriminatorColumn = new JavaDiscriminatorColumn(owner, type, daa); - return javaDiscriminatorColumn; - } - - /** - * - * - * @generated - */ - public JpaJavaMappingsPackage getJpaJavaMappingsPackage() { - return (JpaJavaMappingsPackage) getEPackage(); - } - - public JavaJoinColumn createJavaJoinColumn(IJoinColumn.Owner joinColumnOwner, Member member, IndexedDeclarationAnnotationAdapter idaa) { - JavaJoinColumn javaJoinColumn = new JavaJoinColumn(joinColumnOwner, member, idaa); - return javaJoinColumn; - } - - public JavaJoinColumn createJavaJoinColumn(IJoinColumn.Owner joinColumnOwner, Member member) { - return this.createJavaJoinColumn(joinColumnOwner, member, NullDeclarationAnnotationAdapter.instance()); - } - - public JavaManyToOne createJavaManyToOne() { - throw new UnsupportedOperationException("Use createJavaManyToOne(Attribute) instead"); - } - - public JavaOneToOne createJavaOneToOne() { - throw new UnsupportedOperationException("Use createJavaOneToOne(Attribute) instead"); - } - - public JavaOneToOne createJavaOneToOne(Attribute attribute) { - JavaOneToOne javaOneToOne = new JavaOneToOne(attribute); - return javaOneToOne; - } - - public JavaManyToOne createJavaManyToOne(Attribute attribute) { - JavaManyToOne javaManyToOne = new JavaManyToOne(attribute); - return javaManyToOne; - } - - public JavaOneToMany createJavaOneToMany(Attribute attribute) { - JavaOneToMany javaOneToMany = new JavaOneToMany(attribute); - return javaOneToMany; - } - - public JavaColumn createJavaColumn(IColumn.Owner owner, Member member, DeclarationAnnotationAdapter daa) { - JavaColumn javaColumn = new JavaColumn(owner, member, daa); - return javaColumn; - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static JpaJavaMappingsPackage getPackage() { - return JpaJavaMappingsPackage.eINSTANCE; - } -} //JavaMappingsFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java deleted file mode 100644 index da4c6465bf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java +++ /dev/null @@ -1,5109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsFactory - * @model kind="package" - * @generated - */ -public class JpaJavaMappingsPackage extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "mappings"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "jpt.core.java.mappings.xmi"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "jpt.core.java.mappings"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final JpaJavaMappingsPackage eINSTANCE = org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage.init(); - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping Java Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTypeMapping() - * @generated - */ - public static final int JAVA_TYPE_MAPPING = 0; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TYPE_MAPPING__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TYPE_MAPPING__TABLE_NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Java Type Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TYPE_MAPPING_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity Java Entity}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEntity() - * @generated - */ - public static final int JAVA_ENTITY = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__NAME = JAVA_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__TABLE_NAME = JAVA_TYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SPECIFIED_NAME = JAVA_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DEFAULT_NAME = JAVA_TYPE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__TABLE = JAVA_TYPE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Specified Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SPECIFIED_SECONDARY_TABLES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = JAVA_TYPE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = JAVA_TYPE_MAPPING_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = JAVA_TYPE_MAPPING_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Inheritance Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__INHERITANCE_STRATEGY = JAVA_TYPE_MAPPING_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DEFAULT_DISCRIMINATOR_VALUE = JAVA_TYPE_MAPPING_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Specified Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE = JAVA_TYPE_MAPPING_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DISCRIMINATOR_VALUE = JAVA_TYPE_MAPPING_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Discriminator Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DISCRIMINATOR_COLUMN = JAVA_TYPE_MAPPING_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SEQUENCE_GENERATOR = JAVA_TYPE_MAPPING_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__TABLE_GENERATOR = JAVA_TYPE_MAPPING_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__ATTRIBUTE_OVERRIDES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__ASSOCIATION_OVERRIDES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Specified Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 18; - - /** - * The feature id for the 'Default Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 19; - - /** - * The feature id for the 'Named Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__NAMED_QUERIES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 20; - - /** - * The feature id for the 'Named Native Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__NAMED_NATIVE_QUERIES = JAVA_TYPE_MAPPING_FEATURE_COUNT + 21; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY__ID_CLASS = JAVA_TYPE_MAPPING_FEATURE_COUNT + 22; - - /** - * The number of structural features of the 'Java Entity' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ENTITY_FEATURE_COUNT = JAVA_TYPE_MAPPING_FEATURE_COUNT + 23; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass Java Mapped Superclass}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaMappedSuperclass() - * @generated - */ - public static final int JAVA_MAPPED_SUPERCLASS = 2; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MAPPED_SUPERCLASS__NAME = JAVA_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MAPPED_SUPERCLASS__TABLE_NAME = JAVA_TYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MAPPED_SUPERCLASS__ID_CLASS = JAVA_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java Mapped Superclass' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MAPPED_SUPERCLASS_FEATURE_COUNT = JAVA_TYPE_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable Java Embeddable}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbeddable() - * @generated - */ - public static final int JAVA_EMBEDDABLE = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDABLE__NAME = JAVA_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDABLE__TABLE_NAME = JAVA_TYPE_MAPPING__TABLE_NAME; - - /** - * The number of structural features of the 'Java Embeddable' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDABLE_FEATURE_COUNT = JAVA_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping Java Null Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNullTypeMapping() - * @generated - */ - public static final int JAVA_NULL_TYPE_MAPPING = 4; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NULL_TYPE_MAPPING__NAME = JAVA_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NULL_TYPE_MAPPING__TABLE_NAME = JAVA_TYPE_MAPPING__TABLE_NAME; - - /** - * The number of structural features of the 'Java Null Type Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NULL_TYPE_MAPPING_FEATURE_COUNT = JAVA_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping Java Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAttributeMapping() - * @generated - */ - public static final int JAVA_ATTRIBUTE_MAPPING = 5; - - /** - * The number of structural features of the 'Java Attribute Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping Java Null Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNullAttributeMapping() - * @generated - */ - public static final int JAVA_NULL_ATTRIBUTE_MAPPING = 19; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic Java Basic}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaBasic() - * @generated - */ - public static final int JAVA_BASIC = 6; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC__FETCH = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC__OPTIONAL = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC__COLUMN = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Lob' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC__LOB = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC__TEMPORAL = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Enumerated' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC__ENUMERATED = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Java Basic' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_BASIC_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId Java Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaId - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaId() - * @generated - */ - public static final int JAVA_ID = 7; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ID__COLUMN = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Generated Value' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ID__GENERATED_VALUE = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ID__TEMPORAL = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ID__TABLE_GENERATOR = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ID__SEQUENCE_GENERATOR = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Java Id' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ID_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient Java Transient}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTransient() - * @generated - */ - public static final int JAVA_TRANSIENT = 8; - - /** - * The number of structural features of the 'Java Transient' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TRANSIENT_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion Java Version}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaVersion() - * @generated - */ - public static final int JAVA_VERSION = 9; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_VERSION__COLUMN = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_VERSION__TEMPORAL = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Java Version' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_VERSION_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId Java Embedded Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbeddedId() - * @generated - */ - public static final int JAVA_EMBEDDED_ID = 10; - - /** - * The number of structural features of the 'Java Embedded Id' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDED_ID_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded Java Embedded}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbedded() - * @generated - */ - public static final int JAVA_EMBEDDED = 11; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Embedded' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_EMBEDDED_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping Java Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaRelationshipMapping() - * @generated - */ - public static final int JAVA_RELATIONSHIP_MAPPING = 12; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_RELATIONSHIP_MAPPING__CASCADE = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Java Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping Java Single Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSingleRelationshipMapping() - * @generated - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING = 13; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__CASCADE = JAVA_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Java Single Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne Java Many To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaManyToOne() - * @generated - */ - public static final int JAVA_MANY_TO_ONE = 14; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__SPECIFIED_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__DEFAULT_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__RESOLVED_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__CASCADE = JAVA_SINGLE_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__FETCH = JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__JOIN_COLUMNS = JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__SPECIFIED_JOIN_COLUMNS = JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__DEFAULT_JOIN_COLUMNS = JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE__OPTIONAL = JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - - /** - * The number of structural features of the 'Java Many To One' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_ONE_FEATURE_COUNT = JAVA_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne Java One To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOneToOne() - * @generated - */ - public static final int JAVA_ONE_TO_ONE = 15; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__SPECIFIED_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__DEFAULT_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__RESOLVED_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__CASCADE = JAVA_SINGLE_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__FETCH = JAVA_SINGLE_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__JOIN_COLUMNS = JAVA_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__SPECIFIED_JOIN_COLUMNS = JAVA_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__DEFAULT_JOIN_COLUMNS = JAVA_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__OPTIONAL = JAVA_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE__MAPPED_BY = JAVA_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java One To One' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_ONE_FEATURE_COUNT = JAVA_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping Java Multi Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaMultiRelationshipMapping() - * @generated - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING = 16; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__CASCADE = JAVA_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Java Multi Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany Java One To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOneToMany() - * @generated - */ - public static final int JAVA_ONE_TO_MANY = 17; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__SPECIFIED_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__DEFAULT_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__RESOLVED_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__CASCADE = JAVA_MULTI_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__MAPPED_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__ORDER_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__FETCH = JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__JOIN_TABLE = JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY__MAP_KEY = JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY; - - /** - * The number of structural features of the 'Java One To Many' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ONE_TO_MANY_FEATURE_COUNT = JAVA_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany Java Many To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaManyToMany() - * @generated - */ - public static final int JAVA_MANY_TO_MANY = 18; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__SPECIFIED_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__DEFAULT_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__RESOLVED_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__CASCADE = JAVA_MULTI_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__MAPPED_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__ORDER_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__FETCH = JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__JOIN_TABLE = JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY__MAP_KEY = JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY; - - /** - * The number of structural features of the 'Java Many To Many' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_MANY_TO_MANY_FEATURE_COUNT = JAVA_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java Null Attribute Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NULL_ATTRIBUTE_MAPPING_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable Abstract Java Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getAbstractJavaTable() - * @generated - */ - public static final int ABSTRACT_JAVA_TABLE = 20; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__SPECIFIED_NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__DEFAULT_NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__CATALOG = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__SCHEMA = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 9; - - /** - * The number of structural features of the 'Abstract Java Table' class. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_TABLE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 10; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTable Java Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTable() - * @generated - */ - public static final int JAVA_TABLE = 21; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__NAME = ABSTRACT_JAVA_TABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__SPECIFIED_NAME = ABSTRACT_JAVA_TABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__DEFAULT_NAME = ABSTRACT_JAVA_TABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__CATALOG = ABSTRACT_JAVA_TABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__SPECIFIED_CATALOG = ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__DEFAULT_CATALOG = ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__SCHEMA = ABSTRACT_JAVA_TABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__SPECIFIED_SCHEMA = ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__DEFAULT_SCHEMA = ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS; - - /** - * The number of structural features of the 'Java Table' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_FEATURE_COUNT = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable Java Join Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaJoinTable() - * @generated - */ - public static final int JAVA_JOIN_TABLE = 23; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn Java Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaColumn() - * @generated - */ - public static final int JAVA_COLUMN = 26; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn Java Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaJoinColumn() - * @generated - */ - public static final int JAVA_JOIN_COLUMN = 27; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride Java Attribute Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAttributeOverride() - * @generated - */ - public static final int JAVA_ATTRIBUTE_OVERRIDE = 29; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride Java Association Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAssociationOverride() - * @generated - */ - public static final int JAVA_ASSOCIATION_OVERRIDE = 30; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn Java Discriminator Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaDiscriminatorColumn() - * @generated - */ - public static final int JAVA_DISCRIMINATOR_COLUMN = 31; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn Java Primary Key Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaPrimaryKeyJoinColumn() - * @generated - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN = 32; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue Java Generated Value}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaGeneratedValue() - * @generated - */ - public static final int JAVA_GENERATED_VALUE = 33; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator Java Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaGenerator() - * @generated - */ - public static final int JAVA_GENERATOR = 34; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator Java Table Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTableGenerator() - * @generated - */ - public static final int JAVA_TABLE_GENERATOR = 35; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator Java Sequence Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSequenceGenerator() - * @generated - */ - public static final int JAVA_SEQUENCE_GENERATOR = 36; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable Java Secondary Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSecondaryTable() - * @generated - */ - public static final int JAVA_SECONDARY_TABLE = 22; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__NAME = ABSTRACT_JAVA_TABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__SPECIFIED_NAME = ABSTRACT_JAVA_TABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__DEFAULT_NAME = ABSTRACT_JAVA_TABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__CATALOG = ABSTRACT_JAVA_TABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__SPECIFIED_CATALOG = ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__DEFAULT_CATALOG = ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__SCHEMA = ABSTRACT_JAVA_TABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__SPECIFIED_SCHEMA = ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__DEFAULT_SCHEMA = ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Secondary Table' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SECONDARY_TABLE_FEATURE_COUNT = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__NAME = ABSTRACT_JAVA_TABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__SPECIFIED_NAME = ABSTRACT_JAVA_TABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__DEFAULT_NAME = ABSTRACT_JAVA_TABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__CATALOG = ABSTRACT_JAVA_TABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__SPECIFIED_CATALOG = ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__DEFAULT_CATALOG = ABSTRACT_JAVA_TABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__SCHEMA = ABSTRACT_JAVA_TABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__SPECIFIED_SCHEMA = ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__DEFAULT_SCHEMA = ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__DEFAULT_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__INVERSE_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Java Join Table' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_TABLE_FEATURE_COUNT = ABSTRACT_JAVA_TABLE_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn Java Named Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedColumn() - * @generated - */ - public static final int JAVA_NAMED_COLUMN = 24; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_COLUMN__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_COLUMN__SPECIFIED_NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_COLUMN__DEFAULT_NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_COLUMN__COLUMN_DEFINITION = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Java Named Column' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_COLUMN_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn Abstract Java Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getAbstractJavaColumn() - * @generated - */ - public static final int ABSTRACT_JAVA_COLUMN = 25; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__NAME = JAVA_NAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__SPECIFIED_NAME = JAVA_NAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__DEFAULT_NAME = JAVA_NAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__COLUMN_DEFINITION = JAVA_NAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__UNIQUE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__NULLABLE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__INSERTABLE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__UPDATABLE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__TABLE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'Abstract Java Column' class. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_JAVA_COLUMN_FEATURE_COUNT = JAVA_NAMED_COLUMN_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__NAME = ABSTRACT_JAVA_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__SPECIFIED_NAME = ABSTRACT_JAVA_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__DEFAULT_NAME = ABSTRACT_JAVA_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__COLUMN_DEFINITION = ABSTRACT_JAVA_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__UNIQUE = ABSTRACT_JAVA_COLUMN__UNIQUE; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__NULLABLE = ABSTRACT_JAVA_COLUMN__NULLABLE; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__INSERTABLE = ABSTRACT_JAVA_COLUMN__INSERTABLE; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__UPDATABLE = ABSTRACT_JAVA_COLUMN__UPDATABLE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__TABLE = ABSTRACT_JAVA_COLUMN__TABLE; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__SPECIFIED_TABLE = ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__DEFAULT_TABLE = ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE; - - /** - * The feature id for the 'Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__LENGTH = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Precision' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__PRECISION = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Scale' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN__SCALE = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Column' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_COLUMN_FEATURE_COUNT = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__NAME = ABSTRACT_JAVA_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__SPECIFIED_NAME = ABSTRACT_JAVA_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__DEFAULT_NAME = ABSTRACT_JAVA_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__COLUMN_DEFINITION = ABSTRACT_JAVA_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__UNIQUE = ABSTRACT_JAVA_COLUMN__UNIQUE; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__NULLABLE = ABSTRACT_JAVA_COLUMN__NULLABLE; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__INSERTABLE = ABSTRACT_JAVA_COLUMN__INSERTABLE; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__UPDATABLE = ABSTRACT_JAVA_COLUMN__UPDATABLE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__TABLE = ABSTRACT_JAVA_COLUMN__TABLE; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__SPECIFIED_TABLE = ABSTRACT_JAVA_COLUMN__SPECIFIED_TABLE; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__DEFAULT_TABLE = ABSTRACT_JAVA_COLUMN__DEFAULT_TABLE; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__REFERENCED_COLUMN_NAME = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Join Column' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride Java Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOverride() - * @generated - */ - public static final int JAVA_OVERRIDE = 28; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_OVERRIDE__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java Override' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_OVERRIDE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ATTRIBUTE_OVERRIDE__NAME = JAVA_OVERRIDE__NAME; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ATTRIBUTE_OVERRIDE__COLUMN = JAVA_OVERRIDE_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java Attribute Override' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ATTRIBUTE_OVERRIDE_FEATURE_COUNT = JAVA_OVERRIDE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ASSOCIATION_OVERRIDE__NAME = JAVA_OVERRIDE__NAME; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ASSOCIATION_OVERRIDE__JOIN_COLUMNS = JAVA_OVERRIDE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS = JAVA_OVERRIDE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS = JAVA_OVERRIDE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Association Override' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ASSOCIATION_OVERRIDE_FEATURE_COUNT = JAVA_OVERRIDE_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__NAME = JAVA_NAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME = JAVA_NAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__DEFAULT_NAME = JAVA_NAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = JAVA_NAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Discriminator Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = JAVA_NAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Default Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH = JAVA_NAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH = JAVA_NAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN__LENGTH = JAVA_NAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Java Discriminator Column' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_DISCRIMINATOR_COLUMN_FEATURE_COUNT = JAVA_NAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__NAME = JAVA_NAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_NAME = JAVA_NAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_NAME = JAVA_NAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = JAVA_NAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = JAVA_NAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = JAVA_NAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = JAVA_NAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Primary Key Join Column' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_PRIMARY_KEY_JOIN_COLUMN_FEATURE_COUNT = JAVA_NAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATED_VALUE__STRATEGY = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Generator' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATED_VALUE__GENERATOR = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Java Generated Value' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATED_VALUE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__INITIAL_VALUE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__DEFAULT_INITIAL_VALUE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__ALLOCATION_SIZE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'Java Generator' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_GENERATOR_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__NAME = JAVA_GENERATOR__NAME; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__INITIAL_VALUE = JAVA_GENERATOR__INITIAL_VALUE; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_INITIAL_VALUE = JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_INITIAL_VALUE = JAVA_GENERATOR__DEFAULT_INITIAL_VALUE; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__ALLOCATION_SIZE = JAVA_GENERATOR__ALLOCATION_SIZE; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_ALLOCATION_SIZE = JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_ALLOCATION_SIZE = JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__TABLE = JAVA_GENERATOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_TABLE = JAVA_GENERATOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_TABLE = JAVA_GENERATOR_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__CATALOG = JAVA_GENERATOR_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_CATALOG = JAVA_GENERATOR_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_CATALOG = JAVA_GENERATOR_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SCHEMA = JAVA_GENERATOR_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_SCHEMA = JAVA_GENERATOR_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_SCHEMA = JAVA_GENERATOR_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__PK_COLUMN_NAME = JAVA_GENERATOR_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Specified Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME = JAVA_GENERATOR_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Default Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME = JAVA_GENERATOR_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__VALUE_COLUMN_NAME = JAVA_GENERATOR_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Specified Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME = JAVA_GENERATOR_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Default Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME = JAVA_GENERATOR_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__PK_COLUMN_VALUE = JAVA_GENERATOR_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Specified Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE = JAVA_GENERATOR_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Default Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = JAVA_GENERATOR_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = JAVA_GENERATOR_FEATURE_COUNT + 18; - - /** - * The number of structural features of the 'Java Table Generator' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_TABLE_GENERATOR_FEATURE_COUNT = JAVA_GENERATOR_FEATURE_COUNT + 19; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__NAME = JAVA_GENERATOR__NAME; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__INITIAL_VALUE = JAVA_GENERATOR__INITIAL_VALUE; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__SPECIFIED_INITIAL_VALUE = JAVA_GENERATOR__SPECIFIED_INITIAL_VALUE; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__DEFAULT_INITIAL_VALUE = JAVA_GENERATOR__DEFAULT_INITIAL_VALUE; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__ALLOCATION_SIZE = JAVA_GENERATOR__ALLOCATION_SIZE; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__SPECIFIED_ALLOCATION_SIZE = JAVA_GENERATOR__SPECIFIED_ALLOCATION_SIZE; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__DEFAULT_ALLOCATION_SIZE = JAVA_GENERATOR__DEFAULT_ALLOCATION_SIZE; - - /** - * The feature id for the 'Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__SEQUENCE_NAME = JAVA_GENERATOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME = JAVA_GENERATOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME = JAVA_GENERATOR_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Sequence Generator' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_SEQUENCE_GENERATOR_FEATURE_COUNT = JAVA_GENERATOR_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery Java Abstract Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAbstractQuery() - * @generated - */ - public static final int JAVA_ABSTRACT_QUERY = 37; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ABSTRACT_QUERY__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ABSTRACT_QUERY__QUERY = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ABSTRACT_QUERY__HINTS = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Java Abstract Query' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_ABSTRACT_QUERY_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery Java Named Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedQuery() - * @generated - */ - public static final int JAVA_NAMED_QUERY = 38; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_QUERY__NAME = JAVA_ABSTRACT_QUERY__NAME; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_QUERY__QUERY = JAVA_ABSTRACT_QUERY__QUERY; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_QUERY__HINTS = JAVA_ABSTRACT_QUERY__HINTS; - - /** - * The number of structural features of the 'Java Named Query' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_QUERY_FEATURE_COUNT = JAVA_ABSTRACT_QUERY_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery Java Named Native Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedNativeQuery() - * @generated - */ - public static final int JAVA_NAMED_NATIVE_QUERY = 39; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_NATIVE_QUERY__NAME = JAVA_ABSTRACT_QUERY__NAME; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_NATIVE_QUERY__QUERY = JAVA_ABSTRACT_QUERY__QUERY; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_NATIVE_QUERY__HINTS = JAVA_ABSTRACT_QUERY__HINTS; - - /** - * The feature id for the 'Result Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_NATIVE_QUERY__RESULT_CLASS = JAVA_ABSTRACT_QUERY_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Result Set Mapping' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = JAVA_ABSTRACT_QUERY_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Java Named Native Query' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_NAMED_NATIVE_QUERY_FEATURE_COUNT = JAVA_ABSTRACT_QUERY_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint Java Query Hint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaQueryHint() - * @generated - */ - public static final int JAVA_QUERY_HINT = 40; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_QUERY_HINT__NAME = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_QUERY_HINT__VALUE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Java Query Hint' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_QUERY_HINT_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint Java Unique Constraint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint() - * @generated - */ - public static final int JAVA_UNIQUE_CONSTRAINT = 41; - - /** - * The feature id for the 'Column Names' attribute list. - * - * - * @generated - * @ordered - */ - public static final int JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java Unique Constraint' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_UNIQUE_CONSTRAINT_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade Java Cascade}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade() - * @generated - */ - public static final int JAVA_CASCADE = 42; - - /** - * The feature id for the 'All' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CASCADE__ALL = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persist' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CASCADE__PERSIST = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Merge' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CASCADE__MERGE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Remove' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CASCADE__REMOVE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Refresh' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CASCADE__REFRESH = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Java Cascade' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CASCADE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 5; - - /** - * - * - * @generated - */ - private EClass javaEntityEClass = null; - - /** - * - * - * @generated - */ - private EClass javaMappedSuperclassEClass = null; - - /** - * - * - * @generated - */ - private EClass javaEmbeddableEClass = null; - - /** - * - * - * @generated - */ - private EClass javaNullTypeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass javaNullAttributeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass javaBasicEClass = null; - - /** - * - * - * @generated - */ - private EClass javaIdEClass = null; - - /** - * - * - * @generated - */ - private EClass javaTransientEClass = null; - - /** - * - * - * @generated - */ - private EClass javaVersionEClass = null; - - /** - * - * - * @generated - */ - private EClass javaEmbeddedIdEClass = null; - - /** - * - * - * @generated - */ - private EClass javaEmbeddedEClass = null; - - /** - * - * - * @generated - */ - private EClass javaAttributeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass javaTypeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass abstractJavaTableEClass = null; - - /** - * - * - * @generated - */ - private EClass javaTableEClass = null; - - /** - * - * - * @generated - */ - private EClass javaColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass javaRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass javaSingleRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass javaManyToOneEClass = null; - - /** - * - * - * @generated - */ - private EClass javaOneToOneEClass = null; - - /** - * - * - * @generated - */ - private EClass javaMultiRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass javaOneToManyEClass = null; - - /** - * - * - * @generated - */ - private EClass javaManyToManyEClass = null; - - /** - * - * - * @generated - */ - private EClass javaJoinTableEClass = null; - - /** - * - * - * @generated - */ - private EClass javaNamedColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass abstractJavaColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass javaJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass javaOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass javaAttributeOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass javaAssociationOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass javaDiscriminatorColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass javaPrimaryKeyJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass javaGeneratedValueEClass = null; - - /** - * - * - * @generated - */ - private EClass javaGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass javaTableGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass javaSequenceGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass javaAbstractQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass javaNamedQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass javaNamedNativeQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass javaQueryHintEClass = null; - - /** - * - * - * @generated - */ - private EClass javaUniqueConstraintEClass = null; - - /** - * - * - * @generated - */ - private EClass javaCascadeEClass = null; - - /** - * - * - * @generated - */ - private EClass javaSecondaryTableEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

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. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#eNS_URI - * @see #init() - * @generated - */ - private JpaJavaMappingsPackage() { - super(eNS_URI, JpaJavaMappingsFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static JpaJavaMappingsPackage init() { - if (isInited) - return (JpaJavaMappingsPackage) EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI); - // Obtain or create and register package - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof JpaJavaMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new JpaJavaMappingsPackage()); - isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - // Obtain or create and register interdependencies - JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE); - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE); - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE); - OrmPackage theOrmPackage = (OrmPackage) (EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE); - PersistencePackage thePersistencePackage = (PersistencePackage) (EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE); - // Create package meta-data objects - theJpaJavaMappingsPackage.createPackageContents(); - theJpaCorePackage.createPackageContents(); - theJpaCoreMappingsPackage.createPackageContents(); - theJpaJavaPackage.createPackageContents(); - theOrmPackage.createPackageContents(); - thePersistencePackage.createPackageContents(); - // Initialize created meta-data - theJpaJavaMappingsPackage.initializePackageContents(); - theJpaCorePackage.initializePackageContents(); - theJpaCoreMappingsPackage.initializePackageContents(); - theJpaJavaPackage.initializePackageContents(); - theOrmPackage.initializePackageContents(); - thePersistencePackage.initializePackageContents(); - // Mark meta-data to indicate it can't be changed - theJpaJavaMappingsPackage.freeze(); - return theJpaJavaMappingsPackage; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity Java Entity}'. - * - * - * @return the meta object for class 'Java Entity'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity - * @generated - */ - public EClass getJavaEntity() { - return javaEntityEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass Java Mapped Superclass}'. - * - * - * @return the meta object for class 'Java Mapped Superclass'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass - * @generated - */ - public EClass getJavaMappedSuperclass() { - return javaMappedSuperclassEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable Java Embeddable}'. - * - * - * @return the meta object for class 'Java Embeddable'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable - * @generated - */ - public EClass getJavaEmbeddable() { - return javaEmbeddableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping Java Null Type Mapping}'. - * - * - * @return the meta object for class 'Java Null Type Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping - * @generated - */ - public EClass getJavaNullTypeMapping() { - return javaNullTypeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping Java Null Attribute Mapping}'. - * - * - * @return the meta object for class 'Java Null Attribute Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping - * @generated - */ - public EClass getJavaNullAttributeMapping() { - return javaNullAttributeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic Java Basic}'. - * - * - * @return the meta object for class 'Java Basic'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic - * @generated - */ - public EClass getJavaBasic() { - return javaBasicEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId Java Id}'. - * - * - * @return the meta object for class 'Java Id'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaId - * @generated - */ - public EClass getJavaId() { - return javaIdEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient Java Transient}'. - * - * - * @return the meta object for class 'Java Transient'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient - * @generated - */ - public EClass getJavaTransient() { - return javaTransientEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion Java Version}'. - * - * - * @return the meta object for class 'Java Version'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion - * @generated - */ - public EClass getJavaVersion() { - return javaVersionEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId Java Embedded Id}'. - * - * - * @return the meta object for class 'Java Embedded Id'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId - * @generated - */ - public EClass getJavaEmbeddedId() { - return javaEmbeddedIdEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded Java Embedded}'. - * - * - * @return the meta object for class 'Java Embedded'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded - * @generated - */ - public EClass getJavaEmbedded() { - return javaEmbeddedEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping Java Attribute Mapping}'. - * - * - * @return the meta object for class 'Java Attribute Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping - * @generated - */ - public EClass getJavaAttributeMapping() { - return javaAttributeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping Java Type Mapping}'. - * - * - * @return the meta object for class 'Java Type Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping - * @generated - */ - public EClass getJavaTypeMapping() { - return javaTypeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable Abstract Java Table}'. - * - * - * @return the meta object for class 'Abstract Java Table'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable - * @generated - */ - public EClass getAbstractJavaTable() { - return abstractJavaTableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTable Java Table}'. - * - * - * @return the meta object for class 'Java Table'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTable - * @generated - */ - public EClass getJavaTable() { - return javaTableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn Java Column}'. - * - * - * @return the meta object for class 'Java Column'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn - * @generated - */ - public EClass getJavaColumn() { - return javaColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping Java Relationship Mapping}'. - * - * - * @return the meta object for class 'Java Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping - * @generated - */ - public EClass getJavaRelationshipMapping() { - return javaRelationshipMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping Java Single Relationship Mapping}'. - * - * - * @return the meta object for class 'Java Single Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping - * @generated - */ - public EClass getJavaSingleRelationshipMapping() { - return javaSingleRelationshipMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne Java Many To One}'. - * - * - * @return the meta object for class 'Java Many To One'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne - * @generated - */ - public EClass getJavaManyToOne() { - return javaManyToOneEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne Java One To One}'. - * - * - * @return the meta object for class 'Java One To One'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne - * @generated - */ - public EClass getJavaOneToOne() { - return javaOneToOneEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping Java Multi Relationship Mapping}'. - * - * - * @return the meta object for class 'Java Multi Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping - * @generated - */ - public EClass getJavaMultiRelationshipMapping() { - return javaMultiRelationshipMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany Java One To Many}'. - * - * - * @return the meta object for class 'Java One To Many'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany - * @generated - */ - public EClass getJavaOneToMany() { - return javaOneToManyEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany Java Many To Many}'. - * - * - * @return the meta object for class 'Java Many To Many'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany - * @generated - */ - public EClass getJavaManyToMany() { - return javaManyToManyEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable Java Join Table}'. - * - * - * @return the meta object for class 'Java Join Table'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable - * @generated - */ - public EClass getJavaJoinTable() { - return javaJoinTableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn Java Named Column}'. - * - * - * @return the meta object for class 'Java Named Column'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn - * @generated - */ - public EClass getJavaNamedColumn() { - return javaNamedColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn Abstract Java Column}'. - * - * - * @return the meta object for class 'Abstract Java Column'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn - * @generated - */ - public EClass getAbstractJavaColumn() { - return abstractJavaColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn Java Join Column}'. - * - * - * @return the meta object for class 'Java Join Column'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn - * @generated - */ - public EClass getJavaJoinColumn() { - return javaJoinColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride Java Override}'. - * - * - * @return the meta object for class 'Java Override'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride - * @generated - */ - public EClass getJavaOverride() { - return javaOverrideEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride Java Attribute Override}'. - * - * - * @return the meta object for class 'Java Attribute Override'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride - * @generated - */ - public EClass getJavaAttributeOverride() { - return javaAttributeOverrideEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride Java Association Override}'. - * - * - * @return the meta object for class 'Java Association Override'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride - * @generated - */ - public EClass getJavaAssociationOverride() { - return javaAssociationOverrideEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn Java Discriminator Column}'. - * - * - * @return the meta object for class 'Java Discriminator Column'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn - * @generated - */ - public EClass getJavaDiscriminatorColumn() { - return javaDiscriminatorColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn Java Primary Key Join Column}'. - * - * - * @return the meta object for class 'Java Primary Key Join Column'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn - * @generated - */ - public EClass getJavaPrimaryKeyJoinColumn() { - return javaPrimaryKeyJoinColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue Java Generated Value}'. - * - * - * @return the meta object for class 'Java Generated Value'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue - * @generated - */ - public EClass getJavaGeneratedValue() { - return javaGeneratedValueEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator Java Generator}'. - * - * - * @return the meta object for class 'Java Generator'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator - * @generated - */ - public EClass getJavaGenerator() { - return javaGeneratorEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator Java Table Generator}'. - * - * - * @return the meta object for class 'Java Table Generator'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator - * @generated - */ - public EClass getJavaTableGenerator() { - return javaTableGeneratorEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator Java Sequence Generator}'. - * - * - * @return the meta object for class 'Java Sequence Generator'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator - * @generated - */ - public EClass getJavaSequenceGenerator() { - return javaSequenceGeneratorEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery Java Abstract Query}'. - * - * - * @return the meta object for class 'Java Abstract Query'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery - * @generated - */ - public EClass getJavaAbstractQuery() { - return javaAbstractQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery Java Named Query}'. - * - * - * @return the meta object for class 'Java Named Query'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery - * @generated - */ - public EClass getJavaNamedQuery() { - return javaNamedQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery Java Named Native Query}'. - * - * - * @return the meta object for class 'Java Named Native Query'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery - * @generated - */ - public EClass getJavaNamedNativeQuery() { - return javaNamedNativeQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint Java Query Hint}'. - * - * - * @return the meta object for class 'Java Query Hint'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint - * @generated - */ - public EClass getJavaQueryHint() { - return javaQueryHintEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint Java Unique Constraint}'. - * - * - * @return the meta object for class 'Java Unique Constraint'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint - * @generated - */ - public EClass getJavaUniqueConstraint() { - return javaUniqueConstraintEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade Java Cascade}'. - * - * - * @return the meta object for class 'Java Cascade'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade - * @generated - */ - public EClass getJavaCascade() { - return javaCascadeEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable Java Secondary Table}'. - * - * - * @return the meta object for class 'Java Secondary Table'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable - * @generated - */ - public EClass getJavaSecondaryTable() { - return javaSecondaryTableEClass; - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public JpaJavaMappingsFactory getJpaJavaMappingsFactory() { - return (JpaJavaMappingsFactory) getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - // Create classes and their features - javaTypeMappingEClass = createEClass(JAVA_TYPE_MAPPING); - javaEntityEClass = createEClass(JAVA_ENTITY); - javaMappedSuperclassEClass = createEClass(JAVA_MAPPED_SUPERCLASS); - javaEmbeddableEClass = createEClass(JAVA_EMBEDDABLE); - javaNullTypeMappingEClass = createEClass(JAVA_NULL_TYPE_MAPPING); - javaAttributeMappingEClass = createEClass(JAVA_ATTRIBUTE_MAPPING); - javaBasicEClass = createEClass(JAVA_BASIC); - javaIdEClass = createEClass(JAVA_ID); - javaTransientEClass = createEClass(JAVA_TRANSIENT); - javaVersionEClass = createEClass(JAVA_VERSION); - javaEmbeddedIdEClass = createEClass(JAVA_EMBEDDED_ID); - javaEmbeddedEClass = createEClass(JAVA_EMBEDDED); - javaRelationshipMappingEClass = createEClass(JAVA_RELATIONSHIP_MAPPING); - javaSingleRelationshipMappingEClass = createEClass(JAVA_SINGLE_RELATIONSHIP_MAPPING); - javaManyToOneEClass = createEClass(JAVA_MANY_TO_ONE); - javaOneToOneEClass = createEClass(JAVA_ONE_TO_ONE); - javaMultiRelationshipMappingEClass = createEClass(JAVA_MULTI_RELATIONSHIP_MAPPING); - javaOneToManyEClass = createEClass(JAVA_ONE_TO_MANY); - javaManyToManyEClass = createEClass(JAVA_MANY_TO_MANY); - javaNullAttributeMappingEClass = createEClass(JAVA_NULL_ATTRIBUTE_MAPPING); - abstractJavaTableEClass = createEClass(ABSTRACT_JAVA_TABLE); - javaTableEClass = createEClass(JAVA_TABLE); - javaSecondaryTableEClass = createEClass(JAVA_SECONDARY_TABLE); - javaJoinTableEClass = createEClass(JAVA_JOIN_TABLE); - javaNamedColumnEClass = createEClass(JAVA_NAMED_COLUMN); - abstractJavaColumnEClass = createEClass(ABSTRACT_JAVA_COLUMN); - javaColumnEClass = createEClass(JAVA_COLUMN); - javaJoinColumnEClass = createEClass(JAVA_JOIN_COLUMN); - javaOverrideEClass = createEClass(JAVA_OVERRIDE); - javaAttributeOverrideEClass = createEClass(JAVA_ATTRIBUTE_OVERRIDE); - javaAssociationOverrideEClass = createEClass(JAVA_ASSOCIATION_OVERRIDE); - javaDiscriminatorColumnEClass = createEClass(JAVA_DISCRIMINATOR_COLUMN); - javaPrimaryKeyJoinColumnEClass = createEClass(JAVA_PRIMARY_KEY_JOIN_COLUMN); - javaGeneratedValueEClass = createEClass(JAVA_GENERATED_VALUE); - javaGeneratorEClass = createEClass(JAVA_GENERATOR); - javaTableGeneratorEClass = createEClass(JAVA_TABLE_GENERATOR); - javaSequenceGeneratorEClass = createEClass(JAVA_SEQUENCE_GENERATOR); - javaAbstractQueryEClass = createEClass(JAVA_ABSTRACT_QUERY); - javaNamedQueryEClass = createEClass(JAVA_NAMED_QUERY); - javaNamedNativeQueryEClass = createEClass(JAVA_NAMED_NATIVE_QUERY); - javaQueryHintEClass = createEClass(JAVA_QUERY_HINT); - javaUniqueConstraintEClass = createEClass(JAVA_UNIQUE_CONSTRAINT); - javaCascadeEClass = createEClass(JAVA_CASCADE); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - // Obtain other dependent packages - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI); - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI); - // Create type parameters - // Set bounds for type parameters - // Add supertypes to classes - javaTypeMappingEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaTypeMappingEClass.getESuperTypes().add(theJpaJavaPackage.getIJavaTypeMapping()); - javaEntityEClass.getESuperTypes().add(this.getJavaTypeMapping()); - javaEntityEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEntity()); - javaMappedSuperclassEClass.getESuperTypes().add(this.getJavaTypeMapping()); - javaMappedSuperclassEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIMappedSuperclass()); - javaEmbeddableEClass.getESuperTypes().add(this.getJavaTypeMapping()); - javaEmbeddableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEmbeddable()); - javaNullTypeMappingEClass.getESuperTypes().add(this.getJavaTypeMapping()); - javaAttributeMappingEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaAttributeMappingEClass.getESuperTypes().add(theJpaJavaPackage.getIJavaAttributeMapping()); - javaBasicEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaBasicEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIBasic()); - javaIdEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaIdEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIId()); - javaTransientEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaTransientEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITransient()); - javaVersionEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaVersionEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIVersion()); - javaEmbeddedIdEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaEmbeddedIdEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEmbeddedId()); - javaEmbeddedEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaEmbeddedEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEmbedded()); - javaRelationshipMappingEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - javaRelationshipMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIRelationshipMapping()); - javaSingleRelationshipMappingEClass.getESuperTypes().add(this.getJavaRelationshipMapping()); - javaSingleRelationshipMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISingleRelationshipMapping()); - javaManyToOneEClass.getESuperTypes().add(this.getJavaSingleRelationshipMapping()); - javaManyToOneEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIManyToOne()); - javaOneToOneEClass.getESuperTypes().add(this.getJavaSingleRelationshipMapping()); - javaOneToOneEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOneToOne()); - javaMultiRelationshipMappingEClass.getESuperTypes().add(this.getJavaRelationshipMapping()); - javaMultiRelationshipMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIMultiRelationshipMapping()); - javaOneToManyEClass.getESuperTypes().add(this.getJavaMultiRelationshipMapping()); - javaOneToManyEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOneToMany()); - javaManyToManyEClass.getESuperTypes().add(this.getJavaMultiRelationshipMapping()); - javaManyToManyEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIManyToMany()); - javaNullAttributeMappingEClass.getESuperTypes().add(this.getJavaAttributeMapping()); - abstractJavaTableEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - abstractJavaTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITable()); - javaTableEClass.getESuperTypes().add(this.getAbstractJavaTable()); - javaSecondaryTableEClass.getESuperTypes().add(this.getAbstractJavaTable()); - javaSecondaryTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISecondaryTable()); - javaJoinTableEClass.getESuperTypes().add(this.getAbstractJavaTable()); - javaJoinTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIJoinTable()); - javaNamedColumnEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaNamedColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedColumn()); - abstractJavaColumnEClass.getESuperTypes().add(this.getJavaNamedColumn()); - abstractJavaColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIAbstractColumn()); - javaColumnEClass.getESuperTypes().add(this.getAbstractJavaColumn()); - javaColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIColumn()); - javaJoinColumnEClass.getESuperTypes().add(this.getAbstractJavaColumn()); - javaJoinColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIJoinColumn()); - javaOverrideEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaOverrideEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOverride()); - javaAttributeOverrideEClass.getESuperTypes().add(this.getJavaOverride()); - javaAttributeOverrideEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIAttributeOverride()); - javaAssociationOverrideEClass.getESuperTypes().add(this.getJavaOverride()); - javaAssociationOverrideEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIAssociationOverride()); - javaDiscriminatorColumnEClass.getESuperTypes().add(this.getJavaNamedColumn()); - javaDiscriminatorColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIDiscriminatorColumn()); - javaPrimaryKeyJoinColumnEClass.getESuperTypes().add(this.getJavaNamedColumn()); - javaPrimaryKeyJoinColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIPrimaryKeyJoinColumn()); - javaGeneratedValueEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaGeneratedValueEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIGeneratedValue()); - javaGeneratorEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIGenerator()); - javaTableGeneratorEClass.getESuperTypes().add(this.getJavaGenerator()); - javaTableGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITableGenerator()); - javaSequenceGeneratorEClass.getESuperTypes().add(this.getJavaGenerator()); - javaSequenceGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISequenceGenerator()); - javaAbstractQueryEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaAbstractQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQuery()); - javaNamedQueryEClass.getESuperTypes().add(this.getJavaAbstractQuery()); - javaNamedQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedQuery()); - javaNamedNativeQueryEClass.getESuperTypes().add(this.getJavaAbstractQuery()); - javaNamedNativeQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedNativeQuery()); - javaQueryHintEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaQueryHintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQueryHint()); - javaUniqueConstraintEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaUniqueConstraintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIUniqueConstraint()); - javaCascadeEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaCascadeEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getICascade()); - // Initialize classes and features; add operations and parameters - initEClass(javaTypeMappingEClass, JavaTypeMapping.class, "JavaTypeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaEntityEClass, JavaEntity.class, "JavaEntity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaMappedSuperclassEClass, JavaMappedSuperclass.class, "JavaMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaEmbeddableEClass, JavaEmbeddable.class, "JavaEmbeddable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaNullTypeMappingEClass, JavaNullTypeMapping.class, "JavaNullTypeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaAttributeMappingEClass, JavaAttributeMapping.class, "JavaAttributeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaBasicEClass, JavaBasic.class, "JavaBasic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaIdEClass, JavaId.class, "JavaId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaTransientEClass, JavaTransient.class, "JavaTransient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaVersionEClass, JavaVersion.class, "JavaVersion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaEmbeddedIdEClass, JavaEmbeddedId.class, "JavaEmbeddedId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaEmbeddedEClass, JavaEmbedded.class, "JavaEmbedded", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaRelationshipMappingEClass, JavaRelationshipMapping.class, "JavaRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaSingleRelationshipMappingEClass, JavaSingleRelationshipMapping.class, "JavaSingleRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaManyToOneEClass, JavaManyToOne.class, "JavaManyToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaOneToOneEClass, JavaOneToOne.class, "JavaOneToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaMultiRelationshipMappingEClass, JavaMultiRelationshipMapping.class, "JavaMultiRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaOneToManyEClass, JavaOneToMany.class, "JavaOneToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaManyToManyEClass, JavaManyToMany.class, "JavaManyToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaNullAttributeMappingEClass, JavaNullAttributeMapping.class, "JavaNullAttributeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(abstractJavaTableEClass, AbstractJavaTable.class, "AbstractJavaTable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaTableEClass, JavaTable.class, "JavaTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaSecondaryTableEClass, JavaSecondaryTable.class, "JavaSecondaryTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaJoinTableEClass, JavaJoinTable.class, "JavaJoinTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaNamedColumnEClass, JavaNamedColumn.class, "JavaNamedColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(abstractJavaColumnEClass, AbstractJavaColumn.class, "AbstractJavaColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaColumnEClass, JavaColumn.class, "JavaColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaJoinColumnEClass, JavaJoinColumn.class, "JavaJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaOverrideEClass, JavaOverride.class, "JavaOverride", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaAttributeOverrideEClass, JavaAttributeOverride.class, "JavaAttributeOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaAssociationOverrideEClass, JavaAssociationOverride.class, "JavaAssociationOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaDiscriminatorColumnEClass, JavaDiscriminatorColumn.class, "JavaDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaPrimaryKeyJoinColumnEClass, JavaPrimaryKeyJoinColumn.class, "JavaPrimaryKeyJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaGeneratedValueEClass, JavaGeneratedValue.class, "JavaGeneratedValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaGeneratorEClass, JavaGenerator.class, "JavaGenerator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaTableGeneratorEClass, JavaTableGenerator.class, "JavaTableGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaSequenceGeneratorEClass, JavaSequenceGenerator.class, "JavaSequenceGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaAbstractQueryEClass, JavaAbstractQuery.class, "JavaAbstractQuery", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaNamedQueryEClass, JavaNamedQuery.class, "JavaNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaNamedNativeQueryEClass, JavaNamedNativeQuery.class, "JavaNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaQueryHintEClass, JavaQueryHint.class, "JavaQueryHint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaUniqueConstraintEClass, JavaUniqueConstraint.class, "JavaUniqueConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaCascadeEClass, JavaCascade.class, "JavaCascade", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - } - - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity Java Entity}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEntity() - * @generated - */ - public static final EClass JAVA_ENTITY = eINSTANCE.getJavaEntity(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass Java Mapped Superclass}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaMappedSuperclass() - * @generated - */ - public static final EClass JAVA_MAPPED_SUPERCLASS = eINSTANCE.getJavaMappedSuperclass(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable Java Embeddable}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbeddable() - * @generated - */ - public static final EClass JAVA_EMBEDDABLE = eINSTANCE.getJavaEmbeddable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping Java Null Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNullTypeMapping() - * @generated - */ - public static final EClass JAVA_NULL_TYPE_MAPPING = eINSTANCE.getJavaNullTypeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping Java Null Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNullAttributeMapping() - * @generated - */ - public static final EClass JAVA_NULL_ATTRIBUTE_MAPPING = eINSTANCE.getJavaNullAttributeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic Java Basic}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaBasic() - * @generated - */ - public static final EClass JAVA_BASIC = eINSTANCE.getJavaBasic(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId Java Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaId - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaId() - * @generated - */ - public static final EClass JAVA_ID = eINSTANCE.getJavaId(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient Java Transient}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTransient() - * @generated - */ - public static final EClass JAVA_TRANSIENT = eINSTANCE.getJavaTransient(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion Java Version}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaVersion() - * @generated - */ - public static final EClass JAVA_VERSION = eINSTANCE.getJavaVersion(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId Java Embedded Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbeddedId() - * @generated - */ - public static final EClass JAVA_EMBEDDED_ID = eINSTANCE.getJavaEmbeddedId(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded Java Embedded}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaEmbedded() - * @generated - */ - public static final EClass JAVA_EMBEDDED = eINSTANCE.getJavaEmbedded(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping Java Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAttributeMapping() - * @generated - */ - public static final EClass JAVA_ATTRIBUTE_MAPPING = eINSTANCE.getJavaAttributeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping Java Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTypeMapping() - * @generated - */ - public static final EClass JAVA_TYPE_MAPPING = eINSTANCE.getJavaTypeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable Abstract Java Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getAbstractJavaTable() - * @generated - */ - public static final EClass ABSTRACT_JAVA_TABLE = eINSTANCE.getAbstractJavaTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTable Java Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTable() - * @generated - */ - public static final EClass JAVA_TABLE = eINSTANCE.getJavaTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn Java Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaColumn() - * @generated - */ - public static final EClass JAVA_COLUMN = eINSTANCE.getJavaColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping Java Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaRelationshipMapping() - * @generated - */ - public static final EClass JAVA_RELATIONSHIP_MAPPING = eINSTANCE.getJavaRelationshipMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping Java Single Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSingleRelationshipMapping() - * @generated - */ - public static final EClass JAVA_SINGLE_RELATIONSHIP_MAPPING = eINSTANCE.getJavaSingleRelationshipMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne Java Many To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaManyToOne() - * @generated - */ - public static final EClass JAVA_MANY_TO_ONE = eINSTANCE.getJavaManyToOne(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne Java One To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOneToOne() - * @generated - */ - public static final EClass JAVA_ONE_TO_ONE = eINSTANCE.getJavaOneToOne(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping Java Multi Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaMultiRelationshipMapping() - * @generated - */ - public static final EClass JAVA_MULTI_RELATIONSHIP_MAPPING = eINSTANCE.getJavaMultiRelationshipMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany Java One To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOneToMany() - * @generated - */ - public static final EClass JAVA_ONE_TO_MANY = eINSTANCE.getJavaOneToMany(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany Java Many To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaManyToMany() - * @generated - */ - public static final EClass JAVA_MANY_TO_MANY = eINSTANCE.getJavaManyToMany(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable Java Join Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaJoinTable() - * @generated - */ - public static final EClass JAVA_JOIN_TABLE = eINSTANCE.getJavaJoinTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn Java Named Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedColumn() - * @generated - */ - public static final EClass JAVA_NAMED_COLUMN = eINSTANCE.getJavaNamedColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn Abstract Java Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getAbstractJavaColumn() - * @generated - */ - public static final EClass ABSTRACT_JAVA_COLUMN = eINSTANCE.getAbstractJavaColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn Java Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaJoinColumn() - * @generated - */ - public static final EClass JAVA_JOIN_COLUMN = eINSTANCE.getJavaJoinColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride Java Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOverride() - * @generated - */ - public static final EClass JAVA_OVERRIDE = eINSTANCE.getJavaOverride(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride Java Attribute Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAttributeOverride() - * @generated - */ - public static final EClass JAVA_ATTRIBUTE_OVERRIDE = eINSTANCE.getJavaAttributeOverride(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride Java Association Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAssociationOverride() - * @generated - */ - public static final EClass JAVA_ASSOCIATION_OVERRIDE = eINSTANCE.getJavaAssociationOverride(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn Java Discriminator Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaDiscriminatorColumn() - * @generated - */ - public static final EClass JAVA_DISCRIMINATOR_COLUMN = eINSTANCE.getJavaDiscriminatorColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn Java Primary Key Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaPrimaryKeyJoinColumn() - * @generated - */ - public static final EClass JAVA_PRIMARY_KEY_JOIN_COLUMN = eINSTANCE.getJavaPrimaryKeyJoinColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue Java Generated Value}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaGeneratedValue() - * @generated - */ - public static final EClass JAVA_GENERATED_VALUE = eINSTANCE.getJavaGeneratedValue(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator Java Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaGenerator() - * @generated - */ - public static final EClass JAVA_GENERATOR = eINSTANCE.getJavaGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator Java Table Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaTableGenerator() - * @generated - */ - public static final EClass JAVA_TABLE_GENERATOR = eINSTANCE.getJavaTableGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator Java Sequence Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSequenceGenerator() - * @generated - */ - public static final EClass JAVA_SEQUENCE_GENERATOR = eINSTANCE.getJavaSequenceGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery Java Abstract Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAbstractQuery() - * @generated - */ - public static final EClass JAVA_ABSTRACT_QUERY = eINSTANCE.getJavaAbstractQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery Java Named Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedQuery() - * @generated - */ - public static final EClass JAVA_NAMED_QUERY = eINSTANCE.getJavaNamedQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery Java Named Native Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedNativeQuery() - * @generated - */ - public static final EClass JAVA_NAMED_NATIVE_QUERY = eINSTANCE.getJavaNamedNativeQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint Java Query Hint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaQueryHint() - * @generated - */ - public static final EClass JAVA_QUERY_HINT = eINSTANCE.getJavaQueryHint(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint Java Unique Constraint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint() - * @generated - */ - public static final EClass JAVA_UNIQUE_CONSTRAINT = eINSTANCE.getJavaUniqueConstraint(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade Java Cascade}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade() - * @generated - */ - public static final EClass JAVA_CASCADE = eINSTANCE.getJavaCascade(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable Java Secondary Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaSecondaryTable() - * @generated - */ - public static final EClass JAVA_SECONDARY_TABLE = eINSTANCE.getJavaSecondaryTable(); - } -} //JavaMappingsPackage diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java deleted file mode 100644 index e4df5bf85b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java +++ /dev/null @@ -1,1944 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.IVersion; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage - * @generated - */ -public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static JpaJavaMappingsPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public JpaJavaMappingsAdapterFactory() { - if (modelPackage == null) { - modelPackage = JpaJavaMappingsPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the createXXX methods. - * - * - * @generated - */ - protected JpaJavaMappingsSwitch modelSwitch = new JpaJavaMappingsSwitch() { - @Override - public Adapter caseJavaTypeMapping(JavaTypeMapping object) { - return createJavaTypeMappingAdapter(); - } - - @Override - public Adapter caseJavaEntity(JavaEntity object) { - return createJavaEntityAdapter(); - } - - @Override - public Adapter caseJavaMappedSuperclass(JavaMappedSuperclass object) { - return createJavaMappedSuperclassAdapter(); - } - - @Override - public Adapter caseJavaEmbeddable(JavaEmbeddable object) { - return createJavaEmbeddableAdapter(); - } - - @Override - public Adapter caseJavaNullTypeMapping(JavaNullTypeMapping object) { - return createJavaNullTypeMappingAdapter(); - } - - @Override - public Adapter caseJavaAttributeMapping(JavaAttributeMapping object) { - return createJavaAttributeMappingAdapter(); - } - - @Override - public Adapter caseJavaBasic(JavaBasic object) { - return createJavaBasicAdapter(); - } - - @Override - public Adapter caseJavaId(JavaId object) { - return createJavaIdAdapter(); - } - - @Override - public Adapter caseJavaTransient(JavaTransient object) { - return createJavaTransientAdapter(); - } - - @Override - public Adapter caseJavaVersion(JavaVersion object) { - return createJavaVersionAdapter(); - } - - @Override - public Adapter caseJavaEmbeddedId(JavaEmbeddedId object) { - return createJavaEmbeddedIdAdapter(); - } - - @Override - public Adapter caseJavaEmbedded(JavaEmbedded object) { - return createJavaEmbeddedAdapter(); - } - - @Override - public Adapter caseJavaRelationshipMapping(JavaRelationshipMapping object) { - return createJavaRelationshipMappingAdapter(); - } - - @Override - public Adapter caseJavaSingleRelationshipMapping(JavaSingleRelationshipMapping object) { - return createJavaSingleRelationshipMappingAdapter(); - } - - @Override - public Adapter caseJavaManyToOne(JavaManyToOne object) { - return createJavaManyToOneAdapter(); - } - - @Override - public Adapter caseJavaOneToOne(JavaOneToOne object) { - return createJavaOneToOneAdapter(); - } - - @Override - public Adapter caseJavaMultiRelationshipMapping(JavaMultiRelationshipMapping object) { - return createJavaMultiRelationshipMappingAdapter(); - } - - @Override - public Adapter caseJavaOneToMany(JavaOneToMany object) { - return createJavaOneToManyAdapter(); - } - - @Override - public Adapter caseJavaManyToMany(JavaManyToMany object) { - return createJavaManyToManyAdapter(); - } - - @Override - public Adapter caseJavaNullAttributeMapping(JavaNullAttributeMapping object) { - return createJavaNullAttributeMappingAdapter(); - } - - @Override - public Adapter caseAbstractJavaTable(AbstractJavaTable object) { - return createAbstractJavaTableAdapter(); - } - - @Override - public Adapter caseJavaTable(JavaTable object) { - return createJavaTableAdapter(); - } - - @Override - public Adapter caseJavaSecondaryTable(JavaSecondaryTable object) { - return createJavaSecondaryTableAdapter(); - } - - @Override - public Adapter caseJavaJoinTable(JavaJoinTable object) { - return createJavaJoinTableAdapter(); - } - - @Override - public Adapter caseJavaNamedColumn(JavaNamedColumn object) { - return createJavaNamedColumnAdapter(); - } - - @Override - public Adapter caseAbstractJavaColumn(AbstractJavaColumn object) { - return createAbstractJavaColumnAdapter(); - } - - @Override - public Adapter caseJavaColumn(JavaColumn object) { - return createJavaColumnAdapter(); - } - - @Override - public Adapter caseJavaJoinColumn(JavaJoinColumn object) { - return createJavaJoinColumnAdapter(); - } - - @Override - public Adapter caseJavaOverride(JavaOverride object) { - return createJavaOverrideAdapter(); - } - - @Override - public Adapter caseJavaAttributeOverride(JavaAttributeOverride object) { - return createJavaAttributeOverrideAdapter(); - } - - @Override - public Adapter caseJavaAssociationOverride(JavaAssociationOverride object) { - return createJavaAssociationOverrideAdapter(); - } - - @Override - public Adapter caseJavaDiscriminatorColumn(JavaDiscriminatorColumn object) { - return createJavaDiscriminatorColumnAdapter(); - } - - @Override - public Adapter caseJavaPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn object) { - return createJavaPrimaryKeyJoinColumnAdapter(); - } - - @Override - public Adapter caseJavaGeneratedValue(JavaGeneratedValue object) { - return createJavaGeneratedValueAdapter(); - } - - @Override - public Adapter caseJavaGenerator(JavaGenerator object) { - return createJavaGeneratorAdapter(); - } - - @Override - public Adapter caseJavaTableGenerator(JavaTableGenerator object) { - return createJavaTableGeneratorAdapter(); - } - - @Override - public Adapter caseJavaSequenceGenerator(JavaSequenceGenerator object) { - return createJavaSequenceGeneratorAdapter(); - } - - @Override - public Adapter caseJavaAbstractQuery(JavaAbstractQuery object) { - return createJavaAbstractQueryAdapter(); - } - - @Override - public Adapter caseJavaNamedQuery(JavaNamedQuery object) { - return createJavaNamedQueryAdapter(); - } - - @Override - public Adapter caseJavaNamedNativeQuery(JavaNamedNativeQuery object) { - return createJavaNamedNativeQueryAdapter(); - } - - @Override - public Adapter caseJavaQueryHint(JavaQueryHint object) { - return createJavaQueryHintAdapter(); - } - - @Override - public Adapter caseJavaUniqueConstraint(JavaUniqueConstraint object) { - return createJavaUniqueConstraintAdapter(); - } - - @Override - public Adapter caseJavaCascade(JavaCascade object) { - return createJavaCascadeAdapter(); - } - - @Override - public Adapter caseIJpaEObject(IJpaEObject object) { - return createIJpaEObjectAdapter(); - } - - @Override - public Adapter caseJpaEObject(JpaEObject object) { - return createJpaEObjectAdapter(); - } - - @Override - public Adapter caseIJpaSourceObject(IJpaSourceObject object) { - return createIJpaSourceObjectAdapter(); - } - - @Override - public Adapter caseJavaEObject(JavaEObject object) { - return createJavaEObjectAdapter(); - } - - @Override - public Adapter caseITypeMapping(ITypeMapping object) { - return createITypeMappingAdapter(); - } - - @Override - public Adapter caseIJavaTypeMapping(IJavaTypeMapping object) { - return createIJavaTypeMappingAdapter(); - } - - @Override - public Adapter caseIEntity(IEntity object) { - return createIEntityAdapter(); - } - - @Override - public Adapter caseIMappedSuperclass(IMappedSuperclass object) { - return createIMappedSuperclassAdapter(); - } - - @Override - public Adapter caseIEmbeddable(IEmbeddable object) { - return createIEmbeddableAdapter(); - } - - @Override - public Adapter caseIAttributeMapping(IAttributeMapping object) { - return createIAttributeMappingAdapter(); - } - - @Override - public Adapter caseIJavaAttributeMapping(IJavaAttributeMapping object) { - return createIJavaAttributeMappingAdapter(); - } - - @Override - public Adapter caseIColumnMapping(IColumnMapping object) { - return createIColumnMappingAdapter(); - } - - @Override - public Adapter caseIBasic(IBasic object) { - return createIBasicAdapter(); - } - - @Override - public Adapter caseIId(IId object) { - return createIIdAdapter(); - } - - @Override - public Adapter caseITransient(ITransient object) { - return createITransientAdapter(); - } - - @Override - public Adapter caseIVersion(IVersion object) { - return createIVersionAdapter(); - } - - @Override - public Adapter caseIEmbeddedId(IEmbeddedId object) { - return createIEmbeddedIdAdapter(); - } - - @Override - public Adapter caseIEmbedded(IEmbedded object) { - return createIEmbeddedAdapter(); - } - - @Override - public Adapter caseIRelationshipMapping(IRelationshipMapping object) { - return createIRelationshipMappingAdapter(); - } - - @Override - public Adapter caseISingleRelationshipMapping(ISingleRelationshipMapping object) { - return createISingleRelationshipMappingAdapter(); - } - - @Override - public Adapter caseIManyToOne(IManyToOne object) { - return createIManyToOneAdapter(); - } - - @Override - public Adapter caseINonOwningMapping(INonOwningMapping object) { - return createINonOwningMappingAdapter(); - } - - @Override - public Adapter caseIOneToOne(IOneToOne object) { - return createIOneToOneAdapter(); - } - - @Override - public Adapter caseIMultiRelationshipMapping(IMultiRelationshipMapping object) { - return createIMultiRelationshipMappingAdapter(); - } - - @Override - public Adapter caseIOneToMany(IOneToMany object) { - return createIOneToManyAdapter(); - } - - @Override - public Adapter caseIManyToMany(IManyToMany object) { - return createIManyToManyAdapter(); - } - - @Override - public Adapter caseITable(ITable object) { - return createITableAdapter(); - } - - @Override - public Adapter caseISecondaryTable(ISecondaryTable object) { - return createISecondaryTableAdapter(); - } - - @Override - public Adapter caseIJoinTable(IJoinTable object) { - return createIJoinTableAdapter(); - } - - @Override - public Adapter caseINamedColumn(INamedColumn object) { - return createINamedColumnAdapter(); - } - - @Override - public Adapter caseIAbstractColumn(IAbstractColumn object) { - return createIAbstractColumnAdapter(); - } - - @Override - public Adapter caseIColumn(IColumn object) { - return createIColumnAdapter(); - } - - @Override - public Adapter caseIAbstractJoinColumn(IAbstractJoinColumn object) { - return createIAbstractJoinColumnAdapter(); - } - - @Override - public Adapter caseIJoinColumn(IJoinColumn object) { - return createIJoinColumnAdapter(); - } - - @Override - public Adapter caseIOverride(IOverride object) { - return createIOverrideAdapter(); - } - - @Override - public Adapter caseIAttributeOverride(IAttributeOverride object) { - return createIAttributeOverrideAdapter(); - } - - @Override - public Adapter caseIAssociationOverride(IAssociationOverride object) { - return createIAssociationOverrideAdapter(); - } - - @Override - public Adapter caseIDiscriminatorColumn(IDiscriminatorColumn object) { - return createIDiscriminatorColumnAdapter(); - } - - @Override - public Adapter caseIPrimaryKeyJoinColumn(IPrimaryKeyJoinColumn object) { - return createIPrimaryKeyJoinColumnAdapter(); - } - - @Override - public Adapter caseIGeneratedValue(IGeneratedValue object) { - return createIGeneratedValueAdapter(); - } - - @Override - public Adapter caseIGenerator(IGenerator object) { - return createIGeneratorAdapter(); - } - - @Override - public Adapter caseITableGenerator(ITableGenerator object) { - return createITableGeneratorAdapter(); - } - - @Override - public Adapter caseISequenceGenerator(ISequenceGenerator object) { - return createISequenceGeneratorAdapter(); - } - - @Override - public Adapter caseIQuery(IQuery object) { - return createIQueryAdapter(); - } - - @Override - public Adapter caseINamedQuery(INamedQuery object) { - return createINamedQueryAdapter(); - } - - @Override - public Adapter caseINamedNativeQuery(INamedNativeQuery object) { - return createINamedNativeQueryAdapter(); - } - - @Override - public Adapter caseIQueryHint(IQueryHint object) { - return createIQueryHintAdapter(); - } - - @Override - public Adapter caseIUniqueConstraint(IUniqueConstraint object) { - return createIUniqueConstraintAdapter(); - } - - @Override - public Adapter caseICascade(ICascade object) { - return createICascadeAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity Java Entity}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity - * @generated - */ - public Adapter createJavaEntityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass Java Mapped Superclass}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass - * @generated - */ - public Adapter createJavaMappedSuperclassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable Java Embeddable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable - * @generated - */ - public Adapter createJavaEmbeddableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping Java Null Type Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping - * @generated - */ - public Adapter createJavaNullTypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping Java Null Attribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping - * @generated - */ - public Adapter createJavaNullAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic Java Basic}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic - * @generated - */ - public Adapter createJavaBasicAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaId Java Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaId - * @generated - */ - public Adapter createJavaIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient Java Transient}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient - * @generated - */ - public Adapter createJavaTransientAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion Java Version}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion - * @generated - */ - public Adapter createJavaVersionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId Java Embedded Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId - * @generated - */ - public Adapter createJavaEmbeddedIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded Java Embedded}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded - * @generated - */ - public Adapter createJavaEmbeddedAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping Java Attribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping - * @generated - */ - public Adapter createJavaAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping Java Type Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping - * @generated - */ - public Adapter createJavaTypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable Abstract Java Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable - * @generated - */ - public Adapter createAbstractJavaTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTable Java Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTable - * @generated - */ - public Adapter createJavaTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn Java Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn - * @generated - */ - public Adapter createJavaColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping Java Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping - * @generated - */ - public Adapter createJavaRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping Java Single Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping - * @generated - */ - public Adapter createJavaSingleRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany Java One To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany - * @generated - */ - public Adapter createJavaOneToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany Java Many To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany - * @generated - */ - public Adapter createJavaManyToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable Java Join Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable - * @generated - */ - public Adapter createJavaJoinTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn Java Named Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn - * @generated - */ - public Adapter createJavaNamedColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn Abstract Java Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn - * @generated - */ - public Adapter createAbstractJavaColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn Java Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn - * @generated - */ - public Adapter createJavaJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride Java Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride - * @generated - */ - public Adapter createJavaOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride Java Attribute Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride - * @generated - */ - public Adapter createJavaAttributeOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride Java Association Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride - * @generated - */ - public Adapter createJavaAssociationOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn Java Discriminator Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn - * @generated - */ - public Adapter createJavaDiscriminatorColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn Java Primary Key Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn - * @generated - */ - public Adapter createJavaPrimaryKeyJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue Java Generated Value}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue - * @generated - */ - public Adapter createJavaGeneratedValueAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator Java Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator - * @generated - */ - public Adapter createJavaGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator Java Table Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator - * @generated - */ - public Adapter createJavaTableGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator Java Sequence Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator - * @generated - */ - public Adapter createJavaSequenceGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery Java Abstract Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery - * @generated - */ - public Adapter createJavaAbstractQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery Java Named Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery - * @generated - */ - public Adapter createJavaNamedQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery Java Named Native Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery - * @generated - */ - public Adapter createJavaNamedNativeQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint Java Query Hint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint - * @generated - */ - public Adapter createJavaQueryHintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint Java Unique Constraint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint - * @generated - */ - public Adapter createJavaUniqueConstraintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade Java Cascade}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade - * @generated - */ - public Adapter createJavaCascadeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable Java Secondary Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable - * @generated - */ - public Adapter createJavaSecondaryTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public Adapter createIJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaEObject - * @generated - */ - public Adapter createJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public Adapter createIJpaSourceObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject Java EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.JavaEObject - * @generated - */ - public Adapter createJavaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne Java Many To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne - * @generated - */ - public Adapter createJavaManyToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne Java One To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne - * @generated - */ - public Adapter createJavaOneToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping Java Multi Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping - * @generated - */ - public Adapter createJavaMultiRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @generated - */ - public Adapter createITypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping IJava Type Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping - * @generated - */ - public Adapter createIJavaTypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEntity IEntity}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEntity - * @generated - */ - public Adapter createIEntityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass IMapped Superclass}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass - * @generated - */ - public Adapter createIMappedSuperclassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddable IEmbeddable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddable - * @generated - */ - public Adapter createIEmbeddableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @generated - */ - public Adapter createIAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping IJava Attribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping - * @generated - */ - public Adapter createIJavaAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping IColumn Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IColumnMapping - * @generated - */ - public Adapter createIColumnMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IBasic IBasic}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IBasic - * @generated - */ - public Adapter createIBasicAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IId IId}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IId - * @generated - */ - public Adapter createIIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITransient ITransient}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITransient - * @generated - */ - public Adapter createITransientAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IVersion IVersion}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IVersion - * @generated - */ - public Adapter createIVersionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddedId IEmbedded Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddedId - * @generated - */ - public Adapter createIEmbeddedIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded IEmbedded}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded - * @generated - */ - public Adapter createIEmbeddedAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITable ITable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITable - * @generated - */ - public Adapter createITableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IColumn IColumn}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IColumn - * @generated - */ - public Adapter createIColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn IAbstract Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn - * @generated - */ - public Adapter createIAbstractJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping IRelationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping - * @generated - */ - public Adapter createIRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping IMulti Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping - * @generated - */ - public Adapter createIMultiRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOneToMany IOne To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOneToMany - * @generated - */ - public Adapter createIOneToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IManyToMany IMany To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IManyToMany - * @generated - */ - public Adapter createIManyToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable IJoin Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable - * @generated - */ - public Adapter createIJoinTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn INamed Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn - * @generated - */ - public Adapter createINamedColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn IAbstract Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn - * @generated - */ - public Adapter createIAbstractColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IJoinColumn IJoin Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IJoinColumn - * @generated - */ - public Adapter createIJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOverride IOverride}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOverride - * @generated - */ - public Adapter createIOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride IAttribute Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride - * @generated - */ - public Adapter createIAttributeOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride IAssociation Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride - * @generated - */ - public Adapter createIAssociationOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn IDiscriminator Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn - * @generated - */ - public Adapter createIDiscriminatorColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn IPrimary Key Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn - * @generated - */ - public Adapter createIPrimaryKeyJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue IGenerated Value}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue - * @generated - */ - public Adapter createIGeneratedValueAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IGenerator IGenerator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator - * @generated - */ - public Adapter createIGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator ITable Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator - * @generated - */ - public Adapter createITableGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator ISequence Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator - * @generated - */ - public Adapter createISequenceGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQuery IQuery}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IQuery - * @generated - */ - public Adapter createIQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedQuery INamed Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedQuery - * @generated - */ - public Adapter createINamedQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery INamed Native Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery - * @generated - */ - public Adapter createINamedNativeQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint IQuery Hint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint - * @generated - */ - public Adapter createIQueryHintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint IUnique Constraint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint - * @generated - */ - public Adapter createIUniqueConstraintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ICascade ICascade}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ICascade - * @generated - */ - public Adapter createICascadeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable ISecondary Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable - * @generated - */ - public Adapter createISecondaryTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping ISingle Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping - * @generated - */ - public Adapter createISingleRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IManyToOne IMany To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IManyToOne - * @generated - */ - public Adapter createIManyToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOneToOne IOne To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOneToOne - * @generated - */ - public Adapter createIOneToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping INon Owning Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping - * @generated - */ - public Adapter createINonOwningMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } -} //JavaMappingsAdapterFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java deleted file mode 100644 index 887ae78c16..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java +++ /dev/null @@ -1,2541 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.mappings.util; - -import java.util.List; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.AbstractJavaTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaGeneratedValue; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaJoinTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedNativeQuery; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNamedQuery; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.IVersion; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage - * @generated - */ -public class JpaJavaMappingsSwitch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static JpaJavaMappingsPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public JpaJavaMappingsSwitch() { - if (modelPackage == null) { - modelPackage = JpaJavaMappingsPackage.eINSTANCE; - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List eSuperTypes = theEClass.getESuperTypes(); - return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case JpaJavaMappingsPackage.JAVA_TYPE_MAPPING : { - JavaTypeMapping javaTypeMapping = (JavaTypeMapping) theEObject; - T result = caseJavaTypeMapping(javaTypeMapping); - if (result == null) - result = caseJavaEObject(javaTypeMapping); - if (result == null) - result = caseIJavaTypeMapping(javaTypeMapping); - if (result == null) - result = caseJpaEObject(javaTypeMapping); - if (result == null) - result = caseIJpaSourceObject(javaTypeMapping); - if (result == null) - result = caseITypeMapping(javaTypeMapping); - if (result == null) - result = caseIJpaEObject(javaTypeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ENTITY : { - JavaEntity javaEntity = (JavaEntity) theEObject; - T result = caseJavaEntity(javaEntity); - if (result == null) - result = caseJavaTypeMapping(javaEntity); - if (result == null) - result = caseIEntity(javaEntity); - if (result == null) - result = caseJavaEObject(javaEntity); - if (result == null) - result = caseIJavaTypeMapping(javaEntity); - if (result == null) - result = caseITypeMapping(javaEntity); - if (result == null) - result = caseJpaEObject(javaEntity); - if (result == null) - result = caseIJpaSourceObject(javaEntity); - if (result == null) - result = caseIJpaEObject(javaEntity); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_MAPPED_SUPERCLASS : { - JavaMappedSuperclass javaMappedSuperclass = (JavaMappedSuperclass) theEObject; - T result = caseJavaMappedSuperclass(javaMappedSuperclass); - if (result == null) - result = caseJavaTypeMapping(javaMappedSuperclass); - if (result == null) - result = caseIMappedSuperclass(javaMappedSuperclass); - if (result == null) - result = caseJavaEObject(javaMappedSuperclass); - if (result == null) - result = caseIJavaTypeMapping(javaMappedSuperclass); - if (result == null) - result = caseITypeMapping(javaMappedSuperclass); - if (result == null) - result = caseJpaEObject(javaMappedSuperclass); - if (result == null) - result = caseIJpaSourceObject(javaMappedSuperclass); - if (result == null) - result = caseIJpaEObject(javaMappedSuperclass); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_EMBEDDABLE : { - JavaEmbeddable javaEmbeddable = (JavaEmbeddable) theEObject; - T result = caseJavaEmbeddable(javaEmbeddable); - if (result == null) - result = caseJavaTypeMapping(javaEmbeddable); - if (result == null) - result = caseIEmbeddable(javaEmbeddable); - if (result == null) - result = caseJavaEObject(javaEmbeddable); - if (result == null) - result = caseIJavaTypeMapping(javaEmbeddable); - if (result == null) - result = caseITypeMapping(javaEmbeddable); - if (result == null) - result = caseJpaEObject(javaEmbeddable); - if (result == null) - result = caseIJpaSourceObject(javaEmbeddable); - if (result == null) - result = caseIJpaEObject(javaEmbeddable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_NULL_TYPE_MAPPING : { - JavaNullTypeMapping javaNullTypeMapping = (JavaNullTypeMapping) theEObject; - T result = caseJavaNullTypeMapping(javaNullTypeMapping); - if (result == null) - result = caseJavaTypeMapping(javaNullTypeMapping); - if (result == null) - result = caseJavaEObject(javaNullTypeMapping); - if (result == null) - result = caseIJavaTypeMapping(javaNullTypeMapping); - if (result == null) - result = caseJpaEObject(javaNullTypeMapping); - if (result == null) - result = caseIJpaSourceObject(javaNullTypeMapping); - if (result == null) - result = caseITypeMapping(javaNullTypeMapping); - if (result == null) - result = caseIJpaEObject(javaNullTypeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_MAPPING : { - JavaAttributeMapping javaAttributeMapping = (JavaAttributeMapping) theEObject; - T result = caseJavaAttributeMapping(javaAttributeMapping); - if (result == null) - result = caseJavaEObject(javaAttributeMapping); - if (result == null) - result = caseIJavaAttributeMapping(javaAttributeMapping); - if (result == null) - result = caseJpaEObject(javaAttributeMapping); - if (result == null) - result = caseIJpaSourceObject(javaAttributeMapping); - if (result == null) - result = caseIAttributeMapping(javaAttributeMapping); - if (result == null) - result = caseIJpaEObject(javaAttributeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_BASIC : { - JavaBasic javaBasic = (JavaBasic) theEObject; - T result = caseJavaBasic(javaBasic); - if (result == null) - result = caseJavaAttributeMapping(javaBasic); - if (result == null) - result = caseIBasic(javaBasic); - if (result == null) - result = caseJavaEObject(javaBasic); - if (result == null) - result = caseIJavaAttributeMapping(javaBasic); - if (result == null) - result = caseIAttributeMapping(javaBasic); - if (result == null) - result = caseIColumnMapping(javaBasic); - if (result == null) - result = caseJpaEObject(javaBasic); - if (result == null) - result = caseIJpaSourceObject(javaBasic); - if (result == null) - result = caseIJpaEObject(javaBasic); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ID : { - JavaId javaId = (JavaId) theEObject; - T result = caseJavaId(javaId); - if (result == null) - result = caseJavaAttributeMapping(javaId); - if (result == null) - result = caseIId(javaId); - if (result == null) - result = caseJavaEObject(javaId); - if (result == null) - result = caseIJavaAttributeMapping(javaId); - if (result == null) - result = caseIAttributeMapping(javaId); - if (result == null) - result = caseIColumnMapping(javaId); - if (result == null) - result = caseJpaEObject(javaId); - if (result == null) - result = caseIJpaSourceObject(javaId); - if (result == null) - result = caseIJpaEObject(javaId); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_TRANSIENT : { - JavaTransient javaTransient = (JavaTransient) theEObject; - T result = caseJavaTransient(javaTransient); - if (result == null) - result = caseJavaAttributeMapping(javaTransient); - if (result == null) - result = caseITransient(javaTransient); - if (result == null) - result = caseJavaEObject(javaTransient); - if (result == null) - result = caseIJavaAttributeMapping(javaTransient); - if (result == null) - result = caseIAttributeMapping(javaTransient); - if (result == null) - result = caseJpaEObject(javaTransient); - if (result == null) - result = caseIJpaSourceObject(javaTransient); - if (result == null) - result = caseIJpaEObject(javaTransient); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_VERSION : { - JavaVersion javaVersion = (JavaVersion) theEObject; - T result = caseJavaVersion(javaVersion); - if (result == null) - result = caseJavaAttributeMapping(javaVersion); - if (result == null) - result = caseIVersion(javaVersion); - if (result == null) - result = caseJavaEObject(javaVersion); - if (result == null) - result = caseIJavaAttributeMapping(javaVersion); - if (result == null) - result = caseIAttributeMapping(javaVersion); - if (result == null) - result = caseIColumnMapping(javaVersion); - if (result == null) - result = caseJpaEObject(javaVersion); - if (result == null) - result = caseIJpaSourceObject(javaVersion); - if (result == null) - result = caseIJpaEObject(javaVersion); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_EMBEDDED_ID : { - JavaEmbeddedId javaEmbeddedId = (JavaEmbeddedId) theEObject; - T result = caseJavaEmbeddedId(javaEmbeddedId); - if (result == null) - result = caseJavaAttributeMapping(javaEmbeddedId); - if (result == null) - result = caseIEmbeddedId(javaEmbeddedId); - if (result == null) - result = caseJavaEObject(javaEmbeddedId); - if (result == null) - result = caseIJavaAttributeMapping(javaEmbeddedId); - if (result == null) - result = caseIAttributeMapping(javaEmbeddedId); - if (result == null) - result = caseJpaEObject(javaEmbeddedId); - if (result == null) - result = caseIJpaSourceObject(javaEmbeddedId); - if (result == null) - result = caseIJpaEObject(javaEmbeddedId); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_EMBEDDED : { - JavaEmbedded javaEmbedded = (JavaEmbedded) theEObject; - T result = caseJavaEmbedded(javaEmbedded); - if (result == null) - result = caseJavaAttributeMapping(javaEmbedded); - if (result == null) - result = caseIEmbedded(javaEmbedded); - if (result == null) - result = caseJavaEObject(javaEmbedded); - if (result == null) - result = caseIJavaAttributeMapping(javaEmbedded); - if (result == null) - result = caseIAttributeMapping(javaEmbedded); - if (result == null) - result = caseJpaEObject(javaEmbedded); - if (result == null) - result = caseIJpaSourceObject(javaEmbedded); - if (result == null) - result = caseIJpaEObject(javaEmbedded); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING : { - JavaRelationshipMapping javaRelationshipMapping = (JavaRelationshipMapping) theEObject; - T result = caseJavaRelationshipMapping(javaRelationshipMapping); - if (result == null) - result = caseJavaAttributeMapping(javaRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(javaRelationshipMapping); - if (result == null) - result = caseJavaEObject(javaRelationshipMapping); - if (result == null) - result = caseIJavaAttributeMapping(javaRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(javaRelationshipMapping); - if (result == null) - result = caseJpaEObject(javaRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(javaRelationshipMapping); - if (result == null) - result = caseIJpaEObject(javaRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_SINGLE_RELATIONSHIP_MAPPING : { - JavaSingleRelationshipMapping javaSingleRelationshipMapping = (JavaSingleRelationshipMapping) theEObject; - T result = caseJavaSingleRelationshipMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseJavaRelationshipMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseISingleRelationshipMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseJavaAttributeMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseJavaEObject(javaSingleRelationshipMapping); - if (result == null) - result = caseIJavaAttributeMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(javaSingleRelationshipMapping); - if (result == null) - result = caseJpaEObject(javaSingleRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(javaSingleRelationshipMapping); - if (result == null) - result = caseIJpaEObject(javaSingleRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_MANY_TO_ONE : { - JavaManyToOne javaManyToOne = (JavaManyToOne) theEObject; - T result = caseJavaManyToOne(javaManyToOne); - if (result == null) - result = caseJavaSingleRelationshipMapping(javaManyToOne); - if (result == null) - result = caseIManyToOne(javaManyToOne); - if (result == null) - result = caseJavaRelationshipMapping(javaManyToOne); - if (result == null) - result = caseISingleRelationshipMapping(javaManyToOne); - if (result == null) - result = caseJavaAttributeMapping(javaManyToOne); - if (result == null) - result = caseIRelationshipMapping(javaManyToOne); - if (result == null) - result = caseJavaEObject(javaManyToOne); - if (result == null) - result = caseIJavaAttributeMapping(javaManyToOne); - if (result == null) - result = caseIAttributeMapping(javaManyToOne); - if (result == null) - result = caseJpaEObject(javaManyToOne); - if (result == null) - result = caseIJpaSourceObject(javaManyToOne); - if (result == null) - result = caseIJpaEObject(javaManyToOne); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ONE_TO_ONE : { - JavaOneToOne javaOneToOne = (JavaOneToOne) theEObject; - T result = caseJavaOneToOne(javaOneToOne); - if (result == null) - result = caseJavaSingleRelationshipMapping(javaOneToOne); - if (result == null) - result = caseIOneToOne(javaOneToOne); - if (result == null) - result = caseJavaRelationshipMapping(javaOneToOne); - if (result == null) - result = caseISingleRelationshipMapping(javaOneToOne); - if (result == null) - result = caseINonOwningMapping(javaOneToOne); - if (result == null) - result = caseJavaAttributeMapping(javaOneToOne); - if (result == null) - result = caseIRelationshipMapping(javaOneToOne); - if (result == null) - result = caseJavaEObject(javaOneToOne); - if (result == null) - result = caseIJavaAttributeMapping(javaOneToOne); - if (result == null) - result = caseIAttributeMapping(javaOneToOne); - if (result == null) - result = caseJpaEObject(javaOneToOne); - if (result == null) - result = caseIJpaSourceObject(javaOneToOne); - if (result == null) - result = caseIJpaEObject(javaOneToOne); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING : { - JavaMultiRelationshipMapping javaMultiRelationshipMapping = (JavaMultiRelationshipMapping) theEObject; - T result = caseJavaMultiRelationshipMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseJavaRelationshipMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseIMultiRelationshipMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseJavaAttributeMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseINonOwningMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseJavaEObject(javaMultiRelationshipMapping); - if (result == null) - result = caseIJavaAttributeMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(javaMultiRelationshipMapping); - if (result == null) - result = caseJpaEObject(javaMultiRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(javaMultiRelationshipMapping); - if (result == null) - result = caseIJpaEObject(javaMultiRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ONE_TO_MANY : { - JavaOneToMany javaOneToMany = (JavaOneToMany) theEObject; - T result = caseJavaOneToMany(javaOneToMany); - if (result == null) - result = caseJavaMultiRelationshipMapping(javaOneToMany); - if (result == null) - result = caseIOneToMany(javaOneToMany); - if (result == null) - result = caseJavaRelationshipMapping(javaOneToMany); - if (result == null) - result = caseIMultiRelationshipMapping(javaOneToMany); - if (result == null) - result = caseJavaAttributeMapping(javaOneToMany); - if (result == null) - result = caseIRelationshipMapping(javaOneToMany); - if (result == null) - result = caseINonOwningMapping(javaOneToMany); - if (result == null) - result = caseJavaEObject(javaOneToMany); - if (result == null) - result = caseIJavaAttributeMapping(javaOneToMany); - if (result == null) - result = caseIAttributeMapping(javaOneToMany); - if (result == null) - result = caseJpaEObject(javaOneToMany); - if (result == null) - result = caseIJpaSourceObject(javaOneToMany); - if (result == null) - result = caseIJpaEObject(javaOneToMany); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_MANY_TO_MANY : { - JavaManyToMany javaManyToMany = (JavaManyToMany) theEObject; - T result = caseJavaManyToMany(javaManyToMany); - if (result == null) - result = caseJavaMultiRelationshipMapping(javaManyToMany); - if (result == null) - result = caseIManyToMany(javaManyToMany); - if (result == null) - result = caseJavaRelationshipMapping(javaManyToMany); - if (result == null) - result = caseIMultiRelationshipMapping(javaManyToMany); - if (result == null) - result = caseJavaAttributeMapping(javaManyToMany); - if (result == null) - result = caseIRelationshipMapping(javaManyToMany); - if (result == null) - result = caseINonOwningMapping(javaManyToMany); - if (result == null) - result = caseJavaEObject(javaManyToMany); - if (result == null) - result = caseIJavaAttributeMapping(javaManyToMany); - if (result == null) - result = caseIAttributeMapping(javaManyToMany); - if (result == null) - result = caseJpaEObject(javaManyToMany); - if (result == null) - result = caseIJpaSourceObject(javaManyToMany); - if (result == null) - result = caseIJpaEObject(javaManyToMany); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_NULL_ATTRIBUTE_MAPPING : { - JavaNullAttributeMapping javaNullAttributeMapping = (JavaNullAttributeMapping) theEObject; - T result = caseJavaNullAttributeMapping(javaNullAttributeMapping); - if (result == null) - result = caseJavaAttributeMapping(javaNullAttributeMapping); - if (result == null) - result = caseJavaEObject(javaNullAttributeMapping); - if (result == null) - result = caseIJavaAttributeMapping(javaNullAttributeMapping); - if (result == null) - result = caseJpaEObject(javaNullAttributeMapping); - if (result == null) - result = caseIJpaSourceObject(javaNullAttributeMapping); - if (result == null) - result = caseIAttributeMapping(javaNullAttributeMapping); - if (result == null) - result = caseIJpaEObject(javaNullAttributeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE : { - AbstractJavaTable abstractJavaTable = (AbstractJavaTable) theEObject; - T result = caseAbstractJavaTable(abstractJavaTable); - if (result == null) - result = caseJavaEObject(abstractJavaTable); - if (result == null) - result = caseITable(abstractJavaTable); - if (result == null) - result = caseJpaEObject(abstractJavaTable); - if (result == null) - result = caseIJpaSourceObject(abstractJavaTable); - if (result == null) - result = caseIJpaEObject(abstractJavaTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_TABLE : { - JavaTable javaTable = (JavaTable) theEObject; - T result = caseJavaTable(javaTable); - if (result == null) - result = caseAbstractJavaTable(javaTable); - if (result == null) - result = caseJavaEObject(javaTable); - if (result == null) - result = caseITable(javaTable); - if (result == null) - result = caseJpaEObject(javaTable); - if (result == null) - result = caseIJpaSourceObject(javaTable); - if (result == null) - result = caseIJpaEObject(javaTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_SECONDARY_TABLE : { - JavaSecondaryTable javaSecondaryTable = (JavaSecondaryTable) theEObject; - T result = caseJavaSecondaryTable(javaSecondaryTable); - if (result == null) - result = caseAbstractJavaTable(javaSecondaryTable); - if (result == null) - result = caseISecondaryTable(javaSecondaryTable); - if (result == null) - result = caseJavaEObject(javaSecondaryTable); - if (result == null) - result = caseITable(javaSecondaryTable); - if (result == null) - result = caseJpaEObject(javaSecondaryTable); - if (result == null) - result = caseIJpaSourceObject(javaSecondaryTable); - if (result == null) - result = caseIJpaEObject(javaSecondaryTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_JOIN_TABLE : { - JavaJoinTable javaJoinTable = (JavaJoinTable) theEObject; - T result = caseJavaJoinTable(javaJoinTable); - if (result == null) - result = caseAbstractJavaTable(javaJoinTable); - if (result == null) - result = caseIJoinTable(javaJoinTable); - if (result == null) - result = caseJavaEObject(javaJoinTable); - if (result == null) - result = caseITable(javaJoinTable); - if (result == null) - result = caseJpaEObject(javaJoinTable); - if (result == null) - result = caseIJpaSourceObject(javaJoinTable); - if (result == null) - result = caseIJpaEObject(javaJoinTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_NAMED_COLUMN : { - JavaNamedColumn javaNamedColumn = (JavaNamedColumn) theEObject; - T result = caseJavaNamedColumn(javaNamedColumn); - if (result == null) - result = caseJavaEObject(javaNamedColumn); - if (result == null) - result = caseINamedColumn(javaNamedColumn); - if (result == null) - result = caseJpaEObject(javaNamedColumn); - if (result == null) - result = caseIJpaSourceObject(javaNamedColumn); - if (result == null) - result = caseIJpaEObject(javaNamedColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.ABSTRACT_JAVA_COLUMN : { - AbstractJavaColumn abstractJavaColumn = (AbstractJavaColumn) theEObject; - T result = caseAbstractJavaColumn(abstractJavaColumn); - if (result == null) - result = caseJavaNamedColumn(abstractJavaColumn); - if (result == null) - result = caseIAbstractColumn(abstractJavaColumn); - if (result == null) - result = caseJavaEObject(abstractJavaColumn); - if (result == null) - result = caseINamedColumn(abstractJavaColumn); - if (result == null) - result = caseJpaEObject(abstractJavaColumn); - if (result == null) - result = caseIJpaSourceObject(abstractJavaColumn); - if (result == null) - result = caseIJpaEObject(abstractJavaColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_COLUMN : { - JavaColumn javaColumn = (JavaColumn) theEObject; - T result = caseJavaColumn(javaColumn); - if (result == null) - result = caseAbstractJavaColumn(javaColumn); - if (result == null) - result = caseIColumn(javaColumn); - if (result == null) - result = caseJavaNamedColumn(javaColumn); - if (result == null) - result = caseIAbstractColumn(javaColumn); - if (result == null) - result = caseJavaEObject(javaColumn); - if (result == null) - result = caseINamedColumn(javaColumn); - if (result == null) - result = caseJpaEObject(javaColumn); - if (result == null) - result = caseIJpaSourceObject(javaColumn); - if (result == null) - result = caseIJpaEObject(javaColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_JOIN_COLUMN : { - JavaJoinColumn javaJoinColumn = (JavaJoinColumn) theEObject; - T result = caseJavaJoinColumn(javaJoinColumn); - if (result == null) - result = caseAbstractJavaColumn(javaJoinColumn); - if (result == null) - result = caseIJoinColumn(javaJoinColumn); - if (result == null) - result = caseJavaNamedColumn(javaJoinColumn); - if (result == null) - result = caseIAbstractColumn(javaJoinColumn); - if (result == null) - result = caseIAbstractJoinColumn(javaJoinColumn); - if (result == null) - result = caseJavaEObject(javaJoinColumn); - if (result == null) - result = caseINamedColumn(javaJoinColumn); - if (result == null) - result = caseJpaEObject(javaJoinColumn); - if (result == null) - result = caseIJpaSourceObject(javaJoinColumn); - if (result == null) - result = caseIJpaEObject(javaJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_OVERRIDE : { - JavaOverride javaOverride = (JavaOverride) theEObject; - T result = caseJavaOverride(javaOverride); - if (result == null) - result = caseJavaEObject(javaOverride); - if (result == null) - result = caseIOverride(javaOverride); - if (result == null) - result = caseJpaEObject(javaOverride); - if (result == null) - result = caseIJpaSourceObject(javaOverride); - if (result == null) - result = caseIJpaEObject(javaOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ATTRIBUTE_OVERRIDE : { - JavaAttributeOverride javaAttributeOverride = (JavaAttributeOverride) theEObject; - T result = caseJavaAttributeOverride(javaAttributeOverride); - if (result == null) - result = caseJavaOverride(javaAttributeOverride); - if (result == null) - result = caseIAttributeOverride(javaAttributeOverride); - if (result == null) - result = caseJavaEObject(javaAttributeOverride); - if (result == null) - result = caseIOverride(javaAttributeOverride); - if (result == null) - result = caseIColumnMapping(javaAttributeOverride); - if (result == null) - result = caseJpaEObject(javaAttributeOverride); - if (result == null) - result = caseIJpaSourceObject(javaAttributeOverride); - if (result == null) - result = caseIJpaEObject(javaAttributeOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ASSOCIATION_OVERRIDE : { - JavaAssociationOverride javaAssociationOverride = (JavaAssociationOverride) theEObject; - T result = caseJavaAssociationOverride(javaAssociationOverride); - if (result == null) - result = caseJavaOverride(javaAssociationOverride); - if (result == null) - result = caseIAssociationOverride(javaAssociationOverride); - if (result == null) - result = caseJavaEObject(javaAssociationOverride); - if (result == null) - result = caseIOverride(javaAssociationOverride); - if (result == null) - result = caseJpaEObject(javaAssociationOverride); - if (result == null) - result = caseIJpaSourceObject(javaAssociationOverride); - if (result == null) - result = caseIJpaEObject(javaAssociationOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN : { - JavaDiscriminatorColumn javaDiscriminatorColumn = (JavaDiscriminatorColumn) theEObject; - T result = caseJavaDiscriminatorColumn(javaDiscriminatorColumn); - if (result == null) - result = caseJavaNamedColumn(javaDiscriminatorColumn); - if (result == null) - result = caseIDiscriminatorColumn(javaDiscriminatorColumn); - if (result == null) - result = caseJavaEObject(javaDiscriminatorColumn); - if (result == null) - result = caseINamedColumn(javaDiscriminatorColumn); - if (result == null) - result = caseJpaEObject(javaDiscriminatorColumn); - if (result == null) - result = caseIJpaSourceObject(javaDiscriminatorColumn); - if (result == null) - result = caseIJpaEObject(javaDiscriminatorColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_PRIMARY_KEY_JOIN_COLUMN : { - JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn = (JavaPrimaryKeyJoinColumn) theEObject; - T result = caseJavaPrimaryKeyJoinColumn(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseJavaNamedColumn(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseIPrimaryKeyJoinColumn(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseJavaEObject(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseINamedColumn(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseIAbstractJoinColumn(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseJpaEObject(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseIJpaSourceObject(javaPrimaryKeyJoinColumn); - if (result == null) - result = caseIJpaEObject(javaPrimaryKeyJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_GENERATED_VALUE : { - JavaGeneratedValue javaGeneratedValue = (JavaGeneratedValue) theEObject; - T result = caseJavaGeneratedValue(javaGeneratedValue); - if (result == null) - result = caseJavaEObject(javaGeneratedValue); - if (result == null) - result = caseIGeneratedValue(javaGeneratedValue); - if (result == null) - result = caseJpaEObject(javaGeneratedValue); - if (result == null) - result = caseIJpaSourceObject(javaGeneratedValue); - if (result == null) - result = caseIJpaEObject(javaGeneratedValue); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_GENERATOR : { - JavaGenerator javaGenerator = (JavaGenerator) theEObject; - T result = caseJavaGenerator(javaGenerator); - if (result == null) - result = caseJavaEObject(javaGenerator); - if (result == null) - result = caseIGenerator(javaGenerator); - if (result == null) - result = caseJpaEObject(javaGenerator); - if (result == null) - result = caseIJpaSourceObject(javaGenerator); - if (result == null) - result = caseIJpaEObject(javaGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR : { - JavaTableGenerator javaTableGenerator = (JavaTableGenerator) theEObject; - T result = caseJavaTableGenerator(javaTableGenerator); - if (result == null) - result = caseJavaGenerator(javaTableGenerator); - if (result == null) - result = caseITableGenerator(javaTableGenerator); - if (result == null) - result = caseJavaEObject(javaTableGenerator); - if (result == null) - result = caseIGenerator(javaTableGenerator); - if (result == null) - result = caseJpaEObject(javaTableGenerator); - if (result == null) - result = caseIJpaSourceObject(javaTableGenerator); - if (result == null) - result = caseIJpaEObject(javaTableGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR : { - JavaSequenceGenerator javaSequenceGenerator = (JavaSequenceGenerator) theEObject; - T result = caseJavaSequenceGenerator(javaSequenceGenerator); - if (result == null) - result = caseJavaGenerator(javaSequenceGenerator); - if (result == null) - result = caseISequenceGenerator(javaSequenceGenerator); - if (result == null) - result = caseJavaEObject(javaSequenceGenerator); - if (result == null) - result = caseIGenerator(javaSequenceGenerator); - if (result == null) - result = caseJpaEObject(javaSequenceGenerator); - if (result == null) - result = caseIJpaSourceObject(javaSequenceGenerator); - if (result == null) - result = caseIJpaEObject(javaSequenceGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY : { - JavaAbstractQuery javaAbstractQuery = (JavaAbstractQuery) theEObject; - T result = caseJavaAbstractQuery(javaAbstractQuery); - if (result == null) - result = caseJavaEObject(javaAbstractQuery); - if (result == null) - result = caseIQuery(javaAbstractQuery); - if (result == null) - result = caseJpaEObject(javaAbstractQuery); - if (result == null) - result = caseIJpaSourceObject(javaAbstractQuery); - if (result == null) - result = caseIJpaEObject(javaAbstractQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_NAMED_QUERY : { - JavaNamedQuery javaNamedQuery = (JavaNamedQuery) theEObject; - T result = caseJavaNamedQuery(javaNamedQuery); - if (result == null) - result = caseJavaAbstractQuery(javaNamedQuery); - if (result == null) - result = caseINamedQuery(javaNamedQuery); - if (result == null) - result = caseJavaEObject(javaNamedQuery); - if (result == null) - result = caseIQuery(javaNamedQuery); - if (result == null) - result = caseIJpaSourceObject(javaNamedQuery); - if (result == null) - result = caseJpaEObject(javaNamedQuery); - if (result == null) - result = caseIJpaEObject(javaNamedQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY : { - JavaNamedNativeQuery javaNamedNativeQuery = (JavaNamedNativeQuery) theEObject; - T result = caseJavaNamedNativeQuery(javaNamedNativeQuery); - if (result == null) - result = caseJavaAbstractQuery(javaNamedNativeQuery); - if (result == null) - result = caseINamedNativeQuery(javaNamedNativeQuery); - if (result == null) - result = caseJavaEObject(javaNamedNativeQuery); - if (result == null) - result = caseIQuery(javaNamedNativeQuery); - if (result == null) - result = caseIJpaSourceObject(javaNamedNativeQuery); - if (result == null) - result = caseJpaEObject(javaNamedNativeQuery); - if (result == null) - result = caseIJpaEObject(javaNamedNativeQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_QUERY_HINT : { - JavaQueryHint javaQueryHint = (JavaQueryHint) theEObject; - T result = caseJavaQueryHint(javaQueryHint); - if (result == null) - result = caseJavaEObject(javaQueryHint); - if (result == null) - result = caseIQueryHint(javaQueryHint); - if (result == null) - result = caseJpaEObject(javaQueryHint); - if (result == null) - result = caseIJpaSourceObject(javaQueryHint); - if (result == null) - result = caseIJpaEObject(javaQueryHint); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT : { - JavaUniqueConstraint javaUniqueConstraint = (JavaUniqueConstraint) theEObject; - T result = caseJavaUniqueConstraint(javaUniqueConstraint); - if (result == null) - result = caseJavaEObject(javaUniqueConstraint); - if (result == null) - result = caseIUniqueConstraint(javaUniqueConstraint); - if (result == null) - result = caseJpaEObject(javaUniqueConstraint); - if (result == null) - result = caseIJpaSourceObject(javaUniqueConstraint); - if (result == null) - result = caseIJpaEObject(javaUniqueConstraint); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaMappingsPackage.JAVA_CASCADE : { - JavaCascade javaCascade = (JavaCascade) theEObject; - T result = caseJavaCascade(javaCascade); - if (result == null) - result = caseJavaEObject(javaCascade); - if (result == null) - result = caseICascade(javaCascade); - if (result == null) - result = caseJpaEObject(javaCascade); - if (result == null) - result = caseIJpaSourceObject(javaCascade); - if (result == null) - result = caseIJpaEObject(javaCascade); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Entity'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Entity'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaEntity(JavaEntity object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Mapped Superclass'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Mapped Superclass'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaMappedSuperclass(JavaMappedSuperclass object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Embeddable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Embeddable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaEmbeddable(JavaEmbeddable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Null Type Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Null Type Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaNullTypeMapping(JavaNullTypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Null Attribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Null Attribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaNullAttributeMapping(JavaNullAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Basic'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Basic'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaBasic(JavaBasic object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaId(JavaId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Transient'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Transient'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaTransient(JavaTransient object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Version'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Version'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaVersion(JavaVersion object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Embedded Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Embedded Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaEmbeddedId(JavaEmbeddedId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Embedded'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Embedded'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaEmbedded(JavaEmbedded object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Attribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Attribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaAttributeMapping(JavaAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Type Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Type Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaTypeMapping(JavaTypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Abstract Java Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Abstract Java Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAbstractJavaTable(AbstractJavaTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaTable(JavaTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaColumn(JavaColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaRelationshipMapping(JavaRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Single Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Single Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaSingleRelationshipMapping(JavaSingleRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java One To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java One To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaOneToMany(JavaOneToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Many To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Many To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaManyToMany(JavaManyToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Join Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Join Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaJoinTable(JavaJoinTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Named Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Named Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaNamedColumn(JavaNamedColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Abstract Java Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Abstract Java Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAbstractJavaColumn(AbstractJavaColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaJoinColumn(JavaJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaOverride(JavaOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Attribute Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Attribute Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaAttributeOverride(JavaAttributeOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Association Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Association Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaAssociationOverride(JavaAssociationOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Discriminator Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Discriminator Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaDiscriminatorColumn(JavaDiscriminatorColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Primary Key Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Primary Key Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Generated Value'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Generated Value'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaGeneratedValue(JavaGeneratedValue object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaGenerator(JavaGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Table Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Table Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaTableGenerator(JavaTableGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Sequence Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Sequence Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaSequenceGenerator(JavaSequenceGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Abstract Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Abstract Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaAbstractQuery(JavaAbstractQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Named Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Named Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaNamedQuery(JavaNamedQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Named Native Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Named Native Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaNamedNativeQuery(JavaNamedNativeQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Query Hint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Query Hint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaQueryHint(JavaQueryHint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Unique Constraint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Unique Constraint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaUniqueConstraint(JavaUniqueConstraint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Cascade'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Cascade'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaCascade(JavaCascade object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Secondary Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Secondary Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaSecondaryTable(JavaSecondaryTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaEObject(IJpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaEObject(JpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Source Object'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Source Object'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaSourceObject(IJpaSourceObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaEObject(JavaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Many To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Many To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaManyToOne(JavaManyToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java One To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java One To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaOneToOne(JavaOneToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Multi Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Multi Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaMultiRelationshipMapping(JavaMultiRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IType Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IType Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITypeMapping(ITypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJava Type Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJava Type Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJavaTypeMapping(IJavaTypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEntity'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEntity'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEntity(IEntity object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMapped Superclass'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMapped Superclass'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIMappedSuperclass(IMappedSuperclass object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbeddable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbeddable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbeddable(IEmbeddable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeMapping(IAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJava Attribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJava Attribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJavaAttributeMapping(IJavaAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IColumn Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IColumn Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIColumnMapping(IColumnMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IBasic'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IBasic'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIBasic(IBasic object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IId'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IId'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIId(IId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITransient'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITransient'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITransient(ITransient object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IVersion'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IVersion'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIVersion(IVersion object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbedded Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbedded Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbeddedId(IEmbeddedId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbedded'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbedded'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbedded(IEmbedded object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITable(ITable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IColumn'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IColumn'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIColumn(IColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAbstract Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAbstract Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAbstractJoinColumn(IAbstractJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IRelationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IRelationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIRelationshipMapping(IRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMulti Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMulti Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIMultiRelationshipMapping(IMultiRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOne To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOne To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOneToMany(IOneToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMany To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMany To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIManyToMany(IManyToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJoin Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJoin Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJoinTable(IJoinTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedColumn(INamedColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAbstract Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAbstract Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAbstractColumn(IAbstractColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJoin Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJoin Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJoinColumn(IJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOverride'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOverride'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOverride(IOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeOverride(IAttributeOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAssociation Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAssociation Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAssociationOverride(IAssociationOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IDiscriminator Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IDiscriminator Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIDiscriminatorColumn(IDiscriminatorColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPrimary Key Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPrimary Key Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPrimaryKeyJoinColumn(IPrimaryKeyJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IGenerated Value'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IGenerated Value'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIGeneratedValue(IGeneratedValue object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IGenerator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IGenerator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIGenerator(IGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITable Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITable Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITableGenerator(ITableGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISequence Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISequence Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISequenceGenerator(ISequenceGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IQuery'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IQuery'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIQuery(IQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedQuery(INamedQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Native Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Native Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedNativeQuery(INamedNativeQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IQuery Hint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IQuery Hint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIQueryHint(IQueryHint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IUnique Constraint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IUnique Constraint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIUniqueConstraint(IUniqueConstraint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ICascade'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ICascade'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseICascade(ICascade object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISecondary Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISecondary Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISecondaryTable(ISecondaryTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISingle Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISingle Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISingleRelationshipMapping(ISingleRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMany To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMany To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIManyToOne(IManyToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOne To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOne To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOneToOne(IOneToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INon Owning Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INon Owning Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINonOwningMapping(INonOwningMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } -} //JavaMappingsSwitch diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaAdapterFactory.java deleted file mode 100644 index 967ddb80f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaAdapterFactory.java +++ /dev/null @@ -1,404 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage - * @generated - */ -public class JpaJavaAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static JpaJavaPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public JpaJavaAdapterFactory() { - if (modelPackage == null) { - modelPackage = JpaJavaPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the createXXX methods. - * - * - * @generated - */ - protected JpaJavaSwitch modelSwitch = new JpaJavaSwitch() { - @Override - public Adapter caseJavaEObject(JavaEObject object) { - return createJavaEObjectAdapter(); - } - - @Override - public Adapter caseJpaCompilationUnit(JpaCompilationUnit object) { - return createJpaCompilationUnitAdapter(); - } - - @Override - public Adapter caseJavaPersistentType(JavaPersistentType object) { - return createJavaPersistentTypeAdapter(); - } - - @Override - public Adapter caseJavaPersistentAttribute(JavaPersistentAttribute object) { - return createJavaPersistentAttributeAdapter(); - } - - @Override - public Adapter caseIJavaTypeMapping(IJavaTypeMapping object) { - return createIJavaTypeMappingAdapter(); - } - - @Override - public Adapter caseIJavaAttributeMapping(IJavaAttributeMapping object) { - return createIJavaAttributeMappingAdapter(); - } - - @Override - public Adapter caseIJpaEObject(IJpaEObject object) { - return createIJpaEObjectAdapter(); - } - - @Override - public Adapter caseJpaEObject(JpaEObject object) { - return createJpaEObjectAdapter(); - } - - @Override - public Adapter caseIJpaSourceObject(IJpaSourceObject object) { - return createIJpaSourceObjectAdapter(); - } - - @Override - public Adapter caseIJpaContentNode(IJpaContentNode object) { - return createIJpaContentNodeAdapter(); - } - - @Override - public Adapter caseIJpaRootContentNode(IJpaRootContentNode object) { - return createIJpaRootContentNodeAdapter(); - } - - @Override - public Adapter caseIPersistentType(IPersistentType object) { - return createIPersistentTypeAdapter(); - } - - @Override - public Adapter caseIPersistentAttribute(IPersistentAttribute object) { - return createIPersistentAttributeAdapter(); - } - - @Override - public Adapter caseITypeMapping(ITypeMapping object) { - return createITypeMappingAdapter(); - } - - @Override - public Adapter caseIAttributeMapping(IAttributeMapping object) { - return createIAttributeMappingAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping IJava Attribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping - * @generated - */ - public Adapter createIJavaAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping IJava Type Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping - * @generated - */ - public Adapter createIJavaTypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject Java EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.JavaEObject - * @generated - */ - public Adapter createJavaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit Jpa Compilation Unit}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit - * @generated - */ - public Adapter createJpaCompilationUnitAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentType Java Persistent Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentType - * @generated - */ - public Adapter createJavaPersistentTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute Java Persistent Attribute}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute - * @generated - */ - public Adapter createJavaPersistentAttributeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public Adapter createIJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public Adapter createIJpaSourceObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @generated - */ - public Adapter createIJpaContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @generated - */ - public Adapter createIJpaRootContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IPersistentType IPersistent Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IPersistentType - * @generated - */ - public Adapter createIPersistentTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IPersistentAttribute IPersistent Attribute}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IPersistentAttribute - * @generated - */ - public Adapter createIPersistentAttributeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @generated - */ - public Adapter createIAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @generated - */ - public Adapter createITypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaEObject - * @generated - */ - public Adapter createJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } -} //JpaCoreJavaAdapterFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaSwitch.java deleted file mode 100644 index 15d65257a7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaSwitch.java +++ /dev/null @@ -1,444 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.java.util; - -import java.util.List; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage - * @generated - */ -public class JpaJavaSwitch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static JpaJavaPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public JpaJavaSwitch() { - if (modelPackage == null) { - modelPackage = JpaJavaPackage.eINSTANCE; - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List eSuperTypes = theEClass.getESuperTypes(); - return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case JpaJavaPackage.JAVA_EOBJECT : { - JavaEObject javaEObject = (JavaEObject) theEObject; - T result = caseJavaEObject(javaEObject); - if (result == null) - result = caseJpaEObject(javaEObject); - if (result == null) - result = caseIJpaSourceObject(javaEObject); - if (result == null) - result = caseIJpaEObject(javaEObject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaPackage.JPA_COMPILATION_UNIT : { - JpaCompilationUnit jpaCompilationUnit = (JpaCompilationUnit) theEObject; - T result = caseJpaCompilationUnit(jpaCompilationUnit); - if (result == null) - result = caseJavaEObject(jpaCompilationUnit); - if (result == null) - result = caseIJpaRootContentNode(jpaCompilationUnit); - if (result == null) - result = caseJpaEObject(jpaCompilationUnit); - if (result == null) - result = caseIJpaSourceObject(jpaCompilationUnit); - if (result == null) - result = caseIJpaContentNode(jpaCompilationUnit); - if (result == null) - result = caseIJpaEObject(jpaCompilationUnit); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaPackage.JAVA_PERSISTENT_TYPE : { - JavaPersistentType javaPersistentType = (JavaPersistentType) theEObject; - T result = caseJavaPersistentType(javaPersistentType); - if (result == null) - result = caseJavaEObject(javaPersistentType); - if (result == null) - result = caseIPersistentType(javaPersistentType); - if (result == null) - result = caseJpaEObject(javaPersistentType); - if (result == null) - result = caseIJpaSourceObject(javaPersistentType); - if (result == null) - result = caseIJpaContentNode(javaPersistentType); - if (result == null) - result = caseIJpaEObject(javaPersistentType); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE : { - JavaPersistentAttribute javaPersistentAttribute = (JavaPersistentAttribute) theEObject; - T result = caseJavaPersistentAttribute(javaPersistentAttribute); - if (result == null) - result = caseJavaEObject(javaPersistentAttribute); - if (result == null) - result = caseIPersistentAttribute(javaPersistentAttribute); - if (result == null) - result = caseJpaEObject(javaPersistentAttribute); - if (result == null) - result = caseIJpaSourceObject(javaPersistentAttribute); - if (result == null) - result = caseIJpaContentNode(javaPersistentAttribute); - if (result == null) - result = caseIJpaEObject(javaPersistentAttribute); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaPackage.IJAVA_TYPE_MAPPING : { - IJavaTypeMapping iJavaTypeMapping = (IJavaTypeMapping) theEObject; - T result = caseIJavaTypeMapping(iJavaTypeMapping); - if (result == null) - result = caseITypeMapping(iJavaTypeMapping); - if (result == null) - result = caseIJpaSourceObject(iJavaTypeMapping); - if (result == null) - result = caseIJpaEObject(iJavaTypeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaJavaPackage.IJAVA_ATTRIBUTE_MAPPING : { - IJavaAttributeMapping iJavaAttributeMapping = (IJavaAttributeMapping) theEObject; - T result = caseIJavaAttributeMapping(iJavaAttributeMapping); - if (result == null) - result = caseIAttributeMapping(iJavaAttributeMapping); - if (result == null) - result = caseIJpaSourceObject(iJavaAttributeMapping); - if (result == null) - result = caseIJpaEObject(iJavaAttributeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpretting the object as an instance of 'IJava Attribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJava Attribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJavaAttributeMapping(IJavaAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJava Type Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJava Type Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJavaTypeMapping(IJavaTypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaEObject(JavaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa Compilation Unit'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa Compilation Unit'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaCompilationUnit(JpaCompilationUnit object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Persistent Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Persistent Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaPersistentType(JavaPersistentType object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Persistent Attribute'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Persistent Attribute'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaPersistentAttribute(JavaPersistentAttribute object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaEObject(IJpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Source Object'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Source Object'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaSourceObject(IJpaSourceObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaContentNode(IJpaContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaRootContentNode(IJpaRootContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPersistent Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPersistent Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPersistentType(IPersistentType object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPersistent Attribute'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPersistent Attribute'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPersistentAttribute(IPersistentAttribute object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeMapping(IAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IType Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IType Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITypeMapping(ITypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaEObject(JpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } -} //JpaCoreJavaSwitch diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlColumn.java deleted file mode 100644 index 1fa12e5041..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlColumn.java +++ /dev/null @@ -1,921 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Set; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Abstract Xml Column'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUniqueForXml Unique For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getNullableForXml Nullable For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getInsertableForXml Insertable For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUpdatableForXml Updatable For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getSpecifiedTableForXml Specified Table For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class AbstractXmlColumn extends AbstractXmlNamedColumn - implements IAbstractColumn -{ - /** - * The default value of the '{@link #getUnique() Unique}' attribute. - * - * - * @see #getUnique() - * @generated - * @ordered - */ - protected static final DefaultFalseBoolean UNIQUE_EDEFAULT = DefaultFalseBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getUnique() Unique}' attribute. - * - * - * @see #getUnique() - * @generated - * @ordered - */ - protected DefaultFalseBoolean unique = UNIQUE_EDEFAULT; - - /** - * The default value of the '{@link #getNullable() Nullable}' attribute. - * - * - * @see #getNullable() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean NULLABLE_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getNullable() Nullable}' attribute. - * - * - * @see #getNullable() - * @generated - * @ordered - */ - protected DefaultTrueBoolean nullable = NULLABLE_EDEFAULT; - - /** - * The default value of the '{@link #getInsertable() Insertable}' attribute. - * - * - * @see #getInsertable() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean INSERTABLE_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getInsertable() Insertable}' attribute. - * - * - * @see #getInsertable() - * @generated - * @ordered - */ - protected DefaultTrueBoolean insertable = INSERTABLE_EDEFAULT; - - /** - * The default value of the '{@link #getUpdatable() Updatable}' attribute. - * - * - * @see #getUpdatable() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean UPDATABLE_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getUpdatable() Updatable}' attribute. - * - * - * @see #getUpdatable() - * @generated - * @ordered - */ - protected DefaultTrueBoolean updatable = UPDATABLE_EDEFAULT; - - /** - * The default value of the '{@link #getTable() Table}' attribute. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected static final String TABLE_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected String specifiedTable = SPECIFIED_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected static final String DEFAULT_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected String defaultTable = DEFAULT_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getUniqueForXml() Unique For Xml}' attribute. - * - * - * @see #getUniqueForXml() - * @generated - * @ordered - */ - protected static final DefaultFalseBoolean UNIQUE_FOR_XML_EDEFAULT = DefaultFalseBoolean.DEFAULT; - - /** - * The default value of the '{@link #getNullableForXml() Nullable For Xml}' attribute. - * - * - * @see #getNullableForXml() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean NULLABLE_FOR_XML_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The default value of the '{@link #getInsertableForXml() Insertable For Xml}' attribute. - * - * - * @see #getInsertableForXml() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean INSERTABLE_FOR_XML_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The default value of the '{@link #getUpdatableForXml() Updatable For Xml}' attribute. - * - * - * @see #getUpdatableForXml() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean UPDATABLE_FOR_XML_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The default value of the '{@link #getSpecifiedTableForXml() Specified Table For Xml}' attribute. - * - * - * @see #getSpecifiedTableForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TABLE_FOR_XML_EDEFAULT = null; - - protected AbstractXmlColumn() { - throw new UnsupportedOperationException("Use AbstractXmlColumn(IColumn.Owner) instead."); - } - - protected AbstractXmlColumn(INamedColumn.Owner owner) { - super(owner); - } - - @Override - protected void addInsignificantXmlFeatureIdsTo(Set insignificantXmlFeatureIds) { - super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.ABSTRACT_XML_COLUMN; - } - - /** - * Returns the value of the 'Unique' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean}. - * - *

- * If the meaning of the 'Unique' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Unique' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #setUnique(DefaultFalseBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_Unique() - * @model - * @generated - */ - public DefaultFalseBoolean getUnique() { - return unique; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUnique Unique}' attribute. - * - * - * @param value the new value of the 'Unique' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #getUnique() - * @generated - */ - public void setUniqueGen(DefaultFalseBoolean newUnique) { - DefaultFalseBoolean oldUnique = unique; - unique = newUnique == null ? UNIQUE_EDEFAULT : newUnique; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE, oldUnique, unique)); - } - - /** - * Returns the value of the 'Nullable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Nullable' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Nullable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setNullable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_Nullable() - * @model - * @generated - */ - public DefaultTrueBoolean getNullable() { - return nullable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getNullable Nullable}' attribute. - * - * - * @param value the new value of the 'Nullable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getNullable() - * @generated - */ - public void setNullableGen(DefaultTrueBoolean newNullable) { - DefaultTrueBoolean oldNullable = nullable; - nullable = newNullable == null ? NULLABLE_EDEFAULT : newNullable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE, oldNullable, nullable)); - } - - /** - * Returns the value of the 'Insertable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Insertable' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Insertable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setInsertable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_Insertable() - * @model - * @generated - */ - public DefaultTrueBoolean getInsertable() { - return insertable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getInsertable Insertable}' attribute. - * - * - * @param value the new value of the 'Insertable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getInsertable() - * @generated - */ - public void setInsertableGen(DefaultTrueBoolean newInsertable) { - DefaultTrueBoolean oldInsertable = insertable; - insertable = newInsertable == null ? INSERTABLE_EDEFAULT : newInsertable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE, oldInsertable, insertable)); - } - - /** - * Returns the value of the 'Updatable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Updatable' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Updatable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setUpdatable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_Updatable() - * @model - * @generated - */ - public DefaultTrueBoolean getUpdatable() { - return updatable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUpdatable Updatable}' attribute. - * - * - * @param value the new value of the 'Updatable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getUpdatable() - * @generated - */ - public void setUpdatableGen(DefaultTrueBoolean newUpdatable) { - DefaultTrueBoolean oldUpdatable = updatable; - updatable = newUpdatable == null ? UPDATABLE_EDEFAULT : newUpdatable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE, oldUpdatable, updatable)); - } - - /** - * Returns the value of the 'Table' attribute. - * - *

- * If the meaning of the 'Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_Table() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getTable() { - return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable(); - } - - /** - * Returns the value of the 'Specified Table' attribute. - * - *

- * If the meaning of the 'Specified Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Table' attribute. - * @see #setSpecifiedTable(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_SpecifiedTable() - * @model - * @generated - */ - public String getSpecifiedTable() { - return specifiedTable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getSpecifiedTable Specified Table}' attribute. - * - * - * @param value the new value of the 'Specified Table' attribute. - * @see #getSpecifiedTable() - * @generated - */ - public void setSpecifiedTableGen(String newSpecifiedTable) { - String oldSpecifiedTable = specifiedTable; - specifiedTable = newSpecifiedTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE, oldSpecifiedTable, specifiedTable)); - } - - /** - * Returns the value of the 'Default Table' attribute. - * - *

- * If the meaning of the 'Default Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Table' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractColumn_DefaultTable() - * @model changeable="false" - * @generated - */ - public String getDefaultTable() { - return defaultTable; - } - - protected void setDefaultTable(String newDefaultTable) { - String oldDefaultTable = this.defaultTable; - this.defaultTable = newDefaultTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__DEFAULT_TABLE, oldDefaultTable, this.defaultTable)); - } - - /** - * Returns the value of the 'Unique For Xml' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean}. - * - *

- * If the meaning of the 'Unique For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Unique For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #setUniqueForXml(DefaultFalseBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn_UniqueForXml() - * @model volatile="true" - * @generated NOT - */ - public DefaultFalseBoolean getUniqueForXml() { - return getUnique(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUniqueForXml Unique For Xml}' attribute. - * - * - * @param value the new value of the 'Unique For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #getUniqueForXml() - * @generated NOT - */ - public void setUniqueForXml(DefaultFalseBoolean newUniqueForXml) { - setUniqueGen(newUniqueForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML, null, newUniqueForXml)); - } - - /** - * Returns the value of the 'Nullable For Xml' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Nullable For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Nullable For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setNullableForXml(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn_NullableForXml() - * @model volatile="true" - * @generated NOT - */ - public DefaultTrueBoolean getNullableForXml() { - return getNullable(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getNullableForXml Nullable For Xml}' attribute. - * - * - * @param value the new value of the 'Nullable For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getNullableForXml() - * @generated NOT - */ - public void setNullableForXml(DefaultTrueBoolean newNullableForXml) { - setNullableGen(newNullableForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML, null, newNullableForXml)); - } - - /** - * Returns the value of the 'Insertable For Xml' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Insertable For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Insertable For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setInsertableForXml(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn_InsertableForXml() - * @model volatile="true" - * @generated NOT - */ - public DefaultTrueBoolean getInsertableForXml() { - return getInsertable(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getInsertableForXml Insertable For Xml}' attribute. - * - * - * @param value the new value of the 'Insertable For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getInsertableForXml() - * @generated NOT - */ - public void setInsertableForXml(DefaultTrueBoolean newInsertableForXml) { - setInsertableGen(newInsertableForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML, null, newInsertableForXml)); - } - - /** - * Returns the value of the 'Updatable For Xml' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

- * If the meaning of the 'Updatable For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Updatable For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setUpdatableForXml(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn_UpdatableForXml() - * @model volatile="true" - * @generated NOT - */ - public DefaultTrueBoolean getUpdatableForXml() { - return getUpdatable(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUpdatableForXml Updatable For Xml}' attribute. - * - * - * @param value the new value of the 'Updatable For Xml' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getUpdatableForXml() - * @generated NOT - */ - public void setUpdatableForXml(DefaultTrueBoolean newUpdatableForXml) { - setUpdatableGen(newUpdatableForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML, null, newUpdatableForXml)); - } - - /** - * Returns the value of the 'Column Definition For Xml' attribute. - * - *

- * If the meaning of the 'Column Definition For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Definition For Xml' attribute. - * @see #setColumnDefinitionForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn_ColumnDefinitionForXml() - * @model volatile="true" - * @generated NOT - */ - public String getColumnDefinitionForXml() { - return getColumnDefinition(); - } - - /** - * Returns the value of the 'Specified Table For Xml' attribute. - * - *

- * If the meaning of the 'Specified Table For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Table For Xml' attribute. - * @see #setSpecifiedTableForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn_SpecifiedTableForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSpecifiedTableForXml() { - return getSpecifiedTable(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getSpecifiedTableForXml Specified Table For Xml}' attribute. - * - * - * @param value the new value of the 'Specified Table For Xml' attribute. - * @see #getSpecifiedTableForXml() - * @generated NOT - */ - public void setSpecifiedTableForXml(String newSpecifiedTableForXml) { - setSpecifiedTableGen(newSpecifiedTableForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SPECIFIED_TABLE_FOR_XML, newSpecifiedTableForXml + " ", newSpecifiedTableForXml)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE : - return getUnique(); - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE : - return getNullable(); - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE : - return getInsertable(); - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE : - return getUpdatable(); - case OrmPackage.ABSTRACT_XML_COLUMN__TABLE : - return getTable(); - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE : - return getSpecifiedTable(); - case OrmPackage.ABSTRACT_XML_COLUMN__DEFAULT_TABLE : - return getDefaultTable(); - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML : - return getUniqueForXml(); - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML : - return getNullableForXml(); - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML : - return getInsertableForXml(); - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML : - return getUpdatableForXml(); - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML : - return getSpecifiedTableForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE : - setUnique((DefaultFalseBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE : - setNullable((DefaultTrueBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE : - setInsertable((DefaultTrueBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE : - setUpdatable((DefaultTrueBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE : - setSpecifiedTable((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML : - setUniqueForXml((DefaultFalseBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML : - setNullableForXml((DefaultTrueBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML : - setInsertableForXml((DefaultTrueBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML : - setUpdatableForXml((DefaultTrueBoolean) newValue); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML : - setSpecifiedTableForXml((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE : - setUnique(UNIQUE_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE : - setNullable(NULLABLE_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE : - setInsertable(INSERTABLE_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE : - setUpdatable(UPDATABLE_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE : - setSpecifiedTable(SPECIFIED_TABLE_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML : - setUniqueForXml(UNIQUE_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML : - setNullableForXml(NULLABLE_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML : - setInsertableForXml(INSERTABLE_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML : - setUpdatableForXml(UPDATABLE_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML : - setSpecifiedTableForXml(SPECIFIED_TABLE_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE : - return unique != UNIQUE_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE : - return nullable != NULLABLE_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE : - return insertable != INSERTABLE_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE : - return updatable != UPDATABLE_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__TABLE : - return TABLE_EDEFAULT == null ? getTable() != null : !TABLE_EDEFAULT.equals(getTable()); - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE : - return SPECIFIED_TABLE_EDEFAULT == null ? specifiedTable != null : !SPECIFIED_TABLE_EDEFAULT.equals(specifiedTable); - case OrmPackage.ABSTRACT_XML_COLUMN__DEFAULT_TABLE : - return DEFAULT_TABLE_EDEFAULT == null ? defaultTable != null : !DEFAULT_TABLE_EDEFAULT.equals(defaultTable); - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML : - return getUniqueForXml() != UNIQUE_FOR_XML_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML : - return getNullableForXml() != NULLABLE_FOR_XML_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML : - return getInsertableForXml() != INSERTABLE_FOR_XML_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML : - return getUpdatableForXml() != UPDATABLE_FOR_XML_EDEFAULT; - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML : - return SPECIFIED_TABLE_FOR_XML_EDEFAULT == null ? getSpecifiedTableForXml() != null : !SPECIFIED_TABLE_FOR_XML_EDEFAULT.equals(getSpecifiedTableForXml()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAbstractColumn.class) { - switch (derivedFeatureID) { - case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__UNIQUE; - case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__NULLABLE; - case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__INSERTABLE; - case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__UPDATABLE; - case OrmPackage.ABSTRACT_XML_COLUMN__TABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE; - case OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE; - case OrmPackage.ABSTRACT_XML_COLUMN__DEFAULT_TABLE : - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAbstractColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__UNIQUE : - return OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__NULLABLE : - return OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__INSERTABLE : - return OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__UPDATABLE : - return OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE : - return OrmPackage.ABSTRACT_XML_COLUMN__TABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE : - return OrmPackage.ABSTRACT_XML_COLUMN__SPECIFIED_TABLE; - case JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE : - return OrmPackage.ABSTRACT_XML_COLUMN__DEFAULT_TABLE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (unique: "); - result.append(unique); - result.append(", nullable: "); - result.append(nullable); - result.append(", insertable: "); - result.append(insertable); - result.append(", updatable: "); - result.append(updatable); - result.append(", specifiedTable: "); - result.append(specifiedTable); - result.append(", defaultTable: "); - result.append(defaultTable); - result.append(')'); - return result.toString(); - } - - @Override - protected String tableName() { - return this.getTable(); - } - - public ITextRange tableTextRange() { - if (node == null) { - return owner.validationTextRange(); - } - IDOMNode tableNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.ENTITY__TABLE); - return (tableNode == null) ? validationTextRange() : buildTextRange(tableNode); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java deleted file mode 100644 index aedb293ea0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java +++ /dev/null @@ -1,476 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Set; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Abstract Xml Named Column'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getSpecifiedNameForXml Specified Name For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getColumnDefinitionForXml Column Definition For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlNamedColumn() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class AbstractXmlNamedColumn extends XmlEObject - implements INamedColumn -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected String specifiedName = SPECIFIED_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected static final String DEFAULT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected String defaultName = DEFAULT_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getColumnDefinition() Column Definition}' attribute. - * - * - * @see #getColumnDefinition() - * @generated - * @ordered - */ - protected static final String COLUMN_DEFINITION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnDefinition() Column Definition}' attribute. - * - * - * @see #getColumnDefinition() - * @generated - * @ordered - */ - protected String columnDefinition = COLUMN_DEFINITION_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedNameForXml() Specified Name For Xml}' attribute. - * - * - * @see #getSpecifiedNameForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_FOR_XML_EDEFAULT = null; - - /** - * The default value of the '{@link #getColumnDefinitionForXml() Column Definition For Xml}' attribute. - * - * - * @see #getColumnDefinitionForXml() - * @generated - * @ordered - */ - protected static final String COLUMN_DEFINITION_FOR_XML_EDEFAULT = null; - - protected final INamedColumn.Owner owner; - - protected AbstractXmlNamedColumn() { - throw new UnsupportedOperationException("Use AbstractXmlNamedColumn(INamedColumn.Owner) instead."); - } - - protected AbstractXmlNamedColumn(INamedColumn.Owner owner) { - super(); - this.owner = owner; - } - - @Override - protected void addInsignificantXmlFeatureIdsTo(Set insignificantXmlFeatureIds) { - super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.INAMED_COLUMN__NAME); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.ABSTRACT_XML_NAMED_COLUMN; - } - - public String getName() { - return (this.specifiedName != null) ? this.specifiedName : this.defaultName; - } - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

- * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINamedColumn_SpecifiedName() - * @model - * @generated - */ - public String getSpecifiedName() { - return specifiedName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - public void setSpecifiedNameGen(String newSpecifiedName) { - String oldSpecifiedName = specifiedName; - specifiedName = newSpecifiedName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); - } - - /** - * Returns the value of the 'Default Name' attribute. - * - *

- * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINamedColumn_DefaultName() - * @model changeable="false" - * @generated - */ - public String getDefaultName() { - return defaultName; - } - - protected void setDefaultName(String newDefaultName) { - String oldDefaultName = this.defaultName; - this.defaultName = newDefaultName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__DEFAULT_NAME, oldDefaultName, this.defaultName)); - } - - /** - * Returns the value of the 'Column Definition' attribute. - * - *

- * If the meaning of the 'Column Definition' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Definition' attribute. - * @see #setColumnDefinition(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINamedColumn_ColumnDefinition() - * @model - * @generated - */ - public String getColumnDefinition() { - return columnDefinition; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getColumnDefinition Column Definition}' attribute. - * - * - * @param value the new value of the 'Column Definition' attribute. - * @see #getColumnDefinition() - * @generated - */ - public void setColumnDefinitionGen(String newColumnDefinition) { - String oldColumnDefinition = columnDefinition; - columnDefinition = newColumnDefinition; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION, oldColumnDefinition, columnDefinition)); - } - - public String getSpecifiedNameForXml() { - return getSpecifiedName(); - } - - public void setSpecifiedNameForXml(String newSpecifiedNameForXml) { - setSpecifiedNameGen(newSpecifiedNameForXml); - if (eNotificationRequired()) - //make sure oldValue different from newValue because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML, newSpecifiedNameForXml + " ", newSpecifiedNameForXml)); - } - - public String getColumnDefinitionForXml() { - return getColumnDefinition(); - } - - public void setColumnDefinitionForXml(String newColumnDefinitionForXml) { - setColumnDefinitionGen(newColumnDefinitionForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__COLUMN_DEFINITION_FOR_XML, newColumnDefinitionForXml + " ", newColumnDefinitionForXml)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME : - return getName(); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME : - return getSpecifiedName(); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME : - return getDefaultName(); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION : - return getColumnDefinition(); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML : - return getSpecifiedNameForXml(); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML : - return getColumnDefinitionForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME : - setSpecifiedName((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION : - setColumnDefinition((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML : - setSpecifiedNameForXml((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML : - setColumnDefinitionForXml((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME : - setSpecifiedName(SPECIFIED_NAME_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION : - setColumnDefinition(COLUMN_DEFINITION_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML : - setSpecifiedNameForXml(SPECIFIED_NAME_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML : - setColumnDefinitionForXml(COLUMN_DEFINITION_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME : - return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME : - return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION : - return COLUMN_DEFINITION_EDEFAULT == null ? columnDefinition != null : !COLUMN_DEFINITION_EDEFAULT.equals(columnDefinition); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML : - return SPECIFIED_NAME_FOR_XML_EDEFAULT == null ? getSpecifiedNameForXml() != null : !SPECIFIED_NAME_FOR_XML_EDEFAULT.equals(getSpecifiedNameForXml()); - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML : - return COLUMN_DEFINITION_FOR_XML_EDEFAULT == null ? getColumnDefinitionForXml() != null : !COLUMN_DEFINITION_FOR_XML_EDEFAULT.equals(getColumnDefinitionForXml()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INamedColumn.class) { - switch (derivedFeatureID) { - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME : - return JpaCoreMappingsPackage.INAMED_COLUMN__NAME; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME : - return JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME : - return JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME; - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION : - return JpaCoreMappingsPackage.INAMED_COLUMN__COLUMN_DEFINITION; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INamedColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INAMED_COLUMN__NAME : - return OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME; - case JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME : - return OrmPackage.ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME; - case JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME : - return OrmPackage.ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME; - case JpaCoreMappingsPackage.INAMED_COLUMN__COLUMN_DEFINITION : - return OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedName: "); - result.append(specifiedName); - result.append(", defaultName: "); - result.append(defaultName); - result.append(", columnDefinition: "); - result.append(columnDefinition); - result.append(')'); - return result.toString(); - } - - public INamedColumn.Owner getOwner() { - return owner; - } - - public Column dbColumn() { - Table table = this.dbTable(); - return (table == null) ? null : table.columnNamed(getName()); - } - - public Table dbTable() { - return getOwner().dbTable(this.tableName()); - } - - protected abstract String tableName(); - - public boolean isResolved() { - return dbColumn() != null; - } - - public ITextRange nameTextRange() { - if (node == null) { - return owner.validationTextRange(); - } - IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.NAME); - return (nameNode == null) ? validationTextRange() : buildTextRange(nameNode); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlQuery.java deleted file mode 100644 index 3a9952ee60..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlQuery.java +++ /dev/null @@ -1,353 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Abstract Xml Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlQuery() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class AbstractXmlQuery extends XmlEObject implements IQuery -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getQuery() Query}' attribute. - * - * - * @see #getQuery() - * @generated - * @ordered - */ - protected static final String QUERY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQuery() Query}' attribute. - * - * - * @see #getQuery() - * @generated - * @ordered - */ - protected String query = QUERY_EDEFAULT; - - /** - * The cached value of the '{@link #getHints() Hints}' containment reference list. - * - * - * @see #getHints() - * @generated - * @ordered - */ - protected EList hints; - - /** - * - * - * @generated - */ - protected AbstractXmlQuery() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.ABSTRACT_XML_QUERY; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIQuery_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_QUERY__NAME, oldName, name)); - } - - /** - * Returns the value of the 'Query' attribute. - * - *

- * If the meaning of the 'Query' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Query' attribute. - * @see #setQuery(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIQuery_Query() - * @model - * @generated - */ - public String getQuery() { - return query; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery#getQuery Query}' attribute. - * - * - * @param value the new value of the 'Query' attribute. - * @see #getQuery() - * @generated - */ - public void setQuery(String newQuery) { - String oldQuery = query; - query = newQuery; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_QUERY__QUERY, oldQuery, query)); - } - - /** - * Returns the value of the 'Hints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IQueryHint}. - * - *

- * If the meaning of the 'Hints' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Hints' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIQuery_Hints() - * @model type="org.eclipse.jpt.core.internal.mappings.IQueryHint" containment="true" - * @generated - */ - public EList getHints() { - if (hints == null) { - hints = new EObjectContainmentEList(IQueryHint.class, this, OrmPackage.ABSTRACT_XML_QUERY__HINTS); - } - return hints; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_QUERY__HINTS : - return ((InternalEList) getHints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_QUERY__NAME : - return getName(); - case OrmPackage.ABSTRACT_XML_QUERY__QUERY : - return getQuery(); - case OrmPackage.ABSTRACT_XML_QUERY__HINTS : - return getHints(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_QUERY__NAME : - setName((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_QUERY__QUERY : - setQuery((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_QUERY__HINTS : - getHints().clear(); - getHints().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_QUERY__NAME : - setName(NAME_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_QUERY__QUERY : - setQuery(QUERY_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_QUERY__HINTS : - getHints().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_QUERY__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case OrmPackage.ABSTRACT_XML_QUERY__QUERY : - return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query); - case OrmPackage.ABSTRACT_XML_QUERY__HINTS : - return hints != null && !hints.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IQuery.class) { - switch (derivedFeatureID) { - case OrmPackage.ABSTRACT_XML_QUERY__NAME : - return JpaCoreMappingsPackage.IQUERY__NAME; - case OrmPackage.ABSTRACT_XML_QUERY__QUERY : - return JpaCoreMappingsPackage.IQUERY__QUERY; - case OrmPackage.ABSTRACT_XML_QUERY__HINTS : - return JpaCoreMappingsPackage.IQUERY__HINTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IQuery.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IQUERY__NAME : - return OrmPackage.ABSTRACT_XML_QUERY__NAME; - case JpaCoreMappingsPackage.IQUERY__QUERY : - return OrmPackage.ABSTRACT_XML_QUERY__QUERY; - case JpaCoreMappingsPackage.IQUERY__HINTS : - return OrmPackage.ABSTRACT_XML_QUERY__HINTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", query: "); - result.append(query); - result.append(')'); - return result.toString(); - } - - public XmlQueryHint createQueryHint(int index) { - return OrmFactory.eINSTANCE.createXmlQueryHint(); - } -} // AbstractXmlQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java deleted file mode 100644 index 0d0d91d531..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java +++ /dev/null @@ -1,984 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import java.util.Set; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Abstract Xml Table'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedNameForXml Specified Name For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedCatalogForXml Specified Catalog For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedSchemaForXml Specified Schema For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlTable() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class AbstractXmlTable extends XmlEObject implements ITable -{ - private Owner owner; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected String specifiedName = SPECIFIED_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected static final String DEFAULT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected String defaultName = DEFAULT_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getCatalog() Catalog}' attribute. - * - * - * @see #getCatalog() - * @generated - * @ordered - */ - protected static final String CATALOG_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected static final String SPECIFIED_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected String specifiedCatalog = SPECIFIED_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected static final String DEFAULT_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected String defaultCatalog = DEFAULT_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected String specifiedSchema = SPECIFIED_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected static final String DEFAULT_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT; - - /** - * The cached value of the '{@link #getUniqueConstraints() Unique Constraints}' containment reference list. - * - * - * @see #getUniqueConstraints() - * @generated - * @ordered - */ - protected EList uniqueConstraints; - - /** - * The default value of the '{@link #getSpecifiedNameForXml() Specified Name For Xml}' attribute. - * - * - * @see #getSpecifiedNameForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_FOR_XML_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedCatalogForXml() Specified Catalog For Xml}' attribute. - * - * - * @see #getSpecifiedCatalogForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_CATALOG_FOR_XML_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSchemaForXml() Specified Schema For Xml}' attribute. - * - * - * @see #getSpecifiedSchemaForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SCHEMA_FOR_XML_EDEFAULT = null; - - /** - * - * - * @generated - */ - protected AbstractXmlTable() { - super(); - } - - protected AbstractXmlTable(Owner owner) { - super(); - this.owner = owner; - } - - @Override - protected void addInsignificantXmlFeatureIdsTo(Set insignificantXmlFeatureIds) { - super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - insignificantXmlFeatureIds.add(OrmPackage.ABSTRACT_XML_TABLE__NAME); - insignificantXmlFeatureIds.add(OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_NAME); - insignificantXmlFeatureIds.add(OrmPackage.ABSTRACT_XML_TABLE__SCHEMA); - insignificantXmlFeatureIds.add(OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA); - insignificantXmlFeatureIds.add(OrmPackage.ABSTRACT_XML_TABLE__CATALOG); - insignificantXmlFeatureIds.add(OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_CATALOG); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.ABSTRACT_XML_TABLE; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getName() { - return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName(); - } - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

- * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_SpecifiedName() - * @model - * @generated - */ - public String getSpecifiedName() { - return specifiedName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - public void setSpecifiedNameGen(String newSpecifiedName) { - String oldSpecifiedName = specifiedName; - specifiedName = newSpecifiedName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); - } - - public void setSpecifiedName(String newSpecifiedName) { - setSpecifiedNameGen(newSpecifiedName); - if (newSpecifiedName != SPECIFIED_NAME_EDEFAULT) { - makeTableForXmlNonNull(); - } - setSpecifiedNameForXml(newSpecifiedName); - if (isAllFeaturesUnset()) { - makeTableForXmlNull(); - } - } - - /** - * Returns the value of the 'Default Name' attribute. - * - *

- * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_DefaultName() - * @model changeable="false" - * @generated - */ - public String getDefaultName() { - return defaultName; - } - - /** - * Returns the value of the 'Catalog' attribute. - * - *

- * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_Catalog() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getCatalog() { - return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog(); - } - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

- * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_SpecifiedCatalog() - * @model - * @generated - */ - public String getSpecifiedCatalog() { - return specifiedCatalog; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - public void setSpecifiedCatalogGen(String newSpecifiedCatalog) { - String oldSpecifiedCatalog = specifiedCatalog; - specifiedCatalog = newSpecifiedCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG, oldSpecifiedCatalog, specifiedCatalog)); - } - - public void setSpecifiedCatalog(String newSpecifiedCatalog) { - setSpecifiedCatalogGen(newSpecifiedCatalog); - if (newSpecifiedCatalog != SPECIFIED_CATALOG_EDEFAULT) { - makeTableForXmlNonNull(); - } - setSpecifiedCatalogForXml(newSpecifiedCatalog); - if (isAllFeaturesUnset()) { - makeTableForXmlNull(); - } - } - - protected abstract void makeTableForXmlNull(); - - protected abstract void makeTableForXmlNonNull(); - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

- * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_DefaultCatalog() - * @model changeable="false" - * @generated - */ - public String getDefaultCatalog() { - return defaultCatalog; - } - - /** - * Returns the value of the 'Schema' attribute. - * - *

- * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_Schema() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getSchema() { - return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema(); - } - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

- * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_SpecifiedSchema() - * @model - * @generated - */ - public String getSpecifiedSchema() { - return specifiedSchema; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - public void setSpecifiedSchemaGen(String newSpecifiedSchema) { - String oldSpecifiedSchema = specifiedSchema; - specifiedSchema = newSpecifiedSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA, oldSpecifiedSchema, specifiedSchema)); - } - - public void setSpecifiedSchema(String newSpecifiedSchema) { - setSpecifiedSchemaGen(newSpecifiedSchema); - if (newSpecifiedSchema != SPECIFIED_SCHEMA_EDEFAULT) { - makeTableForXmlNonNull(); - } - setSpecifiedSchemaForXml(newSpecifiedSchema); - if (isAllFeaturesUnset()) { - makeTableForXmlNull(); - } - } - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

- * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_DefaultSchema() - * @model changeable="false" - * @generated - */ - public String getDefaultSchema() { - return defaultSchema; - } - - /** - * Returns the value of the 'Unique Constraints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}. - * - *

- * If the meaning of the 'Unique Constraints' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Unique Constraints' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_UniqueConstraints() - * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true" - * @generated - */ - public EList getUniqueConstraints() { - if (uniqueConstraints == null) { - uniqueConstraints = new EObjectContainmentEList(IUniqueConstraint.class, this, OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS); - } - return uniqueConstraints; - } - - /** - * Returns the value of the 'Specified Name For Xml' attribute. - * - *

- * If the meaning of the 'Specified Name For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Name For Xml' attribute. - * @see #setSpecifiedNameForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlTable_SpecifiedNameForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSpecifiedNameForXml() { - return getSpecifiedName(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedNameForXml Specified Name For Xml}' attribute. - * - * - * @param value the new value of the 'Specified Name For Xml' attribute. - * @see #getSpecifiedNameForXml() - * @generated NOT - */ - public void setSpecifiedNameForXml(String newSpecifiedNameForXml) { - setSpecifiedNameGen(newSpecifiedNameForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML, newSpecifiedNameForXml + " ", newSpecifiedNameForXml)); - } - - /** - * Returns the value of the 'Specified Catalog For Xml' attribute. - * - *

- * If the meaning of the 'Specified Catalog For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Catalog For Xml' attribute. - * @see #setSpecifiedCatalogForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlTable_SpecifiedCatalogForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSpecifiedCatalogForXml() { - return getSpecifiedCatalog(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedCatalogForXml Specified Catalog For Xml}' attribute. - * - * - * @param value the new value of the 'Specified Catalog For Xml' attribute. - * @see #getSpecifiedCatalogForXml() - * @generated NOT - */ - public void setSpecifiedCatalogForXml(String newSpecifiedCatalogForXml) { - setSpecifiedCatalogGen(newSpecifiedCatalogForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML, newSpecifiedCatalogForXml + " ", newSpecifiedCatalogForXml)); - } - - /** - * Returns the value of the 'Specified Schema For Xml' attribute. - * - *

- * If the meaning of the 'Specified Schema For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Schema For Xml' attribute. - * @see #setSpecifiedSchemaForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlTable_SpecifiedSchemaForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSpecifiedSchemaForXml() { - return getSpecifiedSchema(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedSchemaForXml Specified Schema For Xml}' attribute. - * - * - * @param value the new value of the 'Specified Schema For Xml' attribute. - * @see #getSpecifiedSchemaForXml() - * @generated NOT - */ - public void setSpecifiedSchemaForXml(String newSpecifiedSchemaForXml) { - setSpecifiedSchemaGen(newSpecifiedSchemaForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML, newSpecifiedSchemaForXml + " ", newSpecifiedSchemaForXml)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS : - return ((InternalEList) getUniqueConstraints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - //TODO should we allow setting through the ecore, that would make this method - //public and part of the ITable api. only the model needs to be setting the default, - //but the ui needs to be listening for changes to the default. - protected void setDefaultName(String newDefaultName) { - String oldDefaultName = this.defaultName; - this.defaultName = newDefaultName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE__DEFAULT_NAME, oldDefaultName, this.defaultName)); - } - - protected void setDefaultSchema(String newDefaultSchema) { - String oldDefaultSchema = this.defaultSchema; - this.defaultSchema = newDefaultSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE__DEFAULT_SCHEMA, oldDefaultSchema, this.defaultSchema)); - } - - protected void setDefaultCatalog(String newDefaultCatalog) { - String oldDefaultCatalog = this.defaultCatalog; - this.defaultCatalog = newDefaultCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE__DEFAULT_CATALOG, oldDefaultCatalog, this.defaultCatalog)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_TABLE__NAME : - return getName(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME : - return getSpecifiedName(); - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_NAME : - return getDefaultName(); - case OrmPackage.ABSTRACT_XML_TABLE__CATALOG : - return getCatalog(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG : - return getSpecifiedCatalog(); - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_CATALOG : - return getDefaultCatalog(); - case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA : - return getSchema(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA : - return getSpecifiedSchema(); - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA : - return getDefaultSchema(); - case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS : - return getUniqueConstraints(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML : - return getSpecifiedNameForXml(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML : - return getSpecifiedCatalogForXml(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML : - return getSpecifiedSchemaForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME : - setSpecifiedName((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG : - setSpecifiedCatalog((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA : - setSpecifiedSchema((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - getUniqueConstraints().addAll((Collection) newValue); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML : - setSpecifiedNameForXml((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML : - setSpecifiedCatalogForXml((String) newValue); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML : - setSpecifiedSchemaForXml((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME : - setSpecifiedName(SPECIFIED_NAME_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG : - setSpecifiedCatalog(SPECIFIED_CATALOG_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA : - setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML : - setSpecifiedNameForXml(SPECIFIED_NAME_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML : - setSpecifiedCatalogForXml(SPECIFIED_CATALOG_FOR_XML_EDEFAULT); - return; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML : - setSpecifiedSchemaForXml(SPECIFIED_SCHEMA_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.ABSTRACT_XML_TABLE__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME : - return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_NAME : - return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); - case OrmPackage.ABSTRACT_XML_TABLE__CATALOG : - return CATALOG_EDEFAULT == null ? getCatalog() != null : !CATALOG_EDEFAULT.equals(getCatalog()); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG : - return SPECIFIED_CATALOG_EDEFAULT == null ? specifiedCatalog != null : !SPECIFIED_CATALOG_EDEFAULT.equals(specifiedCatalog); - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_CATALOG : - return DEFAULT_CATALOG_EDEFAULT == null ? defaultCatalog != null : !DEFAULT_CATALOG_EDEFAULT.equals(defaultCatalog); - case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA : - return SCHEMA_EDEFAULT == null ? getSchema() != null : !SCHEMA_EDEFAULT.equals(getSchema()); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA : - return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema); - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA : - return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema); - case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS : - return uniqueConstraints != null && !uniqueConstraints.isEmpty(); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML : - return SPECIFIED_NAME_FOR_XML_EDEFAULT == null ? getSpecifiedNameForXml() != null : !SPECIFIED_NAME_FOR_XML_EDEFAULT.equals(getSpecifiedNameForXml()); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML : - return SPECIFIED_CATALOG_FOR_XML_EDEFAULT == null ? getSpecifiedCatalogForXml() != null : !SPECIFIED_CATALOG_FOR_XML_EDEFAULT.equals(getSpecifiedCatalogForXml()); - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML : - return SPECIFIED_SCHEMA_FOR_XML_EDEFAULT == null ? getSpecifiedSchemaForXml() != null : !SPECIFIED_SCHEMA_FOR_XML_EDEFAULT.equals(getSpecifiedSchemaForXml()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ITable.class) { - switch (derivedFeatureID) { - case OrmPackage.ABSTRACT_XML_TABLE__NAME : - return JpaCoreMappingsPackage.ITABLE__NAME; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME : - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME; - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_NAME : - return JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME; - case OrmPackage.ABSTRACT_XML_TABLE__CATALOG : - return JpaCoreMappingsPackage.ITABLE__CATALOG; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG : - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG; - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_CATALOG : - return JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG; - case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA : - return JpaCoreMappingsPackage.ITABLE__SCHEMA; - case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA : - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA; - case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA : - return JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA; - case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS : - return JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ITable.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ITABLE__NAME : - return OrmPackage.ABSTRACT_XML_TABLE__NAME; - case JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME : - return OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME; - case JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME : - return OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_NAME; - case JpaCoreMappingsPackage.ITABLE__CATALOG : - return OrmPackage.ABSTRACT_XML_TABLE__CATALOG; - case JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG : - return OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG; - case JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG : - return OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_CATALOG; - case JpaCoreMappingsPackage.ITABLE__SCHEMA : - return OrmPackage.ABSTRACT_XML_TABLE__SCHEMA; - case JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA : - return OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA; - case JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA : - return OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA; - case JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS : - return OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedName: "); - result.append(specifiedName); - result.append(", defaultName: "); - result.append(defaultName); - result.append(", specifiedCatalog: "); - result.append(specifiedCatalog); - result.append(", defaultCatalog: "); - result.append(defaultCatalog); - result.append(", specifiedSchema: "); - result.append(specifiedSchema); - result.append(", defaultSchema: "); - result.append(defaultSchema); - result.append(')'); - return result.toString(); - } - - /** - * Call this when the table tag is removed from the xml, - * need to make sure all the model attributes are set to the default - */ - protected void unsetAllAttributes() { - eUnset(OrmPackage.XML_TABLE__SPECIFIED_NAME); - eUnset(OrmPackage.XML_TABLE__SPECIFIED_SCHEMA); - eUnset(OrmPackage.XML_TABLE__SPECIFIED_CATALOG); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultCatalog((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)); - setDefaultSchema((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY)); - } - - public ITextRange nameTextRange() { - if (node == null) { - return owner.validationTextRange(); - } - IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.NAME); - return (nameNode == null) ? validationTextRange() : buildTextRange(nameNode); - } - - public ITextRange schemaTextRange() { - if (node == null) { - return owner.validationTextRange(); - } - IDOMNode schemaNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.SCHEMA); - return (schemaNode == null) ? validationTextRange() : buildTextRange(schemaNode); - } - - @Override - public ITextRange validationTextRange() { - return (node == null) ? owner.validationTextRange() : super.validationTextRange(); - } - - public Owner getOwner() { - return owner; - } - - public Table dbTable() { - Schema schema = this.dbSchema(); - return (schema == null) ? null : schema.tableNamed(getName()); - } - - public Schema dbSchema() { - return getJpaProject().connectionProfile().getDatabase().schemaNamed(getSchema()); - } - - public boolean hasResolvedSchema() { - return dbSchema() != null; - } - - public boolean isResolved() { - return dbTable() != null; - } - - public IUniqueConstraint createUniqueConstraint(int index) { - return createXmlJavaUniqueConstraint(index); - } - - protected XmlUniqueConstraint createXmlJavaUniqueConstraint(int index) { - return OrmFactory.eINSTANCE.createXmlUniqueConstraint(); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappings.java deleted file mode 100644 index f9445ba118..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappings.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Entity Mappings'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPersistenceUnitMetadata Persistence Unit Metadata}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPackage Package}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface EntityMappings extends EObject -{ - /** - * Returns the value of the 'Persistence Unit Metadata' reference. - * The default value is "". - * - *

- * If the meaning of the 'Persistence Unit Metadata' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Metadata' reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings_PersistenceUnitMetadata() - * @model resolveProxies="false" changeable="false" volatile="true" - * @generated - */ - PersistenceUnitMetadata getPersistenceUnitMetadata(); - - /** - * Returns the value of the 'Package' attribute. - * - *

- * If the meaning of the 'Package' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Package' attribute. - * @see #setPackage(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings_Package() - * @model volatile="true" - * @generated - */ - String getPackage(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPackage Package}' attribute. - * - * - * @param value the new value of the 'Package' attribute. - * @see #getPackage() - * @generated - */ - void setPackage(String value); - - void changeMapping(XmlTypeMapping oldMapping, String newMappingKey); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsForXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsForXml.java deleted file mode 100644 index 924dd3bd56..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsForXml.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Entity Mappings For Xml'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPackageForXml Package For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface EntityMappingsForXml extends EObject -{ - /** - * Returns the value of the 'Persistence Unit Metadata For Xml' reference. - * - *

- * If the meaning of the 'Persistence Unit Metadata For Xml' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Metadata For Xml' reference. - * @see #setPersistenceUnitMetadataForXml(PersistenceUnitMetadataForXml) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml_PersistenceUnitMetadataForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - PersistenceUnitMetadataForXml getPersistenceUnitMetadataForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}' reference. - * - * - * @param value the new value of the 'Persistence Unit Metadata For Xml' reference. - * @see #getPersistenceUnitMetadataForXml() - * @generated - */ - void setPersistenceUnitMetadataForXml(PersistenceUnitMetadataForXml value); - - /** - * Returns the value of the 'Package For Xml' attribute. - * - *

- * If the meaning of the 'Package For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Package For Xml' attribute. - * @see #setPackageForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml_PackageForXml() - * @model volatile="true" - * @generated - */ - String getPackageForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPackageForXml Package For Xml}' attribute. - * - * - * @param value the new value of the 'Package For Xml' attribute. - * @see #getPackageForXml() - * @generated - */ - void setPackageForXml(String value); -} // EntityMappingsForXml diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsInternal.java deleted file mode 100644 index ae69349df2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsInternal.java +++ /dev/null @@ -1,1681 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import java.util.Comparator; -import java.util.Iterator; -import java.util.Set; -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.EObjectEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.CollectionTools; - -/** - * - * A representation of the model object 'Entity Mappings Internal'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getRoot Root}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getVersion Version}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDescription Description}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistenceUnitMetadataInternal Persistence Unit Metadata Internal}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPackageInternal Package Internal}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultSchema Default Schema}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedSchema Specified Schema}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSchema Schema}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultCatalog Default Catalog}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedCatalog Specified Catalog}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getCatalog Catalog}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultAccess Default Access}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedAccess Specified Access}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getAccess Access}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTypeMappings Type Mappings}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistentTypes Persistent Types}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators Sequence Generators}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTableGenerators Table Generators}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getNamedQueries Named Queries}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getNamedNativeQueries Named Native Queries}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal() - * @model kind="class" - * @generated - */ -public class EntityMappingsInternal extends XmlEObject - implements IJpaContentNode, EntityMappingsForXml, EntityMappings -{ - /** - * The default value of the '{@link #getPackageForXml() Package For Xml}' attribute. - * - * - * @see #getPackageForXml() - * @generated - * @ordered - */ - protected static final String PACKAGE_FOR_XML_EDEFAULT = null; - - /** - * The default value of the '{@link #getPackage() Package}' attribute. - * - * - * @see #getPackage() - * @generated - * @ordered - */ - protected static final String PACKAGE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRoot() Root}' reference. - * - * - * @see #getRoot() - * @generated - * @ordered - */ - protected XmlRootContentNode root; - - /** - * The default value of the '{@link #getVersion() Version}' attribute. - * - * - * @see #getVersion() - * @generated - * @ordered - */ - protected static final String VERSION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getVersion() Version}' attribute. - * - * - * @see #getVersion() - * @generated - * @ordered - */ - protected String version = VERSION_EDEFAULT; - - /** - * The default value of the '{@link #getDescription() Description}' attribute. - * - * - * @see #getDescription() - * @generated - * @ordered - */ - protected static final String DESCRIPTION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDescription() Description}' attribute. - * - * - * @see #getDescription() - * @generated - * @ordered - */ - protected String description = DESCRIPTION_EDEFAULT; - - /** - * The cached value of the '{@link #getPersistenceUnitMetadataInternal() Persistence Unit Metadata Internal}' containment reference. - * - * - * @see #getPersistenceUnitMetadataInternal() - * @generated - * @ordered - */ - protected PersistenceUnitMetadataInternal persistenceUnitMetadataInternal; - - /** - * The default value of the '{@link #getPackageInternal() Package Internal}' attribute. - * - * - * @see #getPackageInternal() - * @generated - * @ordered - */ - protected static final String PACKAGE_INTERNAL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPackageInternal() Package Internal}' attribute. - * - * - * @see #getPackageInternal() - * @generated - * @ordered - */ - protected String packageInternal = PACKAGE_INTERNAL_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected static final String DEFAULT_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected String specifiedSchema = SPECIFIED_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The default value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected static final String DEFAULT_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected String defaultCatalog = DEFAULT_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected static final String SPECIFIED_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected String specifiedCatalog = SPECIFIED_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getCatalog() Catalog}' attribute. - * - * - * @see #getCatalog() - * @generated - * @ordered - */ - protected static final String CATALOG_EDEFAULT = null; - - /** - * The default value of the '{@link #getDefaultAccess() Default Access}' attribute. - * - * - * @see #getDefaultAccess() - * @generated - * @ordered - */ - protected static final AccessType DEFAULT_ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getDefaultAccess() Default Access}' attribute. - * - * - * @see #getDefaultAccess() - * @generated - * @ordered - */ - protected AccessType defaultAccess = DEFAULT_ACCESS_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedAccess() Specified Access}' attribute. - * - * - * @see #getSpecifiedAccess() - * @generated - * @ordered - */ - protected static final AccessType SPECIFIED_ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getSpecifiedAccess() Specified Access}' attribute. - * - * - * @see #getSpecifiedAccess() - * @generated - * @ordered - */ - protected AccessType specifiedAccess = SPECIFIED_ACCESS_EDEFAULT; - - /** - * The default value of the '{@link #getAccess() Access}' attribute. - * - * - * @see #getAccess() - * @generated - * @ordered - */ - protected static final AccessType ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getTypeMappings() Type Mappings}' containment reference list. - * - * - * @see #getTypeMappings() - * @generated - * @ordered - */ - protected EList typeMappings; - - /** - * The cached value of the '{@link #getPersistentTypes() Persistent Types}' reference list. - * - * - * @see #getPersistentTypes() - * @generated - * @ordered - */ - protected EList persistentTypes; - - /** - * The cached value of the '{@link #getSequenceGenerators() Sequence Generators}' containment reference list. - * - * - * @see #getSequenceGenerators() - * @generated - * @ordered - */ - protected EList sequenceGenerators; - - /** - * The cached value of the '{@link #getTableGenerators() Table Generators}' containment reference list. - * - * - * @see #getTableGenerators() - * @generated - * @ordered - */ - protected EList tableGenerators; - - /** - * The cached value of the '{@link #getNamedQueries() Named Queries}' containment reference list. - * - * - * @see #getNamedQueries() - * @generated - * @ordered - */ - protected EList namedQueries; - - /** - * The cached value of the '{@link #getNamedNativeQueries() Named Native Queries}' containment reference list. - * - * - * @see #getNamedNativeQueries() - * @generated - * @ordered - */ - protected EList namedNativeQueries; - - /** - * - * - * @generated NOT - */ - protected EntityMappingsInternal() { - super(); - //we don't want a setter for this object since it should never be null, but - //it must be initialized and is necessary for emf to call the eInverseAdd method - this.persistenceUnitMetadataInternal = OrmFactory.eINSTANCE.createPersistenceUnitMetadataInternal(); - ((InternalEObject) this.persistenceUnitMetadataInternal).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL, null, null); - } - - @Override - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIds.add(OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.ENTITY_MAPPINGS_INTERNAL; - } - - /** - * Returns the value of the 'Access' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.content.orm.AccessType}. - * - *

- * If the meaning of the 'Access' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_Access() - * @model transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public AccessType getAccess() { - return (this.getSpecifiedAccess() == null) ? this.getDefaultAccess() : this.getSpecifiedAccess(); - } - - /** - * Returns the value of the 'Persistence Unit Metadata For Xml' reference. - * - *

- * API just for the xml translators. Null in the model for a containment - * object corresponds to no persistence-unit-metadata xml tag in the xml file. - * We check for whether any features are set in the model and return null for - * persistenceUnitMetadataForXml if there aren't any. Otherwise we return - * the persistenceUnitMetadataInternal that has already been created. - *

- * - * @return the value of the 'Persistence Unit Metadata For Xml' reference. - * @see #setPersistenceUnitMetadataForXml(PersistenceUnitMetadataForXml) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml_PersistenceUnitMetadataForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public PersistenceUnitMetadataForXml getPersistenceUnitMetadataForXml() { - if (getPersistenceUnitMetadataInternal().isAllFeaturesUnset()) { - return null; - } - return getPersistenceUnitMetadataInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}' reference. - * - * - * @param value the new value of the 'Persistence Unit Metadata For Xml' reference. - * @see #getPersistenceUnitMetadataForXml() - * @generated NOT - */ - public void setPersistenceUnitMetadataForXmlGen(PersistenceUnitMetadataForXml newPersistenceUnitMetadataForXml) { - PersistenceUnitMetadataForXml oldValue = newPersistenceUnitMetadataForXml == null ? (PersistenceUnitMetadataForXml) getPersistenceUnitMetadata() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML, oldValue, newPersistenceUnitMetadataForXml)); - } - - public void setPersistenceUnitMetadataForXml(PersistenceUnitMetadataForXml newPersistenceUnitMetadataForXml) { - setPersistenceUnitMetadataForXmlGen(newPersistenceUnitMetadataForXml); - if (newPersistenceUnitMetadataForXml == null) { - getPersistenceUnitMetadataInternal().unsetAllAttributes(); - } - } - - public String getPackageForXml() { - return getPackageInternal(); - } - - public void setPackageForXml(String newPackageForXml) { - setPackageInternal(newPackageForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML, null, newPackageForXml)); - } - - public void makePersistenceUnitMetadataForXmlNull() { - setPersistenceUnitMetadataForXmlGen(null); - } - - public void makePersistenceUnitMetadataForXmlNonNull() { - setPersistenceUnitMetadataForXmlGen(getPersistenceUnitMetadataForXml()); - } - - /** - * Returns the value of the 'Persistence Unit Metadata' containment reference. - * The default value is "". - * - *

- * If the meaning of the 'Persistence Unit Metadata' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Metadata' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings_PersistenceUnitMetadata() - * @model containment="true" required="true" changeable="false" volatile="true" - * @generated NOT - */ - public PersistenceUnitMetadata getPersistenceUnitMetadata() { - return getPersistenceUnitMetadataInternal(); - } - - /** - * Returns the value of the 'Root' reference. - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode#getEntityMappings Entity Mappings}'. - * - *

- * If the meaning of the 'Root' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Root' reference. - * @see #setRoot(XmlRootContentNode) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_Root() - * @see org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode#getEntityMappings - * @model opposite="entityMappings" resolveProxies="false" required="true" ordered="false" - * @generated - */ - public XmlRootContentNode getRoot() { - return root; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetRoot(XmlRootContentNode newRoot, NotificationChain msgs) { - XmlRootContentNode oldRoot = root; - root = newRoot; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT, oldRoot, newRoot); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getRoot Root}' reference. - * - * - * @param value the new value of the 'Root' reference. - * @see #getRoot() - * @generated - */ - public void setRoot(XmlRootContentNode newRoot) { - if (newRoot != root) { - NotificationChain msgs = null; - if (root != null) - msgs = ((InternalEObject) root).eInverseRemove(this, OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS, XmlRootContentNode.class, msgs); - if (newRoot != null) - msgs = ((InternalEObject) newRoot).eInverseAdd(this, OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS, XmlRootContentNode.class, msgs); - msgs = basicSetRoot(newRoot, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT, newRoot, newRoot)); - } - - /** - * Returns the value of the 'Version' attribute. - * - *

- * If the meaning of the 'Version' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Version' attribute. - * @see #setVersion(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_Version() - * @model - * @generated - */ - public String getVersion() { - return version; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getVersion Version}' attribute. - * - * - * @param value the new value of the 'Version' attribute. - * @see #getVersion() - * @generated - */ - public void setVersion(String newVersion) { - String oldVersion = version; - version = newVersion; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__VERSION, oldVersion, version)); - } - - /** - * Returns the value of the 'Description' attribute. - * - *

- * If the meaning of the 'Description' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Description' attribute. - * @see #setDescription(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_Description() - * @model - * @generated - */ - public String getDescription() { - return description; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDescription Description}' attribute. - * - * - * @param value the new value of the 'Description' attribute. - * @see #getDescription() - * @generated - */ - public void setDescription(String newDescription) { - String oldDescription = description; - description = newDescription; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__DESCRIPTION, oldDescription, description)); - } - - /** - * Returns the value of the 'Persistence Unit Metadata Internal' containment reference. - * - *

- * If the meaning of the 'Persistence Unit Metadata Internal' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Metadata Internal' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_PersistenceUnitMetadataInternal() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public PersistenceUnitMetadataInternal getPersistenceUnitMetadataInternal() { - return persistenceUnitMetadataInternal; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetPersistenceUnitMetadataInternal(PersistenceUnitMetadataInternal newPersistenceUnitMetadataInternal, NotificationChain msgs) { - PersistenceUnitMetadataInternal oldPersistenceUnitMetadataInternal = persistenceUnitMetadataInternal; - persistenceUnitMetadataInternal = newPersistenceUnitMetadataInternal; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL, oldPersistenceUnitMetadataInternal, newPersistenceUnitMetadataInternal); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Package Internal' attribute. - * - *

- * If the meaning of the 'Package Internal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Package Internal' attribute. - * @see #setPackageInternal(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_PackageInternal() - * @model - * @generated - */ - public String getPackageInternal() { - return packageInternal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPackageInternal Package Internal}' attribute. - * - * - * @param value the new value of the 'Package Internal' attribute. - * @see #getPackageInternal() - * @generated NOT - */ - public void setPackageInternal(String newPackageInternal) { - String oldPackageInternal = packageInternal; - packageInternal = newPackageInternal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL, oldPackageInternal, packageInternal)); - //notification so the UI is updated when the xml changes, can't call the UI api - //because it has other side effects - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE, oldPackageInternal, packageInternal)); - } - } - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

- * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Schema' attribute. - * @see #setDefaultSchema(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_DefaultSchema() - * @model - * @generated - */ - public String getDefaultSchema() { - return defaultSchema; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultSchema Default Schema}' attribute. - * - * - * @param value the new value of the 'Default Schema' attribute. - * @see #getDefaultSchema() - * @generated - */ - public void setDefaultSchema(String newDefaultSchema) { - String oldDefaultSchema = defaultSchema; - defaultSchema = newDefaultSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA, oldDefaultSchema, defaultSchema)); - } - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

- * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_SpecifiedSchema() - * @model - * @generated - */ - public String getSpecifiedSchema() { - return specifiedSchema; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - public void setSpecifiedSchema(String newSpecifiedSchema) { - String oldSpecifiedSchema = specifiedSchema; - specifiedSchema = newSpecifiedSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA, oldSpecifiedSchema, specifiedSchema)); - } - - /** - * Returns the value of the 'Package' attribute. - * - *

- * If the meaning of the 'Package' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Package' attribute. - * @see #setPackage(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings_Package() - * @model volatile="true" - * @generated NOT - */ - public String getPackage() { - return getPackageInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPackage Package}' attribute. - * - * - * @param value the new value of the 'Package' attribute. - * @see #getPackage() - * @generated NOT - */ - public void setPackage(String newPackage) { - if (newPackage == "") { - newPackage = null; - } - setPackageInternal(newPackage); - setPackageForXml(newPackage); - } - - /** - * Returns the value of the 'Schema' attribute. - * - *

- * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_Schema() - * @model transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public String getSchema() { - return (this.getSpecifiedSchema() == null) ? this.getDefaultSchema() : this.getSpecifiedSchema(); - } - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

- * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Catalog' attribute. - * @see #setDefaultCatalog(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_DefaultCatalog() - * @model - * @generated - */ - public String getDefaultCatalog() { - return defaultCatalog; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultCatalog Default Catalog}' attribute. - * - * - * @param value the new value of the 'Default Catalog' attribute. - * @see #getDefaultCatalog() - * @generated - */ - public void setDefaultCatalog(String newDefaultCatalog) { - String oldDefaultCatalog = defaultCatalog; - defaultCatalog = newDefaultCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG, oldDefaultCatalog, defaultCatalog)); - } - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

- * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_SpecifiedCatalog() - * @model - * @generated - */ - public String getSpecifiedCatalog() { - return specifiedCatalog; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - public void setSpecifiedCatalog(String newSpecifiedCatalog) { - String oldSpecifiedCatalog = specifiedCatalog; - specifiedCatalog = newSpecifiedCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG, oldSpecifiedCatalog, specifiedCatalog)); - } - - /** - * Returns the value of the 'Catalog' attribute. - * - *

- * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_Catalog() - * @model transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public String getCatalog() { - return (this.getSpecifiedCatalog() == null) ? this.getDefaultCatalog() : this.getSpecifiedCatalog(); - } - - /** - * Returns the value of the 'Default Access' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

- * If the meaning of the 'Default Access' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setDefaultAccess(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_DefaultAccess() - * @model - * @generated - */ - public AccessType getDefaultAccess() { - return defaultAccess; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultAccess Default Access}' attribute. - * - * - * @param value the new value of the 'Default Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #getDefaultAccess() - * @generated - */ - public void setDefaultAccess(AccessType newDefaultAccess) { - AccessType oldDefaultAccess = defaultAccess; - defaultAccess = newDefaultAccess == null ? DEFAULT_ACCESS_EDEFAULT : newDefaultAccess; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS, oldDefaultAccess, defaultAccess)); - } - - /** - * Returns the value of the 'Specified Access' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

- * If the meaning of the 'Specified Access' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setSpecifiedAccess(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_SpecifiedAccess() - * @model - * @generated - */ - public AccessType getSpecifiedAccess() { - return specifiedAccess; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedAccess Specified Access}' attribute. - * - * - * @param value the new value of the 'Specified Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #getSpecifiedAccess() - * @generated - */ - public void setSpecifiedAccess(AccessType newSpecifiedAccess) { - AccessType oldSpecifiedAccess = specifiedAccess; - specifiedAccess = newSpecifiedAccess == null ? SPECIFIED_ACCESS_EDEFAULT : newSpecifiedAccess; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS, oldSpecifiedAccess, specifiedAccess)); - } - - /** - * Returns the value of the 'Type Mappings' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping}. - * - *

- * If the meaning of the 'Type Mappings' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Type Mappings' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_TypeMappings() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping" containment="true" - * @generated - */ - public EList getTypeMappingsGen() { - if (typeMappings == null) { - typeMappings = new EObjectContainmentEList(XmlTypeMapping.class, this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS); - } - return typeMappings; - } - - public EList getTypeMappings() { - if (typeMappings == null) { - typeMappings = new TypeMappingsList(); - } - return getTypeMappingsGen(); - } - - /** - * Returns the value of the 'Persistent Types' reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType}. - * - *

- * If the meaning of the 'Persistent Types' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistent Types' reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_PersistentTypes() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlPersistentType" resolveProxies="false" - * @generated - */ - public EList getPersistentTypes() { - if (persistentTypes == null) { - persistentTypes = new EObjectEList(XmlPersistentType.class, this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES); - } - return persistentTypes; - } - - public boolean containsPersistentType(IType type) { - if (type == null) { - return false; - } - for (XmlPersistentType each : getPersistentTypes()) { - if (type.equals(each.findJdtType())) { - return true; - } - } - return false; - } - - /** - * Returns the value of the 'Table Generators' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator}. - * - *

- * If the meaning of the 'Table Generators' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table Generators' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_TableGenerators() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator" containment="true" - * @generated - */ - public EList getTableGenerators() { - if (tableGenerators == null) { - tableGenerators = new EObjectContainmentEList(XmlTableGenerator.class, this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS); - } - return tableGenerators; - } - - /** - * Returns the value of the 'Named Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery}. - * - *

- * If the meaning of the 'Named Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Named Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_NamedQueries() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery" containment="true" - * @generated - */ - public EList getNamedQueries() { - if (namedQueries == null) { - namedQueries = new EObjectContainmentEList(XmlNamedQuery.class, this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES); - } - return namedQueries; - } - - /** - * Returns the value of the 'Named Native Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery}. - * - *

- * If the meaning of the 'Named Native Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Named Native Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_NamedNativeQueries() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery" containment="true" - * @generated - */ - public EList getNamedNativeQueries() { - if (namedNativeQueries == null) { - namedNativeQueries = new EObjectContainmentEList(XmlNamedNativeQuery.class, this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES); - } - return namedNativeQueries; - } - - /** - * Returns the value of the 'Sequence Generators' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator}. - * - *

- * If the meaning of the 'Sequence Generators' reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Sequence Generators' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal_SequenceGenerators() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator" containment="true" - * @generated - */ - public EList getSequenceGenerators() { - if (sequenceGenerators == null) { - sequenceGenerators = new EObjectContainmentEList(XmlSequenceGenerator.class, this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS); - } - return sequenceGenerators; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT : - if (root != null) - msgs = ((InternalEObject) root).eInverseRemove(this, OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS, XmlRootContentNode.class, msgs); - return basicSetRoot((XmlRootContentNode) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT : - return basicSetRoot(null, msgs); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL : - return basicSetPersistenceUnitMetadataInternal(null, msgs); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS : - return ((InternalEList) getTypeMappings()).basicRemove(otherEnd, msgs); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS : - return ((InternalEList) getSequenceGenerators()).basicRemove(otherEnd, msgs); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS : - return ((InternalEList) getTableGenerators()).basicRemove(otherEnd, msgs); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES : - return ((InternalEList) getNamedQueries()).basicRemove(otherEnd, msgs); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES : - return ((InternalEList) getNamedNativeQueries()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML : - return getPersistenceUnitMetadataForXml(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML : - return getPackageForXml(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA : - return getPersistenceUnitMetadata(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE : - return getPackage(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT : - return getRoot(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__VERSION : - return getVersion(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DESCRIPTION : - return getDescription(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL : - return getPersistenceUnitMetadataInternal(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL : - return getPackageInternal(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA : - return getDefaultSchema(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA : - return getSpecifiedSchema(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SCHEMA : - return getSchema(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG : - return getDefaultCatalog(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG : - return getSpecifiedCatalog(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__CATALOG : - return getCatalog(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS : - return getDefaultAccess(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS : - return getSpecifiedAccess(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ACCESS : - return getAccess(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS : - return getTypeMappings(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES : - return getPersistentTypes(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS : - return getSequenceGenerators(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS : - return getTableGenerators(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES : - return getNamedQueries(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES : - return getNamedNativeQueries(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML : - setPersistenceUnitMetadataForXml((PersistenceUnitMetadataForXml) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML : - setPackageForXml((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE : - setPackage((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT : - setRoot((XmlRootContentNode) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__VERSION : - setVersion((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DESCRIPTION : - setDescription((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL : - setPackageInternal((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA : - setDefaultSchema((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA : - setSpecifiedSchema((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG : - setDefaultCatalog((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG : - setSpecifiedCatalog((String) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS : - setDefaultAccess((AccessType) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS : - setSpecifiedAccess((AccessType) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS : - getTypeMappings().clear(); - getTypeMappings().addAll((Collection) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES : - getPersistentTypes().clear(); - getPersistentTypes().addAll((Collection) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS : - getSequenceGenerators().clear(); - getSequenceGenerators().addAll((Collection) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS : - getTableGenerators().clear(); - getTableGenerators().addAll((Collection) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES : - getNamedQueries().clear(); - getNamedQueries().addAll((Collection) newValue); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES : - getNamedNativeQueries().clear(); - getNamedNativeQueries().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML : - setPersistenceUnitMetadataForXml((PersistenceUnitMetadataForXml) null); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML : - setPackageForXml(PACKAGE_FOR_XML_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE : - setPackage(PACKAGE_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT : - setRoot((XmlRootContentNode) null); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__VERSION : - setVersion(VERSION_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DESCRIPTION : - setDescription(DESCRIPTION_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL : - setPackageInternal(PACKAGE_INTERNAL_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA : - setDefaultSchema(DEFAULT_SCHEMA_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA : - setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG : - setDefaultCatalog(DEFAULT_CATALOG_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG : - setSpecifiedCatalog(SPECIFIED_CATALOG_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS : - setDefaultAccess(DEFAULT_ACCESS_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS : - setSpecifiedAccess(SPECIFIED_ACCESS_EDEFAULT); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS : - getTypeMappings().clear(); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES : - getPersistentTypes().clear(); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS : - getSequenceGenerators().clear(); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS : - getTableGenerators().clear(); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES : - getNamedQueries().clear(); - return; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES : - getNamedNativeQueries().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML : - return getPersistenceUnitMetadataForXml() != null; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML : - return PACKAGE_FOR_XML_EDEFAULT == null ? getPackageForXml() != null : !PACKAGE_FOR_XML_EDEFAULT.equals(getPackageForXml()); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA : - return getPersistenceUnitMetadata() != null; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE : - return PACKAGE_EDEFAULT == null ? getPackage() != null : !PACKAGE_EDEFAULT.equals(getPackage()); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT : - return root != null; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__VERSION : - return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DESCRIPTION : - return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL : - return persistenceUnitMetadataInternal != null; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL : - return PACKAGE_INTERNAL_EDEFAULT == null ? packageInternal != null : !PACKAGE_INTERNAL_EDEFAULT.equals(packageInternal); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA : - return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA : - return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SCHEMA : - return SCHEMA_EDEFAULT == null ? getSchema() != null : !SCHEMA_EDEFAULT.equals(getSchema()); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG : - return DEFAULT_CATALOG_EDEFAULT == null ? defaultCatalog != null : !DEFAULT_CATALOG_EDEFAULT.equals(defaultCatalog); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG : - return SPECIFIED_CATALOG_EDEFAULT == null ? specifiedCatalog != null : !SPECIFIED_CATALOG_EDEFAULT.equals(specifiedCatalog); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__CATALOG : - return CATALOG_EDEFAULT == null ? getCatalog() != null : !CATALOG_EDEFAULT.equals(getCatalog()); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS : - return defaultAccess != DEFAULT_ACCESS_EDEFAULT; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS : - return specifiedAccess != SPECIFIED_ACCESS_EDEFAULT; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__ACCESS : - return getAccess() != ACCESS_EDEFAULT; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS : - return typeMappings != null && !typeMappings.isEmpty(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES : - return persistentTypes != null && !persistentTypes.isEmpty(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS : - return sequenceGenerators != null && !sequenceGenerators.isEmpty(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS : - return tableGenerators != null && !tableGenerators.isEmpty(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES : - return namedQueries != null && !namedQueries.isEmpty(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES : - return namedNativeQueries != null && !namedNativeQueries.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == EntityMappingsForXml.class) { - switch (derivedFeatureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML : - return OrmPackage.ENTITY_MAPPINGS_FOR_XML__PERSISTENCE_UNIT_METADATA_FOR_XML; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML : - return OrmPackage.ENTITY_MAPPINGS_FOR_XML__PACKAGE_FOR_XML; - default : - return -1; - } - } - if (baseClass == EntityMappings.class) { - switch (derivedFeatureID) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA : - return OrmPackage.ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA; - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE : - return OrmPackage.ENTITY_MAPPINGS__PACKAGE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == EntityMappingsForXml.class) { - switch (baseFeatureID) { - case OrmPackage.ENTITY_MAPPINGS_FOR_XML__PERSISTENCE_UNIT_METADATA_FOR_XML : - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML; - case OrmPackage.ENTITY_MAPPINGS_FOR_XML__PACKAGE_FOR_XML : - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML; - default : - return -1; - } - } - if (baseClass == EntityMappings.class) { - switch (baseFeatureID) { - case OrmPackage.ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA : - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA; - case OrmPackage.ENTITY_MAPPINGS__PACKAGE : - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__PACKAGE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (version: "); - result.append(version); - result.append(", description: "); - result.append(description); - result.append(", packageInternal: "); - result.append(packageInternal); - result.append(", defaultSchema: "); - result.append(defaultSchema); - result.append(", specifiedSchema: "); - result.append(specifiedSchema); - result.append(", defaultCatalog: "); - result.append(defaultCatalog); - result.append(", specifiedCatalog: "); - result.append(specifiedCatalog); - result.append(", defaultAccess: "); - result.append(defaultAccess); - result.append(", specifiedAccess: "); - result.append(specifiedAccess); - result.append(')'); - return result.toString(); - } - - public void addMapping(String className, String mappingKey) { - XmlPersistentType persistentType = OrmFactory.eINSTANCE.createXmlPersistentType(); - XmlTypeMapping typeMapping = buildXmlTypeMapping(persistentType.typeMappingProviders(), mappingKey); - if (className.startsWith(getPackage() + ".")) { - // adds short name if package name is specified - className = className.substring(getPackage().length() + 1); - } - typeMapping.getPersistentType().setClass(className); - insertTypeMapping(typeMapping); - } - - public void changeMapping(XmlTypeMapping oldMapping, String newMappingKey) { - XmlTypeMapping newTypeMapping = buildXmlTypeMapping(oldMapping.getPersistentType().typeMappingProviders(), newMappingKey); - newTypeMapping.setPersistentType(oldMapping.getPersistentType()); - getTypeMappings().remove(oldMapping); - newTypeMapping.initializeFrom(oldMapping); - insertTypeMapping(newTypeMapping); - } - - private XmlTypeMapping buildXmlTypeMapping(Collection providers, String key) { - for (IXmlTypeMappingProvider provider : providers) { - if (provider.key().equals(key)) { - return provider.buildTypeMapping(); - } - } - //TODO throw an exception? what about the NullJavaTypeMapping? - return null; - } - - private void insertTypeMapping(XmlTypeMapping newMapping) { - int newIndex = CollectionTools.insertionIndexOf(getTypeMappings(), newMapping, buildMappingComparator()); - getTypeMappings().add(newIndex, newMapping); - } - - private Comparator buildMappingComparator() { - return new Comparator() { - public int compare(XmlTypeMapping o1, XmlTypeMapping o2) { - int o1Sequence = o1.xmlSequence(); - int o2Sequence = o2.xmlSequence(); - if (o1Sequence < o2Sequence) { - return -1; - } - if (o1Sequence == o2Sequence) { - return 0; - } - return 1; - } - }; - } - - /** - * Override this because EntityMappingInternal does not have an eContainer() - * This is because entityMappings is the "root" feature of the doc for xml Translators - * and thus cannot be "contained" - */ - @Override - public IJpaProject getJpaProject() { - IJpaFile file = getJpaFile(); - return (file == null) ? null : file.getJpaProject(); - } - - /* @see IJpaContentNode#getId() */ - public Object getId() { - return IXmlContentNodes.ENTITY_MAPPINGS_ID; - } - - public IJpaContentNode getContentNode(int offset) { - for (Iterator i = getTypeMappings().iterator(); i.hasNext();) { - XmlTypeMapping mapping = (XmlTypeMapping) i.next(); - if (mapping.getNode().contains(offset)) { - return mapping.getContentNode(offset); - } - } - return this; - } - - public void handleJavaElementChangedEvent(ElementChangedEvent event) { - for (Iterator i = getTypeMappings().iterator(); i.hasNext();) { - XmlTypeMapping mapping = (XmlTypeMapping) i.next(); - //mapping.javaElementChanged(event); - } - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultCatalog((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)); - setDefaultSchema((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY)); - setDefaultAccess((AccessType) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_ACCESS_KEY)); - } - - - private class TypeMappingsList - extends EObjectContainmentEList - { - private TypeMappingsList() { - super(XmlTypeMapping.class, EntityMappingsInternal.this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS); - } - - @Override - protected void didAdd(int index, XmlTypeMapping newObject) { - XmlPersistentType type = newObject.getPersistentType(); - if (getPersistentTypes().contains(type)) { - // the type has been remapped. don't remove, simply move. - getPersistentTypes().move(index, type); - } - else { - getPersistentTypes().add(index, type); - } - } - - @Override - protected void didChange() { - // TODO Auto-generated method stub - super.didChange(); - } - - @Override - protected void didClear(int size, Object[] oldObjects) { - getPersistentTypes().clear(); - } - - @Override - protected void didMove(int index, XmlTypeMapping movedObject, int oldIndex) { - getPersistentTypes().move(index, movedObject.getPersistentType()); - } - - @Override - protected void didRemove(int index, XmlTypeMapping oldObject) { - XmlPersistentType type = oldObject.getPersistentType(); - if (type != null) { - // the type has been remapped. don't remove, simply move. - // (see didAdd(int, XmlTypeMapping) ) - getPersistentTypes().remove(oldObject.getPersistentType()); - } - } - - @Override - protected void didSet(int index, XmlTypeMapping newObject, XmlTypeMapping oldObject) { - getPersistentTypes().set(index, newObject.getPersistentType()); - } - } -} // EntityMappingsInternal diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlAttributeMappingProvider.java deleted file mode 100644 index 41f0e2daed..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlAttributeMappingProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -public interface IXmlAttributeMappingProvider -{ - String key(); - - XmlAttributeMapping buildAttributeMapping(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlColumnMapping.java deleted file mode 100644 index c071c1308b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlColumnMapping.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; - -/** - * - * A representation of the model object 'IXml Column Mapping'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping#getColumnForXml Column For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IXmlColumnMapping extends IColumnMapping -{ - /** - * Returns the value of the 'Column For Xml' reference. - * - *

- * If the meaning of the 'Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column For Xml' reference. - * @see #setColumnForXml(XmlColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping_ColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - XmlColumn getColumnForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping#getColumnForXml Column For Xml}' reference. - * - * - * @param value the new value of the 'Column For Xml' reference. - * @see #getColumnForXml() - * @generated - */ - void setColumnForXml(XmlColumn value); - - /** - * - * - * @model - * @generated - */ - void makeColumnForXmlNonNull(); - - /** - * - * - * @model - * @generated - */ - void makeColumnForXmlNull(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlContentNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlContentNodes.java deleted file mode 100644 index 59d4ff5107..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlContentNodes.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.JptCorePlugin; - -public interface IXmlContentNodes -{ - public static final String XML_ROOT_ID = - JptCorePlugin.PLUGIN_ID + ".xml.Root"; - - public static final String ENTITY_MAPPINGS_ID = - JptCorePlugin.PLUGIN_ID + ".xml.entityMappings"; - - public static final String PERSISTENT_TYPE_ID = - JptCorePlugin.PLUGIN_ID + ".xml.persistentType"; - - public static final String PERSISTENT_ATTRIBUTE_ID = - JptCorePlugin.PLUGIN_ID + ".xml.persistentAttribute"; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlTypeMappingProvider.java deleted file mode 100644 index a1434a6482..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlTypeMappingProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - - -public interface IXmlTypeMappingProvider -{ - String key(); - - XmlTypeMapping buildTypeMapping(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java deleted file mode 100644 index 75b6486828..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java +++ /dev/null @@ -1,698 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.ITable; - -/** - * - * An implementation of the model Factory. - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage - * @generated - */ -public class OrmFactory extends EFactoryImpl -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final OrmFactory eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static OrmFactory init() { - try { - OrmFactory theOrmFactory = (OrmFactory) EPackage.Registry.INSTANCE.getEFactory("jpt.orm.xmi"); - if (theOrmFactory != null) { - return theOrmFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new OrmFactory(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public OrmFactory() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case OrmPackage.XML_ROOT_CONTENT_NODE : - return createXmlRootContentNode(); - case OrmPackage.ENTITY_MAPPINGS_INTERNAL : - return createEntityMappingsInternal(); - case OrmPackage.XML_PERSISTENT_TYPE : - return createXmlPersistentType(); - case OrmPackage.XML_MAPPED_SUPERCLASS : - return createXmlMappedSuperclass(); - case OrmPackage.XML_ENTITY_INTERNAL : - return createXmlEntityInternal(); - case OrmPackage.XML_EMBEDDABLE : - return createXmlEmbeddable(); - case OrmPackage.XML_NULL_ATTRIBUTE_MAPPING : - return createXmlNullAttributeMapping(); - case OrmPackage.XML_BASIC : - return createXmlBasic(); - case OrmPackage.XML_ID : - return createXmlId(); - case OrmPackage.XML_TRANSIENT : - return createXmlTransient(); - case OrmPackage.XML_EMBEDDED : - return createXmlEmbedded(); - case OrmPackage.XML_EMBEDDED_ID : - return createXmlEmbeddedId(); - case OrmPackage.XML_VERSION : - return createXmlVersion(); - case OrmPackage.XML_ONE_TO_MANY : - return createXmlOneToMany(); - case OrmPackage.XML_MANY_TO_MANY : - return createXmlManyToMany(); - case OrmPackage.XML_PERSISTENT_ATTRIBUTE : - return createXmlPersistentAttribute(); - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL : - return createPersistenceUnitMetadataInternal(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL : - return createPersistenceUnitDefaultsInternal(); - case OrmPackage.XML_TABLE : - return createXmlTable(); - case OrmPackage.XML_COLUMN : - return createXmlColumn(); - case OrmPackage.XML_JOIN_COLUMN : - return createXmlJoinColumn(); - case OrmPackage.XML_MANY_TO_ONE : - return createXmlManyToOne(); - case OrmPackage.XML_ONE_TO_ONE : - return createXmlOneToOne(); - case OrmPackage.XML_JOIN_TABLE : - return createXmlJoinTable(); - case OrmPackage.XML_ATTRIBUTE_OVERRIDE : - return createXmlAttributeOverride(); - case OrmPackage.XML_ASSOCIATION_OVERRIDE : - return createXmlAssociationOverride(); - case OrmPackage.XML_DISCRIMINATOR_COLUMN : - return createXmlDiscriminatorColumn(); - case OrmPackage.XML_SECONDARY_TABLE : - return createXmlSecondaryTable(); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN : - return createXmlPrimaryKeyJoinColumn(); - case OrmPackage.XML_GENERATED_VALUE : - return createXmlGeneratedValue(); - case OrmPackage.XML_SEQUENCE_GENERATOR : - return createXmlSequenceGenerator(); - case OrmPackage.XML_TABLE_GENERATOR : - return createXmlTableGenerator(); - case OrmPackage.XML_NAMED_QUERY : - return createXmlNamedQuery(); - case OrmPackage.XML_NAMED_NATIVE_QUERY : - return createXmlNamedNativeQuery(); - case OrmPackage.XML_QUERY_HINT : - return createXmlQueryHint(); - case OrmPackage.XML_UNIQUE_CONSTRAINT : - return createXmlUniqueConstraint(); - case OrmPackage.XML_CASCADE : - return createXmlCascade(); - case OrmPackage.XML_ID_CLASS : - return createXmlIdClass(); - case OrmPackage.XML_INHERITANCE : - return createXmlInheritance(); - case OrmPackage.XML_MAP_KEY : - return createXmlMapKey(); - default : - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public XmlRootContentNode createXmlRootContentNode() { - XmlRootContentNode xmlRootContentNode = new XmlRootContentNode(); - return xmlRootContentNode; - } - - /** - * - * - * @generated - */ - public EntityMappingsInternal createEntityMappingsInternal() { - EntityMappingsInternal entityMappingsInternal = new EntityMappingsInternal(); - return entityMappingsInternal; - } - - /** - * - * - * @generated - */ - public XmlPersistentType createXmlPersistentType() { - XmlPersistentType xmlPersistentType = new XmlPersistentType(); - return xmlPersistentType; - } - - public XmlPersistentType createXmlPersistentType(String mappingKey) { - XmlPersistentType xmlPersistentType = new XmlPersistentType(mappingKey); - return xmlPersistentType; - } - - /** - * - * - * @generated - */ - public XmlMappedSuperclass createXmlMappedSuperclassGen() { - XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass(); - return xmlMappedSuperclass; - } - - public XmlMappedSuperclass createXmlMappedSuperclass() { - XmlMappedSuperclass mappedSuperclass = createXmlMappedSuperclassGen(); - XmlPersistentType persistentType = createXmlPersistentType(IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - mappedSuperclass.setPersistentType(persistentType); - return mappedSuperclass; - } - - /** - * - * - * @generated - */ - public XmlEntityInternal createXmlEntityInternalGen() { - XmlEntityInternal xmlEntityInternal = new XmlEntityInternal(); - return xmlEntityInternal; - } - - public XmlEntityInternal createXmlEntityInternal() { - XmlEntityInternal entity = createXmlEntityInternalGen(); - XmlPersistentType persistentType = createXmlPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY); - entity.setPersistentType(persistentType); - return entity; - } - - /** - * - * - * @generated - */ - public XmlEmbeddable createXmlEmbeddableGen() { - XmlEmbeddable xmlEmbeddable = new XmlEmbeddable(); - return xmlEmbeddable; - } - - public XmlEmbeddable createXmlEmbeddable() { - XmlEmbeddable embeddable = createXmlEmbeddableGen(); - XmlPersistentType persistentType = createXmlPersistentType(IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - embeddable.setPersistentType(persistentType); - return embeddable; - } - - /** - * - * - * @generated - */ - public XmlNullAttributeMapping createXmlNullAttributeMappingGen() { - XmlNullAttributeMapping xmlNullAttributeMapping = new XmlNullAttributeMapping(); - return xmlNullAttributeMapping; - } - - public XmlNullAttributeMapping createXmlNullAttributeMapping() { - XmlNullAttributeMapping xmlNullAttributeMapping = createXmlNullAttributeMappingGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlNullAttributeMapping.setPersistentAttribute(persistentAttribute); - return xmlNullAttributeMapping; - } - - /** - * - * - * @generated - */ - public XmlPersistentAttribute createXmlPersistentAttribute() { - XmlPersistentAttribute xmlPersistentAttribute = new XmlPersistentAttribute(); - return xmlPersistentAttribute; - } - - /** - * - * - * @generated - */ - public XmlBasic createXmlBasicGen() { - XmlBasic xmlBasic = new XmlBasic(); - return xmlBasic; - } - - public XmlBasic createXmlBasic() { - XmlBasic basic = createXmlBasicGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - basic.setPersistentAttribute(persistentAttribute); - return basic; - } - - /** - * - * - * @generated - */ - public XmlId createXmlIdGen() { - XmlId xmlId = new XmlId(); - return xmlId; - } - - public XmlId createXmlId() { - XmlId id = createXmlIdGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - id.setPersistentAttribute(persistentAttribute); - return id; - } - - /** - * - * - * @generated - */ - public XmlTransient createXmlTransientGen() { - XmlTransient xmlTransient = new XmlTransient(); - return xmlTransient; - } - - public XmlTransient createXmlTransient() { - XmlTransient xmlTransient = createXmlTransientGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlTransient.setPersistentAttribute(persistentAttribute); - return xmlTransient; - } - - /** - * - * - * @generated - */ - public XmlEmbedded createXmlEmbeddedGen() { - XmlEmbedded xmlEmbedded = new XmlEmbedded(); - return xmlEmbedded; - } - - public XmlEmbedded createXmlEmbedded() { - XmlEmbedded xmlEmbedded = createXmlEmbeddedGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlEmbedded.setPersistentAttribute(persistentAttribute); - return xmlEmbedded; - } - - /** - * - * - * @generated - */ - public XmlEmbeddedId createXmlEmbeddedIdGen() { - XmlEmbeddedId xmlEmbeddedId = new XmlEmbeddedId(); - return xmlEmbeddedId; - } - - public XmlEmbeddedId createXmlEmbeddedId() { - XmlEmbeddedId xmlEmbeddedId = createXmlEmbeddedIdGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlEmbeddedId.setPersistentAttribute(persistentAttribute); - return xmlEmbeddedId; - } - - /** - * - * - * @generated - */ - public XmlVersion createXmlVersionGen() { - XmlVersion xmlVersion = new XmlVersion(); - return xmlVersion; - } - - public XmlVersion createXmlVersion() { - XmlVersion xmlVersion = createXmlVersionGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlVersion.setPersistentAttribute(persistentAttribute); - return xmlVersion; - } - - /** - * - * - * @generated - */ - public XmlOneToMany createXmlOneToManyGen() { - XmlOneToMany xmlOneToMany = new XmlOneToMany(); - return xmlOneToMany; - } - - public XmlOneToMany createXmlOneToMany() { - XmlOneToMany oneToMany = createXmlOneToManyGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - oneToMany.setPersistentAttribute(persistentAttribute); - return oneToMany; - } - - /** - * - * - * @generated - */ - public XmlManyToMany createXmlManyToManyGen() { - XmlManyToMany xmlManyToMany = new XmlManyToMany(); - return xmlManyToMany; - } - - public XmlManyToMany createXmlManyToMany() { - XmlManyToMany manyToMany = createXmlManyToManyGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - manyToMany.setPersistentAttribute(persistentAttribute); - return manyToMany; - } - - /** - * - * - * @generated - */ - public PersistenceUnitMetadataInternal createPersistenceUnitMetadataInternal() { - PersistenceUnitMetadataInternal persistenceUnitMetadataInternal = new PersistenceUnitMetadataInternal(); - return persistenceUnitMetadataInternal; - } - - /** - * - * - * @generated - */ - public PersistenceUnitDefaultsInternal createPersistenceUnitDefaultsInternal() { - PersistenceUnitDefaultsInternal persistenceUnitDefaultsInternal = new PersistenceUnitDefaultsInternal(); - return persistenceUnitDefaultsInternal; - } - - /** - * - * - * @generated - */ - public XmlTable createXmlTable() { - XmlTable xmlTable = new XmlTable(); - return xmlTable; - } - - public XmlTable createXmlTable(ITable.Owner owner) { - return new XmlTable(owner); - } - - /** - * - * - * @generated - */ - public XmlColumn createXmlColumn() { - XmlColumn xmlColumn = new XmlColumn(); - return xmlColumn; - } - - public XmlColumn createXmlColumn(IColumn.Owner owner) { - return new XmlColumn(owner); - } - - /** - * - * - * @generated NOT - */ - public XmlJoinColumn createXmlJoinColumn() { - throw new UnsupportedOperationException("Use createXmlJoinColumn(IColumn.Owner) instead"); - } - - public XmlJoinColumn createXmlJoinColumn(IJoinColumn.Owner owner) { - return new XmlJoinColumn(owner); - } - - /** - * - * - * @generated - */ - public XmlManyToOne createXmlManyToOneGen() { - XmlManyToOne xmlManyToOne = new XmlManyToOne(); - return xmlManyToOne; - } - - public XmlManyToOne createXmlManyToOne() { - XmlManyToOne xmlManyToOne = createXmlManyToOneGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlManyToOne.setPersistentAttribute(persistentAttribute); - return xmlManyToOne; - } - - /** - * - * - * @generated - */ - public XmlOneToOne createXmlOneToOneGen() { - XmlOneToOne xmlOneToOne = new XmlOneToOne(); - return xmlOneToOne; - } - - public XmlOneToOne createXmlOneToOne() { - XmlOneToOne xmlOneToOne = createXmlOneToOneGen(); - XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(); - xmlOneToOne.setPersistentAttribute(persistentAttribute); - return xmlOneToOne; - } - - /** - * - * - * @generated - */ - public XmlJoinTable createXmlJoinTable() { - XmlJoinTable xmlJoinTable = new XmlJoinTable(); - return xmlJoinTable; - } - - public XmlJoinTable createXmlJoinTable(IJoinTable.Owner owner) { - return new XmlJoinTable(owner); - } - - public XmlAttributeOverride createXmlAttributeOverride() { - throw new UnsupportedOperationException("Use createXmlAttributeOverride(IAttributeOverride.Owner) instead"); - } - - public XmlAttributeOverride createXmlAttributeOverride(IAttributeOverride.Owner owner) { - XmlAttributeOverride xmlAttributeOverride = new XmlAttributeOverride(owner); - return xmlAttributeOverride; - } - - public XmlAssociationOverride createXmlAssociationOverride() { - throw new UnsupportedOperationException("Use createXmlAssociationOverride(IAssociationOverride.Owner) instead"); - } - - public XmlAssociationOverride createXmlAssociationOverride(IAssociationOverride.Owner owner) { - XmlAssociationOverride xmlAssociationOverride = new XmlAssociationOverride(owner); - return xmlAssociationOverride; - } - - public XmlDiscriminatorColumn createXmlDiscriminatorColumn() { - throw new UnsupportedOperationException("Use createXmlDiscriminatorColumn(INamedColumn.Owner) instead"); - } - - public XmlDiscriminatorColumn createXmlDiscriminatorColumn(INamedColumn.Owner owner) { - XmlDiscriminatorColumn xmlDiscriminatorColumn = new XmlDiscriminatorColumn(owner); - return xmlDiscriminatorColumn; - } - - public XmlSecondaryTable createXmlSecondaryTable() { - throw new UnsupportedOperationException(); - } - - public XmlPrimaryKeyJoinColumn createXmlPrimaryKeyJoinColumn() { - throw new UnsupportedOperationException("Use createXmlPrimaryKeyJoinColumn(INamedColumn.Owner) instead"); - } - - /** - * - * - * @generated - */ - public XmlGeneratedValue createXmlGeneratedValue() { - XmlGeneratedValue xmlGeneratedValue = new XmlGeneratedValue(); - return xmlGeneratedValue; - } - - /** - * - * - * @generated - */ - public XmlSequenceGenerator createXmlSequenceGenerator() { - XmlSequenceGenerator xmlSequenceGenerator = new XmlSequenceGenerator(); - return xmlSequenceGenerator; - } - - /** - * - * - * @generated - */ - public XmlTableGenerator createXmlTableGenerator() { - XmlTableGenerator xmlTableGenerator = new XmlTableGenerator(); - return xmlTableGenerator; - } - - /** - * - * - * @generated - */ - public XmlNamedQuery createXmlNamedQuery() { - XmlNamedQuery xmlNamedQuery = new XmlNamedQuery(); - return xmlNamedQuery; - } - - /** - * - * - * @generated - */ - public XmlNamedNativeQuery createXmlNamedNativeQuery() { - XmlNamedNativeQuery xmlNamedNativeQuery = new XmlNamedNativeQuery(); - return xmlNamedNativeQuery; - } - - /** - * - * - * @generated - */ - public XmlQueryHint createXmlQueryHint() { - XmlQueryHint xmlQueryHint = new XmlQueryHint(); - return xmlQueryHint; - } - - /** - * - * - * @generated - */ - public XmlUniqueConstraint createXmlUniqueConstraint() { - XmlUniqueConstraint xmlUniqueConstraint = new XmlUniqueConstraint(); - return xmlUniqueConstraint; - } - - /** - * - * - * @generated - */ - public XmlCascade createXmlCascade() { - XmlCascade xmlCascade = new XmlCascade(); - return xmlCascade; - } - - /** - * - * - * @generated - */ - public XmlIdClass createXmlIdClass() { - XmlIdClass xmlIdClass = new XmlIdClass(); - return xmlIdClass; - } - - /** - * - * - * @generated - */ - public XmlInheritance createXmlInheritance() { - XmlInheritance xmlInheritance = new XmlInheritance(); - return xmlInheritance; - } - - /** - * - * - * @generated - */ - public XmlMapKey createXmlMapKey() { - XmlMapKey xmlMapKey = new XmlMapKey(); - return xmlMapKey; - } - - public XmlPrimaryKeyJoinColumn createXmlPrimaryKeyJoinColumn(IAbstractJoinColumn.Owner owner) { - XmlPrimaryKeyJoinColumn xmlPrimaryKeyJoinColumn = new XmlPrimaryKeyJoinColumn(owner); - return xmlPrimaryKeyJoinColumn; - } - - public XmlSecondaryTable createXmlSecondaryTable(ITable.Owner owner) { - XmlSecondaryTable xmlSecondaryTable = new XmlSecondaryTable(owner); - return xmlSecondaryTable; - } - - /** - * - * - * @generated - */ - public OrmPackage getOrmPackage() { - return (OrmPackage) getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static OrmPackage getPackage() { - return OrmPackage.eINSTANCE; - } -} //JpaCoreXmlFactory \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmInit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmInit.java deleted file mode 100644 index b93a2b8831..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmInit.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlResourceFactory; -import org.eclipse.wst.common.componentcore.internal.impl.WTPEntityResolver; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil; - -public class OrmInit -{ - private static boolean initialized = false; - - public static void init() { - init(true); - } - - public static void init(boolean shouldPreregisterPackages) { - if (! initialized) { - initialized = true; - DOMUtilities.setDefaultEntityResolver(WTPEntityResolver.INSTANCE); - initResourceFactories(); - } - if (shouldPreregisterPackages) { - preregisterPackages(); - } - } - - private static void initResourceFactories() { - OrmXmlResourceFactory.register(); - } - - private static void preregisterPackages() { - ExtendedEcoreUtil.preRegisterPackage( - "orm.xmi", //$NON-NLS-1$ - new EPackage.Descriptor() { - public EPackage getEPackage() { - return OrmPackage.eINSTANCE; - } - - public EFactory getEFactory() { - return OrmFactory.eINSTANCE; - } - } - ); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java deleted file mode 100644 index 5dd4524349..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java +++ /dev/null @@ -1,10017 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmFactory - * @model kind="package" - * @generated - */ -public class OrmPackage extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "orm"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "jpt.orm.xmi"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "org.eclipse.jpt.core.content.orm"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final OrmPackage eINSTANCE = org.eclipse.jpt.core.internal.content.orm.OrmPackage.init(); - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode Xml Root Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRootContentNode() - * @generated - */ - public static final int XML_ROOT_CONTENT_NODE = 0; - - /** - * The feature id for the 'Jpa File' container reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ROOT_CONTENT_NODE__JPA_FILE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Entity Mappings' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Root Content Node' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ROOT_CONTENT_NODE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal Entity Mappings Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal() - * @generated - */ - public static final int ENTITY_MAPPINGS_INTERNAL = 1; - - /** - * The feature id for the 'Persistence Unit Metadata For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Package For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PACKAGE_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Persistence Unit Metadata' reference. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Package' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PACKAGE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Root' reference. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__ROOT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Version' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__VERSION = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Description' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__DESCRIPTION = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Persistence Unit Metadata Internal' containment reference. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Package Internal' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Default Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Specified Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Type Mappings' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 18; - - /** - * The feature id for the 'Persistent Types' reference list. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 19; - - /** - * The feature id for the 'Sequence Generators' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 20; - - /** - * The feature id for the 'Table Generators' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 21; - - /** - * The feature id for the 'Named Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 22; - - /** - * The feature id for the 'Named Native Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 23; - - /** - * The number of structural features of the 'Entity Mappings Internal' class. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_INTERNAL_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 24; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings Entity Mappings}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappings - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings() - * @generated - */ - public static final int ENTITY_MAPPINGS = 2; - - /** - * The feature id for the 'Persistence Unit Metadata' reference. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = 0; - - /** - * The feature id for the 'Package' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS__PACKAGE = 1; - - /** - * The number of structural features of the 'Entity Mappings' class. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml Entity Mappings For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml() - * @generated - */ - public static final int ENTITY_MAPPINGS_FOR_XML = 3; - - /** - * The feature id for the 'Persistence Unit Metadata For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_FOR_XML__PERSISTENCE_UNIT_METADATA_FOR_XML = 0; - - /** - * The feature id for the 'Package For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_FOR_XML__PACKAGE_FOR_XML = 1; - - /** - * The number of structural features of the 'Entity Mappings For Xml' class. - * - * - * @generated - * @ordered - */ - public static final int ENTITY_MAPPINGS_FOR_XML_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping Xml Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping() - * @generated - */ - public static final int XML_TYPE_MAPPING = 4; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__TABLE_NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__DEFAULT_ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Specified Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__SPECIFIED_ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Metadata Complete' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__METADATA_COMPLETE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Persistent Type' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING__PERSISTENT_TYPE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'Xml Type Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int XML_TYPE_MAPPING_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType Xml Persistent Type}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType() - * @generated - */ - public static final int XML_PERSISTENT_TYPE = 5; - - /** - * The feature id for the 'Mapping Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__MAPPING_KEY = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__CLASS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Attribute Mappings' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Specified Attribute Mappings' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Virtual Attribute Mappings' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Persistent Attributes' reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Specified Persistent Attributes' reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Virtual Persistent Attributes' reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The number of structural features of the 'Xml Persistent Type' class. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_TYPE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass Xml Mapped Superclass}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass() - * @generated - */ - public static final int XML_MAPPED_SUPERCLASS = 6; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__NAME = XML_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__TABLE_NAME = XML_TYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Default Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__DEFAULT_ACCESS = XML_TYPE_MAPPING__DEFAULT_ACCESS; - - /** - * The feature id for the 'Specified Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__SPECIFIED_ACCESS = XML_TYPE_MAPPING__SPECIFIED_ACCESS; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__ACCESS = XML_TYPE_MAPPING__ACCESS; - - /** - * The feature id for the 'Metadata Complete' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__METADATA_COMPLETE = XML_TYPE_MAPPING__METADATA_COMPLETE; - - /** - * The feature id for the 'Persistent Type' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__PERSISTENT_TYPE = XML_TYPE_MAPPING__PERSISTENT_TYPE; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__ID_CLASS = XML_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Id Class For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML = XML_TYPE_MAPPING_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Mapped Superclass' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal Xml Entity Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityInternal() - * @generated - */ - public static final int XML_ENTITY_INTERNAL = 7; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__NAME = XML_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__TABLE_NAME = XML_TYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Default Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DEFAULT_ACCESS = XML_TYPE_MAPPING__DEFAULT_ACCESS; - - /** - * The feature id for the 'Specified Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_ACCESS = XML_TYPE_MAPPING__SPECIFIED_ACCESS; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__ACCESS = XML_TYPE_MAPPING__ACCESS; - - /** - * The feature id for the 'Metadata Complete' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__METADATA_COMPLETE = XML_TYPE_MAPPING__METADATA_COMPLETE; - - /** - * The feature id for the 'Persistent Type' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__PERSISTENT_TYPE = XML_TYPE_MAPPING__PERSISTENT_TYPE; - - /** - * The feature id for the 'Table For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__TABLE_FOR_XML = XML_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Discriminator Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML = XML_TYPE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Id Class For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML = XML_TYPE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Inheritance For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML = XML_TYPE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_NAME = XML_TYPE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DEFAULT_NAME = XML_TYPE_MAPPING_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__TABLE = XML_TYPE_MAPPING_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES = XML_TYPE_MAPPING_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__PRIMARY_KEY_JOIN_COLUMNS = XML_TYPE_MAPPING_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = XML_TYPE_MAPPING_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = XML_TYPE_MAPPING_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Inheritance Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY = XML_TYPE_MAPPING_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Default Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE = XML_TYPE_MAPPING_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Specified Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE = XML_TYPE_MAPPING_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DISCRIMINATOR_VALUE = XML_TYPE_MAPPING_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Discriminator Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN = XML_TYPE_MAPPING_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR = XML_TYPE_MAPPING_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__TABLE_GENERATOR = XML_TYPE_MAPPING_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES = XML_TYPE_MAPPING_FEATURE_COUNT + 18; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES = XML_TYPE_MAPPING_FEATURE_COUNT + 19; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES = XML_TYPE_MAPPING_FEATURE_COUNT + 20; - - /** - * The feature id for the 'Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES = XML_TYPE_MAPPING_FEATURE_COUNT + 21; - - /** - * The feature id for the 'Specified Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES = XML_TYPE_MAPPING_FEATURE_COUNT + 22; - - /** - * The feature id for the 'Default Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES = XML_TYPE_MAPPING_FEATURE_COUNT + 23; - - /** - * The feature id for the 'Named Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__NAMED_QUERIES = XML_TYPE_MAPPING_FEATURE_COUNT + 24; - - /** - * The feature id for the 'Named Native Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES = XML_TYPE_MAPPING_FEATURE_COUNT + 25; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__ID_CLASS = XML_TYPE_MAPPING_FEATURE_COUNT + 26; - - /** - * The feature id for the 'Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__SECONDARY_TABLES = XML_TYPE_MAPPING_FEATURE_COUNT + 27; - - /** - * The feature id for the 'Virtual Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES = XML_TYPE_MAPPING_FEATURE_COUNT + 28; - - /** - * The number of structural features of the 'Xml Entity Internal' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_INTERNAL_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 29; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml Xml Entity For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml() - * @generated - */ - public static final int XML_ENTITY_FOR_XML = 8; - - /** - * The feature id for the 'Table For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_FOR_XML__TABLE_FOR_XML = 0; - - /** - * The feature id for the 'Discriminator Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML = 1; - - /** - * The feature id for the 'Id Class For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_FOR_XML__ID_CLASS_FOR_XML = 2; - - /** - * The feature id for the 'Inheritance For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_FOR_XML__INHERITANCE_FOR_XML = 3; - - /** - * The number of structural features of the 'Xml Entity For Xml' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_FOR_XML_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity Xml Entity}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity() - * @generated - */ - public static final int XML_ENTITY = 9; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__NAME = JpaCoreMappingsPackage.IENTITY__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__TABLE_NAME = JpaCoreMappingsPackage.IENTITY__TABLE_NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SPECIFIED_NAME = JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DEFAULT_NAME = JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME; - - /** - * The feature id for the 'Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__TABLE = JpaCoreMappingsPackage.IENTITY__TABLE; - - /** - * The feature id for the 'Specified Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SPECIFIED_SECONDARY_TABLES = JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = JpaCoreMappingsPackage.IENTITY__PRIMARY_KEY_JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = JpaCoreMappingsPackage.IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - - /** - * The feature id for the 'Inheritance Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__INHERITANCE_STRATEGY = JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY; - - /** - * The feature id for the 'Default Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DEFAULT_DISCRIMINATOR_VALUE = JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE; - - /** - * The feature id for the 'Specified Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SPECIFIED_DISCRIMINATOR_VALUE = JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE; - - /** - * The feature id for the 'Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DISCRIMINATOR_VALUE = JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_VALUE; - - /** - * The feature id for the 'Discriminator Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DISCRIMINATOR_COLUMN = JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_COLUMN; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SEQUENCE_GENERATOR = JpaCoreMappingsPackage.IENTITY__SEQUENCE_GENERATOR; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__TABLE_GENERATOR = JpaCoreMappingsPackage.IENTITY__TABLE_GENERATOR; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__ATTRIBUTE_OVERRIDES = JpaCoreMappingsPackage.IENTITY__ATTRIBUTE_OVERRIDES; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES = JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DEFAULT_ATTRIBUTE_OVERRIDES = JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES; - - /** - * The feature id for the 'Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__ASSOCIATION_OVERRIDES = JpaCoreMappingsPackage.IENTITY__ASSOCIATION_OVERRIDES; - - /** - * The feature id for the 'Specified Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SPECIFIED_ASSOCIATION_OVERRIDES = JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES; - - /** - * The feature id for the 'Default Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__DEFAULT_ASSOCIATION_OVERRIDES = JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES; - - /** - * The feature id for the 'Named Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__NAMED_QUERIES = JpaCoreMappingsPackage.IENTITY__NAMED_QUERIES; - - /** - * The feature id for the 'Named Native Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__NAMED_NATIVE_QUERIES = JpaCoreMappingsPackage.IENTITY__NAMED_NATIVE_QUERIES; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__ID_CLASS = JpaCoreMappingsPackage.IENTITY__ID_CLASS; - - /** - * The feature id for the 'Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__SECONDARY_TABLES = JpaCoreMappingsPackage.IENTITY_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Virtual Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY__VIRTUAL_SECONDARY_TABLES = JpaCoreMappingsPackage.IENTITY_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Entity' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ENTITY_FEATURE_COUNT = JpaCoreMappingsPackage.IENTITY_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable Xml Embeddable}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddable() - * @generated - */ - public static final int XML_EMBEDDABLE = 10; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__NAME = XML_TYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__TABLE_NAME = XML_TYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Default Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__DEFAULT_ACCESS = XML_TYPE_MAPPING__DEFAULT_ACCESS; - - /** - * The feature id for the 'Specified Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__SPECIFIED_ACCESS = XML_TYPE_MAPPING__SPECIFIED_ACCESS; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__ACCESS = XML_TYPE_MAPPING__ACCESS; - - /** - * The feature id for the 'Metadata Complete' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__METADATA_COMPLETE = XML_TYPE_MAPPING__METADATA_COMPLETE; - - /** - * The feature id for the 'Persistent Type' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE__PERSISTENT_TYPE = XML_TYPE_MAPPING__PERSISTENT_TYPE; - - /** - * The number of structural features of the 'Xml Embeddable' class. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDABLE_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping Xml Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeMapping() - * @generated - */ - public static final int XML_ATTRIBUTE_MAPPING = 11; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml Attribute Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping Xml Null Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNullAttributeMapping() - * @generated - */ - public static final int XML_NULL_ATTRIBUTE_MAPPING = 12; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_NULL_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The number of structural features of the 'Xml Null Attribute Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int XML_NULL_ATTRIBUTE_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic Xml Basic}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlBasic - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlBasic() - * @generated - */ - public static final int XML_BASIC = 13; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__FETCH = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__OPTIONAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__COLUMN = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Lob' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__LOB = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__TEMPORAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Enumerated' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__ENUMERATED = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC__COLUMN_FOR_XML = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'Xml Basic' class. - * - * - * @generated - * @ordered - */ - public static final int XML_BASIC_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId Xml Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlId - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlId() - * @generated - */ - public static final int XML_ID = 14; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__COLUMN = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Generated Value' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__GENERATED_VALUE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__TEMPORAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__TABLE_GENERATOR = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__SEQUENCE_GENERATOR = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ID__COLUMN_FOR_XML = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Xml Id' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ID_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTransient Xml Transient}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTransient - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTransient() - * @generated - */ - public static final int XML_TRANSIENT = 15; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_TRANSIENT__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The number of structural features of the 'Xml Transient' class. - * - * - * @generated - * @ordered - */ - public static final int XML_TRANSIENT_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbedded Xml Embedded}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbedded - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbedded() - * @generated - */ - public static final int XML_EMBEDDED = 16; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED__ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Xml Embedded' class. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId Xml Embedded Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddedId() - * @generated - */ - public static final int XML_EMBEDDED_ID = 17; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED_ID__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The number of structural features of the 'Xml Embedded Id' class. - * - * - * @generated - * @ordered - */ - public static final int XML_EMBEDDED_ID_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlVersion Xml Version}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlVersion - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlVersion() - * @generated - */ - public static final int XML_VERSION = 18; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_VERSION__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_VERSION__COLUMN = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_VERSION__TEMPORAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_VERSION__COLUMN_FOR_XML = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Xml Version' class. - * - * - * @generated - * @ordered - */ - public static final int XML_VERSION_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping Xml Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRelationshipMapping() - * @generated - */ - public static final int XML_RELATIONSHIP_MAPPING = 40; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING__PERSISTENT_ATTRIBUTE = XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING__CASCADE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Xml Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int XML_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal Xml Multi Relationship Mapping Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingInternal() - * @generated - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL = 19; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__PERSISTENT_ATTRIBUTE = XML_RELATIONSHIP_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__SPECIFIED_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__DEFAULT_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__RESOLVED_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Join Table For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Map Key For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'Xml Multi Relationship Mapping Internal' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 7; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml Xml Multi Relationship Mapping For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml() - * @generated - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML = 20; - - /** - * The feature id for the 'Join Table For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML = 0; - - /** - * The feature id for the 'Map Key For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML = 1; - - /** - * The number of structural features of the 'Xml Multi Relationship Mapping For Xml' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping Xml Multi Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMapping() - * @generated - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING = 21; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__CASCADE = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__FETCH = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; - - /** - * The number of structural features of the 'Xml Multi Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToMany Xml One To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToMany - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToMany() - * @generated - */ - public static final int XML_ONE_TO_MANY = 22; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__PERSISTENT_ATTRIBUTE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__SPECIFIED_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__DEFAULT_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__RESOLVED_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__CASCADE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__MAPPED_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__MAP_KEY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY; - - /** - * The feature id for the 'Join Table For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__JOIN_TABLE_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML; - - /** - * The feature id for the 'Map Key For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__MAP_KEY_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML; - - /** - * The number of structural features of the 'Xml One To Many' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY_FEATURE_COUNT = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToMany Xml Many To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToMany - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToMany() - * @generated - */ - public static final int XML_MANY_TO_MANY = 23; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__PERSISTENT_ATTRIBUTE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__SPECIFIED_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__DEFAULT_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__RESOLVED_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__CASCADE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__MAPPED_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__MAP_KEY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY; - - /** - * The feature id for the 'Join Table For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__JOIN_TABLE_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML; - - /** - * The feature id for the 'Map Key For Xml' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__MAP_KEY_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML; - - /** - * The number of structural features of the 'Xml Many To Many' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY_FEATURE_COUNT = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute Xml Persistent Attribute}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute() - * @generated - */ - public static final int XML_PERSISTENT_ATTRIBUTE = 24; - - /** - * The feature id for the 'Mapping' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_ATTRIBUTE__MAPPING = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_ATTRIBUTE__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Persistent Attribute' class. - * - * - * @generated - * @ordered - */ - public static final int XML_PERSISTENT_ATTRIBUTE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal Persistence Unit Metadata Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal() - * @generated - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL = 25; - - /** - * The feature id for the 'Xml Mapping Metadata Complete For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persistence Unit Defaults For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Xml Mapping Metadata Complete' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Persistence Unit Defaults' reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Xml Mapping Metadata Complete Internal' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Persistence Unit Defaults Internal' containment reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Persistence Unit Metadata Internal' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_INTERNAL_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata Persistence Unit Metadata}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata() - * @generated - */ - public static final int PERSISTENCE_UNIT_METADATA = 26; - - /** - * The feature id for the 'Xml Mapping Metadata Complete' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persistence Unit Defaults' reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Persistence Unit Metadata' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml() - * @generated - */ - public static final int PERSISTENCE_UNIT_METADATA_FOR_XML = 27; - - /** - * The feature id for the 'Xml Mapping Metadata Complete For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_FOR_XML__XML_MAPPING_METADATA_COMPLETE_FOR_XML = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persistence Unit Defaults For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_FOR_XML__PERSISTENCE_UNIT_DEFAULTS_FOR_XML = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Persistence Unit Metadata For Xml' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_METADATA_FOR_XML_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal Persistence Unit Defaults Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal() - * @generated - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL = 28; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Cascade Persist' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Schema For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Catalog For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Access For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Cascade Persist For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Schema Internal' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Catalog Internal' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Access Internal' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Cascade Persist Internal' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 11; - - /** - * The number of structural features of the 'Persistence Unit Defaults Internal' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 12; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults Persistence Unit Defaults}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults() - * @generated - */ - public static final int PERSISTENCE_UNIT_DEFAULTS = 29; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS__SCHEMA = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS__CATALOG = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Access' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS__ACCESS = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Cascade Persist' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Persistence Unit Defaults' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml() - * @generated - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML = 30; - - /** - * The feature id for the 'Schema For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML__SCHEMA_FOR_XML = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Catalog For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CATALOG_FOR_XML = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Access For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML__ACCESS_FOR_XML = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Cascade Persist For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CASCADE_PERSIST_FOR_XML = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Persistence Unit Defaults For Xml' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable Abstract Xml Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlTable() - * @generated - */ - public static final int ABSTRACT_XML_TABLE = 42; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SPECIFIED_NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__DEFAULT_NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SPECIFIED_CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__DEFAULT_CATALOG = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__DEFAULT_SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Specified Catalog For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Specified Schema For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 12; - - /** - * The number of structural features of the 'Abstract Xml Table' class. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_TABLE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 13; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTable Xml Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTable() - * @generated - */ - public static final int XML_TABLE = 31; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__NAME = ABSTRACT_XML_TABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SPECIFIED_NAME = ABSTRACT_XML_TABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__DEFAULT_NAME = ABSTRACT_XML_TABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__CATALOG = ABSTRACT_XML_TABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SPECIFIED_CATALOG = ABSTRACT_XML_TABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__DEFAULT_CATALOG = ABSTRACT_XML_TABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SCHEMA = ABSTRACT_XML_TABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SPECIFIED_SCHEMA = ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__DEFAULT_SCHEMA = ABSTRACT_XML_TABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Specified Catalog For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SPECIFIED_CATALOG_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML; - - /** - * The feature id for the 'Specified Schema For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE__SPECIFIED_SCHEMA_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML; - - /** - * The number of structural features of the 'Xml Table' class. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_FEATURE_COUNT = ABSTRACT_XML_TABLE_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn Abstract Xml Named Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlNamedColumn() - * @generated - */ - public static final int ABSTRACT_XML_NAMED_COLUMN = 32; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Column Definition For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Abstract Xml Named Column' class. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn Abstract Xml Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn() - * @generated - */ - public static final int ABSTRACT_XML_COLUMN = 33; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__SPECIFIED_NAME = ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__DEFAULT_NAME = ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Column Definition For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__COLUMN_DEFINITION_FOR_XML = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__UNIQUE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__NULLABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__INSERTABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__UPDATABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__TABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__SPECIFIED_TABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__DEFAULT_TABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Unique For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Nullable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Insertable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Updatable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Specified Table For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 11; - - /** - * The number of structural features of the 'Abstract Xml Column' class. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 12; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn Xml Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlColumn() - * @generated - */ - public static final int XML_COLUMN = 34; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__NAME = ABSTRACT_XML_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__SPECIFIED_NAME = ABSTRACT_XML_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__DEFAULT_NAME = ABSTRACT_XML_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_COLUMN__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Column Definition For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__COLUMN_DEFINITION_FOR_XML = ABSTRACT_XML_COLUMN__COLUMN_DEFINITION_FOR_XML; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__UNIQUE = ABSTRACT_XML_COLUMN__UNIQUE; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__NULLABLE = ABSTRACT_XML_COLUMN__NULLABLE; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__INSERTABLE = ABSTRACT_XML_COLUMN__INSERTABLE; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__UPDATABLE = ABSTRACT_XML_COLUMN__UPDATABLE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__TABLE = ABSTRACT_XML_COLUMN__TABLE; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__SPECIFIED_TABLE = ABSTRACT_XML_COLUMN__SPECIFIED_TABLE; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__DEFAULT_TABLE = ABSTRACT_XML_COLUMN__DEFAULT_TABLE; - - /** - * The feature id for the 'Unique For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__UNIQUE_FOR_XML = ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML; - - /** - * The feature id for the 'Nullable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__NULLABLE_FOR_XML = ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML; - - /** - * The feature id for the 'Insertable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__INSERTABLE_FOR_XML = ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML; - - /** - * The feature id for the 'Updatable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__UPDATABLE_FOR_XML = ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML; - - /** - * The feature id for the 'Specified Table For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__SPECIFIED_TABLE_FOR_XML = ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML; - - /** - * The feature id for the 'Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__LENGTH = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Precision' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__PRECISION = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Scale' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__SCALE = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Length For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__LENGTH_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Precision For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__PRECISION_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Scale For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN__SCALE_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Xml Column' class. - * - * - * @generated - * @ordered - */ - public static final int XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn Xml Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinColumn() - * @generated - */ - public static final int XML_JOIN_COLUMN = 35; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__NAME = ABSTRACT_XML_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__SPECIFIED_NAME = ABSTRACT_XML_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__DEFAULT_NAME = ABSTRACT_XML_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_COLUMN__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Column Definition For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__COLUMN_DEFINITION_FOR_XML = ABSTRACT_XML_COLUMN__COLUMN_DEFINITION_FOR_XML; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__UNIQUE = ABSTRACT_XML_COLUMN__UNIQUE; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__NULLABLE = ABSTRACT_XML_COLUMN__NULLABLE; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__INSERTABLE = ABSTRACT_XML_COLUMN__INSERTABLE; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__UPDATABLE = ABSTRACT_XML_COLUMN__UPDATABLE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__TABLE = ABSTRACT_XML_COLUMN__TABLE; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__SPECIFIED_TABLE = ABSTRACT_XML_COLUMN__SPECIFIED_TABLE; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__DEFAULT_TABLE = ABSTRACT_XML_COLUMN__DEFAULT_TABLE; - - /** - * The feature id for the 'Unique For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__UNIQUE_FOR_XML = ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML; - - /** - * The feature id for the 'Nullable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__NULLABLE_FOR_XML = ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML; - - /** - * The feature id for the 'Insertable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__INSERTABLE_FOR_XML = ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML; - - /** - * The feature id for the 'Updatable For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__UPDATABLE_FOR_XML = ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML; - - /** - * The feature id for the 'Specified Table For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__SPECIFIED_TABLE_FOR_XML = ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Specified Referenced Column Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Xml Join Column' class. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping IXml Column Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping() - * @generated - */ - public static final int IXML_COLUMN_MAPPING = 36; - - /** - * The feature id for the 'Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int IXML_COLUMN_MAPPING__COLUMN_FOR_XML = JpaCoreMappingsPackage.ICOLUMN_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IXml Column Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int IXML_COLUMN_MAPPING_FEATURE_COUNT = JpaCoreMappingsPackage.ICOLUMN_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping Xml Single Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSingleRelationshipMapping() - * @generated - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING = 39; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__PERSISTENT_ATTRIBUTE = XML_RELATIONSHIP_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__FETCH = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Xml Single Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToOne Xml Many To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToOne - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToOne() - * @generated - */ - public static final int XML_MANY_TO_ONE = 37; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__PERSISTENT_ATTRIBUTE = XML_SINGLE_RELATIONSHIP_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__SPECIFIED_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__DEFAULT_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__RESOLVED_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__CASCADE = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__FETCH = XML_SINGLE_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__SPECIFIED_JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__DEFAULT_JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE__OPTIONAL = XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - - /** - * The number of structural features of the 'Xml Many To One' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MANY_TO_ONE_FEATURE_COUNT = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToOne Xml One To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToOne - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToOne() - * @generated - */ - public static final int XML_ONE_TO_ONE = 38; - - /** - * The feature id for the 'Persistent Attribute' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__PERSISTENT_ATTRIBUTE = XML_SINGLE_RELATIONSHIP_MAPPING__PERSISTENT_ATTRIBUTE; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__SPECIFIED_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__DEFAULT_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__RESOLVED_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__CASCADE = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__FETCH = XML_SINGLE_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__SPECIFIED_JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__DEFAULT_JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__OPTIONAL = XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE__MAPPED_BY = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml One To One' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ONE_TO_ONE_FEATURE_COUNT = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinTable Xml Join Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinTable() - * @generated - */ - public static final int XML_JOIN_TABLE = 41; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__NAME = ABSTRACT_XML_TABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_NAME = ABSTRACT_XML_TABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__DEFAULT_NAME = ABSTRACT_XML_TABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__CATALOG = ABSTRACT_XML_TABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_CATALOG = ABSTRACT_XML_TABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__DEFAULT_CATALOG = ABSTRACT_XML_TABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SCHEMA = ABSTRACT_XML_TABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_SCHEMA = ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__DEFAULT_SCHEMA = ABSTRACT_XML_TABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Specified Catalog For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_CATALOG_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML; - - /** - * The feature id for the 'Specified Schema For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_SCHEMA_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Xml Join Table' class. - * - * - * @generated - * @ordered - */ - public static final int XML_JOIN_TABLE_FEATURE_COUNT = ABSTRACT_XML_TABLE_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOverride Xml Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlOverride - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOverride() - * @generated - */ - public static final int XML_OVERRIDE = 43; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_OVERRIDE__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml Override' class. - * - * - * @generated - * @ordered - */ - public static final int XML_OVERRIDE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride Xml Attribute Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeOverride() - * @generated - */ - public static final int XML_ATTRIBUTE_OVERRIDE = 44; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ATTRIBUTE_OVERRIDE__NAME = XML_OVERRIDE__NAME; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ATTRIBUTE_OVERRIDE__COLUMN = XML_OVERRIDE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Column For Xml' reference. - * - * - * @generated - * @ordered - */ - public static final int XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML = XML_OVERRIDE_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Attribute Override' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ATTRIBUTE_OVERRIDE_FEATURE_COUNT = XML_OVERRIDE_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride Xml Association Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAssociationOverride() - * @generated - */ - public static final int XML_ASSOCIATION_OVERRIDE = 45; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ASSOCIATION_OVERRIDE__NAME = XML_OVERRIDE__NAME; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS = XML_OVERRIDE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS = XML_OVERRIDE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS = XML_OVERRIDE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Xml Association Override' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ASSOCIATION_OVERRIDE_FEATURE_COUNT = XML_OVERRIDE_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn Xml Discriminator Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlDiscriminatorColumn() - * @generated - */ - public static final int XML_DISCRIMINATOR_COLUMN = 46; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__SPECIFIED_NAME = ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__DEFAULT_NAME = ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Column Definition For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION_FOR_XML = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML; - - /** - * The feature id for the 'Discriminator Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Default Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Discriminator Type For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Length For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Xml Discriminator Column' class. - * - * - * @generated - * @ordered - */ - public static final int XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable Xml Secondary Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSecondaryTable() - * @generated - */ - public static final int XML_SECONDARY_TABLE = 47; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__NAME = ABSTRACT_XML_TABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_NAME = ABSTRACT_XML_TABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__DEFAULT_NAME = ABSTRACT_XML_TABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__CATALOG = ABSTRACT_XML_TABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_CATALOG = ABSTRACT_XML_TABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__DEFAULT_CATALOG = ABSTRACT_XML_TABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SCHEMA = ABSTRACT_XML_TABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_SCHEMA = ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__DEFAULT_SCHEMA = ABSTRACT_XML_TABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Specified Catalog For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_CATALOG_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML; - - /** - * The feature id for the 'Specified Schema For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_SCHEMA_FOR_XML = ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Xml Secondary Table' class. - * - * - * @generated - * @ordered - */ - public static final int XML_SECONDARY_TABLE_FEATURE_COUNT = ABSTRACT_XML_TABLE_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn Xml Primary Key Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPrimaryKeyJoinColumn() - * @generated - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 48; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_NAME = ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_NAME = ABSTRACT_XML_NAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Specified Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_NAME_FOR_XML = ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML; - - /** - * The feature id for the 'Column Definition For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION_FOR_XML = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Specified Referenced Column Name For Xml' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Xml Primary Key Join Column' class. - * - * - * @generated - * @ordered - */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue Xml Generated Value}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlGeneratedValue() - * @generated - */ - public static final int XML_GENERATED_VALUE = 49; - - /** - * The feature id for the 'Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATED_VALUE__STRATEGY = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Generator' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATED_VALUE__GENERATOR = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Generated Value' class. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATED_VALUE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator Xml Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlGenerator - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlGenerator() - * @generated - */ - public static final int XML_GENERATOR = 50; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__INITIAL_VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__SPECIFIED_INITIAL_VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__DEFAULT_INITIAL_VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__ALLOCATION_SIZE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR__DEFAULT_ALLOCATION_SIZE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'Xml Generator' class. - * - * - * @generated - * @ordered - */ - public static final int XML_GENERATOR_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator Xml Sequence Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSequenceGenerator() - * @generated - */ - public static final int XML_SEQUENCE_GENERATOR = 51; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__NAME = XML_GENERATOR__NAME; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__INITIAL_VALUE = XML_GENERATOR__INITIAL_VALUE; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__SPECIFIED_INITIAL_VALUE = XML_GENERATOR__SPECIFIED_INITIAL_VALUE; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__DEFAULT_INITIAL_VALUE = XML_GENERATOR__DEFAULT_INITIAL_VALUE; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE = XML_GENERATOR__ALLOCATION_SIZE; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__SPECIFIED_ALLOCATION_SIZE = XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__DEFAULT_ALLOCATION_SIZE = XML_GENERATOR__DEFAULT_ALLOCATION_SIZE; - - /** - * The feature id for the 'Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__SEQUENCE_NAME = XML_GENERATOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME = XML_GENERATOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME = XML_GENERATOR_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Xml Sequence Generator' class. - * - * - * @generated - * @ordered - */ - public static final int XML_SEQUENCE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator Xml Table Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTableGenerator() - * @generated - */ - public static final int XML_TABLE_GENERATOR = 52; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__NAME = XML_GENERATOR__NAME; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__INITIAL_VALUE = XML_GENERATOR__INITIAL_VALUE; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_INITIAL_VALUE = XML_GENERATOR__SPECIFIED_INITIAL_VALUE; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_INITIAL_VALUE = XML_GENERATOR__DEFAULT_INITIAL_VALUE; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__ALLOCATION_SIZE = XML_GENERATOR__ALLOCATION_SIZE; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_ALLOCATION_SIZE = XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_ALLOCATION_SIZE = XML_GENERATOR__DEFAULT_ALLOCATION_SIZE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__TABLE = XML_GENERATOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_TABLE = XML_GENERATOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_TABLE = XML_GENERATOR_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__CATALOG = XML_GENERATOR_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_CATALOG = XML_GENERATOR_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_CATALOG = XML_GENERATOR_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SCHEMA = XML_GENERATOR_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_SCHEMA = XML_GENERATOR_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_SCHEMA = XML_GENERATOR_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__PK_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Specified Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Default Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__VALUE_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Specified Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Default Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__PK_COLUMN_VALUE = XML_GENERATOR_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Specified Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE = XML_GENERATOR_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Default Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = XML_GENERATOR_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = XML_GENERATOR_FEATURE_COUNT + 18; - - /** - * The number of structural features of the 'Xml Table Generator' class. - * - * - * @generated - * @ordered - */ - public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 19; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery Abstract Xml Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlQuery() - * @generated - */ - public static final int ABSTRACT_XML_QUERY = 53; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_QUERY__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_QUERY__QUERY = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_QUERY__HINTS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Abstract Xml Query' class. - * - * - * @generated - * @ordered - */ - public static final int ABSTRACT_XML_QUERY_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery Xml Named Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedQuery() - * @generated - */ - public static final int XML_NAMED_QUERY = 54; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_QUERY__NAME = ABSTRACT_XML_QUERY__NAME; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_QUERY__QUERY = ABSTRACT_XML_QUERY__QUERY; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_QUERY__HINTS = ABSTRACT_XML_QUERY__HINTS; - - /** - * The number of structural features of the 'Xml Named Query' class. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_QUERY_FEATURE_COUNT = ABSTRACT_XML_QUERY_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery Xml Named Native Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedNativeQuery() - * @generated - */ - public static final int XML_NAMED_NATIVE_QUERY = 55; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_NATIVE_QUERY__NAME = ABSTRACT_XML_QUERY__NAME; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_NATIVE_QUERY__QUERY = ABSTRACT_XML_QUERY__QUERY; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_NATIVE_QUERY__HINTS = ABSTRACT_XML_QUERY__HINTS; - - /** - * The feature id for the 'Result Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_NATIVE_QUERY__RESULT_CLASS = ABSTRACT_XML_QUERY_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Result Set Mapping' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = ABSTRACT_XML_QUERY_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Named Native Query' class. - * - * - * @generated - * @ordered - */ - public static final int XML_NAMED_NATIVE_QUERY_FEATURE_COUNT = ABSTRACT_XML_QUERY_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlQueryHint Xml Query Hint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlQueryHint - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlQueryHint() - * @generated - */ - public static final int XML_QUERY_HINT = 56; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_QUERY_HINT__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_QUERY_HINT__VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Query Hint' class. - * - * - * @generated - * @ordered - */ - public static final int XML_QUERY_HINT_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint Xml Unique Constraint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint() - * @generated - */ - public static final int XML_UNIQUE_CONSTRAINT = 57; - - /** - * The feature id for the 'Column Names' attribute list. - * - * - * @generated - * @ordered - */ - public static final int XML_UNIQUE_CONSTRAINT__COLUMN_NAMES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml Unique Constraint' class. - * - * - * @generated - * @ordered - */ - public static final int XML_UNIQUE_CONSTRAINT_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade Xml Cascade}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade() - * @generated - */ - public static final int XML_CASCADE = 58; - - /** - * The feature id for the 'All' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_CASCADE__ALL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persist' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_CASCADE__PERSIST = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Merge' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_CASCADE__MERGE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Remove' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_CASCADE__REMOVE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Refresh' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_CASCADE__REFRESH = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'Xml Cascade' class. - * - * - * @generated - * @ordered - */ - public static final int XML_CASCADE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass Xml Id Class}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlIdClass - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlIdClass() - * @generated - */ - public static final int XML_ID_CLASS = 59; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_ID_CLASS__VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml Id Class' class. - * - * - * @generated - * @ordered - */ - public static final int XML_ID_CLASS_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance Xml Inheritance}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlInheritance - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlInheritance() - * @generated - */ - public static final int XML_INHERITANCE = 60; - - /** - * The feature id for the 'Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_INHERITANCE__STRATEGY = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml Inheritance' class. - * - * - * @generated - * @ordered - */ - public static final int XML_INHERITANCE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey Xml Map Key}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMapKey - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMapKey() - * @generated - */ - public static final int XML_MAP_KEY = 61; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int XML_MAP_KEY__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Xml Map Key' class. - * - * - * @generated - * @ordered - */ - public static final int XML_MAP_KEY_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * - * - * @generated - */ - private EClass xmlRootContentNodeEClass = null; - - /** - * - * - * @generated - */ - private EClass entityMappingsInternalEClass = null; - - /** - * - * - * @generated - */ - private EClass entityMappingsEClass = null; - - /** - * - * - * @generated - */ - private EClass entityMappingsForXmlEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlTypeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlPersistentTypeEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlMappedSuperclassEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEntityInternalEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEntityForXmlEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEntityEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEmbeddableEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlAttributeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlNullAttributeMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlBasicEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlIdEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlTransientEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEmbeddedEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlEmbeddedIdEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlVersionEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlMultiRelationshipMappingInternalEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlMultiRelationshipMappingForXmlEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlMultiRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlOneToManyEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlManyToManyEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlPersistentAttributeEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitMetadataInternalEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitMetadataEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitMetadataForXmlEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitDefaultsInternalEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitDefaultsEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitDefaultsForXmlEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlTableEClass = null; - - /** - * - * - * @generated - */ - private EClass abstractXmlNamedColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass abstractXmlColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iXmlColumnMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlManyToOneEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlOneToOneEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlSingleRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlJoinTableEClass = null; - - /** - * - * - * @generated - */ - private EClass abstractXmlTableEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlAttributeOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlAssociationOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlDiscriminatorColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlSecondaryTableEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlPrimaryKeyJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlGeneratedValueEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlSequenceGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlTableGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass abstractXmlQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlNamedQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlNamedNativeQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlQueryHintEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlUniqueConstraintEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlCascadeEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlIdClassEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlInheritanceEClass = null; - - /** - * - * - * @generated - */ - private EClass xmlMapKeyEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

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. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#eNS_URI - * @see #init() - * @generated - */ - private OrmPackage() { - super(eNS_URI, OrmFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static OrmPackage init() { - if (isInited) - return (OrmPackage) EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI); - // Obtain or create and register package - OrmPackage theOrmPackage = (OrmPackage) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new OrmPackage()); - isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - // Obtain or create and register interdependencies - JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE); - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE); - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE); - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) instanceof JpaJavaMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) : JpaJavaMappingsPackage.eINSTANCE); - PersistencePackage thePersistencePackage = (PersistencePackage) (EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE); - // Create package meta-data objects - theOrmPackage.createPackageContents(); - theJpaCorePackage.createPackageContents(); - theJpaCoreMappingsPackage.createPackageContents(); - theJpaJavaPackage.createPackageContents(); - theJpaJavaMappingsPackage.createPackageContents(); - thePersistencePackage.createPackageContents(); - // Initialize created meta-data - theOrmPackage.initializePackageContents(); - theJpaCorePackage.initializePackageContents(); - theJpaCoreMappingsPackage.initializePackageContents(); - theJpaJavaPackage.initializePackageContents(); - theJpaJavaMappingsPackage.initializePackageContents(); - thePersistencePackage.initializePackageContents(); - // Mark meta-data to indicate it can't be changed - theOrmPackage.freeze(); - return theOrmPackage; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode Xml Root Content Node}'. - * - * - * @return the meta object for class 'Xml Root Content Node'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode - * @generated - */ - public EClass getXmlRootContentNode() { - return xmlRootContentNodeEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode#getEntityMappings Entity Mappings}'. - * - * - * @return the meta object for the reference 'Entity Mappings'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode#getEntityMappings() - * @see #getXmlRootContentNode() - * @generated - */ - public EReference getXmlRootContentNode_EntityMappings() { - return (EReference) xmlRootContentNodeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal Entity Mappings Internal}'. - * - * - * @return the meta object for class 'Entity Mappings Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal - * @generated - */ - public EClass getEntityMappingsInternal() { - return entityMappingsInternalEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getRoot Root}'. - * - * - * @return the meta object for the reference 'Root'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getRoot() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_Root() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getVersion Version}'. - * - * - * @return the meta object for the attribute 'Version'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getVersion() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_Version() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDescription Description}'. - * - * - * @return the meta object for the attribute 'Description'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDescription() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_Description() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistenceUnitMetadataInternal Persistence Unit Metadata Internal}'. - * - * - * @return the meta object for the containment reference 'Persistence Unit Metadata Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistenceUnitMetadataInternal() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_PersistenceUnitMetadataInternal() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPackageInternal Package Internal}'. - * - * - * @return the meta object for the attribute 'Package Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPackageInternal() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_PackageInternal() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultSchema Default Schema}'. - * - * - * @return the meta object for the attribute 'Default Schema'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultSchema() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_DefaultSchema() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedSchema Specified Schema}'. - * - * - * @return the meta object for the attribute 'Specified Schema'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedSchema() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_SpecifiedSchema() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSchema Schema}'. - * - * - * @return the meta object for the attribute 'Schema'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSchema() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_Schema() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultCatalog Default Catalog}'. - * - * - * @return the meta object for the attribute 'Default Catalog'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultCatalog() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_DefaultCatalog() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(8); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedCatalog Specified Catalog}'. - * - * - * @return the meta object for the attribute 'Specified Catalog'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedCatalog() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_SpecifiedCatalog() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(9); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getCatalog Catalog}'. - * - * - * @return the meta object for the attribute 'Catalog'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getCatalog() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_Catalog() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(10); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultAccess Default Access}'. - * - * - * @return the meta object for the attribute 'Default Access'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getDefaultAccess() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_DefaultAccess() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(11); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedAccess Specified Access}'. - * - * - * @return the meta object for the attribute 'Specified Access'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSpecifiedAccess() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_SpecifiedAccess() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(12); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getAccess Access}'. - * - * - * @return the meta object for the attribute 'Access'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getAccess() - * @see #getEntityMappingsInternal() - * @generated - */ - public EAttribute getEntityMappingsInternal_Access() { - return (EAttribute) entityMappingsInternalEClass.getEStructuralFeatures().get(13); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTypeMappings Type Mappings}'. - * - * - * @return the meta object for the containment reference list 'Type Mappings'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTypeMappings() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_TypeMappings() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(14); - } - - /** - * Returns the meta object for the reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistentTypes Persistent Types}'. - * - * - * @return the meta object for the reference list 'Persistent Types'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getPersistentTypes() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_PersistentTypes() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(15); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators Sequence Generators}'. - * - * - * @return the meta object for the containment reference list 'Sequence Generators'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_SequenceGenerators() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(16); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTableGenerators Table Generators}'. - * - * - * @return the meta object for the containment reference list 'Table Generators'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTableGenerators() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_TableGenerators() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(17); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getNamedQueries Named Queries}'. - * - * - * @return the meta object for the containment reference list 'Named Queries'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getNamedQueries() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_NamedQueries() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(18); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getNamedNativeQueries Named Native Queries}'. - * - * - * @return the meta object for the containment reference list 'Named Native Queries'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getNamedNativeQueries() - * @see #getEntityMappingsInternal() - * @generated - */ - public EReference getEntityMappingsInternal_NamedNativeQueries() { - return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(19); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings Entity Mappings}'. - * - * - * @return the meta object for class 'Entity Mappings'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappings - * @generated - */ - public EClass getEntityMappings() { - return entityMappingsEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPersistenceUnitMetadata Persistence Unit Metadata}'. - * - * - * @return the meta object for the reference 'Persistence Unit Metadata'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPersistenceUnitMetadata() - * @see #getEntityMappings() - * @generated - */ - public EReference getEntityMappings_PersistenceUnitMetadata() { - return (EReference) entityMappingsEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPackage Package}'. - * - * - * @return the meta object for the attribute 'Package'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappings#getPackage() - * @see #getEntityMappings() - * @generated - */ - public EAttribute getEntityMappings_Package() { - return (EAttribute) entityMappingsEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml Entity Mappings For Xml}'. - * - * - * @return the meta object for class 'Entity Mappings For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml - * @generated - */ - public EClass getEntityMappingsForXml() { - return entityMappingsForXmlEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}'. - * - * - * @return the meta object for the reference 'Persistence Unit Metadata For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPersistenceUnitMetadataForXml() - * @see #getEntityMappingsForXml() - * @generated - */ - public EReference getEntityMappingsForXml_PersistenceUnitMetadataForXml() { - return (EReference) entityMappingsForXmlEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPackageForXml Package For Xml}'. - * - * - * @return the meta object for the attribute 'Package For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml#getPackageForXml() - * @see #getEntityMappingsForXml() - * @generated - */ - public EAttribute getEntityMappingsForXml_PackageForXml() { - return (EAttribute) entityMappingsForXmlEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping Xml Type Mapping}'. - * - * - * @return the meta object for class 'Xml Type Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping - * @generated - */ - public EClass getXmlTypeMapping() { - return xmlTypeMappingEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getDefaultAccess Default Access}'. - * - * - * @return the meta object for the attribute 'Default Access'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getDefaultAccess() - * @see #getXmlTypeMapping() - * @generated - */ - public EAttribute getXmlTypeMapping_DefaultAccess() { - return (EAttribute) xmlTypeMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getSpecifiedAccess Specified Access}'. - * - * - * @return the meta object for the attribute 'Specified Access'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getSpecifiedAccess() - * @see #getXmlTypeMapping() - * @generated - */ - public EAttribute getXmlTypeMapping_SpecifiedAccess() { - return (EAttribute) xmlTypeMappingEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getAccess Access}'. - * - * - * @return the meta object for the attribute 'Access'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getAccess() - * @see #getXmlTypeMapping() - * @generated - */ - public EAttribute getXmlTypeMapping_Access() { - return (EAttribute) xmlTypeMappingEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getMetadataComplete Metadata Complete}'. - * - * - * @return the meta object for the attribute 'Metadata Complete'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getMetadataComplete() - * @see #getXmlTypeMapping() - * @generated - */ - public EAttribute getXmlTypeMapping_MetadataComplete() { - return (EAttribute) xmlTypeMappingEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getPersistentType Persistent Type}'. - * - * - * @return the meta object for the containment reference 'Persistent Type'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getPersistentType() - * @see #getXmlTypeMapping() - * @generated - */ - public EReference getXmlTypeMapping_PersistentType() { - return (EReference) xmlTypeMappingEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType Xml Persistent Type}'. - * - * - * @return the meta object for class 'Xml Persistent Type'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType - * @generated - */ - public EClass getXmlPersistentType() { - return xmlPersistentTypeEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getClass_ Class}'. - * - * - * @return the meta object for the attribute 'Class'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getClass_() - * @see #getXmlPersistentType() - * @generated - */ - public EAttribute getXmlPersistentType_Class() { - return (EAttribute) xmlPersistentTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getAttributeMappings Attribute Mappings}'. - * - * - * @return the meta object for the containment reference list 'Attribute Mappings'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getAttributeMappings() - * @see #getXmlPersistentType() - * @generated - */ - public EReference getXmlPersistentType_AttributeMappings() { - return (EReference) xmlPersistentTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getSpecifiedAttributeMappings Specified Attribute Mappings}'. - * - * - * @return the meta object for the containment reference list 'Specified Attribute Mappings'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getSpecifiedAttributeMappings() - * @see #getXmlPersistentType() - * @generated - */ - public EReference getXmlPersistentType_SpecifiedAttributeMappings() { - return (EReference) xmlPersistentTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getVirtualAttributeMappings Virtual Attribute Mappings}'. - * - * - * @return the meta object for the containment reference list 'Virtual Attribute Mappings'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getVirtualAttributeMappings() - * @see #getXmlPersistentType() - * @generated - */ - public EReference getXmlPersistentType_VirtualAttributeMappings() { - return (EReference) xmlPersistentTypeEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getPersistentAttributes Persistent Attributes}'. - * - * - * @return the meta object for the reference list 'Persistent Attributes'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getPersistentAttributes() - * @see #getXmlPersistentType() - * @generated - */ - public EReference getXmlPersistentType_PersistentAttributes() { - return (EReference) xmlPersistentTypeEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getSpecifiedPersistentAttributes Specified Persistent Attributes}'. - * - * - * @return the meta object for the reference list 'Specified Persistent Attributes'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getSpecifiedPersistentAttributes() - * @see #getXmlPersistentType() - * @generated - */ - public EReference getXmlPersistentType_SpecifiedPersistentAttributes() { - return (EReference) xmlPersistentTypeEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getVirtualPersistentAttributes Virtual Persistent Attributes}'. - * - * - * @return the meta object for the reference list 'Virtual Persistent Attributes'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getVirtualPersistentAttributes() - * @see #getXmlPersistentType() - * @generated - */ - public EReference getXmlPersistentType_VirtualPersistentAttributes() { - return (EReference) xmlPersistentTypeEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass Xml Mapped Superclass}'. - * - * - * @return the meta object for class 'Xml Mapped Superclass'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass - * @generated - */ - public EClass getXmlMappedSuperclass() { - return xmlMappedSuperclassEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml Id Class For Xml}'. - * - * - * @return the meta object for the containment reference 'Id Class For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml() - * @see #getXmlMappedSuperclass() - * @generated - */ - public EReference getXmlMappedSuperclass_IdClassForXml() { - return (EReference) xmlMappedSuperclassEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal Xml Entity Internal}'. - * - * - * @return the meta object for class 'Xml Entity Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal - * @generated - */ - public EClass getXmlEntityInternal() { - return xmlEntityInternalEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml Xml Entity For Xml}'. - * - * - * @return the meta object for class 'Xml Entity For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml - * @generated - */ - public EClass getXmlEntityForXml() { - return xmlEntityForXmlEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml Table For Xml}'. - * - * - * @return the meta object for the reference 'Table For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml() - * @see #getXmlEntityForXml() - * @generated - */ - public EReference getXmlEntityForXml_TableForXml() { - return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml Discriminator Column For Xml}'. - * - * - * @return the meta object for the reference 'Discriminator Column For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml() - * @see #getXmlEntityForXml() - * @generated - */ - public EReference getXmlEntityForXml_DiscriminatorColumnForXml() { - return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getIdClassForXml Id Class For Xml}'. - * - * - * @return the meta object for the containment reference 'Id Class For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getIdClassForXml() - * @see #getXmlEntityForXml() - * @generated - */ - public EReference getXmlEntityForXml_IdClassForXml() { - return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getInheritanceForXml Inheritance For Xml}'. - * - * - * @return the meta object for the containment reference 'Inheritance For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getInheritanceForXml() - * @see #getXmlEntityForXml() - * @generated - */ - public EReference getXmlEntityForXml_InheritanceForXml() { - return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity Xml Entity}'. - * - * - * @return the meta object for class 'Xml Entity'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity - * @generated - */ - public EClass getXmlEntity() { - return xmlEntityEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity#getSecondaryTables Secondary Tables}'. - * - * - * @return the meta object for the containment reference list 'Secondary Tables'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity#getSecondaryTables() - * @see #getXmlEntity() - * @generated - */ - public EReference getXmlEntity_SecondaryTables() { - return (EReference) xmlEntityEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity#getVirtualSecondaryTables Virtual Secondary Tables}'. - * - * - * @return the meta object for the containment reference list 'Virtual Secondary Tables'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity#getVirtualSecondaryTables() - * @see #getXmlEntity() - * @generated - */ - public EReference getXmlEntity_VirtualSecondaryTables() { - return (EReference) xmlEntityEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable Xml Embeddable}'. - * - * - * @return the meta object for class 'Xml Embeddable'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable - * @generated - */ - public EClass getXmlEmbeddable() { - return xmlEmbeddableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping Xml Attribute Mapping}'. - * - * - * @return the meta object for class 'Xml Attribute Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping - * @generated - */ - public EClass getXmlAttributeMapping() { - return xmlAttributeMappingEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping#getPersistentAttribute Persistent Attribute}'. - * - * - * @return the meta object for the containment reference 'Persistent Attribute'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping#getPersistentAttribute() - * @see #getXmlAttributeMapping() - * @generated - */ - public EReference getXmlAttributeMapping_PersistentAttribute() { - return (EReference) xmlAttributeMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping Xml Null Attribute Mapping}'. - * - * - * @return the meta object for class 'Xml Null Attribute Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping - * @generated - */ - public EClass getXmlNullAttributeMapping() { - return xmlNullAttributeMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic Xml Basic}'. - * - * - * @return the meta object for class 'Xml Basic'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlBasic - * @generated - */ - public EClass getXmlBasic() { - return xmlBasicEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlId Xml Id}'. - * - * - * @return the meta object for class 'Xml Id'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlId - * @generated - */ - public EClass getXmlId() { - return xmlIdEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTransient Xml Transient}'. - * - * - * @return the meta object for class 'Xml Transient'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTransient - * @generated - */ - public EClass getXmlTransient() { - return xmlTransientEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbedded Xml Embedded}'. - * - * - * @return the meta object for class 'Xml Embedded'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbedded - * @generated - */ - public EClass getXmlEmbedded() { - return xmlEmbeddedEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId Xml Embedded Id}'. - * - * - * @return the meta object for class 'Xml Embedded Id'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId - * @generated - */ - public EClass getXmlEmbeddedId() { - return xmlEmbeddedIdEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlVersion Xml Version}'. - * - * - * @return the meta object for class 'Xml Version'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlVersion - * @generated - */ - public EClass getXmlVersion() { - return xmlVersionEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal Xml Multi Relationship Mapping Internal}'. - * - * - * @return the meta object for class 'Xml Multi Relationship Mapping Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal - * @generated - */ - public EClass getXmlMultiRelationshipMappingInternal() { - return xmlMultiRelationshipMappingInternalEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml Xml Multi Relationship Mapping For Xml}'. - * - * - * @return the meta object for class 'Xml Multi Relationship Mapping For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml - * @generated - */ - public EClass getXmlMultiRelationshipMappingForXml() { - return xmlMultiRelationshipMappingForXmlEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getJoinTableForXml Join Table For Xml}'. - * - * - * @return the meta object for the reference 'Join Table For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getJoinTableForXml() - * @see #getXmlMultiRelationshipMappingForXml() - * @generated - */ - public EReference getXmlMultiRelationshipMappingForXml_JoinTableForXml() { - return (EReference) xmlMultiRelationshipMappingForXmlEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getMapKeyForXml Map Key For Xml}'. - * - * - * @return the meta object for the containment reference 'Map Key For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getMapKeyForXml() - * @see #getXmlMultiRelationshipMappingForXml() - * @generated - */ - public EReference getXmlMultiRelationshipMappingForXml_MapKeyForXml() { - return (EReference) xmlMultiRelationshipMappingForXmlEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping Xml Multi Relationship Mapping}'. - * - * - * @return the meta object for class 'Xml Multi Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping - * @generated - */ - public EClass getXmlMultiRelationshipMapping() { - return xmlMultiRelationshipMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToMany Xml One To Many}'. - * - * - * @return the meta object for class 'Xml One To Many'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToMany - * @generated - */ - public EClass getXmlOneToMany() { - return xmlOneToManyEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToMany Xml Many To Many}'. - * - * - * @return the meta object for class 'Xml Many To Many'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToMany - * @generated - */ - public EClass getXmlManyToMany() { - return xmlManyToManyEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute Xml Persistent Attribute}'. - * - * - * @return the meta object for class 'Xml Persistent Attribute'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute - * @generated - */ - public EClass getXmlPersistentAttribute() { - return xmlPersistentAttributeEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName() - * @see #getXmlPersistentAttribute() - * @generated - */ - public EAttribute getXmlPersistentAttribute_Name() { - return (EAttribute) xmlPersistentAttributeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal Persistence Unit Metadata Internal}'. - * - * - * @return the meta object for class 'Persistence Unit Metadata Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal - * @generated - */ - public EClass getPersistenceUnitMetadataInternal() { - return persistenceUnitMetadataInternalEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#isXmlMappingMetadataCompleteInternal Xml Mapping Metadata Complete Internal}'. - * - * - * @return the meta object for the attribute 'Xml Mapping Metadata Complete Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#isXmlMappingMetadataCompleteInternal() - * @see #getPersistenceUnitMetadataInternal() - * @generated - */ - public EAttribute getPersistenceUnitMetadataInternal_XmlMappingMetadataCompleteInternal() { - return (EAttribute) persistenceUnitMetadataInternalEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#getPersistenceUnitDefaultsInternal Persistence Unit Defaults Internal}'. - * - * - * @return the meta object for the containment reference 'Persistence Unit Defaults Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#getPersistenceUnitDefaultsInternal() - * @see #getPersistenceUnitMetadataInternal() - * @generated - */ - public EReference getPersistenceUnitMetadataInternal_PersistenceUnitDefaultsInternal() { - return (EReference) persistenceUnitMetadataInternalEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata Persistence Unit Metadata}'. - * - * - * @return the meta object for class 'Persistence Unit Metadata'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata - * @generated - */ - public EClass getPersistenceUnitMetadata() { - return persistenceUnitMetadataEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#isXmlMappingMetadataComplete Xml Mapping Metadata Complete}'. - * - * - * @return the meta object for the attribute 'Xml Mapping Metadata Complete'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#isXmlMappingMetadataComplete() - * @see #getPersistenceUnitMetadata() - * @generated - */ - public EAttribute getPersistenceUnitMetadata_XmlMappingMetadataComplete() { - return (EAttribute) persistenceUnitMetadataEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#getPersistenceUnitDefaults Persistence Unit Defaults}'. - * - * - * @return the meta object for the reference 'Persistence Unit Defaults'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#getPersistenceUnitDefaults() - * @see #getPersistenceUnitMetadata() - * @generated - */ - public EReference getPersistenceUnitMetadata_PersistenceUnitDefaults() { - return (EReference) persistenceUnitMetadataEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}'. - * - * - * @return the meta object for class 'Persistence Unit Metadata For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml - * @generated - */ - public EClass getPersistenceUnitMetadataForXml() { - return persistenceUnitMetadataForXmlEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#isXmlMappingMetadataCompleteForXml Xml Mapping Metadata Complete For Xml}'. - * - * - * @return the meta object for the attribute 'Xml Mapping Metadata Complete For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#isXmlMappingMetadataCompleteForXml() - * @see #getPersistenceUnitMetadataForXml() - * @generated - */ - public EAttribute getPersistenceUnitMetadataForXml_XmlMappingMetadataCompleteForXml() { - return (EAttribute) persistenceUnitMetadataForXmlEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#getPersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}'. - * - * - * @return the meta object for the reference 'Persistence Unit Defaults For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#getPersistenceUnitDefaultsForXml() - * @see #getPersistenceUnitMetadataForXml() - * @generated - */ - public EReference getPersistenceUnitMetadataForXml_PersistenceUnitDefaultsForXml() { - return (EReference) persistenceUnitMetadataForXmlEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal Persistence Unit Defaults Internal}'. - * - * - * @return the meta object for class 'Persistence Unit Defaults Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal - * @generated - */ - public EClass getPersistenceUnitDefaultsInternal() { - return persistenceUnitDefaultsInternalEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getSchemaInternal Schema Internal}'. - * - * - * @return the meta object for the attribute 'Schema Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getSchemaInternal() - * @see #getPersistenceUnitDefaultsInternal() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsInternal_SchemaInternal() { - return (EAttribute) persistenceUnitDefaultsInternalEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getCatalogInternal Catalog Internal}'. - * - * - * @return the meta object for the attribute 'Catalog Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getCatalogInternal() - * @see #getPersistenceUnitDefaultsInternal() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsInternal_CatalogInternal() { - return (EAttribute) persistenceUnitDefaultsInternalEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getAccessInternal Access Internal}'. - * - * - * @return the meta object for the attribute 'Access Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getAccessInternal() - * @see #getPersistenceUnitDefaultsInternal() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsInternal_AccessInternal() { - return (EAttribute) persistenceUnitDefaultsInternalEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#isCascadePersistInternal Cascade Persist Internal}'. - * - * - * @return the meta object for the attribute 'Cascade Persist Internal'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#isCascadePersistInternal() - * @see #getPersistenceUnitDefaultsInternal() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsInternal_CascadePersistInternal() { - return (EAttribute) persistenceUnitDefaultsInternalEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults Persistence Unit Defaults}'. - * - * - * @return the meta object for class 'Persistence Unit Defaults'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults - * @generated - */ - public EClass getPersistenceUnitDefaults() { - return persistenceUnitDefaultsEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getSchema Schema}'. - * - * - * @return the meta object for the attribute 'Schema'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getSchema() - * @see #getPersistenceUnitDefaults() - * @generated - */ - public EAttribute getPersistenceUnitDefaults_Schema() { - return (EAttribute) persistenceUnitDefaultsEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getCatalog Catalog}'. - * - * - * @return the meta object for the attribute 'Catalog'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getCatalog() - * @see #getPersistenceUnitDefaults() - * @generated - */ - public EAttribute getPersistenceUnitDefaults_Catalog() { - return (EAttribute) persistenceUnitDefaultsEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getAccess Access}'. - * - * - * @return the meta object for the attribute 'Access'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getAccess() - * @see #getPersistenceUnitDefaults() - * @generated - */ - public EAttribute getPersistenceUnitDefaults_Access() { - return (EAttribute) persistenceUnitDefaultsEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#isCascadePersist Cascade Persist}'. - * - * - * @return the meta object for the attribute 'Cascade Persist'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#isCascadePersist() - * @see #getPersistenceUnitDefaults() - * @generated - */ - public EAttribute getPersistenceUnitDefaults_CascadePersist() { - return (EAttribute) persistenceUnitDefaultsEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}'. - * - * - * @return the meta object for class 'Persistence Unit Defaults For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml - * @generated - */ - public EClass getPersistenceUnitDefaultsForXml() { - return persistenceUnitDefaultsForXmlEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getSchemaForXml Schema For Xml}'. - * - * - * @return the meta object for the attribute 'Schema For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getSchemaForXml() - * @see #getPersistenceUnitDefaultsForXml() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsForXml_SchemaForXml() { - return (EAttribute) persistenceUnitDefaultsForXmlEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getCatalogForXml Catalog For Xml}'. - * - * - * @return the meta object for the attribute 'Catalog For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getCatalogForXml() - * @see #getPersistenceUnitDefaultsForXml() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsForXml_CatalogForXml() { - return (EAttribute) persistenceUnitDefaultsForXmlEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getAccessForXml Access For Xml}'. - * - * - * @return the meta object for the attribute 'Access For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getAccessForXml() - * @see #getPersistenceUnitDefaultsForXml() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsForXml_AccessForXml() { - return (EAttribute) persistenceUnitDefaultsForXmlEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#isCascadePersistForXml Cascade Persist For Xml}'. - * - * - * @return the meta object for the attribute 'Cascade Persist For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#isCascadePersistForXml() - * @see #getPersistenceUnitDefaultsForXml() - * @generated - */ - public EAttribute getPersistenceUnitDefaultsForXml_CascadePersistForXml() { - return (EAttribute) persistenceUnitDefaultsForXmlEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTable Xml Table}'. - * - * - * @return the meta object for class 'Xml Table'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTable - * @generated - */ - public EClass getXmlTable() { - return xmlTableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn Abstract Xml Named Column}'. - * - * - * @return the meta object for class 'Abstract Xml Named Column'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn - * @generated - */ - public EClass getAbstractXmlNamedColumn() { - return abstractXmlNamedColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getSpecifiedNameForXml Specified Name For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Name For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getSpecifiedNameForXml() - * @see #getAbstractXmlNamedColumn() - * @generated - */ - public EAttribute getAbstractXmlNamedColumn_SpecifiedNameForXml() { - return (EAttribute) abstractXmlNamedColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getColumnDefinitionForXml Column Definition For Xml}'. - * - * - * @return the meta object for the attribute 'Column Definition For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn#getColumnDefinitionForXml() - * @see #getAbstractXmlNamedColumn() - * @generated - */ - public EAttribute getAbstractXmlNamedColumn_ColumnDefinitionForXml() { - return (EAttribute) abstractXmlNamedColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn Abstract Xml Column}'. - * - * - * @return the meta object for class 'Abstract Xml Column'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn - * @generated - */ - public EClass getAbstractXmlColumn() { - return abstractXmlColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUniqueForXml Unique For Xml}'. - * - * - * @return the meta object for the attribute 'Unique For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUniqueForXml() - * @see #getAbstractXmlColumn() - * @generated - */ - public EAttribute getAbstractXmlColumn_UniqueForXml() { - return (EAttribute) abstractXmlColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getNullableForXml Nullable For Xml}'. - * - * - * @return the meta object for the attribute 'Nullable For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getNullableForXml() - * @see #getAbstractXmlColumn() - * @generated - */ - public EAttribute getAbstractXmlColumn_NullableForXml() { - return (EAttribute) abstractXmlColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getInsertableForXml Insertable For Xml}'. - * - * - * @return the meta object for the attribute 'Insertable For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getInsertableForXml() - * @see #getAbstractXmlColumn() - * @generated - */ - public EAttribute getAbstractXmlColumn_InsertableForXml() { - return (EAttribute) abstractXmlColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUpdatableForXml Updatable For Xml}'. - * - * - * @return the meta object for the attribute 'Updatable For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getUpdatableForXml() - * @see #getAbstractXmlColumn() - * @generated - */ - public EAttribute getAbstractXmlColumn_UpdatableForXml() { - return (EAttribute) abstractXmlColumnEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getSpecifiedTableForXml Specified Table For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Table For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn#getSpecifiedTableForXml() - * @see #getAbstractXmlColumn() - * @generated - */ - public EAttribute getAbstractXmlColumn_SpecifiedTableForXml() { - return (EAttribute) abstractXmlColumnEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn Xml Column}'. - * - * - * @return the meta object for class 'Xml Column'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn - * @generated - */ - public EClass getXmlColumn() { - return xmlColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getLengthForXml Length For Xml}'. - * - * - * @return the meta object for the attribute 'Length For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn#getLengthForXml() - * @see #getXmlColumn() - * @generated - */ - public EAttribute getXmlColumn_LengthForXml() { - return (EAttribute) xmlColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getPrecisionForXml Precision For Xml}'. - * - * - * @return the meta object for the attribute 'Precision For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn#getPrecisionForXml() - * @see #getXmlColumn() - * @generated - */ - public EAttribute getXmlColumn_PrecisionForXml() { - return (EAttribute) xmlColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getScaleForXml Scale For Xml}'. - * - * - * @return the meta object for the attribute 'Scale For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn#getScaleForXml() - * @see #getXmlColumn() - * @generated - */ - public EAttribute getXmlColumn_ScaleForXml() { - return (EAttribute) xmlColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn Xml Join Column}'. - * - * - * @return the meta object for class 'Xml Join Column'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn - * @generated - */ - public EClass getXmlJoinColumn() { - return xmlJoinColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn#getSpecifiedReferencedColumnNameForXml Specified Referenced Column Name For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Referenced Column Name For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn#getSpecifiedReferencedColumnNameForXml() - * @see #getXmlJoinColumn() - * @generated - */ - public EAttribute getXmlJoinColumn_SpecifiedReferencedColumnNameForXml() { - return (EAttribute) xmlJoinColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping IXml Column Mapping}'. - * - * - * @return the meta object for class 'IXml Column Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping - * @generated - */ - public EClass getIXmlColumnMapping() { - return iXmlColumnMappingEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping#getColumnForXml Column For Xml}'. - * - * - * @return the meta object for the reference 'Column For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping#getColumnForXml() - * @see #getIXmlColumnMapping() - * @generated - */ - public EReference getIXmlColumnMapping_ColumnForXml() { - return (EReference) iXmlColumnMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToOne Xml Many To One}'. - * - * - * @return the meta object for class 'Xml Many To One'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToOne - * @generated - */ - public EClass getXmlManyToOne() { - return xmlManyToOneEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToOne Xml One To One}'. - * - * - * @return the meta object for class 'Xml One To One'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToOne - * @generated - */ - public EClass getXmlOneToOne() { - return xmlOneToOneEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping Xml Single Relationship Mapping}'. - * - * - * @return the meta object for class 'Xml Single Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping - * @generated - */ - public EClass getXmlSingleRelationshipMapping() { - return xmlSingleRelationshipMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping Xml Relationship Mapping}'. - * - * - * @return the meta object for class 'Xml Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping - * @generated - */ - public EClass getXmlRelationshipMapping() { - return xmlRelationshipMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinTable Xml Join Table}'. - * - * - * @return the meta object for class 'Xml Join Table'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinTable - * @generated - */ - public EClass getXmlJoinTable() { - return xmlJoinTableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable Abstract Xml Table}'. - * - * - * @return the meta object for class 'Abstract Xml Table'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable - * @generated - */ - public EClass getAbstractXmlTable() { - return abstractXmlTableEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedNameForXml Specified Name For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Name For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedNameForXml() - * @see #getAbstractXmlTable() - * @generated - */ - public EAttribute getAbstractXmlTable_SpecifiedNameForXml() { - return (EAttribute) abstractXmlTableEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedCatalogForXml Specified Catalog For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Catalog For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedCatalogForXml() - * @see #getAbstractXmlTable() - * @generated - */ - public EAttribute getAbstractXmlTable_SpecifiedCatalogForXml() { - return (EAttribute) abstractXmlTableEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedSchemaForXml Specified Schema For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Schema For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable#getSpecifiedSchemaForXml() - * @see #getAbstractXmlTable() - * @generated - */ - public EAttribute getAbstractXmlTable_SpecifiedSchemaForXml() { - return (EAttribute) abstractXmlTableEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOverride Xml Override}'. - * - * - * @return the meta object for class 'Xml Override'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOverride - * @generated - */ - public EClass getXmlOverride() { - return xmlOverrideEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride Xml Attribute Override}'. - * - * - * @return the meta object for class 'Xml Attribute Override'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride - * @generated - */ - public EClass getXmlAttributeOverride() { - return xmlAttributeOverrideEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride Xml Association Override}'. - * - * - * @return the meta object for class 'Xml Association Override'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride - * @generated - */ - public EClass getXmlAssociationOverride() { - return xmlAssociationOverrideEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn Xml Discriminator Column}'. - * - * - * @return the meta object for class 'Xml Discriminator Column'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn - * @generated - */ - public EClass getXmlDiscriminatorColumn() { - return xmlDiscriminatorColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getDiscriminatorTypeForXml Discriminator Type For Xml}'. - * - * - * @return the meta object for the attribute 'Discriminator Type For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getDiscriminatorTypeForXml() - * @see #getXmlDiscriminatorColumn() - * @generated - */ - public EAttribute getXmlDiscriminatorColumn_DiscriminatorTypeForXml() { - return (EAttribute) xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getSpecifiedLengthForXml Specified Length For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Length For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getSpecifiedLengthForXml() - * @see #getXmlDiscriminatorColumn() - * @generated - */ - public EAttribute getXmlDiscriminatorColumn_SpecifiedLengthForXml() { - return (EAttribute) xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable Xml Secondary Table}'. - * - * - * @return the meta object for class 'Xml Secondary Table'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable - * @generated - */ - public EClass getXmlSecondaryTable() { - return xmlSecondaryTableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn Xml Primary Key Join Column}'. - * - * - * @return the meta object for class 'Xml Primary Key Join Column'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn - * @generated - */ - public EClass getXmlPrimaryKeyJoinColumn() { - return xmlPrimaryKeyJoinColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn#getSpecifiedReferencedColumnNameForXml Specified Referenced Column Name For Xml}'. - * - * - * @return the meta object for the attribute 'Specified Referenced Column Name For Xml'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn#getSpecifiedReferencedColumnNameForXml() - * @see #getXmlPrimaryKeyJoinColumn() - * @generated - */ - public EAttribute getXmlPrimaryKeyJoinColumn_SpecifiedReferencedColumnNameForXml() { - return (EAttribute) xmlPrimaryKeyJoinColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue Xml Generated Value}'. - * - * - * @return the meta object for class 'Xml Generated Value'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue - * @generated - */ - public EClass getXmlGeneratedValue() { - return xmlGeneratedValueEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator Xml Generator}'. - * - * - * @return the meta object for class 'Xml Generator'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlGenerator - * @generated - */ - public EClass getXmlGenerator() { - return xmlGeneratorEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator Xml Sequence Generator}'. - * - * - * @return the meta object for class 'Xml Sequence Generator'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator - * @generated - */ - public EClass getXmlSequenceGenerator() { - return xmlSequenceGeneratorEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator Xml Table Generator}'. - * - * - * @return the meta object for class 'Xml Table Generator'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator - * @generated - */ - public EClass getXmlTableGenerator() { - return xmlTableGeneratorEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery Abstract Xml Query}'. - * - * - * @return the meta object for class 'Abstract Xml Query'. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery - * @generated - */ - public EClass getAbstractXmlQuery() { - return abstractXmlQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery Xml Named Query}'. - * - * - * @return the meta object for class 'Xml Named Query'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery - * @generated - */ - public EClass getXmlNamedQuery() { - return xmlNamedQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery Xml Named Native Query}'. - * - * - * @return the meta object for class 'Xml Named Native Query'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery - * @generated - */ - public EClass getXmlNamedNativeQuery() { - return xmlNamedNativeQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlQueryHint Xml Query Hint}'. - * - * - * @return the meta object for class 'Xml Query Hint'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlQueryHint - * @generated - */ - public EClass getXmlQueryHint() { - return xmlQueryHintEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint Xml Unique Constraint}'. - * - * - * @return the meta object for class 'Xml Unique Constraint'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint - * @generated - */ - public EClass getXmlUniqueConstraint() { - return xmlUniqueConstraintEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade Xml Cascade}'. - * - * - * @return the meta object for class 'Xml Cascade'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade - * @generated - */ - public EClass getXmlCascade() { - return xmlCascadeEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass Xml Id Class}'. - * - * - * @return the meta object for class 'Xml Id Class'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlIdClass - * @generated - */ - public EClass getXmlIdClass() { - return xmlIdClassEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlIdClass#getValue() - * @see #getXmlIdClass() - * @generated - */ - public EAttribute getXmlIdClass_Value() { - return (EAttribute) xmlIdClassEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance Xml Inheritance}'. - * - * - * @return the meta object for class 'Xml Inheritance'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlInheritance - * @generated - */ - public EClass getXmlInheritance() { - return xmlInheritanceEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance#getStrategy Strategy}'. - * - * - * @return the meta object for the attribute 'Strategy'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlInheritance#getStrategy() - * @see #getXmlInheritance() - * @generated - */ - public EAttribute getXmlInheritance_Strategy() { - return (EAttribute) xmlInheritanceEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey Xml Map Key}'. - * - * - * @return the meta object for class 'Xml Map Key'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMapKey - * @generated - */ - public EClass getXmlMapKey() { - return xmlMapKeyEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMapKey#getName() - * @see #getXmlMapKey() - * @generated - */ - public EAttribute getXmlMapKey_Name() { - return (EAttribute) xmlMapKeyEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public OrmFactory getOrmFactory() { - return (OrmFactory) getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - // Create classes and their features - xmlRootContentNodeEClass = createEClass(XML_ROOT_CONTENT_NODE); - createEReference(xmlRootContentNodeEClass, XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS); - entityMappingsInternalEClass = createEClass(ENTITY_MAPPINGS_INTERNAL); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__ROOT); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__VERSION); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__DESCRIPTION); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__SCHEMA); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__CATALOG); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS); - createEAttribute(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__ACCESS); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES); - createEReference(entityMappingsInternalEClass, ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES); - entityMappingsEClass = createEClass(ENTITY_MAPPINGS); - createEReference(entityMappingsEClass, ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA); - createEAttribute(entityMappingsEClass, ENTITY_MAPPINGS__PACKAGE); - entityMappingsForXmlEClass = createEClass(ENTITY_MAPPINGS_FOR_XML); - createEReference(entityMappingsForXmlEClass, ENTITY_MAPPINGS_FOR_XML__PERSISTENCE_UNIT_METADATA_FOR_XML); - createEAttribute(entityMappingsForXmlEClass, ENTITY_MAPPINGS_FOR_XML__PACKAGE_FOR_XML); - xmlTypeMappingEClass = createEClass(XML_TYPE_MAPPING); - createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__DEFAULT_ACCESS); - createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__SPECIFIED_ACCESS); - createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__ACCESS); - createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__METADATA_COMPLETE); - createEReference(xmlTypeMappingEClass, XML_TYPE_MAPPING__PERSISTENT_TYPE); - xmlPersistentTypeEClass = createEClass(XML_PERSISTENT_TYPE); - createEAttribute(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__CLASS); - createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS); - createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS); - createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS); - createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES); - createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES); - createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES); - xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS); - createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML); - xmlEntityInternalEClass = createEClass(XML_ENTITY_INTERNAL); - xmlEntityForXmlEClass = createEClass(XML_ENTITY_FOR_XML); - createEReference(xmlEntityForXmlEClass, XML_ENTITY_FOR_XML__TABLE_FOR_XML); - createEReference(xmlEntityForXmlEClass, XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML); - createEReference(xmlEntityForXmlEClass, XML_ENTITY_FOR_XML__ID_CLASS_FOR_XML); - createEReference(xmlEntityForXmlEClass, XML_ENTITY_FOR_XML__INHERITANCE_FOR_XML); - xmlEntityEClass = createEClass(XML_ENTITY); - createEReference(xmlEntityEClass, XML_ENTITY__SECONDARY_TABLES); - createEReference(xmlEntityEClass, XML_ENTITY__VIRTUAL_SECONDARY_TABLES); - xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE); - xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING); - createEReference(xmlAttributeMappingEClass, XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE); - xmlNullAttributeMappingEClass = createEClass(XML_NULL_ATTRIBUTE_MAPPING); - xmlBasicEClass = createEClass(XML_BASIC); - xmlIdEClass = createEClass(XML_ID); - xmlTransientEClass = createEClass(XML_TRANSIENT); - xmlEmbeddedEClass = createEClass(XML_EMBEDDED); - xmlEmbeddedIdEClass = createEClass(XML_EMBEDDED_ID); - xmlVersionEClass = createEClass(XML_VERSION); - xmlMultiRelationshipMappingInternalEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL); - xmlMultiRelationshipMappingForXmlEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML); - createEReference(xmlMultiRelationshipMappingForXmlEClass, XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML); - createEReference(xmlMultiRelationshipMappingForXmlEClass, XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML); - xmlMultiRelationshipMappingEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING); - xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY); - xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY); - xmlPersistentAttributeEClass = createEClass(XML_PERSISTENT_ATTRIBUTE); - createEAttribute(xmlPersistentAttributeEClass, XML_PERSISTENT_ATTRIBUTE__NAME); - persistenceUnitMetadataInternalEClass = createEClass(PERSISTENCE_UNIT_METADATA_INTERNAL); - createEAttribute(persistenceUnitMetadataInternalEClass, PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL); - createEReference(persistenceUnitMetadataInternalEClass, PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL); - persistenceUnitMetadataEClass = createEClass(PERSISTENCE_UNIT_METADATA); - createEAttribute(persistenceUnitMetadataEClass, PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE); - createEReference(persistenceUnitMetadataEClass, PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS); - persistenceUnitMetadataForXmlEClass = createEClass(PERSISTENCE_UNIT_METADATA_FOR_XML); - createEAttribute(persistenceUnitMetadataForXmlEClass, PERSISTENCE_UNIT_METADATA_FOR_XML__XML_MAPPING_METADATA_COMPLETE_FOR_XML); - createEReference(persistenceUnitMetadataForXmlEClass, PERSISTENCE_UNIT_METADATA_FOR_XML__PERSISTENCE_UNIT_DEFAULTS_FOR_XML); - persistenceUnitDefaultsInternalEClass = createEClass(PERSISTENCE_UNIT_DEFAULTS_INTERNAL); - createEAttribute(persistenceUnitDefaultsInternalEClass, PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL); - createEAttribute(persistenceUnitDefaultsInternalEClass, PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL); - createEAttribute(persistenceUnitDefaultsInternalEClass, PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL); - createEAttribute(persistenceUnitDefaultsInternalEClass, PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL); - persistenceUnitDefaultsEClass = createEClass(PERSISTENCE_UNIT_DEFAULTS); - createEAttribute(persistenceUnitDefaultsEClass, PERSISTENCE_UNIT_DEFAULTS__SCHEMA); - createEAttribute(persistenceUnitDefaultsEClass, PERSISTENCE_UNIT_DEFAULTS__CATALOG); - createEAttribute(persistenceUnitDefaultsEClass, PERSISTENCE_UNIT_DEFAULTS__ACCESS); - createEAttribute(persistenceUnitDefaultsEClass, PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST); - persistenceUnitDefaultsForXmlEClass = createEClass(PERSISTENCE_UNIT_DEFAULTS_FOR_XML); - createEAttribute(persistenceUnitDefaultsForXmlEClass, PERSISTENCE_UNIT_DEFAULTS_FOR_XML__SCHEMA_FOR_XML); - createEAttribute(persistenceUnitDefaultsForXmlEClass, PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CATALOG_FOR_XML); - createEAttribute(persistenceUnitDefaultsForXmlEClass, PERSISTENCE_UNIT_DEFAULTS_FOR_XML__ACCESS_FOR_XML); - createEAttribute(persistenceUnitDefaultsForXmlEClass, PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CASCADE_PERSIST_FOR_XML); - xmlTableEClass = createEClass(XML_TABLE); - abstractXmlNamedColumnEClass = createEClass(ABSTRACT_XML_NAMED_COLUMN); - createEAttribute(abstractXmlNamedColumnEClass, ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML); - createEAttribute(abstractXmlNamedColumnEClass, ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML); - abstractXmlColumnEClass = createEClass(ABSTRACT_XML_COLUMN); - createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML); - createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML); - createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML); - createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML); - createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML); - xmlColumnEClass = createEClass(XML_COLUMN); - createEAttribute(xmlColumnEClass, XML_COLUMN__LENGTH_FOR_XML); - createEAttribute(xmlColumnEClass, XML_COLUMN__PRECISION_FOR_XML); - createEAttribute(xmlColumnEClass, XML_COLUMN__SCALE_FOR_XML); - xmlJoinColumnEClass = createEClass(XML_JOIN_COLUMN); - createEAttribute(xmlJoinColumnEClass, XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML); - iXmlColumnMappingEClass = createEClass(IXML_COLUMN_MAPPING); - createEReference(iXmlColumnMappingEClass, IXML_COLUMN_MAPPING__COLUMN_FOR_XML); - xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE); - xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE); - xmlSingleRelationshipMappingEClass = createEClass(XML_SINGLE_RELATIONSHIP_MAPPING); - xmlRelationshipMappingEClass = createEClass(XML_RELATIONSHIP_MAPPING); - xmlJoinTableEClass = createEClass(XML_JOIN_TABLE); - abstractXmlTableEClass = createEClass(ABSTRACT_XML_TABLE); - createEAttribute(abstractXmlTableEClass, ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML); - createEAttribute(abstractXmlTableEClass, ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML); - createEAttribute(abstractXmlTableEClass, ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML); - xmlOverrideEClass = createEClass(XML_OVERRIDE); - xmlAttributeOverrideEClass = createEClass(XML_ATTRIBUTE_OVERRIDE); - xmlAssociationOverrideEClass = createEClass(XML_ASSOCIATION_OVERRIDE); - xmlDiscriminatorColumnEClass = createEClass(XML_DISCRIMINATOR_COLUMN); - createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML); - createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML); - xmlSecondaryTableEClass = createEClass(XML_SECONDARY_TABLE); - xmlPrimaryKeyJoinColumnEClass = createEClass(XML_PRIMARY_KEY_JOIN_COLUMN); - createEAttribute(xmlPrimaryKeyJoinColumnEClass, XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML); - xmlGeneratedValueEClass = createEClass(XML_GENERATED_VALUE); - xmlGeneratorEClass = createEClass(XML_GENERATOR); - xmlSequenceGeneratorEClass = createEClass(XML_SEQUENCE_GENERATOR); - xmlTableGeneratorEClass = createEClass(XML_TABLE_GENERATOR); - abstractXmlQueryEClass = createEClass(ABSTRACT_XML_QUERY); - xmlNamedQueryEClass = createEClass(XML_NAMED_QUERY); - xmlNamedNativeQueryEClass = createEClass(XML_NAMED_NATIVE_QUERY); - xmlQueryHintEClass = createEClass(XML_QUERY_HINT); - xmlUniqueConstraintEClass = createEClass(XML_UNIQUE_CONSTRAINT); - xmlCascadeEClass = createEClass(XML_CASCADE); - xmlIdClassEClass = createEClass(XML_ID_CLASS); - createEAttribute(xmlIdClassEClass, XML_ID_CLASS__VALUE); - xmlInheritanceEClass = createEClass(XML_INHERITANCE); - createEAttribute(xmlInheritanceEClass, XML_INHERITANCE__STRATEGY); - xmlMapKeyEClass = createEClass(XML_MAP_KEY); - createEAttribute(xmlMapKeyEClass, XML_MAP_KEY__NAME); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - // Obtain other dependent packages - JpaCorePackage theJpaCorePackage = (JpaCorePackage) EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI); - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI); - EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - // Create type parameters - // Set bounds for type parameters - // Add supertypes to classes - xmlRootContentNodeEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlRootContentNodeEClass.getESuperTypes().add(theJpaCorePackage.getIJpaRootContentNode()); - entityMappingsInternalEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - entityMappingsInternalEClass.getESuperTypes().add(theJpaCorePackage.getIJpaContentNode()); - entityMappingsInternalEClass.getESuperTypes().add(this.getEntityMappingsForXml()); - entityMappingsInternalEClass.getESuperTypes().add(this.getEntityMappings()); - xmlTypeMappingEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlTypeMappingEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping()); - xmlPersistentTypeEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlPersistentTypeEClass.getESuperTypes().add(theJpaCorePackage.getIPersistentType()); - xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlTypeMapping()); - xmlMappedSuperclassEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIMappedSuperclass()); - xmlEntityInternalEClass.getESuperTypes().add(this.getXmlTypeMapping()); - xmlEntityInternalEClass.getESuperTypes().add(this.getXmlEntityForXml()); - xmlEntityInternalEClass.getESuperTypes().add(this.getXmlEntity()); - xmlEntityEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEntity()); - xmlEmbeddableEClass.getESuperTypes().add(this.getXmlTypeMapping()); - xmlEmbeddableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEmbeddable()); - xmlAttributeMappingEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlAttributeMappingEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - xmlNullAttributeMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlBasicEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlBasicEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIBasic()); - xmlBasicEClass.getESuperTypes().add(this.getIXmlColumnMapping()); - xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlIdEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIId()); - xmlIdEClass.getESuperTypes().add(this.getIXmlColumnMapping()); - xmlTransientEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlTransientEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITransient()); - xmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlEmbeddedEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEmbedded()); - xmlEmbeddedIdEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlEmbeddedIdEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIEmbeddedId()); - xmlVersionEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlVersionEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIVersion()); - xmlVersionEClass.getESuperTypes().add(this.getIXmlColumnMapping()); - xmlMultiRelationshipMappingInternalEClass.getESuperTypes().add(this.getXmlRelationshipMapping()); - xmlMultiRelationshipMappingInternalEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIMultiRelationshipMapping()); - xmlMultiRelationshipMappingInternalEClass.getESuperTypes().add(this.getXmlMultiRelationshipMappingForXml()); - xmlMultiRelationshipMappingInternalEClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping()); - xmlMultiRelationshipMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIMultiRelationshipMapping()); - xmlOneToManyEClass.getESuperTypes().add(this.getXmlMultiRelationshipMappingInternal()); - xmlOneToManyEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOneToMany()); - xmlManyToManyEClass.getESuperTypes().add(this.getXmlMultiRelationshipMappingInternal()); - xmlManyToManyEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIManyToMany()); - xmlPersistentAttributeEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlPersistentAttributeEClass.getESuperTypes().add(theJpaCorePackage.getIPersistentAttribute()); - persistenceUnitMetadataInternalEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - persistenceUnitMetadataInternalEClass.getESuperTypes().add(this.getPersistenceUnitMetadataForXml()); - persistenceUnitMetadataInternalEClass.getESuperTypes().add(this.getPersistenceUnitMetadata()); - persistenceUnitMetadataEClass.getESuperTypes().add(theJpaCorePackage.getIXmlEObject()); - persistenceUnitMetadataForXmlEClass.getESuperTypes().add(theJpaCorePackage.getIXmlEObject()); - persistenceUnitDefaultsInternalEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - persistenceUnitDefaultsInternalEClass.getESuperTypes().add(this.getPersistenceUnitDefaults()); - persistenceUnitDefaultsInternalEClass.getESuperTypes().add(this.getPersistenceUnitDefaultsForXml()); - persistenceUnitDefaultsEClass.getESuperTypes().add(theJpaCorePackage.getIXmlEObject()); - persistenceUnitDefaultsForXmlEClass.getESuperTypes().add(theJpaCorePackage.getIXmlEObject()); - xmlTableEClass.getESuperTypes().add(this.getAbstractXmlTable()); - xmlTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITable()); - abstractXmlNamedColumnEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - abstractXmlNamedColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedColumn()); - abstractXmlColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn()); - abstractXmlColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIAbstractColumn()); - xmlColumnEClass.getESuperTypes().add(this.getAbstractXmlColumn()); - xmlColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIColumn()); - xmlJoinColumnEClass.getESuperTypes().add(this.getAbstractXmlColumn()); - xmlJoinColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIJoinColumn()); - iXmlColumnMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIColumnMapping()); - xmlManyToOneEClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping()); - xmlManyToOneEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIManyToOne()); - xmlOneToOneEClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping()); - xmlOneToOneEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOneToOne()); - xmlSingleRelationshipMappingEClass.getESuperTypes().add(this.getXmlRelationshipMapping()); - xmlSingleRelationshipMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISingleRelationshipMapping()); - xmlRelationshipMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping()); - xmlRelationshipMappingEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIRelationshipMapping()); - xmlJoinTableEClass.getESuperTypes().add(this.getAbstractXmlTable()); - xmlJoinTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIJoinTable()); - abstractXmlTableEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - abstractXmlTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITable()); - xmlOverrideEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlOverrideEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOverride()); - xmlAttributeOverrideEClass.getESuperTypes().add(this.getXmlOverride()); - xmlAttributeOverrideEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIAttributeOverride()); - xmlAttributeOverrideEClass.getESuperTypes().add(this.getIXmlColumnMapping()); - xmlAssociationOverrideEClass.getESuperTypes().add(this.getXmlOverride()); - xmlAssociationOverrideEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIAssociationOverride()); - xmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn()); - xmlDiscriminatorColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIDiscriminatorColumn()); - xmlSecondaryTableEClass.getESuperTypes().add(this.getAbstractXmlTable()); - xmlSecondaryTableEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISecondaryTable()); - xmlPrimaryKeyJoinColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn()); - xmlPrimaryKeyJoinColumnEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIPrimaryKeyJoinColumn()); - xmlGeneratedValueEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlGeneratedValueEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIGeneratedValue()); - xmlGeneratorEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIGenerator()); - xmlSequenceGeneratorEClass.getESuperTypes().add(this.getXmlGenerator()); - xmlSequenceGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISequenceGenerator()); - xmlTableGeneratorEClass.getESuperTypes().add(this.getXmlGenerator()); - xmlTableGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITableGenerator()); - abstractXmlQueryEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - abstractXmlQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQuery()); - xmlNamedQueryEClass.getESuperTypes().add(this.getAbstractXmlQuery()); - xmlNamedQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedQuery()); - xmlNamedNativeQueryEClass.getESuperTypes().add(this.getAbstractXmlQuery()); - xmlNamedNativeQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedNativeQuery()); - xmlQueryHintEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlQueryHintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQueryHint()); - xmlUniqueConstraintEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlUniqueConstraintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIUniqueConstraint()); - xmlCascadeEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlCascadeEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getICascade()); - xmlIdClassEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlInheritanceEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlMapKeyEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - // Initialize classes and features; add operations and parameters - initEClass(xmlRootContentNodeEClass, XmlRootContentNode.class, "XmlRootContentNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXmlRootContentNode_EntityMappings(), this.getEntityMappingsInternal(), this.getEntityMappingsInternal_Root(), "entityMappings", null, 1, 1, XmlRootContentNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEClass(entityMappingsInternalEClass, EntityMappingsInternal.class, "EntityMappingsInternal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getEntityMappingsInternal_Root(), this.getXmlRootContentNode(), this.getXmlRootContentNode_EntityMappings(), "root", "", 1, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getEntityMappingsInternal_Version(), ecorePackage.getEString(), "version", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_Description(), ecorePackage.getEString(), "description", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_PersistenceUnitMetadataInternal(), this.getPersistenceUnitMetadataInternal(), null, "persistenceUnitMetadataInternal", "", 1, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_PackageInternal(), ecorePackage.getEString(), "packageInternal", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_DefaultSchema(), ecorePackage.getEString(), "defaultSchema", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_SpecifiedSchema(), ecorePackage.getEString(), "specifiedSchema", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_Schema(), ecorePackage.getEString(), "schema", null, 0, 1, EntityMappingsInternal.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_DefaultCatalog(), ecorePackage.getEString(), "defaultCatalog", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_SpecifiedCatalog(), ecorePackage.getEString(), "specifiedCatalog", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_Catalog(), ecorePackage.getEString(), "catalog", null, 0, 1, EntityMappingsInternal.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_DefaultAccess(), theJpaCorePackage.getAccessType(), "defaultAccess", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_SpecifiedAccess(), theJpaCorePackage.getAccessType(), "specifiedAccess", null, 0, 1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsInternal_Access(), theJpaCorePackage.getAccessType(), "access", null, 0, 1, EntityMappingsInternal.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_TypeMappings(), this.getXmlTypeMapping(), null, "typeMappings", "", 0, -1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_PersistentTypes(), this.getXmlPersistentType(), null, "persistentTypes", null, 0, -1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_SequenceGenerators(), this.getXmlSequenceGenerator(), null, "sequenceGenerators", null, 0, -1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_TableGenerators(), this.getXmlTableGenerator(), null, "tableGenerators", null, 0, -1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_NamedQueries(), this.getXmlNamedQuery(), null, "namedQueries", null, 0, -1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEntityMappingsInternal_NamedNativeQueries(), this.getXmlNamedNativeQuery(), null, "namedNativeQueries", null, 0, -1, EntityMappingsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(entityMappingsEClass, EntityMappings.class, "EntityMappings", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getEntityMappings_PersistenceUnitMetadata(), this.getPersistenceUnitMetadata(), null, "persistenceUnitMetadata", "", 0, 1, EntityMappings.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappings_Package(), ecorePackage.getEString(), "package", null, 0, 1, EntityMappings.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(entityMappingsForXmlEClass, EntityMappingsForXml.class, "EntityMappingsForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getEntityMappingsForXml_PersistenceUnitMetadataForXml(), this.getPersistenceUnitMetadataForXml(), null, "persistenceUnitMetadataForXml", null, 0, 1, EntityMappingsForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEntityMappingsForXml_PackageForXml(), ecorePackage.getEString(), "packageForXml", null, 0, 1, EntityMappingsForXml.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); - initEAttribute(getXmlTypeMapping_DefaultAccess(), theJpaCorePackage.getAccessType(), "defaultAccess", null, 0, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlTypeMapping_SpecifiedAccess(), theJpaCorePackage.getAccessType(), "specifiedAccess", null, 0, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlTypeMapping_Access(), theJpaCorePackage.getAccessType(), "access", null, 0, 1, XmlTypeMapping.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlTypeMapping_MetadataComplete(), theJpaCoreMappingsPackage.getDefaultFalseBoolean(), "metadataComplete", null, 0, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlTypeMapping_PersistentType(), this.getXmlPersistentType(), null, "persistentType", null, 1, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlPersistentTypeEClass, XmlPersistentType.class, "XmlPersistentType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlPersistentType_Class(), theEcorePackage.getEString(), "class", null, 0, 1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlPersistentType_AttributeMappings(), this.getXmlAttributeMapping(), null, "attributeMappings", null, 0, -1, XmlPersistentType.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlPersistentType_SpecifiedAttributeMappings(), this.getXmlAttributeMapping(), null, "specifiedAttributeMappings", null, 0, -1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlPersistentType_VirtualAttributeMappings(), this.getXmlAttributeMapping(), null, "virtualAttributeMappings", null, 0, -1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlPersistentType_PersistentAttributes(), this.getXmlPersistentAttribute(), null, "persistentAttributes", null, 0, -1, XmlPersistentType.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlPersistentType_SpecifiedPersistentAttributes(), this.getXmlPersistentAttribute(), null, "specifiedPersistentAttributes", null, 0, -1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlPersistentType_VirtualPersistentAttributes(), this.getXmlPersistentAttribute(), null, "virtualPersistentAttributes", null, 0, -1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXmlMappedSuperclass_IdClassForXml(), this.getXmlIdClass(), null, "idClassForXml", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlEntityInternalEClass, XmlEntityInternal.class, "XmlEntityInternal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlEntityForXmlEClass, XmlEntityForXml.class, "XmlEntityForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXmlEntityForXml_TableForXml(), this.getXmlTable(), null, "tableForXml", null, 0, 1, XmlEntityForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlEntityForXml_DiscriminatorColumnForXml(), this.getXmlDiscriminatorColumn(), null, "discriminatorColumnForXml", null, 0, 1, XmlEntityForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlEntityForXml_IdClassForXml(), this.getXmlIdClass(), null, "idClassForXml", null, 0, 1, XmlEntityForXml.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlEntityForXml_InheritanceForXml(), this.getXmlInheritance(), null, "inheritanceForXml", null, 0, 1, XmlEntityForXml.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlEntityEClass, XmlEntity.class, "XmlEntity", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXmlEntity_SecondaryTables(), theJpaCoreMappingsPackage.getISecondaryTable(), null, "secondaryTables", null, 0, -1, XmlEntity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlEntity_VirtualSecondaryTables(), theJpaCoreMappingsPackage.getISecondaryTable(), null, "virtualSecondaryTables", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlEmbeddableEClass, XmlEmbeddable.class, "XmlEmbeddable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlAttributeMappingEClass, XmlAttributeMapping.class, "XmlAttributeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXmlAttributeMapping_PersistentAttribute(), this.getXmlPersistentAttribute(), null, "persistentAttribute", null, 1, 1, XmlAttributeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlNullAttributeMappingEClass, XmlNullAttributeMapping.class, "XmlNullAttributeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlBasicEClass, XmlBasic.class, "XmlBasic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlIdEClass, XmlId.class, "XmlId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlTransientEClass, XmlTransient.class, "XmlTransient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlEmbeddedEClass, XmlEmbedded.class, "XmlEmbedded", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlEmbeddedIdEClass, XmlEmbeddedId.class, "XmlEmbeddedId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlMultiRelationshipMappingInternalEClass, XmlMultiRelationshipMappingInternal.class, "XmlMultiRelationshipMappingInternal", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlMultiRelationshipMappingForXmlEClass, XmlMultiRelationshipMappingForXml.class, "XmlMultiRelationshipMappingForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXmlMultiRelationshipMappingForXml_JoinTableForXml(), this.getXmlJoinTable(), null, "joinTableForXml", null, 0, 1, XmlMultiRelationshipMappingForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlMultiRelationshipMappingForXml_MapKeyForXml(), this.getXmlMapKey(), null, "mapKeyForXml", null, 0, 1, XmlMultiRelationshipMappingForXml.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlMultiRelationshipMappingEClass, XmlMultiRelationshipMapping.class, "XmlMultiRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlManyToManyEClass, XmlManyToMany.class, "XmlManyToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlPersistentAttributeEClass, XmlPersistentAttribute.class, "XmlPersistentAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlPersistentAttribute_Name(), ecorePackage.getEString(), "name", null, 0, 1, XmlPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceUnitMetadataInternalEClass, PersistenceUnitMetadataInternal.class, "PersistenceUnitMetadataInternal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnitMetadataInternal_XmlMappingMetadataCompleteInternal(), ecorePackage.getEBoolean(), "xmlMappingMetadataCompleteInternal", null, 0, 1, PersistenceUnitMetadataInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistenceUnitMetadataInternal_PersistenceUnitDefaultsInternal(), this.getPersistenceUnitDefaultsInternal(), null, "persistenceUnitDefaultsInternal", "", 1, 1, PersistenceUnitMetadataInternal.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceUnitMetadataEClass, PersistenceUnitMetadata.class, "PersistenceUnitMetadata", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnitMetadata_XmlMappingMetadataComplete(), ecorePackage.getEBoolean(), "xmlMappingMetadataComplete", null, 0, 1, PersistenceUnitMetadata.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistenceUnitMetadata_PersistenceUnitDefaults(), this.getPersistenceUnitDefaults(), null, "persistenceUnitDefaults", "", 0, 1, PersistenceUnitMetadata.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceUnitMetadataForXmlEClass, PersistenceUnitMetadataForXml.class, "PersistenceUnitMetadataForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnitMetadataForXml_XmlMappingMetadataCompleteForXml(), ecorePackage.getEBoolean(), "xmlMappingMetadataCompleteForXml", null, 0, 1, PersistenceUnitMetadataForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistenceUnitMetadataForXml_PersistenceUnitDefaultsForXml(), this.getPersistenceUnitDefaultsForXml(), null, "persistenceUnitDefaultsForXml", "", 0, 1, PersistenceUnitMetadataForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceUnitDefaultsInternalEClass, PersistenceUnitDefaultsInternal.class, "PersistenceUnitDefaultsInternal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnitDefaultsInternal_SchemaInternal(), ecorePackage.getEString(), "schemaInternal", null, 0, 1, PersistenceUnitDefaultsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaultsInternal_CatalogInternal(), ecorePackage.getEString(), "catalogInternal", null, 0, 1, PersistenceUnitDefaultsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaultsInternal_AccessInternal(), theJpaCorePackage.getAccessType(), "accessInternal", "", 0, 1, PersistenceUnitDefaultsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaultsInternal_CascadePersistInternal(), ecorePackage.getEBoolean(), "cascadePersistInternal", null, 0, 1, PersistenceUnitDefaultsInternal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceUnitDefaultsEClass, PersistenceUnitDefaults.class, "PersistenceUnitDefaults", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnitDefaults_Schema(), ecorePackage.getEString(), "schema", null, 0, 1, PersistenceUnitDefaults.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaults_Catalog(), ecorePackage.getEString(), "catalog", null, 0, 1, PersistenceUnitDefaults.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaults_Access(), theJpaCorePackage.getAccessType(), "access", "", 0, 1, PersistenceUnitDefaults.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaults_CascadePersist(), ecorePackage.getEBoolean(), "cascadePersist", null, 0, 1, PersistenceUnitDefaults.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceUnitDefaultsForXmlEClass, PersistenceUnitDefaultsForXml.class, "PersistenceUnitDefaultsForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnitDefaultsForXml_SchemaForXml(), ecorePackage.getEString(), "schemaForXml", null, 0, 1, PersistenceUnitDefaultsForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaultsForXml_CatalogForXml(), ecorePackage.getEString(), "catalogForXml", null, 0, 1, PersistenceUnitDefaultsForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaultsForXml_AccessForXml(), theJpaCorePackage.getAccessType(), "accessForXml", "", 0, 1, PersistenceUnitDefaultsForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnitDefaultsForXml_CascadePersistForXml(), ecorePackage.getEBoolean(), "cascadePersistForXml", null, 0, 1, PersistenceUnitDefaultsForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlTableEClass, XmlTable.class, "XmlTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(abstractXmlNamedColumnEClass, AbstractXmlNamedColumn.class, "AbstractXmlNamedColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getAbstractXmlNamedColumn_SpecifiedNameForXml(), ecorePackage.getEString(), "specifiedNameForXml", null, 0, 1, AbstractXmlNamedColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlNamedColumn_ColumnDefinitionForXml(), ecorePackage.getEString(), "columnDefinitionForXml", null, 0, 1, AbstractXmlNamedColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(abstractXmlColumnEClass, AbstractXmlColumn.class, "AbstractXmlColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getAbstractXmlColumn_UniqueForXml(), theJpaCoreMappingsPackage.getDefaultFalseBoolean(), "uniqueForXml", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlColumn_NullableForXml(), theJpaCoreMappingsPackage.getDefaultTrueBoolean(), "nullableForXml", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlColumn_InsertableForXml(), theJpaCoreMappingsPackage.getDefaultTrueBoolean(), "insertableForXml", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlColumn_UpdatableForXml(), theJpaCoreMappingsPackage.getDefaultTrueBoolean(), "updatableForXml", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlColumn_SpecifiedTableForXml(), ecorePackage.getEString(), "specifiedTableForXml", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlColumnEClass, XmlColumn.class, "XmlColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlColumn_LengthForXml(), ecorePackage.getEInt(), "lengthForXml", "255", 0, 1, XmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlColumn_PrecisionForXml(), ecorePackage.getEInt(), "precisionForXml", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlColumn_ScaleForXml(), ecorePackage.getEInt(), "scaleForXml", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlJoinColumnEClass, XmlJoinColumn.class, "XmlJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlJoinColumn_SpecifiedReferencedColumnNameForXml(), ecorePackage.getEString(), "specifiedReferencedColumnNameForXml", null, 0, 1, XmlJoinColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iXmlColumnMappingEClass, IXmlColumnMapping.class, "IXmlColumnMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIXmlColumnMapping_ColumnForXml(), this.getXmlColumn(), null, "columnForXml", null, 0, 1, IXmlColumnMapping.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - addEOperation(iXmlColumnMappingEClass, null, "makeColumnForXmlNonNull"); - addEOperation(iXmlColumnMappingEClass, null, "makeColumnForXmlNull"); - initEClass(xmlManyToOneEClass, XmlManyToOne.class, "XmlManyToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlOneToOneEClass, XmlOneToOne.class, "XmlOneToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlSingleRelationshipMappingEClass, XmlSingleRelationshipMapping.class, "XmlSingleRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlRelationshipMappingEClass, XmlRelationshipMapping.class, "XmlRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlJoinTableEClass, XmlJoinTable.class, "XmlJoinTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(abstractXmlTableEClass, AbstractXmlTable.class, "AbstractXmlTable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getAbstractXmlTable_SpecifiedNameForXml(), ecorePackage.getEString(), "specifiedNameForXml", null, 0, 1, AbstractXmlTable.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlTable_SpecifiedCatalogForXml(), ecorePackage.getEString(), "specifiedCatalogForXml", null, 0, 1, AbstractXmlTable.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAbstractXmlTable_SpecifiedSchemaForXml(), ecorePackage.getEString(), "specifiedSchemaForXml", null, 0, 1, AbstractXmlTable.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlOverrideEClass, XmlOverride.class, "XmlOverride", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlAttributeOverrideEClass, XmlAttributeOverride.class, "XmlAttributeOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlAssociationOverrideEClass, XmlAssociationOverride.class, "XmlAssociationOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlDiscriminatorColumnEClass, XmlDiscriminatorColumn.class, "XmlDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlDiscriminatorColumn_DiscriminatorTypeForXml(), theJpaCoreMappingsPackage.getDiscriminatorType(), "discriminatorTypeForXml", null, 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlDiscriminatorColumn_SpecifiedLengthForXml(), theEcorePackage.getEInt(), "specifiedLengthForXml", "-1", 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlSecondaryTableEClass, XmlSecondaryTable.class, "XmlSecondaryTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlPrimaryKeyJoinColumnEClass, XmlPrimaryKeyJoinColumn.class, "XmlPrimaryKeyJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlPrimaryKeyJoinColumn_SpecifiedReferencedColumnNameForXml(), ecorePackage.getEString(), "specifiedReferencedColumnNameForXml", null, 0, 1, XmlPrimaryKeyJoinColumn.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlGeneratedValueEClass, XmlGeneratedValue.class, "XmlGeneratedValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlGeneratorEClass, XmlGenerator.class, "XmlGenerator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlSequenceGeneratorEClass, XmlSequenceGenerator.class, "XmlSequenceGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlTableGeneratorEClass, XmlTableGenerator.class, "XmlTableGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(abstractXmlQueryEClass, AbstractXmlQuery.class, "AbstractXmlQuery", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlNamedQueryEClass, XmlNamedQuery.class, "XmlNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlNamedNativeQueryEClass, XmlNamedNativeQuery.class, "XmlNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlQueryHintEClass, XmlQueryHint.class, "XmlQueryHint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlUniqueConstraintEClass, XmlUniqueConstraint.class, "XmlUniqueConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlCascadeEClass, XmlCascade.class, "XmlCascade", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlIdClassEClass, XmlIdClass.class, "XmlIdClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlIdClass_Value(), theEcorePackage.getEString(), "value", "", 0, 1, XmlIdClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlInheritanceEClass, XmlInheritance.class, "XmlInheritance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlInheritance_Strategy(), theJpaCoreMappingsPackage.getInheritanceType(), "strategy", "", 0, 1, XmlInheritance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(xmlMapKeyEClass, XmlMapKey.class, "XmlMapKey", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlMapKey_Name(), ecorePackage.getEString(), "name", null, 0, 1, XmlMapKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - // Create resource - createResource(eNS_URI); - } - - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode Xml Root Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRootContentNode() - * @generated - */ - public static final EClass XML_ROOT_CONTENT_NODE = eINSTANCE.getXmlRootContentNode(); - - /** - * The meta object literal for the 'Entity Mappings' reference feature. - * - * - * @generated - */ - public static final EReference XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS = eINSTANCE.getXmlRootContentNode_EntityMappings(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal Entity Mappings Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsInternal() - * @generated - */ - public static final EClass ENTITY_MAPPINGS_INTERNAL = eINSTANCE.getEntityMappingsInternal(); - - /** - * The meta object literal for the 'Root' reference feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__ROOT = eINSTANCE.getEntityMappingsInternal_Root(); - - /** - * The meta object literal for the 'Version' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__VERSION = eINSTANCE.getEntityMappingsInternal_Version(); - - /** - * The meta object literal for the 'Description' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__DESCRIPTION = eINSTANCE.getEntityMappingsInternal_Description(); - - /** - * The meta object literal for the 'Persistence Unit Metadata Internal' containment reference feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__PERSISTENCE_UNIT_METADATA_INTERNAL = eINSTANCE.getEntityMappingsInternal_PersistenceUnitMetadataInternal(); - - /** - * The meta object literal for the 'Package Internal' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__PACKAGE_INTERNAL = eINSTANCE.getEntityMappingsInternal_PackageInternal(); - - /** - * The meta object literal for the 'Default Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA = eINSTANCE.getEntityMappingsInternal_DefaultSchema(); - - /** - * The meta object literal for the 'Specified Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA = eINSTANCE.getEntityMappingsInternal_SpecifiedSchema(); - - /** - * The meta object literal for the 'Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__SCHEMA = eINSTANCE.getEntityMappingsInternal_Schema(); - - /** - * The meta object literal for the 'Default Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG = eINSTANCE.getEntityMappingsInternal_DefaultCatalog(); - - /** - * The meta object literal for the 'Specified Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG = eINSTANCE.getEntityMappingsInternal_SpecifiedCatalog(); - - /** - * The meta object literal for the 'Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__CATALOG = eINSTANCE.getEntityMappingsInternal_Catalog(); - - /** - * The meta object literal for the 'Default Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__DEFAULT_ACCESS = eINSTANCE.getEntityMappingsInternal_DefaultAccess(); - - /** - * The meta object literal for the 'Specified Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS = eINSTANCE.getEntityMappingsInternal_SpecifiedAccess(); - - /** - * The meta object literal for the 'Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_INTERNAL__ACCESS = eINSTANCE.getEntityMappingsInternal_Access(); - - /** - * The meta object literal for the 'Type Mappings' containment reference list feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS = eINSTANCE.getEntityMappingsInternal_TypeMappings(); - - /** - * The meta object literal for the 'Persistent Types' reference list feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES = eINSTANCE.getEntityMappingsInternal_PersistentTypes(); - - /** - * The meta object literal for the 'Sequence Generators' containment reference list feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS = eINSTANCE.getEntityMappingsInternal_SequenceGenerators(); - - /** - * The meta object literal for the 'Table Generators' containment reference list feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS = eINSTANCE.getEntityMappingsInternal_TableGenerators(); - - /** - * The meta object literal for the 'Named Queries' containment reference list feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES = eINSTANCE.getEntityMappingsInternal_NamedQueries(); - - /** - * The meta object literal for the 'Named Native Queries' containment reference list feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES = eINSTANCE.getEntityMappingsInternal_NamedNativeQueries(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings Entity Mappings}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappings - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappings() - * @generated - */ - public static final EClass ENTITY_MAPPINGS = eINSTANCE.getEntityMappings(); - - /** - * The meta object literal for the 'Persistence Unit Metadata' reference feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = eINSTANCE.getEntityMappings_PersistenceUnitMetadata(); - - /** - * The meta object literal for the 'Package' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS__PACKAGE = eINSTANCE.getEntityMappings_Package(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml Entity Mappings For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml() - * @generated - */ - public static final EClass ENTITY_MAPPINGS_FOR_XML = eINSTANCE.getEntityMappingsForXml(); - - /** - * The meta object literal for the 'Persistence Unit Metadata For Xml' reference feature. - * - * - * @generated - */ - public static final EReference ENTITY_MAPPINGS_FOR_XML__PERSISTENCE_UNIT_METADATA_FOR_XML = eINSTANCE.getEntityMappingsForXml_PersistenceUnitMetadataForXml(); - - /** - * The meta object literal for the 'Package For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ENTITY_MAPPINGS_FOR_XML__PACKAGE_FOR_XML = eINSTANCE.getEntityMappingsForXml_PackageForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping Xml Type Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping() - * @generated - */ - public static final EClass XML_TYPE_MAPPING = eINSTANCE.getXmlTypeMapping(); - - /** - * The meta object literal for the 'Default Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_TYPE_MAPPING__DEFAULT_ACCESS = eINSTANCE.getXmlTypeMapping_DefaultAccess(); - - /** - * The meta object literal for the 'Specified Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_TYPE_MAPPING__SPECIFIED_ACCESS = eINSTANCE.getXmlTypeMapping_SpecifiedAccess(); - - /** - * The meta object literal for the 'Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_TYPE_MAPPING__ACCESS = eINSTANCE.getXmlTypeMapping_Access(); - - /** - * The meta object literal for the 'Metadata Complete' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_TYPE_MAPPING__METADATA_COMPLETE = eINSTANCE.getXmlTypeMapping_MetadataComplete(); - - /** - * The meta object literal for the 'Persistent Type' containment reference feature. - * - * - * @generated - */ - public static final EReference XML_TYPE_MAPPING__PERSISTENT_TYPE = eINSTANCE.getXmlTypeMapping_PersistentType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType Xml Persistent Type}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType() - * @generated - */ - public static final EClass XML_PERSISTENT_TYPE = eINSTANCE.getXmlPersistentType(); - - /** - * The meta object literal for the 'Class' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_PERSISTENT_TYPE__CLASS = eINSTANCE.getXmlPersistentType_Class(); - - /** - * The meta object literal for the 'Attribute Mappings' containment reference list feature. - * - * - * @generated - */ - public static final EReference XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS = eINSTANCE.getXmlPersistentType_AttributeMappings(); - - /** - * The meta object literal for the 'Specified Attribute Mappings' containment reference list feature. - * - * - * @generated - */ - public static final EReference XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS = eINSTANCE.getXmlPersistentType_SpecifiedAttributeMappings(); - - /** - * The meta object literal for the 'Virtual Attribute Mappings' containment reference list feature. - * - * - * @generated - */ - public static final EReference XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS = eINSTANCE.getXmlPersistentType_VirtualAttributeMappings(); - - /** - * The meta object literal for the 'Persistent Attributes' reference list feature. - * - * - * @generated - */ - public static final EReference XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES = eINSTANCE.getXmlPersistentType_PersistentAttributes(); - - /** - * The meta object literal for the 'Specified Persistent Attributes' reference list feature. - * - * - * @generated - */ - public static final EReference XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES = eINSTANCE.getXmlPersistentType_SpecifiedPersistentAttributes(); - - /** - * The meta object literal for the 'Virtual Persistent Attributes' reference list feature. - * - * - * @generated - */ - public static final EReference XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES = eINSTANCE.getXmlPersistentType_VirtualPersistentAttributes(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass Xml Mapped Superclass}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass() - * @generated - */ - public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass(); - - /** - * The meta object literal for the 'Id Class For Xml' containment reference feature. - * - * - * @generated - */ - public static final EReference XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML = eINSTANCE.getXmlMappedSuperclass_IdClassForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal Xml Entity Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityInternal() - * @generated - */ - public static final EClass XML_ENTITY_INTERNAL = eINSTANCE.getXmlEntityInternal(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml Xml Entity For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml() - * @generated - */ - public static final EClass XML_ENTITY_FOR_XML = eINSTANCE.getXmlEntityForXml(); - - /** - * The meta object literal for the 'Table For Xml' reference feature. - * - * - * @generated - */ - public static final EReference XML_ENTITY_FOR_XML__TABLE_FOR_XML = eINSTANCE.getXmlEntityForXml_TableForXml(); - - /** - * The meta object literal for the 'Discriminator Column For Xml' reference feature. - * - * - * @generated - */ - public static final EReference XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML = eINSTANCE.getXmlEntityForXml_DiscriminatorColumnForXml(); - - /** - * The meta object literal for the 'Id Class For Xml' containment reference feature. - * - * - * @generated - */ - public static final EReference XML_ENTITY_FOR_XML__ID_CLASS_FOR_XML = eINSTANCE.getXmlEntityForXml_IdClassForXml(); - - /** - * The meta object literal for the 'Inheritance For Xml' containment reference feature. - * - * - * @generated - */ - public static final EReference XML_ENTITY_FOR_XML__INHERITANCE_FOR_XML = eINSTANCE.getXmlEntityForXml_InheritanceForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity Xml Entity}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity() - * @generated - */ - public static final EClass XML_ENTITY = eINSTANCE.getXmlEntity(); - - /** - * The meta object literal for the 'Secondary Tables' containment reference list feature. - * - * - * @generated - */ - public static final EReference XML_ENTITY__SECONDARY_TABLES = eINSTANCE.getXmlEntity_SecondaryTables(); - - /** - * The meta object literal for the 'Virtual Secondary Tables' containment reference list feature. - * - * - * @generated - */ - public static final EReference XML_ENTITY__VIRTUAL_SECONDARY_TABLES = eINSTANCE.getXmlEntity_VirtualSecondaryTables(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable Xml Embeddable}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddable() - * @generated - */ - public static final EClass XML_EMBEDDABLE = eINSTANCE.getXmlEmbeddable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping Xml Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeMapping() - * @generated - */ - public static final EClass XML_ATTRIBUTE_MAPPING = eINSTANCE.getXmlAttributeMapping(); - - /** - * The meta object literal for the 'Persistent Attribute' containment reference feature. - * - * - * @generated - */ - public static final EReference XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE = eINSTANCE.getXmlAttributeMapping_PersistentAttribute(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping Xml Null Attribute Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNullAttributeMapping() - * @generated - */ - public static final EClass XML_NULL_ATTRIBUTE_MAPPING = eINSTANCE.getXmlNullAttributeMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic Xml Basic}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlBasic - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlBasic() - * @generated - */ - public static final EClass XML_BASIC = eINSTANCE.getXmlBasic(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId Xml Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlId - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlId() - * @generated - */ - public static final EClass XML_ID = eINSTANCE.getXmlId(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTransient Xml Transient}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTransient - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTransient() - * @generated - */ - public static final EClass XML_TRANSIENT = eINSTANCE.getXmlTransient(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbedded Xml Embedded}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbedded - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbedded() - * @generated - */ - public static final EClass XML_EMBEDDED = eINSTANCE.getXmlEmbedded(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId Xml Embedded Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddedId() - * @generated - */ - public static final EClass XML_EMBEDDED_ID = eINSTANCE.getXmlEmbeddedId(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlVersion Xml Version}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlVersion - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlVersion() - * @generated - */ - public static final EClass XML_VERSION = eINSTANCE.getXmlVersion(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal Xml Multi Relationship Mapping Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingInternal() - * @generated - */ - public static final EClass XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL = eINSTANCE.getXmlMultiRelationshipMappingInternal(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml Xml Multi Relationship Mapping For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml() - * @generated - */ - public static final EClass XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML = eINSTANCE.getXmlMultiRelationshipMappingForXml(); - - /** - * The meta object literal for the 'Join Table For Xml' reference feature. - * - * - * @generated - */ - public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML = eINSTANCE.getXmlMultiRelationshipMappingForXml_JoinTableForXml(); - - /** - * The meta object literal for the 'Map Key For Xml' containment reference feature. - * - * - * @generated - */ - public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML = eINSTANCE.getXmlMultiRelationshipMappingForXml_MapKeyForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping Xml Multi Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMapping() - * @generated - */ - public static final EClass XML_MULTI_RELATIONSHIP_MAPPING = eINSTANCE.getXmlMultiRelationshipMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToMany Xml One To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToMany - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToMany() - * @generated - */ - public static final EClass XML_ONE_TO_MANY = eINSTANCE.getXmlOneToMany(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToMany Xml Many To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToMany - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToMany() - * @generated - */ - public static final EClass XML_MANY_TO_MANY = eINSTANCE.getXmlManyToMany(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute Xml Persistent Attribute}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute() - * @generated - */ - public static final EClass XML_PERSISTENT_ATTRIBUTE = eINSTANCE.getXmlPersistentAttribute(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_PERSISTENT_ATTRIBUTE__NAME = eINSTANCE.getXmlPersistentAttribute_Name(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal Persistence Unit Metadata Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal() - * @generated - */ - public static final EClass PERSISTENCE_UNIT_METADATA_INTERNAL = eINSTANCE.getPersistenceUnitMetadataInternal(); - - /** - * The meta object literal for the 'Xml Mapping Metadata Complete Internal' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL = eINSTANCE.getPersistenceUnitMetadataInternal_XmlMappingMetadataCompleteInternal(); - - /** - * The meta object literal for the 'Persistence Unit Defaults Internal' containment reference feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL = eINSTANCE.getPersistenceUnitMetadataInternal_PersistenceUnitDefaultsInternal(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata Persistence Unit Metadata}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata() - * @generated - */ - public static final EClass PERSISTENCE_UNIT_METADATA = eINSTANCE.getPersistenceUnitMetadata(); - - /** - * The meta object literal for the 'Xml Mapping Metadata Complete' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = eINSTANCE.getPersistenceUnitMetadata_XmlMappingMetadataComplete(); - - /** - * The meta object literal for the 'Persistence Unit Defaults' reference feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getPersistenceUnitMetadata_PersistenceUnitDefaults(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml() - * @generated - */ - public static final EClass PERSISTENCE_UNIT_METADATA_FOR_XML = eINSTANCE.getPersistenceUnitMetadataForXml(); - - /** - * The meta object literal for the 'Xml Mapping Metadata Complete For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_METADATA_FOR_XML__XML_MAPPING_METADATA_COMPLETE_FOR_XML = eINSTANCE.getPersistenceUnitMetadataForXml_XmlMappingMetadataCompleteForXml(); - - /** - * The meta object literal for the 'Persistence Unit Defaults For Xml' reference feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_UNIT_METADATA_FOR_XML__PERSISTENCE_UNIT_DEFAULTS_FOR_XML = eINSTANCE.getPersistenceUnitMetadataForXml_PersistenceUnitDefaultsForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal Persistence Unit Defaults Internal}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal() - * @generated - */ - public static final EClass PERSISTENCE_UNIT_DEFAULTS_INTERNAL = eINSTANCE.getPersistenceUnitDefaultsInternal(); - - /** - * The meta object literal for the 'Schema Internal' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL = eINSTANCE.getPersistenceUnitDefaultsInternal_SchemaInternal(); - - /** - * The meta object literal for the 'Catalog Internal' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL = eINSTANCE.getPersistenceUnitDefaultsInternal_CatalogInternal(); - - /** - * The meta object literal for the 'Access Internal' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL = eINSTANCE.getPersistenceUnitDefaultsInternal_AccessInternal(); - - /** - * The meta object literal for the 'Cascade Persist Internal' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL = eINSTANCE.getPersistenceUnitDefaultsInternal_CascadePersistInternal(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults Persistence Unit Defaults}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults() - * @generated - */ - public static final EClass PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getPersistenceUnitDefaults(); - - /** - * The meta object literal for the 'Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS__SCHEMA = eINSTANCE.getPersistenceUnitDefaults_Schema(); - - /** - * The meta object literal for the 'Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS__CATALOG = eINSTANCE.getPersistenceUnitDefaults_Catalog(); - - /** - * The meta object literal for the 'Access' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS__ACCESS = eINSTANCE.getPersistenceUnitDefaults_Access(); - - /** - * The meta object literal for the 'Cascade Persist' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = eINSTANCE.getPersistenceUnitDefaults_CascadePersist(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml() - * @generated - */ - public static final EClass PERSISTENCE_UNIT_DEFAULTS_FOR_XML = eINSTANCE.getPersistenceUnitDefaultsForXml(); - - /** - * The meta object literal for the 'Schema For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_FOR_XML__SCHEMA_FOR_XML = eINSTANCE.getPersistenceUnitDefaultsForXml_SchemaForXml(); - - /** - * The meta object literal for the 'Catalog For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CATALOG_FOR_XML = eINSTANCE.getPersistenceUnitDefaultsForXml_CatalogForXml(); - - /** - * The meta object literal for the 'Access For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_FOR_XML__ACCESS_FOR_XML = eINSTANCE.getPersistenceUnitDefaultsForXml_AccessForXml(); - - /** - * The meta object literal for the 'Cascade Persist For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CASCADE_PERSIST_FOR_XML = eINSTANCE.getPersistenceUnitDefaultsForXml_CascadePersistForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTable Xml Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTable() - * @generated - */ - public static final EClass XML_TABLE = eINSTANCE.getXmlTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn Abstract Xml Named Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlNamedColumn() - * @generated - */ - public static final EClass ABSTRACT_XML_NAMED_COLUMN = eINSTANCE.getAbstractXmlNamedColumn(); - - /** - * The meta object literal for the 'Specified Name For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_NAMED_COLUMN__SPECIFIED_NAME_FOR_XML = eINSTANCE.getAbstractXmlNamedColumn_SpecifiedNameForXml(); - - /** - * The meta object literal for the 'Column Definition For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION_FOR_XML = eINSTANCE.getAbstractXmlNamedColumn_ColumnDefinitionForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn Abstract Xml Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlColumn() - * @generated - */ - public static final EClass ABSTRACT_XML_COLUMN = eINSTANCE.getAbstractXmlColumn(); - - /** - * The meta object literal for the 'Unique For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_COLUMN__UNIQUE_FOR_XML = eINSTANCE.getAbstractXmlColumn_UniqueForXml(); - - /** - * The meta object literal for the 'Nullable For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_COLUMN__NULLABLE_FOR_XML = eINSTANCE.getAbstractXmlColumn_NullableForXml(); - - /** - * The meta object literal for the 'Insertable For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_COLUMN__INSERTABLE_FOR_XML = eINSTANCE.getAbstractXmlColumn_InsertableForXml(); - - /** - * The meta object literal for the 'Updatable For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_COLUMN__UPDATABLE_FOR_XML = eINSTANCE.getAbstractXmlColumn_UpdatableForXml(); - - /** - * The meta object literal for the 'Specified Table For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_COLUMN__SPECIFIED_TABLE_FOR_XML = eINSTANCE.getAbstractXmlColumn_SpecifiedTableForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn Xml Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlColumn() - * @generated - */ - public static final EClass XML_COLUMN = eINSTANCE.getXmlColumn(); - - /** - * The meta object literal for the 'Length For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_COLUMN__LENGTH_FOR_XML = eINSTANCE.getXmlColumn_LengthForXml(); - - /** - * The meta object literal for the 'Precision For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_COLUMN__PRECISION_FOR_XML = eINSTANCE.getXmlColumn_PrecisionForXml(); - - /** - * The meta object literal for the 'Scale For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_COLUMN__SCALE_FOR_XML = eINSTANCE.getXmlColumn_ScaleForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn Xml Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinColumn() - * @generated - */ - public static final EClass XML_JOIN_COLUMN = eINSTANCE.getXmlJoinColumn(); - - /** - * The meta object literal for the 'Specified Referenced Column Name For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML = eINSTANCE.getXmlJoinColumn_SpecifiedReferencedColumnNameForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping IXml Column Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping() - * @generated - */ - public static final EClass IXML_COLUMN_MAPPING = eINSTANCE.getIXmlColumnMapping(); - - /** - * The meta object literal for the 'Column For Xml' reference feature. - * - * - * @generated - */ - public static final EReference IXML_COLUMN_MAPPING__COLUMN_FOR_XML = eINSTANCE.getIXmlColumnMapping_ColumnForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToOne Xml Many To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToOne - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToOne() - * @generated - */ - public static final EClass XML_MANY_TO_ONE = eINSTANCE.getXmlManyToOne(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToOne Xml One To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToOne - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToOne() - * @generated - */ - public static final EClass XML_ONE_TO_ONE = eINSTANCE.getXmlOneToOne(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping Xml Single Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSingleRelationshipMapping() - * @generated - */ - public static final EClass XML_SINGLE_RELATIONSHIP_MAPPING = eINSTANCE.getXmlSingleRelationshipMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping Xml Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRelationshipMapping() - * @generated - */ - public static final EClass XML_RELATIONSHIP_MAPPING = eINSTANCE.getXmlRelationshipMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinTable Xml Join Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinTable() - * @generated - */ - public static final EClass XML_JOIN_TABLE = eINSTANCE.getXmlJoinTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable Abstract Xml Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlTable() - * @generated - */ - public static final EClass ABSTRACT_XML_TABLE = eINSTANCE.getAbstractXmlTable(); - - /** - * The meta object literal for the 'Specified Name For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML = eINSTANCE.getAbstractXmlTable_SpecifiedNameForXml(); - - /** - * The meta object literal for the 'Specified Catalog For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML = eINSTANCE.getAbstractXmlTable_SpecifiedCatalogForXml(); - - /** - * The meta object literal for the 'Specified Schema For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML = eINSTANCE.getAbstractXmlTable_SpecifiedSchemaForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOverride Xml Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlOverride - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOverride() - * @generated - */ - public static final EClass XML_OVERRIDE = eINSTANCE.getXmlOverride(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride Xml Attribute Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeOverride() - * @generated - */ - public static final EClass XML_ATTRIBUTE_OVERRIDE = eINSTANCE.getXmlAttributeOverride(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride Xml Association Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAssociationOverride() - * @generated - */ - public static final EClass XML_ASSOCIATION_OVERRIDE = eINSTANCE.getXmlAssociationOverride(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn Xml Discriminator Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlDiscriminatorColumn() - * @generated - */ - public static final EClass XML_DISCRIMINATOR_COLUMN = eINSTANCE.getXmlDiscriminatorColumn(); - - /** - * The meta object literal for the 'Discriminator Type For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML = eINSTANCE.getXmlDiscriminatorColumn_DiscriminatorTypeForXml(); - - /** - * The meta object literal for the 'Specified Length For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML = eINSTANCE.getXmlDiscriminatorColumn_SpecifiedLengthForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable Xml Secondary Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSecondaryTable() - * @generated - */ - public static final EClass XML_SECONDARY_TABLE = eINSTANCE.getXmlSecondaryTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn Xml Primary Key Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPrimaryKeyJoinColumn() - * @generated - */ - public static final EClass XML_PRIMARY_KEY_JOIN_COLUMN = eINSTANCE.getXmlPrimaryKeyJoinColumn(); - - /** - * The meta object literal for the 'Specified Referenced Column Name For Xml' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML = eINSTANCE.getXmlPrimaryKeyJoinColumn_SpecifiedReferencedColumnNameForXml(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue Xml Generated Value}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlGeneratedValue() - * @generated - */ - public static final EClass XML_GENERATED_VALUE = eINSTANCE.getXmlGeneratedValue(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator Xml Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlGenerator - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlGenerator() - * @generated - */ - public static final EClass XML_GENERATOR = eINSTANCE.getXmlGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator Xml Sequence Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSequenceGenerator() - * @generated - */ - public static final EClass XML_SEQUENCE_GENERATOR = eINSTANCE.getXmlSequenceGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator Xml Table Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTableGenerator() - * @generated - */ - public static final EClass XML_TABLE_GENERATOR = eINSTANCE.getXmlTableGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery Abstract Xml Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlQuery() - * @generated - */ - public static final EClass ABSTRACT_XML_QUERY = eINSTANCE.getAbstractXmlQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery Xml Named Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedQuery() - * @generated - */ - public static final EClass XML_NAMED_QUERY = eINSTANCE.getXmlNamedQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery Xml Named Native Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedNativeQuery() - * @generated - */ - public static final EClass XML_NAMED_NATIVE_QUERY = eINSTANCE.getXmlNamedNativeQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlQueryHint Xml Query Hint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlQueryHint - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlQueryHint() - * @generated - */ - public static final EClass XML_QUERY_HINT = eINSTANCE.getXmlQueryHint(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint Xml Unique Constraint}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint() - * @generated - */ - public static final EClass XML_UNIQUE_CONSTRAINT = eINSTANCE.getXmlUniqueConstraint(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade Xml Cascade}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade() - * @generated - */ - public static final EClass XML_CASCADE = eINSTANCE.getXmlCascade(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass Xml Id Class}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlIdClass - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlIdClass() - * @generated - */ - public static final EClass XML_ID_CLASS = eINSTANCE.getXmlIdClass(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_ID_CLASS__VALUE = eINSTANCE.getXmlIdClass_Value(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance Xml Inheritance}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlInheritance - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlInheritance() - * @generated - */ - public static final EClass XML_INHERITANCE = eINSTANCE.getXmlInheritance(); - - /** - * The meta object literal for the 'Strategy' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_INHERITANCE__STRATEGY = eINSTANCE.getXmlInheritance_Strategy(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey Xml Map Key}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.orm.XmlMapKey - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMapKey() - * @generated - */ - public static final EClass XML_MAP_KEY = eINSTANCE.getXmlMapKey(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute XML_MAP_KEY__NAME = eINSTANCE.getXmlMapKey_Name(); - } -} //OrmPackage diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java deleted file mode 100644 index bc1aeefa8e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.io.IOException; -import java.util.Collections; -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase; -import org.eclipse.jpt.core.internal.IJpaFileContentProvider; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlResourceFactory; - -public class OrmXmlJpaFileContentProvider implements IJpaFileContentProvider -{ - public static OrmXmlJpaFileContentProvider INSTANCE = new OrmXmlJpaFileContentProvider(); - - - private IFile resourceFile; - - - /** - * Restrict access - */ - private OrmXmlJpaFileContentProvider() { - - } - - public IJpaRootContentNode buildRootContent(IFile resourceFile) { - OrmXmlResourceFactory.register(); - this.resourceFile = resourceFile; - URI fileURI = URI.createPlatformResourceURI(resourceFile.getFullPath().toString()); - OrmXmlResource resource = (OrmXmlResource) getResourceSet(resourceFile).getResource(fileURI, true); - XmlRootContentNode root = OrmFactory.eINSTANCE.createXmlRootContentNode(); - root.setEntityMappings(resource.getXmlFileContent()); - resource.eAdapters().add(buildRootNodeListener(root)); - return root; - } - - private Adapter buildRootNodeListener(XmlRootContentNode root) { - return new RootAdapter(root); - } - - protected ResourceSet getResourceSet(IFile file) { - return WorkbenchResourceHelperBase.getResourceSet(file.getProject()); - } - - public String contentType() { - return JptCorePlugin.ORM_XML_CONTENT_TYPE; - } - - - private class RootAdapter extends AdapterImpl - { - XmlRootContentNode root; - - private RootAdapter(XmlRootContentNode rootContentNode) { - super(); - root = rootContentNode; - } - public void notifyChanged(Notification notification) { - int featureId = notification.getFeatureID(Resource.class); - if (featureId == Resource.RESOURCE__CONTENTS) { - if (notification.getEventType() == Notification.ADD - || notification.getEventType() == Notification.REMOVE) { - OrmXmlResource resource = (OrmXmlResource) notification.getNotifier(); - root.setEntityMappings(resource.getXmlFileContent()); - } - } - else if (featureId == Resource.RESOURCE__IS_LOADED) { - if (resourceFile.exists()) { - // dumb translator is unloading my resource, reload it - if (notification.getNewBooleanValue() == false) { - OrmXmlResource resource = (OrmXmlResource) notification.getNotifier(); - try { - resource.load(Collections.EMPTY_MAP); - } - catch (IOException ioe) { - // hmmm, log for now - JptCorePlugin.log(ioe); - } - } - } - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlResource.java deleted file mode 100644 index 6f6d02c524..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlResource.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.wst.common.internal.emf.resource.TranslatorResource; - - -public interface OrmXmlResource extends TranslatorResource -{ - /** - * Return the root object - */ - EntityMappingsInternal getXmlFileContent(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaults.java deleted file mode 100644 index 1966dd4da0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaults.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IXmlEObject; - -/** - * - * A representation of the model object 'Persistence Unit Defaults'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getSchema Schema}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getCatalog Catalog}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getAccess Access}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#isCascadePersist Cascade Persist}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface PersistenceUnitDefaults extends IXmlEObject -{ - /** - * Returns the value of the 'Schema' attribute. - * - *

- * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema' attribute. - * @see #setSchema(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults_Schema() - * @model volatile="true" - * @generated - */ - String getSchema(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getSchema Schema}' attribute. - * - * - * @param value the new value of the 'Schema' attribute. - * @see #getSchema() - * @generated - */ - void setSchema(String value); - - /** - * Returns the value of the 'Catalog' attribute. - * - *

- * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog' attribute. - * @see #setCatalog(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults_Catalog() - * @model volatile="true" - * @generated - */ - String getCatalog(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getCatalog Catalog}' attribute. - * - * - * @param value the new value of the 'Catalog' attribute. - * @see #getCatalog() - * @generated - */ - void setCatalog(String value); - - /** - * Returns the value of the 'Access' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

- * If the meaning of the 'Access' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setAccess(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults_Access() - * @model default="" volatile="true" - * @generated - */ - AccessType getAccess(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#getAccess Access}' attribute. - * - * - * @param value the new value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #getAccess() - * @generated - */ - void setAccess(AccessType value); - - /** - * Returns the value of the 'Cascade Persist' attribute. - * - *

- * If the meaning of the 'Cascade Persist' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Cascade Persist' attribute. - * @see #setCascadePersist(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults_CascadePersist() - * @model volatile="true" - * @generated - */ - boolean isCascadePersist(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults#isCascadePersist Cascade Persist}' attribute. - * - * - * @param value the new value of the 'Cascade Persist' attribute. - * @see #isCascadePersist() - * @generated - */ - void setCascadePersist(boolean value); -} // PersistenceUnitDefaults diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsForXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsForXml.java deleted file mode 100644 index 47480750a0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsForXml.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IXmlEObject; - -/** - * - * A representation of the model object 'Persistence Unit Defaults For Xml'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getSchemaForXml Schema For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getCatalogForXml Catalog For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getAccessForXml Access For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#isCascadePersistForXml Cascade Persist For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface PersistenceUnitDefaultsForXml extends IXmlEObject -{ - /** - * Returns the value of the 'Schema For Xml' attribute. - * - *

- * If the meaning of the 'Schema For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema For Xml' attribute. - * @see #setSchemaForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_SchemaForXml() - * @model volatile="true" - * @generated - */ - String getSchemaForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getSchemaForXml Schema For Xml}' attribute. - * - * - * @param value the new value of the 'Schema For Xml' attribute. - * @see #getSchemaForXml() - * @generated - */ - void setSchemaForXml(String value); - - /** - * Returns the value of the 'Catalog For Xml' attribute. - * - *

- * If the meaning of the 'Catalog For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog For Xml' attribute. - * @see #setCatalogForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_CatalogForXml() - * @model volatile="true" - * @generated - */ - String getCatalogForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getCatalogForXml Catalog For Xml}' attribute. - * - * - * @param value the new value of the 'Catalog For Xml' attribute. - * @see #getCatalogForXml() - * @generated - */ - void setCatalogForXml(String value); - - /** - * Returns the value of the 'Access For Xml' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

- * If the meaning of the 'Access For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access For Xml' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setAccessForXml(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_AccessForXml() - * @model default="" volatile="true" - * @generated - */ - AccessType getAccessForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#getAccessForXml Access For Xml}' attribute. - * - * - * @param value the new value of the 'Access For Xml' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #getAccessForXml() - * @generated - */ - void setAccessForXml(AccessType value); - - /** - * Returns the value of the 'Cascade Persist For Xml' attribute. - * - *

- * If the meaning of the 'Cascade Persist For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Cascade Persist For Xml' attribute. - * @see #setCascadePersistForXml(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_CascadePersistForXml() - * @model volatile="true" - * @generated - */ - boolean isCascadePersistForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml#isCascadePersistForXml Cascade Persist For Xml}' attribute. - * - * - * @param value the new value of the 'Cascade Persist For Xml' attribute. - * @see #isCascadePersistForXml() - * @generated - */ - void setCascadePersistForXml(boolean value); -} // PersistenceUnitDefaultsForXml diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsInternal.java deleted file mode 100644 index 31e78b1fa0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsInternal.java +++ /dev/null @@ -1,951 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * A representation of the model object 'Persistence Unit Defaults Internal'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getSchemaInternal Schema Internal}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getCatalogInternal Catalog Internal}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getAccessInternal Access Internal}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#isCascadePersistInternal Cascade Persist Internal}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal() - * @model kind="class" - * @generated - */ -public class PersistenceUnitDefaultsInternal extends XmlEObject - implements PersistenceUnitDefaults, PersistenceUnitDefaultsForXml -{ - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The default value of the '{@link #getCatalog() Catalog}' attribute. - * - * - * @see #getCatalog() - * @generated - * @ordered - */ - protected static final String CATALOG_EDEFAULT = null; - - /** - * The default value of the '{@link #getAccess() Access}' attribute. - * - * - * @see #getAccess() - * @generated - * @ordered - */ - protected static final AccessType ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The default value of the '{@link #isCascadePersist() Cascade Persist}' attribute. - * - * - * @see #isCascadePersist() - * @generated - * @ordered - */ - protected static final boolean CASCADE_PERSIST_EDEFAULT = false; - - /** - * The default value of the '{@link #getSchemaForXml() Schema For Xml}' attribute. - * - * - * @see #getSchemaForXml() - * @generated - * @ordered - */ - protected static final String SCHEMA_FOR_XML_EDEFAULT = null; - - /** - * The default value of the '{@link #getCatalogForXml() Catalog For Xml}' attribute. - * - * - * @see #getCatalogForXml() - * @generated - * @ordered - */ - protected static final String CATALOG_FOR_XML_EDEFAULT = null; - - /** - * The default value of the '{@link #getAccessForXml() Access For Xml}' attribute. - * - * - * @see #getAccessForXml() - * @generated - * @ordered - */ - protected static final AccessType ACCESS_FOR_XML_EDEFAULT = AccessType.DEFAULT; - - /** - * The default value of the '{@link #isCascadePersistForXml() Cascade Persist For Xml}' attribute. - * - * - * @see #isCascadePersistForXml() - * @generated - * @ordered - */ - protected static final boolean CASCADE_PERSIST_FOR_XML_EDEFAULT = false; - - /** - * The default value of the '{@link #getSchemaInternal() Schema Internal}' attribute. - * - * - * @see #getSchemaInternal() - * @generated - * @ordered - */ - protected static final String SCHEMA_INTERNAL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSchemaInternal() Schema Internal}' attribute. - * - * - * @see #getSchemaInternal() - * @generated - * @ordered - */ - protected String schemaInternal = SCHEMA_INTERNAL_EDEFAULT; - - /** - * The default value of the '{@link #getCatalogInternal() Catalog Internal}' attribute. - * - * - * @see #getCatalogInternal() - * @generated - * @ordered - */ - protected static final String CATALOG_INTERNAL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCatalogInternal() Catalog Internal}' attribute. - * - * - * @see #getCatalogInternal() - * @generated - * @ordered - */ - protected String catalogInternal = CATALOG_INTERNAL_EDEFAULT; - - /** - * The default value of the '{@link #getAccessInternal() Access Internal}' attribute. - * - * - * @see #getAccessInternal() - * @generated - * @ordered - */ - protected static final AccessType ACCESS_INTERNAL_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getAccessInternal() Access Internal}' attribute. - * - * - * @see #getAccessInternal() - * @generated - * @ordered - */ - protected AccessType accessInternal = ACCESS_INTERNAL_EDEFAULT; - - /** - * The default value of the '{@link #isCascadePersistInternal() Cascade Persist Internal}' attribute. - * - * - * @see #isCascadePersistInternal() - * @generated - * @ordered - */ - protected static final boolean CASCADE_PERSIST_INTERNAL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isCascadePersistInternal() Cascade Persist Internal}' attribute. - * - * - * @see #isCascadePersistInternal() - * @generated - * @ordered - */ - protected boolean cascadePersistInternal = CASCADE_PERSIST_INTERNAL_EDEFAULT; - - /** - * - * - * @generated - */ - protected PersistenceUnitDefaultsInternal() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.PERSISTENCE_UNIT_DEFAULTS_INTERNAL; - } - - /** - * Returns the value of the 'Access' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.content.orm.AccessType}. - * - *

- * If the meaning of the 'Access' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see #setAccess(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAccessHolder_Access() - * @model default="" volatile="true" - * @generated NOT - */ - public AccessType getAccess() { - return getAccessInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getAccess Access}' attribute. - * This api should be used by the UI. It calls the appropriate - * internal api for updating the xml. It also handles setting container - * objects to null for the xml. If access is set to the default, empty xml containment - * tags will be removed when they no longer contain any other xml tags. - * This is done in the UI method because we do not want the same behavior - * when setting the access from the xml, we never want to change the xml - * as the user is directly edting the xml. - * - * @param value the new value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see #getAccess() - * @generated NOT - */ - public void setAccess(AccessType newAccess) { - setAccessInternal(newAccess); - if (newAccess != ACCESS_EDEFAULT) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNonNull(); - } - setAccessForXml(newAccess); - if (isAllFeaturesUnset()) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNull(); - } - } - - private PersistenceUnitMetadataInternal getPersistenceUnitMetadata() { - return (PersistenceUnitMetadataInternal) eContainer(); - } - - /** - * Returns the value of the 'Catalog' attribute. - * - *

- * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog' attribute. - * @see #setCatalog(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getCatalogHolder_Catalog() - * @model volatile="true" - * @generated NOT - */ - public String getCatalog() { - return getCatalogInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getCatalog Catalog}' attribute. - * This api should be used by the UI. It calls the appropriate - * internal api for updating the xml. It also handles setting container - * objects to null for the xml. If access is set to the default, empty xml containment - * tags will be removed when they no longer contain any other xml tags. - * This is done in the UI method because we do not want the same behavior - * when setting the access from the xml, we never want to change the xml - * as the user is directly edting the xml. - * @param value the new value of the 'Catalog' attribute. - * @see #getCatalog() - * @generated NOT - */ - public void setCatalog(String newCatalog) { - setCatalogInternal(newCatalog); - if (newCatalog != CATALOG_EDEFAULT) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNonNull(); - } - setCatalogForXml(newCatalog); - if (isAllFeaturesUnset()) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNull(); - } - } - - /** - * Returns the value of the 'Schema' attribute. - * - *

- * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema' attribute. - * @see #setSchema(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getSchemaHolder_Schema() - * @model volatile="true" - * @generated NOT - */ - public String getSchema() { - return getSchemaInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getSchema Schema}' attribute. - * This api should be used by the UI. It calls the appropriate - * internal api for updating the xml. It also handles setting container - * objects to null for the xml. If access is set to the default, empty xml containment - * tags will be removed when they no longer contain any other xml tags. - * This is done in the UI method because we do not want the same behavior - * when setting the access from the xml, we never want to change the xml - * as the user is directly edting the xml. - * @param value the new value of the 'Schema' attribute. - * @see #getSchema() - * @generated NOT - */ - public void setSchema(String newSchema) { - setSchemaInternal(newSchema); - if (newSchema != SCHEMA_EDEFAULT) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNonNull(); - } - setSchemaForXml(newSchema); - if (isAllFeaturesUnset()) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNull(); - } - } - - /** - * Returns the value of the 'Cascade Persist' attribute. - * - *

- * If the meaning of the 'Cascade Persist' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Cascade Persist' attribute. - * @see #setCascadePersist(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults_CascadePersist() - * @model volatile="true" - * @generated NOT - */ - public boolean isCascadePersist() { - return isCascadePersistInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#isCascadePersist Cascade Persist}' attribute. - * - * - * @param value the new value of the 'Cascade Persist' attribute. - * @see #isCascadePersist() - * @generated NOT - */ - public void setCascadePersist(boolean newCascadePersist) { - setCascadePersistInternal(newCascadePersist); - if (newCascadePersist != CASCADE_PERSIST_EDEFAULT) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNonNull(); - } - setCascadePersistForXml(newCascadePersist); - if (isAllFeaturesUnset()) { - getPersistenceUnitMetadata().makePersistenceUnitDefaultsForXmlNull(); - } - } - - /** - * Returns the value of the 'Schema For Xml' attribute. - * - *

- * If the meaning of the 'Schema For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema For Xml' attribute. - * @see #setSchemaForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_SchemaForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSchemaForXml() { - return getSchemaInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getSchemaForXml Schema For Xml}' attribute. - * - * - * @param value the new value of the 'Schema For Xml' attribute. - * @see #getSchemaForXml() - * @generated NOT - */ - public void setSchemaForXml(String newSchemaForXml) { - setSchemaInternal(newSchemaForXml); - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML, newSchemaForXml + " ", newSchemaForXml)); - } - - /** - * Returns the value of the 'Catalog For Xml' attribute. - * - *

- * If the meaning of the 'Catalog For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog For Xml' attribute. - * @see #setCatalogForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_CatalogForXml() - * @model volatile="true" - * @generated NOT - */ - public String getCatalogForXml() { - return getCatalogInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getCatalogForXml Catalog For Xml}' attribute. - * - * - * @param value the new value of the 'Catalog For Xml' attribute. - * @see #getCatalogForXml() - * @generated NOT - */ - public void setCatalogForXml(String newCatalogForXml) { - setCatalogInternal(newCatalogForXml); - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML, newCatalogForXml + " ", newCatalogForXml)); - } - - /** - * Returns the value of the 'Access For Xml' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.content.orm.AccessType}. - * - *

- * If the meaning of the 'Access For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access For Xml' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see #setAccessForXml(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_AccessForXml() - * @model default="" volatile="true" - * @generated NOT - */ - public AccessType getAccessForXml() { - return getAccessInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getAccessForXml Access For Xml}' attribute. - * - * - * @param value the new value of the 'Access For Xml' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see #getAccessForXml() - * @generated NOT - */ - public void setAccessForXml(AccessType newAccessForXml) { - setAccessInternal(newAccessForXml); - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML, null, newAccessForXml)); - } - - /** - * Returns the value of the 'Cascade Persist For Xml' attribute. - * - *

- * If the meaning of the 'Cascade Persist For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Cascade Persist For Xml' attribute. - * @see #setCascadePersistForXml(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml_CascadePersistForXml() - * @model volatile="true" - * @generated NOT - */ - public boolean isCascadePersistForXml() { - return isCascadePersistInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#isCascadePersistForXml Cascade Persist For Xml}' attribute. - * - * - * @param value the new value of the 'Cascade Persist For Xml' attribute. - * @see #isCascadePersistForXml() - * @generated NOT - */ - public void setCascadePersistForXml(boolean newCascadePersistForXml) { - setCascadePersistInternal(newCascadePersistForXml); - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML, null, newCascadePersistForXml)); - } - - /** - * Returns the value of the 'Schema Internal' attribute. - * - *

- * If the meaning of the 'Schema Internal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema Internal' attribute. - * @see #setSchemaInternal(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal_SchemaInternal() - * @model - * @generated - */ - public String getSchemaInternal() { - return schemaInternal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getSchemaInternal Schema Internal}' attribute. - * - * - * @param value the new value of the 'Schema Internal' attribute. - * @see #getSchemaInternal() - * @generated NOT - */ - public void setSchemaInternal(String newSchemaInternal) { - String oldSchemaInternal = schemaInternal; - schemaInternal = newSchemaInternal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL, oldSchemaInternal, schemaInternal)); - //notification so the UI is updated when the xml changes, can't call the UI api - //because it has other side effects - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA, oldSchemaInternal, schemaInternal)); - } - } - - /** - * Returns the value of the 'Catalog Internal' attribute. - * - *

- * If the meaning of the 'Catalog Internal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catalog Internal' attribute. - * @see #setCatalogInternal(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal_CatalogInternal() - * @model - * @generated - */ - public String getCatalogInternal() { - return catalogInternal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getCatalogInternal Catalog Internal}' attribute. - * - * - * @param value the new value of the 'Catalog Internal' attribute. - * @see #getCatalogInternal() - * @generated NOT - */ - public void setCatalogInternal(String newCatalogInternal) { - String oldCatalogInternal = catalogInternal; - catalogInternal = newCatalogInternal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL, oldCatalogInternal, catalogInternal)); - //notification so the UI is updated when the xml changes, can't call the UI api - //because it has other side effects - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG, oldCatalogInternal, catalogInternal)); - } - } - - /** - * Returns the value of the 'Access Internal' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

- * If the meaning of the 'Access Internal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Access Internal' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setAccessInternal(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal_AccessInternal() - * @model default="" - * @generated - */ - public AccessType getAccessInternal() { - return accessInternal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#getAccessInternal Access Internal}' attribute. - * - * - * @param value the new value of the 'Access Internal' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see #getAccessInternal() - * @generated NOT - */ - public void setAccessInternal(AccessType newAccessInternal) { - AccessType oldAccessInternal = accessInternal; - accessInternal = newAccessInternal == null ? ACCESS_INTERNAL_EDEFAULT : newAccessInternal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL, oldAccessInternal, accessInternal)); - //notification so the UI is updated when the xml changes, can't call the UI api - //because it has other side effects - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS, oldAccessInternal, accessInternal)); - } - } - - /** - * Returns the value of the 'Cascade Persist Internal' attribute. - * - *

- * If the meaning of the 'Cascade Persist Internal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Cascade Persist Internal' attribute. - * @see #setCascadePersistInternal(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal_CascadePersistInternal() - * @model - * @generated - */ - public boolean isCascadePersistInternal() { - return cascadePersistInternal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal#isCascadePersistInternal Cascade Persist Internal}' attribute. - * - * - * @param value the new value of the 'Cascade Persist Internal' attribute. - * @see #isCascadePersistInternal() - * @generated NOT - */ - public void setCascadePersistInternal(boolean newCascadePersistInternal) { - boolean oldCascadePersistInternal = cascadePersistInternal; - cascadePersistInternal = newCascadePersistInternal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL, oldCascadePersistInternal, cascadePersistInternal)); - //notification so the UI is updated when the xml changes, can't call the UI api - //because it has other side effects - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST, newCascadePersistInternal, newCascadePersistInternal)); - } - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA : - return getSchema(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG : - return getCatalog(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS : - return getAccess(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST : - return isCascadePersist() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML : - return getSchemaForXml(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML : - return getCatalogForXml(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML : - return getAccessForXml(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML : - return isCascadePersistForXml() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL : - return getSchemaInternal(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL : - return getCatalogInternal(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL : - return getAccessInternal(); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL : - return isCascadePersistInternal() ? Boolean.TRUE : Boolean.FALSE; - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA : - setSchema((String) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG : - setCatalog((String) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS : - setAccess((AccessType) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST : - setCascadePersist(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML : - setSchemaForXml((String) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML : - setCatalogForXml((String) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML : - setAccessForXml((AccessType) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML : - setCascadePersistForXml(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL : - setSchemaInternal((String) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL : - setCatalogInternal((String) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL : - setAccessInternal((AccessType) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL : - setCascadePersistInternal(((Boolean) newValue).booleanValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA : - setSchema(SCHEMA_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG : - setCatalog(CATALOG_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS : - setAccess(ACCESS_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST : - setCascadePersist(CASCADE_PERSIST_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML : - setSchemaForXml(SCHEMA_FOR_XML_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML : - setCatalogForXml(CATALOG_FOR_XML_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML : - setAccessForXml(ACCESS_FOR_XML_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML : - setCascadePersistForXml(CASCADE_PERSIST_FOR_XML_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL : - setSchemaInternal(SCHEMA_INTERNAL_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL : - setCatalogInternal(CATALOG_INTERNAL_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL : - setAccessInternal(ACCESS_INTERNAL_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL : - setCascadePersistInternal(CASCADE_PERSIST_INTERNAL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA : - return SCHEMA_EDEFAULT == null ? getSchema() != null : !SCHEMA_EDEFAULT.equals(getSchema()); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG : - return CATALOG_EDEFAULT == null ? getCatalog() != null : !CATALOG_EDEFAULT.equals(getCatalog()); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS : - return getAccess() != ACCESS_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST : - return isCascadePersist() != CASCADE_PERSIST_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML : - return SCHEMA_FOR_XML_EDEFAULT == null ? getSchemaForXml() != null : !SCHEMA_FOR_XML_EDEFAULT.equals(getSchemaForXml()); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML : - return CATALOG_FOR_XML_EDEFAULT == null ? getCatalogForXml() != null : !CATALOG_FOR_XML_EDEFAULT.equals(getCatalogForXml()); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML : - return getAccessForXml() != ACCESS_FOR_XML_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML : - return isCascadePersistForXml() != CASCADE_PERSIST_FOR_XML_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL : - return SCHEMA_INTERNAL_EDEFAULT == null ? schemaInternal != null : !SCHEMA_INTERNAL_EDEFAULT.equals(schemaInternal); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL : - return CATALOG_INTERNAL_EDEFAULT == null ? catalogInternal != null : !CATALOG_INTERNAL_EDEFAULT.equals(catalogInternal); - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL : - return accessInternal != ACCESS_INTERNAL_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL : - return cascadePersistInternal != CASCADE_PERSIST_INTERNAL_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == PersistenceUnitDefaults.class) { - switch (derivedFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__SCHEMA; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CATALOG; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__ACCESS; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST; - default : - return -1; - } - } - if (baseClass == PersistenceUnitDefaultsForXml.class) { - switch (derivedFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__SCHEMA_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CATALOG_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__ACCESS_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CASCADE_PERSIST_FOR_XML; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == PersistenceUnitDefaults.class) { - switch (baseFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS__SCHEMA : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CATALOG : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS__ACCESS : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST; - default : - return -1; - } - } - if (baseClass == PersistenceUnitDefaultsForXml.class) { - switch (baseFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__SCHEMA_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CATALOG_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__ACCESS_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML__CASCADE_PERSIST_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_FOR_XML; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (schemaInternal: "); - result.append(schemaInternal); - result.append(", catalogInternal: "); - result.append(catalogInternal); - result.append(", accessInternal: "); - result.append(accessInternal); - result.append(", cascadePersistInternal: "); - result.append(cascadePersistInternal); - result.append(')'); - return result.toString(); - } - - /** - * Call this when the persistence-unit-defaults tag is removed - * from the xml, need to make sure all the model attributes are set to the default - */ - protected void unsetAllAttributes() { - eUnset(OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__ACCESS_INTERNAL); - eUnset(OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CATALOG_INTERNAL); - eUnset(OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__SCHEMA_INTERNAL); - eUnset(OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL__CASCADE_PERSIST_INTERNAL); - } -} // PersistenceUnitDefaultsInternal diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadata.java deleted file mode 100644 index 9696fed3ed..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadata.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IXmlEObject; - -/** - * - * A representation of the model object 'Persistence Unit Metadata'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#isXmlMappingMetadataComplete Xml Mapping Metadata Complete}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#getPersistenceUnitDefaults Persistence Unit Defaults}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface PersistenceUnitMetadata extends IXmlEObject -{ - /** - * Returns the value of the 'Xml Mapping Metadata Complete' attribute. - * - *

- * If the meaning of the 'Xml Mapping Metadata Complete' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Xml Mapping Metadata Complete' attribute. - * @see #setXmlMappingMetadataComplete(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata_XmlMappingMetadataComplete() - * @model volatile="true" - * @generated - */ - boolean isXmlMappingMetadataComplete(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata#isXmlMappingMetadataComplete Xml Mapping Metadata Complete}' attribute. - * - * - * @param value the new value of the 'Xml Mapping Metadata Complete' attribute. - * @see #isXmlMappingMetadataComplete() - * @generated - */ - void setXmlMappingMetadataComplete(boolean value); - - /** - * Returns the value of the 'Persistence Unit Defaults' reference. - * The default value is "". - * - *

- * If the meaning of the 'Persistence Unit Defaults' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Defaults' reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata_PersistenceUnitDefaults() - * @model resolveProxies="false" changeable="false" volatile="true" - * @generated - */ - PersistenceUnitDefaults getPersistenceUnitDefaults(); -} // PersistenceUnitMetadata diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataForXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataForXml.java deleted file mode 100644 index 848acae953..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataForXml.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IXmlEObject; - -/** - * - * A representation of the model object 'Persistence Unit Metadata For Xml'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#isXmlMappingMetadataCompleteForXml Xml Mapping Metadata Complete For Xml}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#getPersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface PersistenceUnitMetadataForXml extends IXmlEObject -{ - /** - * Returns the value of the 'Xml Mapping Metadata Complete For Xml' attribute. - * - *

- * If the meaning of the 'Xml Mapping Metadata Complete For Xml' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Xml Mapping Metadata Complete For Xml' attribute. - * @see #setXmlMappingMetadataCompleteForXml(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml_XmlMappingMetadataCompleteForXml() - * @model volatile="true" - * @generated - */ - boolean isXmlMappingMetadataCompleteForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#isXmlMappingMetadataCompleteForXml Xml Mapping Metadata Complete For Xml}' attribute. - * - * - * @param value the new value of the 'Xml Mapping Metadata Complete For Xml' attribute. - * @see #isXmlMappingMetadataCompleteForXml() - * @generated - */ - void setXmlMappingMetadataCompleteForXml(boolean value); - - /** - * Returns the value of the 'Persistence Unit Defaults For Xml' reference. - * The default value is "". - * - *

- * If the meaning of the 'Persistence Unit Defaults For Xml' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Defaults For Xml' reference. - * @see #setPersistenceUnitDefaultsForXml(PersistenceUnitDefaultsForXml) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml_PersistenceUnitDefaultsForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - PersistenceUnitDefaultsForXml getPersistenceUnitDefaultsForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml#getPersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}' reference. - * - * - * @param value the new value of the 'Persistence Unit Defaults For Xml' reference. - * @see #getPersistenceUnitDefaultsForXml() - * @generated - */ - void setPersistenceUnitDefaultsForXml(PersistenceUnitDefaultsForXml value); -} // PersistenceUnitMetadataForXml diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataInternal.java deleted file mode 100644 index 07f07ffee6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataInternal.java +++ /dev/null @@ -1,533 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * A representation of the model object 'Persistence Unit Metadata Internal'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#isXmlMappingMetadataCompleteInternal Xml Mapping Metadata Complete Internal}
  • - *
  • {@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#getPersistenceUnitDefaultsInternal Persistence Unit Defaults Internal}
  • - *
- *

- * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal() - * @model kind="class" - * @generated - */ -public class PersistenceUnitMetadataInternal extends XmlEObject - implements PersistenceUnitMetadataForXml, PersistenceUnitMetadata -{ - /** - * The default value of the '{@link #isXmlMappingMetadataCompleteForXml() Xml Mapping Metadata Complete For Xml}' attribute. - * - * - * @see #isXmlMappingMetadataCompleteForXml() - * @generated - * @ordered - */ - protected static final boolean XML_MAPPING_METADATA_COMPLETE_FOR_XML_EDEFAULT = false; - - /** - * The default value of the '{@link #isXmlMappingMetadataComplete() Xml Mapping Metadata Complete}' attribute. - * - * - * @see #isXmlMappingMetadataComplete() - * @generated - * @ordered - */ - protected static final boolean XML_MAPPING_METADATA_COMPLETE_EDEFAULT = false; - - /** - * The default value of the '{@link #isXmlMappingMetadataCompleteInternal() Xml Mapping Metadata Complete Internal}' attribute. - * - * - * @see #isXmlMappingMetadataCompleteInternal() - * @generated - * @ordered - */ - protected static final boolean XML_MAPPING_METADATA_COMPLETE_INTERNAL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isXmlMappingMetadataCompleteInternal() Xml Mapping Metadata Complete Internal}' attribute. - * - * - * @see #isXmlMappingMetadataCompleteInternal() - * @generated - * @ordered - */ - protected boolean xmlMappingMetadataCompleteInternal = XML_MAPPING_METADATA_COMPLETE_INTERNAL_EDEFAULT; - - /** - * The cached value of the '{@link #getPersistenceUnitDefaultsInternal() Persistence Unit Defaults Internal}' containment reference. - * - * - * @see #getPersistenceUnitDefaultsInternal() - * @generated - * @ordered - */ - protected PersistenceUnitDefaultsInternal persistenceUnitDefaultsInternal; - - /** - * - * - * @generated NOT - */ - protected PersistenceUnitMetadataInternal() { - super(); - //we don't want a setter for this object since it should never be null, but - //it must be initialized and is necessary for emf to call the eInverseAdd method - this.persistenceUnitDefaultsInternal = OrmFactory.eINSTANCE.createPersistenceUnitDefaultsInternal(); - ((InternalEObject) this.persistenceUnitDefaultsInternal).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL, null, null); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.PERSISTENCE_UNIT_METADATA_INTERNAL; - } - - /** - * Returns the value of the 'Xml Mapping Metadata Complete For Xml' attribute. - * - *

- * API used by the xml translator. Defers to the internal attribute, no actual - * xml attribute is stored in the model. - *

- * - * @return the value of the 'Xml Mapping Metadata Complete For Xml' attribute. - * @see #setXmlMappingMetadataCompleteForXml(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml_XmlMappingMetadataCompleteForXml() - * @model volatile="true" - * @generated NOT - */ - public boolean isXmlMappingMetadataCompleteForXml() { - return isXmlMappingMetadataCompleteInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#isXmlMappingMetadataCompleteForXml Xml Mapping Metadata Complete For Xml}' attribute. - * API used by the XML translator, sets the internal attribute and - * fires notification about the XML attribute changing. - * @param value the new value of the 'Xml Mapping Metadata Complete For Xml' attribute. - * @see #isXmlMappingMetadataCompleteForXml() - * @generated NOT - */ - public void setXmlMappingMetadataCompleteForXml(boolean newXmlMappingMetadataCompleteForXml) { - setXmlMappingMetadataCompleteInternal(newXmlMappingMetadataCompleteForXml); - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML, null, newXmlMappingMetadataCompleteForXml)); - } - - /** - * Returns the value of the 'Persistence Unit Defaults For Xml' reference. - * The default value is "". - * - *

- * API just for the xml translators. Null in the model for a containment - * object corresponds to no persistence-unit-defaults xml tag in the xml file. - * We check for whether any features are set in the model and return null for - * persistenceUnitDefaultsForXml if there aren't any. Otherwise we return - * the persistenceUnitDefaultsInternal that has already been created. - *

- * - * @return the value of the 'Persistence Unit Defaults For Xml' reference. - * @see #setPersistenceUnitDefaultsForXml(PersistenceUnitDefaultsForXml) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml_PersistenceUnitDefaultsForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public PersistenceUnitDefaultsForXml getPersistenceUnitDefaultsForXml() { - if (getPersistenceUnitDefaultsInternal().isAllFeaturesUnset()) { - return null; - } - return getPersistenceUnitDefaultsInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#getPersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}' reference. - * - * - * @param value the new value of the 'Persistence Unit Defaults For Xml' reference. - * @see #getPersistenceUnitDefaultsForXml() - * @generated NOT - */ - public void setPersistenceUnitDefaultsForXmlGen(PersistenceUnitDefaultsForXml newPersistenceUnitDefaultsForXml) { - PersistenceUnitDefaultsForXml oldValue = newPersistenceUnitDefaultsForXml == null ? (PersistenceUnitDefaultsForXml) getPersistenceUnitDefaults() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML, oldValue, newPersistenceUnitDefaultsForXml)); - } - - public void setPersistenceUnitDefaultsForXml(PersistenceUnitDefaultsForXml newPersistenceUnitDefaultsForXml) { - setPersistenceUnitDefaultsForXmlGen(newPersistenceUnitDefaultsForXml); - if (newPersistenceUnitDefaultsForXml == null) { - getPersistenceUnitDefaultsInternal().unsetAllAttributes(); - } - } - - public void makePersistenceUnitDefaultsForXmlNull() { - setPersistenceUnitDefaultsForXmlGen(null); - if (isAllFeaturesUnset()) { - getEntityMappings().makePersistenceUnitMetadataForXmlNull(); - } - } - - public void makePersistenceUnitDefaultsForXmlNonNull() { - setPersistenceUnitDefaultsForXmlGen(getPersistenceUnitDefaultsForXml()); - getEntityMappings().makePersistenceUnitMetadataForXmlNonNull(); - } - - private EntityMappingsInternal getEntityMappings() { - return (EntityMappingsInternal) eContainer(); - } - - /** - * Returns the value of the 'Xml Mapping Metadata Complete' attribute. - * - *

- * If the meaning of the 'Xml Mapping Metadata Complete' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Xml Mapping Metadata Complete' attribute. - * @see #setXmlMappingMetadataComplete(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata_XmlMappingMetadataComplete() - * @model volatile="true" - * @generated NOT - */ - public boolean isXmlMappingMetadataComplete() { - return isXmlMappingMetadataCompleteInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#isXmlMappingMetadataComplete Xml Mapping Metadata Complete}' attribute. - * This api should be used by the UI. It calls the appropriate - * internal api for updating the xml. It also handles setting container - * objects to null for the xml. If access is set to the default, empty xml containment - * tags will be removed when they no longer contain any other xml tags. - * This is done in the UI method because we do not want the same behavior - * when setting the access from the xml, we never want to change the xml - * as the user is directly edting the xml. - * @param value the new value of the 'Xml Mapping Metadata Complete' attribute. - * @see #isXmlMappingMetadataComplete() - * @generated NOT - */ - public void setXmlMappingMetadataComplete(boolean newXmlMappingMetadataComplete) { - setXmlMappingMetadataCompleteInternal(newXmlMappingMetadataComplete); - if (newXmlMappingMetadataComplete != XML_MAPPING_METADATA_COMPLETE_EDEFAULT) { - getEntityMappings().makePersistenceUnitMetadataForXmlNonNull(); - } - setXmlMappingMetadataCompleteForXml(newXmlMappingMetadataComplete); - if (isAllFeaturesUnset()) { - getEntityMappings().makePersistenceUnitMetadataForXmlNull(); - } - } - - /** - * Returns the value of the 'Persistence Unit Defaults' reference. - * The default value is "". - * - *

- * If the meaning of the 'Persistence Unit Defaults' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Defaults' reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata_PersistenceUnitDefaults() - * @model resolveProxies="false" changeable="false" volatile="true" - * @generated NOT - */ - public PersistenceUnitDefaults getPersistenceUnitDefaults() { - return getPersistenceUnitDefaultsInternal(); - } - - /** - * Returns the value of the 'Xml Mapping Metadata Complete Internal' attribute. - * - *

- * If the meaning of the 'Xml Mapping Metadata Complete Internal' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Xml Mapping Metadata Complete Internal' attribute. - * @see #setXmlMappingMetadataCompleteInternal(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal_XmlMappingMetadataCompleteInternal() - * @model - * @generated - */ - public boolean isXmlMappingMetadataCompleteInternal() { - return xmlMappingMetadataCompleteInternal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal#isXmlMappingMetadataCompleteInternal Xml Mapping Metadata Complete Internal}' attribute. - * - * - * @param value the new value of the 'Xml Mapping Metadata Complete Internal' attribute. - * @see #isXmlMappingMetadataCompleteInternal() - * @generated NOT - */ - public void setXmlMappingMetadataCompleteInternal(boolean newXmlMappingMetadataCompleteInternal) { - boolean oldXmlMappingMetadataCompleteInternal = xmlMappingMetadataCompleteInternal; - xmlMappingMetadataCompleteInternal = newXmlMappingMetadataCompleteInternal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL, oldXmlMappingMetadataCompleteInternal, xmlMappingMetadataCompleteInternal)); - //notification so the UI is updated when the xml changes, can't call the UI api - //because it has other side effects - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE, oldXmlMappingMetadataCompleteInternal, xmlMappingMetadataCompleteInternal)); - } - } - - /** - * Returns the value of the 'Persistence Unit Defaults Internal' containment reference. - * The default value is "". - * - *

- * If the meaning of the 'Persistence Unit Defaults Internal' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persistence Unit Defaults Internal' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal_PersistenceUnitDefaultsInternal() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public PersistenceUnitDefaultsInternal getPersistenceUnitDefaultsInternal() { - return persistenceUnitDefaultsInternal; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetPersistenceUnitDefaultsInternal(PersistenceUnitDefaultsInternal newPersistenceUnitDefaultsInternal, NotificationChain msgs) { - PersistenceUnitDefaultsInternal oldPersistenceUnitDefaultsInternal = persistenceUnitDefaultsInternal; - persistenceUnitDefaultsInternal = newPersistenceUnitDefaultsInternal; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL, oldPersistenceUnitDefaultsInternal, newPersistenceUnitDefaultsInternal); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL : - return basicSetPersistenceUnitDefaultsInternal(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML : - return isXmlMappingMetadataCompleteForXml() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML : - return getPersistenceUnitDefaultsForXml(); - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE : - return isXmlMappingMetadataComplete() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS : - return getPersistenceUnitDefaults(); - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL : - return isXmlMappingMetadataCompleteInternal() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL : - return getPersistenceUnitDefaultsInternal(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML : - setXmlMappingMetadataCompleteForXml(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML : - setPersistenceUnitDefaultsForXml((PersistenceUnitDefaultsForXml) newValue); - return; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE : - setXmlMappingMetadataComplete(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL : - setXmlMappingMetadataCompleteInternal(((Boolean) newValue).booleanValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML : - setXmlMappingMetadataCompleteForXml(XML_MAPPING_METADATA_COMPLETE_FOR_XML_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML : - setPersistenceUnitDefaultsForXml((PersistenceUnitDefaultsForXml) null); - return; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE : - setXmlMappingMetadataComplete(XML_MAPPING_METADATA_COMPLETE_EDEFAULT); - return; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL : - setXmlMappingMetadataCompleteInternal(XML_MAPPING_METADATA_COMPLETE_INTERNAL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML : - return isXmlMappingMetadataCompleteForXml() != XML_MAPPING_METADATA_COMPLETE_FOR_XML_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML : - return getPersistenceUnitDefaultsForXml() != null; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE : - return isXmlMappingMetadataComplete() != XML_MAPPING_METADATA_COMPLETE_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS : - return getPersistenceUnitDefaults() != null; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL : - return xmlMappingMetadataCompleteInternal != XML_MAPPING_METADATA_COMPLETE_INTERNAL_EDEFAULT; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_INTERNAL : - return persistenceUnitDefaultsInternal != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == PersistenceUnitMetadataForXml.class) { - switch (derivedFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_METADATA_FOR_XML__XML_MAPPING_METADATA_COMPLETE_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_METADATA_FOR_XML__PERSISTENCE_UNIT_DEFAULTS_FOR_XML; - default : - return -1; - } - } - if (baseClass == PersistenceUnitMetadata.class) { - switch (derivedFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE : - return OrmPackage.PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE; - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS : - return OrmPackage.PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == PersistenceUnitMetadataForXml.class) { - switch (baseFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA_FOR_XML__XML_MAPPING_METADATA_COMPLETE_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_FOR_XML; - case OrmPackage.PERSISTENCE_UNIT_METADATA_FOR_XML__PERSISTENCE_UNIT_DEFAULTS_FOR_XML : - return OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS_FOR_XML; - default : - return -1; - } - } - if (baseClass == PersistenceUnitMetadata.class) { - switch (baseFeatureID) { - case OrmPackage.PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE : - return OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE; - case OrmPackage.PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS : - return OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__PERSISTENCE_UNIT_DEFAULTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (xmlMappingMetadataCompleteInternal: "); - result.append(xmlMappingMetadataCompleteInternal); - result.append(')'); - return result.toString(); - } - - /** - * Call this when the persistence-unit-metadata tag is removed - * from the xml, need to make sure all the model attributes are set to the default - */ - protected void unsetAllAttributes() { - eUnset(OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL__XML_MAPPING_METADATA_COMPLETE_INTERNAL); - getPersistenceUnitDefaultsInternal().unsetAllAttributes(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAssociationOverride.java deleted file mode 100644 index e890df0c3e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAssociationOverride.java +++ /dev/null @@ -1,281 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Association Override'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAssociationOverride() - * @model kind="class" - * @generated - */ -public class XmlAssociationOverride extends XmlOverride - implements IAssociationOverride -{ - /** - * The cached value of the '{@link #getSpecifiedJoinColumns() Specified Join Columns}' containment reference list. - * - * - * @see #getSpecifiedJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedJoinColumns; - - /** - * The cached value of the '{@link #getDefaultJoinColumns() Default Join Columns}' containment reference list. - * - * - * @see #getDefaultJoinColumns() - * @generated - * @ordered - */ - protected EList defaultJoinColumns; - - /** - * - * - * @generated - */ - protected XmlAssociationOverride() { - super(); - } - - protected XmlAssociationOverride(IOverride.Owner owner) { - super(owner); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ASSOCIATION_OVERRIDE; - } - - public EList getJoinColumns() { - return this.getSpecifiedJoinColumns().isEmpty() ? this.getDefaultJoinColumns() : this.getSpecifiedJoinColumns(); - } - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAssociationOverride_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedJoinColumns() { - if (specifiedJoinColumns == null) { - specifiedJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS); - } - return specifiedJoinColumns; - } - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

- * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAssociationOverride_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultJoinColumns() { - if (defaultJoinColumns == null) { - defaultJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS); - } - return defaultJoinColumns; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return ((InternalEList) getJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return ((InternalEList) getDefaultJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return getJoinColumns(); - case OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return getSpecifiedJoinColumns(); - case OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return getDefaultJoinColumns(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - getSpecifiedJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - getDefaultJoinColumns().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - return; - case OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return !getJoinColumns().isEmpty(); - case OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return specifiedJoinColumns != null && !specifiedJoinColumns.isEmpty(); - case OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return defaultJoinColumns != null && !defaultJoinColumns.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAssociationOverride.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__JOIN_COLUMNS; - case OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS; - case OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAssociationOverride.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__JOIN_COLUMNS : - return OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS; - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS : - return OrmPackage.XML_ASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS : - return OrmPackage.XML_ASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - // ********** IAssociationOverride implementation ********** - public IJoinColumn createJoinColumn(int index) { - return this.createXmlJoinColumn(index); - } - - private XmlJoinColumn createXmlJoinColumn(int index) { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new JoinColumnOwner(this)); - //return XmlJoinColumn.createJoinTableJoinColumn(new JoinColumnOwner(), this.getMember(), index); - } - - public boolean containsSpecifiedJoinColumns() { - return !this.getSpecifiedJoinColumns().isEmpty(); - } - - public ITypeMapping typeMapping() { - return (ITypeMapping) eContainer(); - } -} // XmlAssociationOverride diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeMapping.java deleted file mode 100644 index 6e663af487..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeMapping.java +++ /dev/null @@ -1,379 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Set; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Xml Attribute Mapping'. - * Discussion of morphing mappings:
    - - *
  1. Each concrete subclass must override the method initializeOn(MWMapping newMapping) - * and call the appropriate initializeFromMW___Mapping(MW___Mapping oldMapping). - * [This is call double-dispatching.] - * We could have overloaded the same method name (e.g. initializeFrom(MW___Mapping oldMapping)) - * but the resulting confusion is not worth it. "Upcasting" just makes this really fuzzy.... - * - * If necessary, each subclass (concrete and abstract) should override - * the initializeFromMW___Mapping(MW___Mapping oldMapping) method. This override - * should first call super.initializeFromMW___Mapping(MW___Mapping oldMapping); then - * it should initialize only the properties that are defined by it that have - * corresponding properties in the oldMapping. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping#getPersistentAttribute Persistent Attribute}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlAttributeMapping extends XmlEObject - implements IAttributeMapping -{ - /** - * The cached value of the '{@link #getPersistentAttribute() Persistent Attribute}' containment reference. - * - * - * @see #getPersistentAttribute() - * @generated - * @ordered - */ - protected XmlPersistentAttribute persistentAttribute; - - /** - * - * - * @generated - */ - protected XmlAttributeMapping() { - super(); - } - - protected INamedColumn.Owner buildOwner() { - return new ColumnOwner(); - } - - @Override - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIds.add(OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ATTRIBUTE_MAPPING; - } - - public XmlPersistentType getPersistentType() { - return (XmlPersistentType) eContainer(); - } - - /** - * Returns the value of the 'Persistent Attribute' containment reference. - * - *

    - * If the meaning of the 'Persistent Attribute' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Persistent Attribute' containment reference. - * @see #setPersistentAttribute(XmlPersistentAttribute) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeMapping_PersistentAttribute() - * @model containment="true" required="true" - * @generated - */ - public XmlPersistentAttribute getPersistentAttribute() { - return persistentAttribute; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetPersistentAttribute(XmlPersistentAttribute newPersistentAttribute, NotificationChain msgs) { - XmlPersistentAttribute oldPersistentAttribute = persistentAttribute; - persistentAttribute = newPersistentAttribute; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE, oldPersistentAttribute, newPersistentAttribute); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping#getPersistentAttribute Persistent Attribute}' containment reference. - * - * - * @param value the new value of the 'Persistent Attribute' containment reference. - * @see #getPersistentAttribute() - * @generated - */ - public void setPersistentAttribute(XmlPersistentAttribute newPersistentAttribute) { - if (newPersistentAttribute != persistentAttribute) { - NotificationChain msgs = null; - if (persistentAttribute != null) - msgs = ((InternalEObject) persistentAttribute).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE, null, msgs); - if (newPersistentAttribute != null) - msgs = ((InternalEObject) newPersistentAttribute).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE, null, msgs); - msgs = basicSetPersistentAttribute(newPersistentAttribute, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE, newPersistentAttribute, newPersistentAttribute)); - } - - public boolean isDefault() { - return false; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE : - return basicSetPersistentAttribute(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE : - return getPersistentAttribute(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE : - setPersistentAttribute((XmlPersistentAttribute) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE : - setPersistentAttribute((XmlPersistentAttribute) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_MAPPING__PERSISTENT_ATTRIBUTE : - return persistentAttribute != null; - } - return super.eIsSet(featureID); - } - - /** - * IMPORTANT: See XmlAttributeMapping class comment. - * Subclasses should override this method to call the - * appropriate initializeFrom___Mapping() method. - */ - protected abstract void initializeOn(XmlAttributeMapping newMapping); - - public void initializeFromXmlAttributeMapping(XmlAttributeMapping oldMapping) { - } - - public void initializeFromXmlBasicMapping(XmlBasic oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlIdMapping(XmlId oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlTransientMapping(XmlTransient oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlEmbeddedMapping(XmlEmbedded oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlEmbeddedIdMapping(XmlEmbeddedId oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlVersionMapping(XmlVersion oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlRelationshipMapping(XmlRelationshipMapping oldMapping) { - initializeFromXmlAttributeMapping(oldMapping); - } - - public void initializeFromXmlMulitRelationshipMapping(XmlMultiRelationshipMappingInternal oldMapping) { - initializeFromXmlRelationshipMapping(oldMapping); - } - - public void initializeFromXmlSingleRelationshipMapping(XmlSingleRelationshipMapping oldMapping) { - initializeFromXmlRelationshipMapping(oldMapping); - } - - public void initializeFromXmlOneToManyMapping(XmlOneToMany oldMapping) { - initializeFromXmlMulitRelationshipMapping(oldMapping); - } - - public void initializeFromXmlManyToOneMapping(XmlManyToOne oldMapping) { - initializeFromXmlSingleRelationshipMapping(oldMapping); - } - - public void initializeFromXmlOneToOneMapping(XmlOneToOne oldMapping) { - initializeFromXmlSingleRelationshipMapping(oldMapping); - } - - public void initializeFromXmlManyToManyMapping(XmlManyToMany oldMapping) { - initializeFromXmlMulitRelationshipMapping(oldMapping); - } - - public IJpaContentNode getContentNode(int offset) { - return getPersistentAttribute(); - } - - /** - * Attributes are a sequence in the orm schema. We must keep - * the list of attributes in the appropriate order so the wtp xml - * translators will write them to the xml in that order and they - * will adhere to the schema. - * - * Each concrete subclass of XmlAttributeMapping must implement this - * method and return an int that matches it's order in the schema - * @return - */ - public abstract int xmlSequence(); - - public void initialize() { - //do nothing as this will be handle by the Xml Translators - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - // do nothing - } - - public String primaryKeyColumnName() { - return null; - } - - public XmlTypeMapping typeMapping() { - return this.getPersistentType().getMapping(); - } - - public boolean isVirtual() { - return getPersistentType().getVirtualAttributeMappings().contains(this); - } - - public void setVirtual(boolean virtual) { - getPersistentType().setMappingVirtual(this, virtual); - } - - @Override - public ITextRange validationTextRange() { - return (this.isVirtual()) ? this.getPersistentType().attributesTextRange() : super.validationTextRange(); - } - - public ITextRange nameTextRange() { - IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.NAME); - return (nameNode != null) ? this.buildTextRange(nameNode) : this.validationTextRange(); - } - - public boolean isOverridableAttributeMapping() { - return false; - } - - public boolean isOverridableAssociationMapping() { - return false; - } - - public boolean isIdMapping() { - return false; - } - - - public class ColumnOwner implements INamedColumn.Owner - { - public ITextRange validationTextRange() { - return XmlAttributeMapping.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return XmlAttributeMapping.this.typeMapping(); - } - - public Table dbTable(String tableName) { - return this.getTypeMapping().dbTable(tableName); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeOverride.java deleted file mode 100644 index bcd363009e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeOverride.java +++ /dev/null @@ -1,327 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'Xml Attribute Override'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeOverride() - * @model kind="class" - * @generated - */ -public class XmlAttributeOverride extends XmlOverride - implements IAttributeOverride, IXmlColumnMapping -{ - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - protected XmlAttributeOverride() { - throw new UnsupportedOperationException(); - } - - protected XmlAttributeOverride(IOverride.Owner owner) { - super(owner); - this.column = OrmFactory.eINSTANCE.createXmlColumn(buildColumnOwner()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN, null, null); - } - - protected INamedColumn.Owner buildColumnOwner() { - return new ColumnOwner(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ATTRIBUTE_OVERRIDE; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAttributeOverride_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Column For Xml' reference. - * - *

    - * If the meaning of the 'Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column For Xml' reference. - * @see #setColumnForXml(XmlColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping_ColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public XmlColumn getColumnForXml() { - if (((XmlColumn) getColumn()).isAllFeaturesUnset()) { - return null; - } - return (XmlColumn) getColumn(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride#getColumnForXml Column For Xml}' reference. - * - * - * @param value the new value of the 'Column For Xml' reference. - * @see #getColumnForXml() - * @generated NOT - */ - public void setColumnForXmlGen(XmlColumn newColumnForXml) { - XmlColumn oldValue = newColumnForXml == null ? (XmlColumn) getColumn() : null; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML, oldValue, newColumnForXml)); - } - } - - public void setColumnForXml(XmlColumn newColumnForXml) { - setColumnForXmlGen(newColumnForXml); - if (newColumnForXml == null) { - ((XmlColumn) getColumn()).unsetAllAttributes(); - } - } - - /** - * - * - * @model - * @generated NOT - */ - public void makeColumnForXmlNonNull() { - setColumnForXmlGen(getColumnForXml()); - } - - /** - * - * - * @model - * @generated NOT - */ - public void makeColumnForXmlNull() { - setColumnForXmlGen(null); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN : - return basicSetColumn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN : - return getColumn(); - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML : - return getColumnForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN : - return column != null; - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML : - return getColumnForXml() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IAttributeOverride.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN : - return JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE__COLUMN; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML : - return OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IAttributeOverride.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE__COLUMN : - return OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (baseFeatureID) { - case OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML : - return OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - - public class ColumnOwner implements INamedColumn.Owner - { - public ITextRange validationTextRange() { - return XmlAttributeOverride.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return XmlAttributeOverride.this.getOwner().getTypeMapping(); - } - - public Table dbTable(String tablename) { - return this.getTypeMapping().dbTable(column.getTable()); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java deleted file mode 100644 index 28d7b929c6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java +++ /dev/null @@ -1,704 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.EnumType; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; - -/** - * - * A representation of the model object 'Xml Basic'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlBasic() - * @model kind="class" - * @generated - */ -public class XmlBasic extends XmlAttributeMapping - implements IBasic, IXmlColumnMapping -{ - /** - * The default value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected static final DefaultEagerFetchType FETCH_EDEFAULT = DefaultEagerFetchType.DEFAULT; - - /** - * The cached value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected DefaultEagerFetchType fetch = FETCH_EDEFAULT; - - /** - * The default value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean OPTIONAL_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected DefaultTrueBoolean optional = OPTIONAL_EDEFAULT; - - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - /** - * The default value of the '{@link #isLob() Lob}' attribute. - * - * - * @see #isLob() - * @generated - * @ordered - */ - protected static final boolean LOB_EDEFAULT = false; - - /** - * The cached value of the '{@link #isLob() Lob}' attribute. - * - * - * @see #isLob() - * @generated - * @ordered - */ - protected boolean lob = LOB_EDEFAULT; - - /** - * The default value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected static final TemporalType TEMPORAL_EDEFAULT = TemporalType.NULL; - - /** - * The cached value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected TemporalType temporal = TEMPORAL_EDEFAULT; - - /** - * The default value of the '{@link #getEnumerated() Enumerated}' attribute. - * - * - * @see #getEnumerated() - * @generated - * @ordered - */ - protected static final EnumType ENUMERATED_EDEFAULT = EnumType.DEFAULT; - - /** - * The cached value of the '{@link #getEnumerated() Enumerated}' attribute. - * - * - * @see #getEnumerated() - * @generated - * @ordered - */ - protected EnumType enumerated = ENUMERATED_EDEFAULT; - - /** - * - * - * @generated NOT - */ - protected XmlBasic() { - super(); - this.column = OrmFactory.eINSTANCE.createXmlColumn(buildOwner()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_BASIC__COLUMN, null, null); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_BASIC; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIBasic_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType}. - * - *

    - * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #setFetch(DefaultEagerFetchType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIBasic_Fetch() - * @model - * @generated - */ - public DefaultEagerFetchType getFetch() { - return fetch; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #getFetch() - * @generated - */ - public void setFetch(DefaultEagerFetchType newFetch) { - DefaultEagerFetchType oldFetch = fetch; - fetch = newFetch == null ? FETCH_EDEFAULT : newFetch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__FETCH, oldFetch, fetch)); - } - - /** - * Returns the value of the 'Optional' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Optional' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setOptional(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIBasic_Optional() - * @model - * @generated - */ - public DefaultTrueBoolean getOptional() { - return optional; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic#getOptional Optional}' attribute. - * - * - * @param value the new value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getOptional() - * @generated - */ - public void setOptional(DefaultTrueBoolean newOptional) { - DefaultTrueBoolean oldOptional = optional; - optional = newOptional == null ? OPTIONAL_EDEFAULT : newOptional; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__OPTIONAL, oldOptional, optional)); - } - - /** - * Returns the value of the 'Lob' attribute. - * - *

    - * If the meaning of the 'Lob' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Lob' attribute. - * @see #setLob(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIBasic_Lob() - * @model - * @generated - */ - public boolean isLob() { - return lob; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic#isLob Lob}' attribute. - * - * - * @param value the new value of the 'Lob' attribute. - * @see #isLob() - * @generated - */ - public void setLob(boolean newLob) { - boolean oldLob = lob; - lob = newLob; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__LOB, oldLob, lob)); - } - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

    - * If the meaning of the 'Temporal' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIBasic_Temporal() - * @model - * @generated - */ - public TemporalType getTemporal() { - return temporal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - public void setTemporal(TemporalType newTemporal) { - TemporalType oldTemporal = temporal; - temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__TEMPORAL, oldTemporal, temporal)); - } - - /** - * Returns the value of the 'Enumerated' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.EnumType}. - * - *

    - * If the meaning of the 'Enumerated' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Enumerated' attribute. - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see #setEnumerated(EnumType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIBasic_Enumerated() - * @model - * @generated - */ - public EnumType getEnumerated() { - return enumerated; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic#getEnumerated Enumerated}' attribute. - * - * - * @param value the new value of the 'Enumerated' attribute. - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see #getEnumerated() - * @generated - */ - public void setEnumerated(EnumType newEnumerated) { - EnumType oldEnumerated = enumerated; - enumerated = newEnumerated == null ? ENUMERATED_EDEFAULT : newEnumerated; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__ENUMERATED, oldEnumerated, enumerated)); - } - - /** - * Returns the value of the 'Column For Xml' reference. - * - *

    - * If the meaning of the 'Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column For Xml' reference. - * @see #setColumnForXml(XmlColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping_ColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public XmlColumn getColumnForXml() { - if (((XmlColumn) getColumn()).isAllFeaturesUnset()) { - return null; - } - return (XmlColumn) getColumn(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic#getColumnForXml Column For Xml}' reference. - * - * - * @param value the new value of the 'Column For Xml' reference. - * @see #getColumnForXml() - * @generated NOT - */ - public void setColumnForXmlGen(XmlColumn newColumnForXml) { - XmlColumn oldValue = newColumnForXml == null ? (XmlColumn) getColumn() : null; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__COLUMN_FOR_XML, oldValue, newColumnForXml)); - } - } - - public void setColumnForXml(XmlColumn newColumnForXml) { - setColumnForXmlGen(newColumnForXml); - if (newColumnForXml == null) { - ((XmlColumn) getColumn()).unsetAllAttributes(); - } - } - - /** - * - * - * @model - * @generated NOT - */ - public void makeColumnForXmlNonNull() { - setColumnForXmlGen(getColumnForXml()); - } - - /** - * - * - * @model - * @generated NOT - */ - public void makeColumnForXmlNull() { - setColumnForXmlGen(null); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_BASIC__COLUMN : - return basicSetColumn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_BASIC__FETCH : - return getFetch(); - case OrmPackage.XML_BASIC__OPTIONAL : - return getOptional(); - case OrmPackage.XML_BASIC__COLUMN : - return getColumn(); - case OrmPackage.XML_BASIC__LOB : - return isLob() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.XML_BASIC__TEMPORAL : - return getTemporal(); - case OrmPackage.XML_BASIC__ENUMERATED : - return getEnumerated(); - case OrmPackage.XML_BASIC__COLUMN_FOR_XML : - return getColumnForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_BASIC__FETCH : - setFetch((DefaultEagerFetchType) newValue); - return; - case OrmPackage.XML_BASIC__OPTIONAL : - setOptional((DefaultTrueBoolean) newValue); - return; - case OrmPackage.XML_BASIC__LOB : - setLob(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.XML_BASIC__TEMPORAL : - setTemporal((TemporalType) newValue); - return; - case OrmPackage.XML_BASIC__ENUMERATED : - setEnumerated((EnumType) newValue); - return; - case OrmPackage.XML_BASIC__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_BASIC__FETCH : - setFetch(FETCH_EDEFAULT); - return; - case OrmPackage.XML_BASIC__OPTIONAL : - setOptional(OPTIONAL_EDEFAULT); - return; - case OrmPackage.XML_BASIC__LOB : - setLob(LOB_EDEFAULT); - return; - case OrmPackage.XML_BASIC__TEMPORAL : - setTemporal(TEMPORAL_EDEFAULT); - return; - case OrmPackage.XML_BASIC__ENUMERATED : - setEnumerated(ENUMERATED_EDEFAULT); - return; - case OrmPackage.XML_BASIC__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_BASIC__FETCH : - return fetch != FETCH_EDEFAULT; - case OrmPackage.XML_BASIC__OPTIONAL : - return optional != OPTIONAL_EDEFAULT; - case OrmPackage.XML_BASIC__COLUMN : - return column != null; - case OrmPackage.XML_BASIC__LOB : - return lob != LOB_EDEFAULT; - case OrmPackage.XML_BASIC__TEMPORAL : - return temporal != TEMPORAL_EDEFAULT; - case OrmPackage.XML_BASIC__ENUMERATED : - return enumerated != ENUMERATED_EDEFAULT; - case OrmPackage.XML_BASIC__COLUMN_FOR_XML : - return getColumnForXml() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IBasic.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_BASIC__FETCH : - return JpaCoreMappingsPackage.IBASIC__FETCH; - case OrmPackage.XML_BASIC__OPTIONAL : - return JpaCoreMappingsPackage.IBASIC__OPTIONAL; - case OrmPackage.XML_BASIC__COLUMN : - return JpaCoreMappingsPackage.IBASIC__COLUMN; - case OrmPackage.XML_BASIC__LOB : - return JpaCoreMappingsPackage.IBASIC__LOB; - case OrmPackage.XML_BASIC__TEMPORAL : - return JpaCoreMappingsPackage.IBASIC__TEMPORAL; - case OrmPackage.XML_BASIC__ENUMERATED : - return JpaCoreMappingsPackage.IBASIC__ENUMERATED; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_BASIC__COLUMN_FOR_XML : - return OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IBasic.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IBASIC__FETCH : - return OrmPackage.XML_BASIC__FETCH; - case JpaCoreMappingsPackage.IBASIC__OPTIONAL : - return OrmPackage.XML_BASIC__OPTIONAL; - case JpaCoreMappingsPackage.IBASIC__COLUMN : - return OrmPackage.XML_BASIC__COLUMN; - case JpaCoreMappingsPackage.IBASIC__LOB : - return OrmPackage.XML_BASIC__LOB; - case JpaCoreMappingsPackage.IBASIC__TEMPORAL : - return OrmPackage.XML_BASIC__TEMPORAL; - case JpaCoreMappingsPackage.IBASIC__ENUMERATED : - return OrmPackage.XML_BASIC__ENUMERATED; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (baseFeatureID) { - case OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML : - return OrmPackage.XML_BASIC__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fetch: "); - result.append(fetch); - result.append(", optional: "); - result.append(optional); - result.append(", lob: "); - result.append(lob); - result.append(", temporal: "); - result.append(temporal); - result.append(", enumerated: "); - result.append(enumerated); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY; - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlBasicMapping(this); - } - - @Override - public void initializeFromXmlIdMapping(XmlId oldMapping) { - super.initializeFromXmlIdMapping(oldMapping); - setTemporal(oldMapping.getTemporal()); - } - - @Override - public int xmlSequence() { - return 1; - } - - @Override - public boolean isOverridableAttributeMapping() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasicProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasicProvider.java deleted file mode 100644 index a68bcde901..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasicProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlBasicProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlBasicProvider INSTANCE = new XmlBasicProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlBasicProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlBasic(); - } - - public String key() { - return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java deleted file mode 100644 index aac4d933ab..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java +++ /dev/null @@ -1,488 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Cascade'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade() - * @model kind="class" - * @generated - */ -public class XmlCascade extends XmlEObject implements ICascade -{ - /** - * The default value of the '{@link #isAll() All}' attribute. - * - * - * @see #isAll() - * @generated - * @ordered - */ - protected static final boolean ALL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isAll() All}' attribute. - * - * - * @see #isAll() - * @generated - * @ordered - */ - protected boolean all = ALL_EDEFAULT; - - /** - * The default value of the '{@link #isPersist() Persist}' attribute. - * - * - * @see #isPersist() - * @generated - * @ordered - */ - protected static final boolean PERSIST_EDEFAULT = false; - - /** - * The cached value of the '{@link #isPersist() Persist}' attribute. - * - * - * @see #isPersist() - * @generated - * @ordered - */ - protected boolean persist = PERSIST_EDEFAULT; - - /** - * The default value of the '{@link #isMerge() Merge}' attribute. - * - * - * @see #isMerge() - * @generated - * @ordered - */ - protected static final boolean MERGE_EDEFAULT = false; - - /** - * The cached value of the '{@link #isMerge() Merge}' attribute. - * - * - * @see #isMerge() - * @generated - * @ordered - */ - protected boolean merge = MERGE_EDEFAULT; - - /** - * The default value of the '{@link #isRemove() Remove}' attribute. - * - * - * @see #isRemove() - * @generated - * @ordered - */ - protected static final boolean REMOVE_EDEFAULT = false; - - /** - * The cached value of the '{@link #isRemove() Remove}' attribute. - * - * - * @see #isRemove() - * @generated - * @ordered - */ - protected boolean remove = REMOVE_EDEFAULT; - - /** - * The default value of the '{@link #isRefresh() Refresh}' attribute. - * - * - * @see #isRefresh() - * @generated - * @ordered - */ - protected static final boolean REFRESH_EDEFAULT = false; - - /** - * The cached value of the '{@link #isRefresh() Refresh}' attribute. - * - * - * @see #isRefresh() - * @generated - * @ordered - */ - protected boolean refresh = REFRESH_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlCascade() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_CASCADE; - } - - /** - * Returns the value of the 'All' attribute. - * - *

    - * If the meaning of the 'All' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'All' attribute. - * @see #setAll(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_All() - * @model - * @generated - */ - public boolean isAll() { - return all; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isAll All}' attribute. - * - * - * @param value the new value of the 'All' attribute. - * @see #isAll() - * @generated - */ - public void setAll(boolean newAll) { - boolean oldAll = all; - all = newAll; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__ALL, oldAll, all)); - } - - /** - * Returns the value of the 'Persist' attribute. - * - *

    - * If the meaning of the 'Persist' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Persist' attribute. - * @see #setPersist(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Persist() - * @model - * @generated - */ - public boolean isPersist() { - return persist; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isPersist Persist}' attribute. - * - * - * @param value the new value of the 'Persist' attribute. - * @see #isPersist() - * @generated - */ - public void setPersist(boolean newPersist) { - boolean oldPersist = persist; - persist = newPersist; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__PERSIST, oldPersist, persist)); - } - - /** - * Returns the value of the 'Merge' attribute. - * - *

    - * If the meaning of the 'Merge' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Merge' attribute. - * @see #setMerge(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Merge() - * @model - * @generated - */ - public boolean isMerge() { - return merge; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isMerge Merge}' attribute. - * - * - * @param value the new value of the 'Merge' attribute. - * @see #isMerge() - * @generated - */ - public void setMerge(boolean newMerge) { - boolean oldMerge = merge; - merge = newMerge; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__MERGE, oldMerge, merge)); - } - - /** - * Returns the value of the 'Remove' attribute. - * - *

    - * If the meaning of the 'Remove' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Remove' attribute. - * @see #setRemove(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Remove() - * @model - * @generated - */ - public boolean isRemove() { - return remove; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isRemove Remove}' attribute. - * - * - * @param value the new value of the 'Remove' attribute. - * @see #isRemove() - * @generated - */ - public void setRemove(boolean newRemove) { - boolean oldRemove = remove; - remove = newRemove; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__REMOVE, oldRemove, remove)); - } - - /** - * Returns the value of the 'Refresh' attribute. - * - *

    - * If the meaning of the 'Refresh' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Refresh' attribute. - * @see #setRefresh(boolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Refresh() - * @model - * @generated - */ - public boolean isRefresh() { - return refresh; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isRefresh Refresh}' attribute. - * - * - * @param value the new value of the 'Refresh' attribute. - * @see #isRefresh() - * @generated - */ - public void setRefresh(boolean newRefresh) { - boolean oldRefresh = refresh; - refresh = newRefresh; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__REFRESH, oldRefresh, refresh)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_CASCADE__ALL : - return isAll() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.XML_CASCADE__PERSIST : - return isPersist() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.XML_CASCADE__MERGE : - return isMerge() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.XML_CASCADE__REMOVE : - return isRemove() ? Boolean.TRUE : Boolean.FALSE; - case OrmPackage.XML_CASCADE__REFRESH : - return isRefresh() ? Boolean.TRUE : Boolean.FALSE; - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_CASCADE__ALL : - setAll(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.XML_CASCADE__PERSIST : - setPersist(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.XML_CASCADE__MERGE : - setMerge(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.XML_CASCADE__REMOVE : - setRemove(((Boolean) newValue).booleanValue()); - return; - case OrmPackage.XML_CASCADE__REFRESH : - setRefresh(((Boolean) newValue).booleanValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_CASCADE__ALL : - setAll(ALL_EDEFAULT); - return; - case OrmPackage.XML_CASCADE__PERSIST : - setPersist(PERSIST_EDEFAULT); - return; - case OrmPackage.XML_CASCADE__MERGE : - setMerge(MERGE_EDEFAULT); - return; - case OrmPackage.XML_CASCADE__REMOVE : - setRemove(REMOVE_EDEFAULT); - return; - case OrmPackage.XML_CASCADE__REFRESH : - setRefresh(REFRESH_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_CASCADE__ALL : - return all != ALL_EDEFAULT; - case OrmPackage.XML_CASCADE__PERSIST : - return persist != PERSIST_EDEFAULT; - case OrmPackage.XML_CASCADE__MERGE : - return merge != MERGE_EDEFAULT; - case OrmPackage.XML_CASCADE__REMOVE : - return remove != REMOVE_EDEFAULT; - case OrmPackage.XML_CASCADE__REFRESH : - return refresh != REFRESH_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ICascade.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_CASCADE__ALL : - return JpaCoreMappingsPackage.ICASCADE__ALL; - case OrmPackage.XML_CASCADE__PERSIST : - return JpaCoreMappingsPackage.ICASCADE__PERSIST; - case OrmPackage.XML_CASCADE__MERGE : - return JpaCoreMappingsPackage.ICASCADE__MERGE; - case OrmPackage.XML_CASCADE__REMOVE : - return JpaCoreMappingsPackage.ICASCADE__REMOVE; - case OrmPackage.XML_CASCADE__REFRESH : - return JpaCoreMappingsPackage.ICASCADE__REFRESH; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ICascade.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ICASCADE__ALL : - return OrmPackage.XML_CASCADE__ALL; - case JpaCoreMappingsPackage.ICASCADE__PERSIST : - return OrmPackage.XML_CASCADE__PERSIST; - case JpaCoreMappingsPackage.ICASCADE__MERGE : - return OrmPackage.XML_CASCADE__MERGE; - case JpaCoreMappingsPackage.ICASCADE__REMOVE : - return OrmPackage.XML_CASCADE__REMOVE; - case JpaCoreMappingsPackage.ICASCADE__REFRESH : - return OrmPackage.XML_CASCADE__REFRESH; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (all: "); - result.append(all); - result.append(", persist: "); - result.append(persist); - result.append(", merge: "); - result.append(merge); - result.append(", remove: "); - result.append(remove); - result.append(", refresh: "); - result.append(refresh); - result.append(')'); - return result.toString(); - } -} // XmlCascade diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java deleted file mode 100644 index 009f658495..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java +++ /dev/null @@ -1,662 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - * A representation of the model object 'Xml Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getLengthForXml Length For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getPrecisionForXml Precision For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getScaleForXml Scale For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlColumn() - * @model kind="class" - * @generated - */ -public class XmlColumn extends AbstractXmlColumn implements IColumn -{ - /** - * The default value of the '{@link #getLength() Length}' attribute. - * - * - * @see #getLength() - * @generated - * @ordered - */ - protected static final int LENGTH_EDEFAULT = 255; - - /** - * The cached value of the '{@link #getLength() Length}' attribute. - * - * - * @see #getLength() - * @generated - * @ordered - */ - protected int length = LENGTH_EDEFAULT; - - /** - * The default value of the '{@link #getPrecision() Precision}' attribute. - * - * - * @see #getPrecision() - * @generated - * @ordered - */ - protected static final int PRECISION_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getPrecision() Precision}' attribute. - * - * - * @see #getPrecision() - * @generated - * @ordered - */ - protected int precision = PRECISION_EDEFAULT; - - /** - * The default value of the '{@link #getScale() Scale}' attribute. - * - * - * @see #getScale() - * @generated - * @ordered - */ - protected static final int SCALE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getScale() Scale}' attribute. - * - * - * @see #getScale() - * @generated - * @ordered - */ - protected int scale = SCALE_EDEFAULT; - - /** - * The default value of the '{@link #getLengthForXml() Length For Xml}' attribute. - * - * - * @see #getLengthForXml() - * @generated - * @ordered - */ - protected static final int LENGTH_FOR_XML_EDEFAULT = 255; - - /** - * The default value of the '{@link #getPrecisionForXml() Precision For Xml}' attribute. - * - * - * @see #getPrecisionForXml() - * @generated - * @ordered - */ - protected static final int PRECISION_FOR_XML_EDEFAULT = 0; - - /** - * The default value of the '{@link #getScaleForXml() Scale For Xml}' attribute. - * - * - * @see #getScaleForXml() - * @generated - * @ordered - */ - protected static final int SCALE_FOR_XML_EDEFAULT = 0; - - /** - * - * - * @generated - */ - protected XmlColumn() { - super(); - } - - protected XmlColumn(IColumn.Owner owner) { - super(owner); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_COLUMN; - } - - /** - * Returns the value of the 'Length' attribute. - * The default value is "255". - * - *

    - * If the meaning of the 'Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Length' attribute. - * @see #setLength(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_Length() - * @model default="255" - * @generated - */ - public int getLength() { - return length; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getLength Length}' attribute. - * - * - * @param value the new value of the 'Length' attribute. - * @see #getLength() - * @generated - */ - public void setLengthGen(int newLength) { - int oldLength = length; - length = newLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__LENGTH, oldLength, length)); - } - - public void setLength(int newLength) { - setLengthGen(newLength); - if (newLength != LENGTH_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setLengthForXml(newLength); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - /** - * Returns the value of the 'Precision' attribute. - * - *

    - * If the meaning of the 'Precision' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Precision' attribute. - * @see #setPrecision(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_Precision() - * @model - * @generated - */ - public int getPrecision() { - return precision; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getPrecision Precision}' attribute. - * - * - * @param value the new value of the 'Precision' attribute. - * @see #getPrecision() - * @generated - */ - public void setPrecisionGen(int newPrecision) { - int oldPrecision = precision; - precision = newPrecision; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__PRECISION, oldPrecision, precision)); - } - - public void setPrecision(int newPrecision) { - setPrecisionGen(newPrecision); - if (newPrecision != PRECISION_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setPrecisionForXml(newPrecision); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - /** - * Returns the value of the 'Scale' attribute. - * - *

    - * If the meaning of the 'Scale' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Scale' attribute. - * @see #setScale(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_Scale() - * @model - * @generated - */ - public int getScale() { - return scale; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getScale Scale}' attribute. - * - * - * @param value the new value of the 'Scale' attribute. - * @see #getScale() - * @generated - */ - public void setScaleGen(int newScale) { - int oldScale = scale; - scale = newScale; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SCALE, oldScale, scale)); - } - - public void setScale(int newScale) { - setScaleGen(newScale); - if (newScale != SCALE_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setScaleForXml(newScale); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - /** - * Returns the value of the 'Length For Xml' attribute. - * The default value is "255". - * - *

    - * If the meaning of the 'Length For Xml' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Length For Xml' attribute. - * @see #setLengthForXml(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlColumn_LengthForXml() - * @model default="255" volatile="true" - * @generated NOT - */ - public int getLengthForXml() { - return getLength(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getLengthForXml Length For Xml}' attribute. - * - * - * @param value the new value of the 'Length For Xml' attribute. - * @see #getLengthForXml() - * @generated NOT - */ - public void setLengthForXml(int newLengthForXml) { - setLengthGen(newLengthForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__LENGTH_FOR_XML, null, newLengthForXml)); - } - - /** - * Returns the value of the 'Precision For Xml' attribute. - * - *

    - * If the meaning of the 'Precision For Xml' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Precision For Xml' attribute. - * @see #setPrecisionForXml(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlColumn_PrecisionForXml() - * @model volatile="true" - * @generated NOT - */ - public int getPrecisionForXml() { - return getPrecision(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getPrecisionForXml Precision For Xml}' attribute. - * - * - * @param value the new value of the 'Precision For Xml' attribute. - * @see #getPrecisionForXml() - * @generated NOT - */ - public void setPrecisionForXml(int newPrecisionForXml) { - setPrecisionGen(newPrecisionForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__PRECISION_FOR_XML, null, newPrecisionForXml)); - } - - /** - * Returns the value of the 'Scale For Xml' attribute. - * - *

    - * If the meaning of the 'Scale For Xml' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Scale For Xml' attribute. - * @see #setScaleForXml(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlColumn_ScaleForXml() - * @model volatile="true" - * @generated NOT - */ - public int getScaleForXml() { - return getScale(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getScaleForXml Scale For Xml}' attribute. - * - * - * @param value the new value of the 'Scale For Xml' attribute. - * @see #getScaleForXml() - * @generated NOT - */ - public void setScaleForXml(int newScaleForXml) { - setScaleGen(newScaleForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SCALE_FOR_XML, null, newScaleForXml)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_COLUMN__LENGTH : - return new Integer(getLength()); - case OrmPackage.XML_COLUMN__PRECISION : - return new Integer(getPrecision()); - case OrmPackage.XML_COLUMN__SCALE : - return new Integer(getScale()); - case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : - return new Integer(getLengthForXml()); - case OrmPackage.XML_COLUMN__PRECISION_FOR_XML : - return new Integer(getPrecisionForXml()); - case OrmPackage.XML_COLUMN__SCALE_FOR_XML : - return new Integer(getScaleForXml()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_COLUMN__LENGTH : - setLength(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_COLUMN__PRECISION : - setPrecision(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_COLUMN__SCALE : - setScale(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : - setLengthForXml(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_COLUMN__PRECISION_FOR_XML : - setPrecisionForXml(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_COLUMN__SCALE_FOR_XML : - setScaleForXml(((Integer) newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_COLUMN__LENGTH : - setLength(LENGTH_EDEFAULT); - return; - case OrmPackage.XML_COLUMN__PRECISION : - setPrecision(PRECISION_EDEFAULT); - return; - case OrmPackage.XML_COLUMN__SCALE : - setScale(SCALE_EDEFAULT); - return; - case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : - setLengthForXml(LENGTH_FOR_XML_EDEFAULT); - return; - case OrmPackage.XML_COLUMN__PRECISION_FOR_XML : - setPrecisionForXml(PRECISION_FOR_XML_EDEFAULT); - return; - case OrmPackage.XML_COLUMN__SCALE_FOR_XML : - setScaleForXml(SCALE_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_COLUMN__LENGTH : - return length != LENGTH_EDEFAULT; - case OrmPackage.XML_COLUMN__PRECISION : - return precision != PRECISION_EDEFAULT; - case OrmPackage.XML_COLUMN__SCALE : - return scale != SCALE_EDEFAULT; - case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : - return getLengthForXml() != LENGTH_FOR_XML_EDEFAULT; - case OrmPackage.XML_COLUMN__PRECISION_FOR_XML : - return getPrecisionForXml() != PRECISION_FOR_XML_EDEFAULT; - case OrmPackage.XML_COLUMN__SCALE_FOR_XML : - return getScaleForXml() != SCALE_FOR_XML_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumn.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_COLUMN__LENGTH : - return JpaCoreMappingsPackage.ICOLUMN__LENGTH; - case OrmPackage.XML_COLUMN__PRECISION : - return JpaCoreMappingsPackage.ICOLUMN__PRECISION; - case OrmPackage.XML_COLUMN__SCALE : - return JpaCoreMappingsPackage.ICOLUMN__SCALE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ICOLUMN__LENGTH : - return OrmPackage.XML_COLUMN__LENGTH; - case JpaCoreMappingsPackage.ICOLUMN__PRECISION : - return OrmPackage.XML_COLUMN__PRECISION; - case JpaCoreMappingsPackage.ICOLUMN__SCALE : - return OrmPackage.XML_COLUMN__SCALE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (length: "); - result.append(length); - result.append(", precision: "); - result.append(precision); - result.append(", scale: "); - result.append(scale); - result.append(')'); - return result.toString(); - } - - /** - * Call this when the table tag is removed from the xml, - * need to make sure all the model attributes are set to the default - */ - protected void unsetAllAttributes() { - eUnset(OrmPackage.XML_COLUMN__SPECIFIED_NAME); - eUnset(OrmPackage.XML_COLUMN__SPECIFIED_TABLE); - eUnset(OrmPackage.XML_COLUMN__COLUMN_DEFINITION); - eUnset(OrmPackage.XML_COLUMN__INSERTABLE); - eUnset(OrmPackage.XML_COLUMN__LENGTH); - eUnset(OrmPackage.XML_COLUMN__NULLABLE); - eUnset(OrmPackage.XML_COLUMN__PRECISION); - eUnset(OrmPackage.XML_COLUMN__SCALE); - eUnset(OrmPackage.XML_COLUMN__UNIQUE); - eUnset(OrmPackage.XML_COLUMN__UPDATABLE); - } - - public void setSpecifiedName(String newSpecifiedName) { - setSpecifiedNameGen(newSpecifiedName); - if (newSpecifiedName != SPECIFIED_NAME_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setSpecifiedNameForXml(newSpecifiedName); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - public void setUnique(DefaultFalseBoolean newUnique) { - setUniqueGen(newUnique); - if (newUnique != UNIQUE_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setUniqueForXml(newUnique); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - public void setNullable(DefaultTrueBoolean newNullable) { - setNullableGen(newNullable); - if (newNullable != NULLABLE_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setNullableForXml(newNullable); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - public void setInsertable(DefaultTrueBoolean newInsertable) { - setInsertableGen(newInsertable); - if (newInsertable != INSERTABLE_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setInsertableForXml(newInsertable); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - public void setUpdatable(DefaultTrueBoolean newUpdatable) { - setUpdatableGen(newUpdatable); - if (newUpdatable != UPDATABLE_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setUpdatableForXml(newUpdatable); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - public void setColumnDefinition(String newColumnDefinition) { - setColumnDefinitionGen(newColumnDefinition); - if (newColumnDefinition != COLUMN_DEFINITION_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setColumnDefinitionForXml(newColumnDefinition); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - public void setSpecifiedTable(String newSpecifiedTable) { - setSpecifiedTableGen(newSpecifiedTable); - if (newSpecifiedTable != SPECIFIED_TABLE_EDEFAULT) { - getColumnMapping().makeColumnForXmlNonNull(); - } - setSpecifiedTableForXml(newSpecifiedTable); - if (isAllFeaturesUnset()) { - getColumnMapping().makeColumnForXmlNull(); - } - } - - protected IXmlColumnMapping getColumnMapping() { - return (IXmlColumnMapping) eContainer(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultTable((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_COLUMN_TABLE_KEY)); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)); - } -} // XmlColumn diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java deleted file mode 100644 index e44f2cfebf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java +++ /dev/null @@ -1,519 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Set; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.mappings.DiscriminatorType; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Discriminator Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getDiscriminatorTypeForXml Discriminator Type For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getSpecifiedLengthForXml Specified Length For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlDiscriminatorColumn() - * @model kind="class" - * @generated - */ -public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn - implements IDiscriminatorColumn -{ - /** - * The default value of the '{@link #getDiscriminatorType() Discriminator Type}' attribute. - * - * - * @see #getDiscriminatorType() - * @generated - * @ordered - */ - protected static final DiscriminatorType DISCRIMINATOR_TYPE_EDEFAULT = DiscriminatorType.DEFAULT; - - /** - * The cached value of the '{@link #getDiscriminatorType() Discriminator Type}' attribute. - * - * - * @see #getDiscriminatorType() - * @generated - * @ordered - */ - protected DiscriminatorType discriminatorType = DISCRIMINATOR_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultLength() Default Length}' attribute. - * - * - * @see #getDefaultLength() - * @generated - * @ordered - */ - protected static final int DEFAULT_LENGTH_EDEFAULT = 31; - - /** - * The cached value of the '{@link #getDefaultLength() Default Length}' attribute. - * - * - * @see #getDefaultLength() - * @generated - * @ordered - */ - protected int defaultLength = DEFAULT_LENGTH_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedLength() Specified Length}' attribute. - * - * - * @see #getSpecifiedLength() - * @generated - * @ordered - */ - protected static final int SPECIFIED_LENGTH_EDEFAULT = -1; - - /** - * The cached value of the '{@link #getSpecifiedLength() Specified Length}' attribute. - * - * - * @see #getSpecifiedLength() - * @generated - * @ordered - */ - protected int specifiedLength = SPECIFIED_LENGTH_EDEFAULT; - - /** - * The default value of the '{@link #getLength() Length}' attribute. - * - * - * @see #getLength() - * @generated - * @ordered - */ - protected static final int LENGTH_EDEFAULT = 0; - - /** - * The default value of the '{@link #getDiscriminatorTypeForXml() Discriminator Type For Xml}' attribute. - * - * - * @see #getDiscriminatorTypeForXml() - * @generated - * @ordered - */ - protected static final DiscriminatorType DISCRIMINATOR_TYPE_FOR_XML_EDEFAULT = DiscriminatorType.DEFAULT; - - /** - * The default value of the '{@link #getSpecifiedLengthForXml() Specified Length For Xml}' attribute. - * - * - * @see #getSpecifiedLengthForXml() - * @generated - * @ordered - */ - protected static final int SPECIFIED_LENGTH_FOR_XML_EDEFAULT = -1; - - protected XmlDiscriminatorColumn() { - throw new UnsupportedOperationException(); - } - - protected XmlDiscriminatorColumn(INamedColumn.Owner owner) { - super(owner); - } - - @Override - protected void addInsignificantXmlFeatureIdsTo(Set insignificantXmlFeatureIds) { - super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__LENGTH); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_DISCRIMINATOR_COLUMN; - } - - public void setSpecifiedName(String newSpecifiedName) { - setSpecifiedNameGen(newSpecifiedName); - if (newSpecifiedName != SPECIFIED_NAME_EDEFAULT) { - entity().makeDiscriminatorColumnForXmlNonNull(); - } - setSpecifiedNameForXml(newSpecifiedName); - if (isAllFeaturesUnset()) { - entity().makeDiscriminatorColumnForXmlNull(); - } - } - - /** - * Returns the value of the 'Discriminator Type' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType}. - * - *

    - * If the meaning of the 'Discriminator Type' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Type' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see #setDiscriminatorType(DiscriminatorType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIDiscriminatorColumn_DiscriminatorType() - * @model - * @generated - */ - public DiscriminatorType getDiscriminatorType() { - return discriminatorType; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getDiscriminatorType Discriminator Type}' attribute. - * - * - * @param value the new value of the 'Discriminator Type' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see #getDiscriminatorType() - * @generated - */ - public void setDiscriminatorTypeGen(DiscriminatorType newDiscriminatorType) { - DiscriminatorType oldDiscriminatorType = discriminatorType; - discriminatorType = newDiscriminatorType == null ? DISCRIMINATOR_TYPE_EDEFAULT : newDiscriminatorType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, oldDiscriminatorType, discriminatorType)); - } - - public void setDiscriminatorType(DiscriminatorType newDiscriminatorType) { - setDiscriminatorTypeGen(newDiscriminatorType); - if (newDiscriminatorType != DISCRIMINATOR_TYPE_EDEFAULT) { - entity().makeDiscriminatorColumnForXmlNonNull(); - } - setDiscriminatorTypeForXml(newDiscriminatorType); - if (isAllFeaturesUnset()) { - entity().makeDiscriminatorColumnForXmlNull(); - } - } - - public void setColumnDefinition(String newColumnDefinition) { - setColumnDefinitionGen(newColumnDefinition); - if (newColumnDefinition != COLUMN_DEFINITION_EDEFAULT) { - entity().makeDiscriminatorColumnForXmlNonNull(); - } - setColumnDefinitionForXml(newColumnDefinition); - if (isAllFeaturesUnset()) { - entity().makeDiscriminatorColumnForXmlNull(); - } - } - - /** - * Returns the value of the 'Default Length' attribute. - * The default value is "31". - * - *

    - * If the meaning of the 'Default Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Length' attribute. - * @see #setDefaultLength(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIDiscriminatorColumn_DefaultLength() - * @model default="31" - * @generated - */ - public int getDefaultLength() { - return defaultLength; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getDefaultLength Default Length}' attribute. - * - * - * @param value the new value of the 'Default Length' attribute. - * @see #getDefaultLength() - * @generated - */ - public void setDefaultLength(int newDefaultLength) { - int oldDefaultLength = defaultLength; - defaultLength = newDefaultLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH, oldDefaultLength, defaultLength)); - } - - /** - * Returns the value of the 'Specified Length' attribute. - * The default value is "-1". - * - *

    - * If the meaning of the 'Specified Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Length' attribute. - * @see #setSpecifiedLength(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIDiscriminatorColumn_SpecifiedLength() - * @model default="-1" - * @generated - */ - public int getSpecifiedLength() { - return specifiedLength; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn#getSpecifiedLength Specified Length}' attribute. - * - * - * @param value the new value of the 'Specified Length' attribute. - * @see #getSpecifiedLength() - * @generated - */ - public void setSpecifiedLengthGen(int newSpecifiedLength) { - int oldSpecifiedLength = specifiedLength; - specifiedLength = newSpecifiedLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH, oldSpecifiedLength, specifiedLength)); - } - - public void setSpecifiedLength(int newSpecifiedLength) { - setSpecifiedLengthGen(newSpecifiedLength); - if (newSpecifiedLength != SPECIFIED_LENGTH_EDEFAULT) { - entity().makeDiscriminatorColumnForXmlNonNull(); - } - setSpecifiedLengthForXml(newSpecifiedLength); - if (isAllFeaturesUnset()) { - entity().makeDiscriminatorColumnForXmlNull(); - } - } - - public int getLength() { - return (this.specifiedLength != -1) ? this.specifiedLength : this.defaultLength; - } - - public DiscriminatorType getDiscriminatorTypeForXml() { - return getDiscriminatorType(); - } - - public void setDiscriminatorTypeForXml(DiscriminatorType newDiscriminatorTypeForXml) { - setDiscriminatorTypeGen(newDiscriminatorTypeForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML, null, newDiscriminatorTypeForXml)); - } - - public int getSpecifiedLengthForXml() { - return getSpecifiedLength(); - } - - public void setSpecifiedLengthForXml(int newSpecifiedLengthForXml) { - setSpecifiedLengthGen(newSpecifiedLengthForXml); - if (eNotificationRequired()) - //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML, -1, newSpecifiedLengthForXml)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return getDiscriminatorType(); - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return new Integer(getDefaultLength()); - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return new Integer(getSpecifiedLength()); - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH : - return new Integer(getLength()); - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML : - return getDiscriminatorTypeForXml(); - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML : - return new Integer(getSpecifiedLengthForXml()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - setDiscriminatorType((DiscriminatorType) newValue); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - setDefaultLength(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - setSpecifiedLength(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML : - setDiscriminatorTypeForXml((DiscriminatorType) newValue); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML : - setSpecifiedLengthForXml(((Integer) newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - setDefaultLength(DEFAULT_LENGTH_EDEFAULT); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - setSpecifiedLength(SPECIFIED_LENGTH_EDEFAULT); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML : - setDiscriminatorTypeForXml(DISCRIMINATOR_TYPE_FOR_XML_EDEFAULT); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML : - setSpecifiedLengthForXml(SPECIFIED_LENGTH_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return defaultLength != DEFAULT_LENGTH_EDEFAULT; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return specifiedLength != SPECIFIED_LENGTH_EDEFAULT; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH : - return getLength() != LENGTH_EDEFAULT; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE_FOR_XML : - return getDiscriminatorTypeForXml() != DISCRIMINATOR_TYPE_FOR_XML_EDEFAULT; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH_FOR_XML : - return getSpecifiedLengthForXml() != SPECIFIED_LENGTH_FOR_XML_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IDiscriminatorColumn.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH : - return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__LENGTH; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IDiscriminatorColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : - return OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH : - return OrmPackage.XML_DISCRIMINATOR_COLUMN__DEFAULT_LENGTH; - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH : - return OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH; - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__LENGTH : - return OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (discriminatorType: "); - result.append(discriminatorType); - result.append(", defaultLength: "); - result.append(defaultLength); - result.append(", specifiedLength: "); - result.append(specifiedLength); - result.append(')'); - return result.toString(); - } - - private XmlEntityInternal entity() { - return (XmlEntityInternal) eContainer(); - } - - @Override - protected String tableName() { - return this.getOwner().getTypeMapping().getTableName(); - } - - /** - * Call this when the table tag is removed from the xml, - * need to make sure all the model attributes are set to the default - */ - protected void unsetAllAttributes() { - eUnset(OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_LENGTH); - eUnset(OrmPackage.XML_DISCRIMINATOR_COLUMN__SPECIFIED_NAME); - eUnset(OrmPackage.XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION); - eUnset(OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddable.java deleted file mode 100644 index 79f87f3a14..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddable.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Iterator; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -/** - * - * A representation of the model object 'Xml Embeddable'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddable() - * @model kind="class" - * @generated - */ -public class XmlEmbeddable extends XmlTypeMapping implements IEmbeddable -{ - /** - * - * - * @generated - */ - protected XmlEmbeddable() { - super(); - } - - public String getKey() { - return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_EMBEDDABLE; - } - - public boolean tableNameIsInvalid(String tableName) { - return false; - } - - public Iterator associatedTableNamesIncludingInherited() { - // TODO Auto-generated method stub - return EmptyIterator.instance(); - } - - public Iterator associatedTables() { - // TODO Auto-generated method stub - return EmptyIterator.instance(); - } - - public Iterator associatedTablesIncludingInherited() { - // TODO Auto-generated method stub - return EmptyIterator.instance(); - } - - @Override - public int xmlSequence() { - return 2; - } - - @Override - public boolean attributeMappingKeyAllowed(String attributeMappingKey) { - return attributeMappingKey == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || attributeMappingKey == IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddableProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddableProvider.java deleted file mode 100644 index e6956df26c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddableProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - - -public class XmlEmbeddableProvider implements IXmlTypeMappingProvider -{ - - public XmlTypeMapping buildTypeMapping() { - return OrmFactory.eINSTANCE.createXmlEmbeddable(); - } - - public String key() { - return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java deleted file mode 100644 index 1e0d2f6c3f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java +++ /dev/null @@ -1,381 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EObjectEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Xml Embedded'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbedded() - * @model kind="class" - * @generated - */ -public class XmlEmbedded extends XmlAttributeMapping implements IEmbedded -{ - /** - * The cached value of the '{@link #getSpecifiedAttributeOverrides() Specified Attribute Overrides}' containment reference list. - * - * - * @see #getSpecifiedAttributeOverrides() - * @generated - * @ordered - */ - protected EList specifiedAttributeOverrides; - - /** - * The cached value of the '{@link #getDefaultAttributeOverrides() Default Attribute Overrides}' containment reference list. - * - * - * @see #getDefaultAttributeOverrides() - * @generated - * @ordered - */ - protected EList defaultAttributeOverrides; - - private IEmbeddable embeddable; - - /** - * - * - * @generated - */ - protected XmlEmbedded() { - super(); - } - - @Override - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIds.add(OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES); - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlEmbeddedMapping(this); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_EMBEDDED; - } - - public EList getAttributeOverrides() { - EList list = new EObjectEList(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES); - list.addAll(getSpecifiedAttributeOverrides()); - list.addAll(getDefaultAttributeOverrides()); - return list; - } - - /** - * Returns the value of the 'Specified Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Specified Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEmbedded_SpecifiedAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getSpecifiedAttributeOverrides() { - if (specifiedAttributeOverrides == null) { - specifiedAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES); - } - return specifiedAttributeOverrides; - } - - /** - * Returns the value of the 'Default Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Default Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEmbedded_DefaultAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getDefaultAttributeOverrides() { - if (defaultAttributeOverrides == null) { - defaultAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES); - } - return defaultAttributeOverrides; - } - - public IEmbeddable embeddable() { - return this.embeddable; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES : - return ((InternalEList) getAttributeOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getSpecifiedAttributeOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getDefaultAttributeOverrides()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES : - return getAttributeOverrides(); - case OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return getSpecifiedAttributeOverrides(); - case OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return getDefaultAttributeOverrides(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - getSpecifiedAttributeOverrides().addAll((Collection) newValue); - return; - case OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - getDefaultAttributeOverrides().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - return; - case OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES : - return !getAttributeOverrides().isEmpty(); - case OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return specifiedAttributeOverrides != null && !specifiedAttributeOverrides.isEmpty(); - case OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return defaultAttributeOverrides != null && !defaultAttributeOverrides.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IEmbedded.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IEMBEDDED__ATTRIBUTE_OVERRIDES; - case OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES; - case OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IEmbedded.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IEMBEDDED__ATTRIBUTE_OVERRIDES : - return OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - return OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - return OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - @Override - public int xmlSequence() { - return 7; - } - - public String getKey() { - return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } - - public IAttributeOverride attributeOverrideNamed(String name) { - return (IAttributeOverride) overrideNamed(name, getAttributeOverrides()); - } - - public boolean containsAttributeOverride(String name) { - return containsOverride(name, getAttributeOverrides()); - } - - public boolean containsSpecifiedAttributeOverride(String name) { - return containsOverride(name, getSpecifiedAttributeOverrides()); - } - - private IOverride overrideNamed(String name, List overrides) { - for (IOverride override : overrides) { - String overrideName = override.getName(); - if (overrideName == null && name == null) { - return override; - } - if (overrideName != null && overrideName.equals(name)) { - return override; - } - } - return null; - } - - private boolean containsOverride(String name, List overrides) { - return overrideNamed(name, overrides) != null; - } - - public Iterator allOverridableAttributeNames() { - return new TransformationIterator(this.allOverridableAttributes()) { - @Override - protected String transform(IPersistentAttribute attribute) { - return attribute.getName(); - } - }; - } - - public Iterator allOverridableAttributes() { - if (this.embeddable() == null) { - return EmptyIterator.instance(); - } - return new FilteringIterator(this.embeddable().getPersistentType().attributes()) { - @Override - protected boolean accept(Object o) { - return ((IPersistentAttribute) o).isOverridableAttribute(); - } - }; - } - - public IAttributeOverride createAttributeOverride(int index) { - return OrmFactory.eINSTANCE.createXmlAttributeOverride(new AttributeOverrideOwner(this)); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - refreshEmbeddable(defaultsContext); - } - - private void refreshEmbeddable(DefaultsContext defaultsContext) { - this.embeddable = embeddableFor(getPersistentAttribute().getAttribute(), defaultsContext); - } - - //******* static methods ********* - public static IEmbeddable embeddableFor(Attribute attribute, DefaultsContext defaultsContext) { - if (attribute == null) { - return null; - } - String resolvedTypeName = attribute.resolvedTypeName(); - if (resolvedTypeName == null) { - return null; - } - IPersistentType persistentType = defaultsContext.persistentType(resolvedTypeName); - if (persistentType != null) { - if (persistentType.getMapping() instanceof IEmbeddable) { - return (IEmbeddable) persistentType.getMapping(); - } - } - return null; - } -} // XmlEmbedded diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java deleted file mode 100644 index 0cf1d64b91..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; - -/** - * - * A representation of the model object 'Xml Embedded Id'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddedId() - * @model kind="class" - * @generated - */ -public class XmlEmbeddedId extends XmlAttributeMapping implements IEmbeddedId -{ - /** - * - * - * @generated - */ - protected XmlEmbeddedId() { - super(); - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlEmbeddedIdMapping(this); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_EMBEDDED_ID; - } - - @Override - public int xmlSequence() { - return 0; - } - - public String getKey() { - return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public boolean isIdMapping() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedIdProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedIdProvider.java deleted file mode 100644 index 3327620b6a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedIdProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlEmbeddedIdProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlEmbeddedIdProvider INSTANCE = new XmlEmbeddedIdProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlEmbeddedIdProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlEmbeddedId(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedProvider.java deleted file mode 100644 index a2423e70d0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlEmbeddedProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlEmbeddedProvider INSTANCE = new XmlEmbeddedProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlEmbeddedProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlEmbedded(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntity.java deleted file mode 100644 index 7f88ec7fbb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntity.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; - -/** - * - * A representation of the model object 'Xml Entity'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlEntity#getSecondaryTables Secondary Tables}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlEntity#getVirtualSecondaryTables Virtual Secondary Tables}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface XmlEntity extends IEntity -{ - /** - * Returns the value of the 'Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

    - * If the meaning of the 'Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity_SecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getSecondaryTables(); - - /** - * Returns the value of the 'Virtual Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

    - * If the meaning of the 'Virtual Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Virtual Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity_VirtualSecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" - * @generated - */ - EList getVirtualSecondaryTables(); -} // XmlEntity diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityForXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityForXml.java deleted file mode 100644 index 20578b091d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityForXml.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Xml Entity For Xml'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml Table For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml Discriminator Column For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getIdClassForXml Id Class For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getInheritanceForXml Inheritance For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface XmlEntityForXml extends EObject -{ - /** - * Returns the value of the 'Table For Xml' reference. - * - *

    - * If the meaning of the 'Table For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table For Xml' reference. - * @see #setTableForXml(XmlTable) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_TableForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - XmlTable getTableForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml Table For Xml}' reference. - * - * - * @param value the new value of the 'Table For Xml' reference. - * @see #getTableForXml() - * @generated - */ - void setTableForXml(XmlTable value); - - /** - * Returns the value of the 'Discriminator Column For Xml' reference. - * - *

    - * If the meaning of the 'Discriminator Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Column For Xml' reference. - * @see #setDiscriminatorColumnForXml(XmlDiscriminatorColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_DiscriminatorColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - XmlDiscriminatorColumn getDiscriminatorColumnForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml Discriminator Column For Xml}' reference. - * - * - * @param value the new value of the 'Discriminator Column For Xml' reference. - * @see #getDiscriminatorColumnForXml() - * @generated - */ - void setDiscriminatorColumnForXml(XmlDiscriminatorColumn value); - - /** - * Returns the value of the 'Id Class For Xml' containment reference. - * - *

    - * If the meaning of the 'Id Class For Xml' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class For Xml' containment reference. - * @see #setIdClassForXml(XmlIdClass) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_IdClassForXml() - * @model containment="true" - * @generated - */ - XmlIdClass getIdClassForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getIdClassForXml Id Class For Xml}' containment reference. - * - * - * @param value the new value of the 'Id Class For Xml' containment reference. - * @see #getIdClassForXml() - * @generated - */ - void setIdClassForXml(XmlIdClass value); - - /** - * Returns the value of the 'Inheritance For Xml' containment reference. - * - *

    - * If the meaning of the 'Inheritance For Xml' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Inheritance For Xml' containment reference. - * @see #setInheritanceForXml(XmlInheritance) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_InheritanceForXml() - * @model containment="true" - * @generated - */ - XmlInheritance getInheritanceForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getInheritanceForXml Inheritance For Xml}' containment reference. - * - * - * @param value the new value of the 'Inheritance For Xml' containment reference. - * @see #getInheritanceForXml() - * @generated - */ - void setInheritanceForXml(XmlInheritance value); -} // XmlEntityForXml diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java deleted file mode 100644 index 6563159f26..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java +++ /dev/null @@ -1,2177 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -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.EObjectEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * An implementation of the model object 'Xml Entity'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityInternal() - * @model kind="class" - * @generated - */ -public class XmlEntityInternal extends XmlTypeMapping - implements XmlEntityForXml, XmlEntity -{ - /** - * The cached value of the '{@link #getIdClassForXml() Id Class For Xml}' containment reference. - * - * - * @see #getIdClassForXml() - * @generated - * @ordered - */ - protected XmlIdClass idClassForXml; - - /** - * The cached value of the '{@link #getInheritanceForXml() Inheritance For Xml}' containment reference. - * - * - * @see #getInheritanceForXml() - * @generated - * @ordered - */ - protected XmlInheritance inheritanceForXml; - - /** - * The default value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedName() Specified Name}' attribute. - * - * - * @see #getSpecifiedName() - * @generated - * @ordered - */ - protected String specifiedName = SPECIFIED_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected static final String DEFAULT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultName() Default Name}' attribute. - * - * - * @see #getDefaultName() - * @generated - * @ordered - */ - protected String defaultName = DEFAULT_NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getTable() Table}' containment reference. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected ITable table; - - /** - * The cached value of the '{@link #getSpecifiedSecondaryTables() Specified Secondary Tables}' containment reference list. - * - * - * @see #getSpecifiedSecondaryTables() - * @generated - * @ordered - */ - protected EList specifiedSecondaryTables; - - /** - * The cached value of the '{@link #getSpecifiedPrimaryKeyJoinColumns() Specified Primary Key Join Columns}' containment reference list. - * - * - * @see #getSpecifiedPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedPrimaryKeyJoinColumns; - - /** - * The cached value of the '{@link #getDefaultPrimaryKeyJoinColumns() Default Primary Key Join Columns}' containment reference list. - * - * - * @see #getDefaultPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList defaultPrimaryKeyJoinColumns; - - /** - * The default value of the '{@link #getInheritanceStrategy() Inheritance Strategy}' attribute. - * - * - * @see #getInheritanceStrategy() - * @generated - * @ordered - */ - protected static final InheritanceType INHERITANCE_STRATEGY_EDEFAULT = InheritanceType.DEFAULT; - - /** - * The cached value of the '{@link #getInheritanceStrategy() Inheritance Strategy}' attribute. - * - * - * @see #getInheritanceStrategy() - * @generated - * @ordered - */ - protected InheritanceType inheritanceStrategy = INHERITANCE_STRATEGY_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultDiscriminatorValue() Default Discriminator Value}' attribute. - * - * - * @see #getDefaultDiscriminatorValue() - * @generated - * @ordered - */ - protected static final String DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultDiscriminatorValue() Default Discriminator Value}' attribute. - * - * - * @see #getDefaultDiscriminatorValue() - * @generated - * @ordered - */ - protected String defaultDiscriminatorValue = DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedDiscriminatorValue() Specified Discriminator Value}' attribute. - * - * - * @see #getSpecifiedDiscriminatorValue() - * @generated - * @ordered - */ - protected static final String SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedDiscriminatorValue() Specified Discriminator Value}' attribute. - * - * - * @see #getSpecifiedDiscriminatorValue() - * @generated - * @ordered - */ - protected String specifiedDiscriminatorValue = SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getDiscriminatorValue() Discriminator Value}' attribute. - * - * - * @see #getDiscriminatorValue() - * @generated - * @ordered - */ - protected static final String DISCRIMINATOR_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDiscriminatorColumn() Discriminator Column}' containment reference. - * - * - * @see #getDiscriminatorColumn() - * @generated - * @ordered - */ - protected IDiscriminatorColumn discriminatorColumn; - - /** - * The cached value of the '{@link #getSequenceGenerator() Sequence Generator}' containment reference. - * - * - * @see #getSequenceGenerator() - * @generated - * @ordered - */ - protected ISequenceGenerator sequenceGenerator; - - /** - * The cached value of the '{@link #getTableGenerator() Table Generator}' containment reference. - * - * - * @see #getTableGenerator() - * @generated - * @ordered - */ - protected ITableGenerator tableGenerator; - - /** - * The cached value of the '{@link #getSpecifiedAttributeOverrides() Specified Attribute Overrides}' containment reference list. - * - * - * @see #getSpecifiedAttributeOverrides() - * @generated - * @ordered - */ - protected EList specifiedAttributeOverrides; - - /** - * The cached value of the '{@link #getDefaultAttributeOverrides() Default Attribute Overrides}' containment reference list. - * - * - * @see #getDefaultAttributeOverrides() - * @generated - * @ordered - */ - protected EList defaultAttributeOverrides; - - /** - * The cached value of the '{@link #getSpecifiedAssociationOverrides() Specified Association Overrides}' containment reference list. - * - * - * @see #getSpecifiedAssociationOverrides() - * @generated - * @ordered - */ - protected EList specifiedAssociationOverrides; - - /** - * The cached value of the '{@link #getDefaultAssociationOverrides() Default Association Overrides}' containment reference list. - * - * - * @see #getDefaultAssociationOverrides() - * @generated - * @ordered - */ - protected EList defaultAssociationOverrides; - - /** - * The cached value of the '{@link #getNamedQueries() Named Queries}' containment reference list. - * - * - * @see #getNamedQueries() - * @generated - * @ordered - */ - protected EList namedQueries; - - /** - * The cached value of the '{@link #getNamedNativeQueries() Named Native Queries}' containment reference list. - * - * - * @see #getNamedNativeQueries() - * @generated - * @ordered - */ - protected EList namedNativeQueries; - - /** - * The default value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected static final String ID_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected String idClass = ID_CLASS_EDEFAULT; - - /** - * The cached value of the '{@link #getVirtualSecondaryTables() Virtual Secondary Tables}' containment reference list. - * - * - * @see #getVirtualSecondaryTables() - * @generated - * @ordered - */ - protected EList virtualSecondaryTables; - - protected XmlEntityInternal() { - super(); - this.table = OrmFactory.eINSTANCE.createXmlTable(buildTableOwner()); - ((InternalEObject) this.table).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__TABLE, null, null); - this.discriminatorColumn = OrmFactory.eINSTANCE.createXmlDiscriminatorColumn(new IDiscriminatorColumn.Owner(this)); - ((InternalEObject) this.discriminatorColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN, null, null); - this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(0)); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - XmlEntityInternal.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - switch (notification.getFeatureID(IEntity.class)) { - case JpaCoreMappingsPackage.IENTITY__ID_CLASS : - idClassChanged(); - break; - case JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY : - inheritanceStrategyChanged(); - break; - default : - break; - } - switch (notification.getFeatureID(XmlEntityForXml.class)) { - case OrmPackage.XML_ENTITY_FOR_XML__ID_CLASS_FOR_XML : - xmlIdClassChanged(); - break; - case OrmPackage.XML_ENTITY_FOR_XML__INHERITANCE_FOR_XML : - xmlInheritanceChanged(); - break; - default : - break; - } - } - - protected void inheritanceStrategyChanged() { - if (getInheritanceStrategy() == InheritanceType.DEFAULT) { - setInheritanceForXml(null); - } - else { - if (getInheritanceForXml() == null) { - setInheritanceForXml(OrmFactory.eINSTANCE.createXmlInheritance()); - } - getInheritanceForXml().setStrategy(getInheritanceStrategy()); - } - } - - protected void xmlInheritanceChanged() { - if (getInheritanceForXml() == null) { - setInheritanceStrategy(null); - } - } - - @Override - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIds.add(OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES); - insignificantFeatureIds.add(OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES); - insignificantFeatureIds.add(OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES); - } - - private ITable.Owner buildTableOwner() { - return new ITable.Owner() { - public ITextRange validationTextRange() { - return XmlEntityInternal.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return XmlEntityInternal.this; - } - }; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ENTITY_INTERNAL; - } - - /** - * - * - * @generated NOT - */ - public String getName() { - return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName(); - } - - /** - * Returns the value of the 'Specified Name' attribute. - * - * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SpecifiedName() - * @model - * @generated - */ - public String getSpecifiedName() { - return specifiedName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - public void setSpecifiedName(String newSpecifiedName) { - String oldSpecifiedName = specifiedName; - specifiedName = newSpecifiedName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); - } - - /** - * Returns the value of the 'Default Name' attribute. - * - * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DefaultName() - * @model changeable="false" - * @generated - */ - public String getDefaultName() { - return defaultName; - } - - /** - * Returns the value of the 'Table' containment reference. - * - *

    - * If the meaning of the 'Table' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_Table() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public ITable getTable() { - return table; - } - - private XmlTable getTableInternal() { - return (XmlTable) getTable(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTable(ITable newTable, NotificationChain msgs) { - ITable oldTable = table; - table = newTable; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__TABLE, oldTable, newTable); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

    - * If the meaning of the 'Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity_SecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public EList getSecondaryTables() { - EList list = new EObjectEList(ISecondaryTable.class, this, OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES); - list.addAll(getSpecifiedSecondaryTables()); - list.addAll(getVirtualSecondaryTables()); - return list; - } - - /** - * Returns the value of the 'Virtual Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

    - * If the meaning of the 'Virtual Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Virtual Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity_VirtualSecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" - * @generated - */ - public EList getVirtualSecondaryTables() { - if (virtualSecondaryTables == null) { - virtualSecondaryTables = new EObjectContainmentEList(ISecondaryTable.class, this, OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES); - } - return virtualSecondaryTables; - } - - protected void xmlIdClassChanged() { - if (getIdClassForXml() == null) { - setIdClass(null); - } - } - - public boolean containsSecondaryTable(String name) { - return containsSecondaryTable(name, getSecondaryTables()); - } - - public boolean containsSpecifiedSecondaryTable(String name) { - return containsSecondaryTable(name, getSpecifiedSecondaryTables()); - } - - private boolean containsSecondaryTable(String name, List secondaryTables) { - for (ISecondaryTable secondaryTable : secondaryTables) { - String secondaryTableName = secondaryTable.getName(); - if (secondaryTableName != null && secondaryTableName.equals(name)) { - return true; - } - } - return false; - } - - /** - * Returns the value of the 'Specified Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

    - * If the meaning of the 'Specified Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SpecifiedSecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" - * @generated - */ - public EList getSpecifiedSecondaryTables() { - if (specifiedSecondaryTables == null) { - specifiedSecondaryTables = new EObjectContainmentEList(ISecondaryTable.class, this, OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES); - } - return specifiedSecondaryTables; - } - - /** - * Returns the value of the 'Inheritance Strategy' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.InheritanceType}. - * - *

    - * If the meaning of the 'Inheritance Strategy' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Inheritance Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #setInheritanceStrategy(InheritanceType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_InheritanceStrategy() - * @model - * @generated - */ - public InheritanceType getInheritanceStrategy() { - return inheritanceStrategy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getInheritanceStrategy Inheritance Strategy}' attribute. - * - * - * @param value the new value of the 'Inheritance Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #getInheritanceStrategy() - * @generated - */ - public void setInheritanceStrategy(InheritanceType newInheritanceStrategy) { - InheritanceType oldInheritanceStrategy = inheritanceStrategy; - inheritanceStrategy = newInheritanceStrategy == null ? INHERITANCE_STRATEGY_EDEFAULT : newInheritanceStrategy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY, oldInheritanceStrategy, inheritanceStrategy)); - } - - // public void setInheritanceStrategy(InheritanceType newInheritanceStrategy) { - // setInheritanceStrategyGen(newInheritanceStrategy); - // if (newInheritanceStrategy != INHERITANCE_STRATEGY_EDEFAULT) { - // //makeInheritanceForXmlNonNull(); - // } - // setInheritanceStrategyForXml(newInheritanceStrategy); - // if (isAllFeaturesUnset()) { - // //makeInheritanceForXmlNull(); - // } - // } - /** - * Returns the value of the 'Discriminator Column' containment reference. - * - *

    - * If the meaning of the 'Discriminator Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DiscriminatorColumn() - * @model containment="true" changeable="false" - * @generated - */ - public IDiscriminatorColumn getDiscriminatorColumn() { - return discriminatorColumn; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetDiscriminatorColumn(IDiscriminatorColumn newDiscriminatorColumn, NotificationChain msgs) { - IDiscriminatorColumn oldDiscriminatorColumn = discriminatorColumn; - discriminatorColumn = newDiscriminatorColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN, oldDiscriminatorColumn, newDiscriminatorColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Sequence Generator' containment reference. - * - *

    - * If the meaning of the 'Sequence Generator' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Sequence Generator' containment reference. - * @see #setSequenceGenerator(ISequenceGenerator) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SequenceGenerator() - * @model containment="true" - * @generated - */ - public ISequenceGenerator getSequenceGenerator() { - return sequenceGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSequenceGenerator(ISequenceGenerator newSequenceGenerator, NotificationChain msgs) { - ISequenceGenerator oldSequenceGenerator = sequenceGenerator; - sequenceGenerator = newSequenceGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getSequenceGenerator Sequence Generator}' containment reference. - * - * - * @param value the new value of the 'Sequence Generator' containment reference. - * @see #getSequenceGenerator() - * @generated - */ - public void setSequenceGenerator(ISequenceGenerator newSequenceGenerator) { - if (newSequenceGenerator != sequenceGenerator) { - NotificationChain msgs = null; - if (sequenceGenerator != null) - msgs = ((InternalEObject) sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR, null, msgs); - if (newSequenceGenerator != null) - msgs = ((InternalEObject) newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR, null, msgs); - msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator)); - } - - /** - * Returns the value of the 'Table Generator' containment reference. - * - *

    - * If the meaning of the 'Table Generator' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table Generator' containment reference. - * @see #setTableGenerator(ITableGenerator) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_TableGenerator() - * @model containment="true" - * @generated - */ - public ITableGenerator getTableGenerator() { - return tableGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTableGenerator(ITableGenerator newTableGenerator, NotificationChain msgs) { - ITableGenerator oldTableGenerator = tableGenerator; - tableGenerator = newTableGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR, oldTableGenerator, newTableGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getTableGenerator Table Generator}' containment reference. - * - * - * @param value the new value of the 'Table Generator' containment reference. - * @see #getTableGenerator() - * @generated - */ - public void setTableGenerator(ITableGenerator newTableGenerator) { - if (newTableGenerator != tableGenerator) { - NotificationChain msgs = null; - if (tableGenerator != null) - msgs = ((InternalEObject) tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR, null, msgs); - if (newTableGenerator != null) - msgs = ((InternalEObject) newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR, null, msgs); - msgs = basicSetTableGenerator(newTableGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR, newTableGenerator, newTableGenerator)); - } - - /** - * Returns the value of the 'Default Discriminator Value' attribute. - * - *

    - * If the meaning of the 'Default Discriminator Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Discriminator Value' attribute. - * @see #setDefaultDiscriminatorValue(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DefaultDiscriminatorValue() - * @model - * @generated - */ - public String getDefaultDiscriminatorValue() { - return defaultDiscriminatorValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getDefaultDiscriminatorValue Default Discriminator Value}' attribute. - * - * - * @param value the new value of the 'Default Discriminator Value' attribute. - * @see #getDefaultDiscriminatorValue() - * @generated - */ - public void setDefaultDiscriminatorValue(String newDefaultDiscriminatorValue) { - String oldDefaultDiscriminatorValue = defaultDiscriminatorValue; - defaultDiscriminatorValue = newDefaultDiscriminatorValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE, oldDefaultDiscriminatorValue, defaultDiscriminatorValue)); - } - - /** - * Returns the value of the 'Specified Discriminator Value' attribute. - * - *

    - * If the meaning of the 'Specified Discriminator Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Discriminator Value' attribute. - * @see #setSpecifiedDiscriminatorValue(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SpecifiedDiscriminatorValue() - * @model - * @generated - */ - public String getSpecifiedDiscriminatorValue() { - return specifiedDiscriminatorValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getSpecifiedDiscriminatorValue Specified Discriminator Value}' attribute. - * - * - * @param value the new value of the 'Specified Discriminator Value' attribute. - * @see #getSpecifiedDiscriminatorValue() - * @generated - */ - public void setSpecifiedDiscriminatorValue(String newSpecifiedDiscriminatorValue) { - String oldSpecifiedDiscriminatorValue = specifiedDiscriminatorValue; - specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE, oldSpecifiedDiscriminatorValue, specifiedDiscriminatorValue)); - } - - /** - * Returns the value of the 'Discriminator Value' attribute. - * - *

    - * If the meaning of the 'Discriminator Value' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Value' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DiscriminatorValue() - * @model transient="true" changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getDiscriminatorValue() { - return (this.getSpecifiedDiscriminatorValue() == null) ? getDefaultDiscriminatorValue() : this.getSpecifiedDiscriminatorValue(); - } - - public EList getPrimaryKeyJoinColumns() { - return this.getSpecifiedPrimaryKeyJoinColumns().isEmpty() ? this.getDefaultPrimaryKeyJoinColumns() : this.getSpecifiedPrimaryKeyJoinColumns(); - } - - /** - * Returns the value of the 'Specified Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Specified Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SpecifiedPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedPrimaryKeyJoinColumns() { - if (specifiedPrimaryKeyJoinColumns == null) { - specifiedPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS); - } - return specifiedPrimaryKeyJoinColumns; - } - - /** - * Returns the value of the 'Default Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Default Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DefaultPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getDefaultPrimaryKeyJoinColumns() { - if (defaultPrimaryKeyJoinColumns == null) { - defaultPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS); - } - return defaultPrimaryKeyJoinColumns; - } - - public EList getAttributeOverrides() { - EList list = new EObjectEList(IAttributeOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES); - list.addAll(getSpecifiedAttributeOverrides()); - list.addAll(getDefaultAttributeOverrides()); - return list; - } - - /** - * Returns the value of the 'Specified Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Specified Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SpecifiedAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getSpecifiedAttributeOverrides() { - if (specifiedAttributeOverrides == null) { - specifiedAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES); - } - return specifiedAttributeOverrides; - } - - /** - * Returns the value of the 'Default Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Default Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DefaultAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - public EList getDefaultAttributeOverrides() { - if (defaultAttributeOverrides == null) { - defaultAttributeOverrides = new EObjectContainmentEList(IAttributeOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES); - } - return defaultAttributeOverrides; - } - - public EList getAssociationOverrides() { - EList list = new EObjectEList(IAssociationOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES); - list.addAll(getSpecifiedAssociationOverrides()); - list.addAll(getDefaultAssociationOverrides()); - return list; - } - - /** - * Returns the value of the 'Specified Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

    - * If the meaning of the 'Specified Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_SpecifiedAssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" - * @generated - */ - public EList getSpecifiedAssociationOverrides() { - if (specifiedAssociationOverrides == null) { - specifiedAssociationOverrides = new EObjectContainmentEList(IAssociationOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES); - } - return specifiedAssociationOverrides; - } - - /** - * Returns the value of the 'Default Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

    - * If the meaning of the 'Default Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_DefaultAssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" - * @generated - */ - public EList getDefaultAssociationOverrides() { - if (defaultAssociationOverrides == null) { - defaultAssociationOverrides = new EObjectContainmentEList(IAssociationOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES); - } - return defaultAssociationOverrides; - } - - /** - * Returns the value of the 'Named Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.INamedQuery}. - * - *

    - * If the meaning of the 'Named Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Named Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_NamedQueries() - * @model type="org.eclipse.jpt.core.internal.mappings.INamedQuery" containment="true" - * @generated - */ - public EList getNamedQueries() { - if (namedQueries == null) { - namedQueries = new EObjectContainmentEList(INamedQuery.class, this, OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES); - } - return namedQueries; - } - - /** - * Returns the value of the 'Named Native Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery}. - * - *

    - * If the meaning of the 'Named Native Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Named Native Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_NamedNativeQueries() - * @model type="org.eclipse.jpt.core.internal.mappings.INamedNativeQuery" containment="true" - * @generated - */ - public EList getNamedNativeQueries() { - if (namedNativeQueries == null) { - namedNativeQueries = new EObjectContainmentEList(INamedNativeQuery.class, this, OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES); - } - return namedNativeQueries; - } - - /** - * Returns the value of the 'Id Class' attribute. - * - *

    - * If the meaning of the 'Id Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class' attribute. - * @see #setIdClass(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIEntity_IdClass() - * @model - * @generated - */ - public String getIdClass() { - return idClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getIdClass Id Class}' attribute. - * - * - * @param value the new value of the 'Id Class' attribute. - * @see #getIdClass() - * @generated - */ - public void setIdClass(String newIdClass) { - String oldIdClass = idClass; - idClass = newIdClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS, oldIdClass, idClass)); - } - - protected void idClassChanged() { - if (getIdClass() == null) { - setIdClassForXml(null); - } - else { - if (getIdClassForXml() == null) { - setIdClassForXml(OrmFactory.eINSTANCE.createXmlIdClass()); - } - getIdClassForXml().setValue(getIdClass()); - } - } - - public boolean discriminatorValueIsAllowed() { - Type type = getPersistentType().findType(); - return (type == null) ? false : !type.isAbstract(); - } - - public IEntity parentEntity() { - for (Iterator i = getPersistentType().inheritanceHierarchy(); i.hasNext();) { - ITypeMapping typeMapping = i.next().getMapping(); - if (typeMapping != this && typeMapping instanceof IEntity) { - return (IEntity) typeMapping; - } - } - return this; - } - - public IEntity rootEntity() { - IEntity rootEntity = null; - for (Iterator i = getPersistentType().inheritanceHierarchy(); i.hasNext();) { - IPersistentType persistentType = i.next(); - if (persistentType.getMapping() instanceof IEntity) { - rootEntity = (IEntity) persistentType.getMapping(); - } - } - return rootEntity; - } - - /** - * Returns the value of the 'Table For Xml' reference. - * - *

    - * If the meaning of the 'Table For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table For Xml' reference. - * @see #setTableForXml(XmlTable) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_TableForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public XmlTable getTableForXml() { - if (getTableInternal().isAllFeaturesUnset()) { - return null; - } - return getTableInternal(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getTableForXml Table For Xml}' reference. - * - * - * @param value the new value of the 'Table For Xml' reference. - * @see #getTableForXml() - * @generated NOT - */ - public void setTableForXmlGen(XmlTable newTableForXml) { - XmlTable oldValue = newTableForXml == null ? (XmlTable) getTable() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML, oldValue, newTableForXml)); - } - - public void setTableForXml(XmlTable newTableForXml) { - setTableForXmlGen(newTableForXml); - if (newTableForXml == null) { - getTableInternal().unsetAllAttributes(); - } - } - - /** - * Returns the value of the 'Discriminator Column For Xml' reference. - * - *

    - * If the meaning of the 'Discriminator Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Column For Xml' reference. - * @see #setDiscriminatorColumnForXml(XmlDiscriminatorColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_DiscriminatorColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public XmlDiscriminatorColumn getDiscriminatorColumnForXml() { - if (getDiscriminatorColumnInternal().isAllFeaturesUnset()) { - return null; - } - return getDiscriminatorColumnInternal(); - } - - private XmlDiscriminatorColumn getDiscriminatorColumnInternal() { - return (XmlDiscriminatorColumn) getDiscriminatorColumn(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getDiscriminatorColumnForXml Discriminator Column For Xml}' reference. - * - * - * @param value the new value of the 'Discriminator Column For Xml' reference. - * @see #getDiscriminatorColumnForXml() - * @generated NOT - */ - public void setDiscriminatorColumnForXmlGen(XmlDiscriminatorColumn newDiscriminatorColumnForXml) { - XmlDiscriminatorColumn oldValue = newDiscriminatorColumnForXml == null ? (XmlDiscriminatorColumn) getDiscriminatorColumn() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML, oldValue, newDiscriminatorColumnForXml)); - } - - public void setDiscriminatorColumnForXml(XmlDiscriminatorColumn newDiscriminatorColumnForXml) { - setDiscriminatorColumnForXmlGen(newDiscriminatorColumnForXml); - if (newDiscriminatorColumnForXml == null) { - getDiscriminatorColumnInternal().unsetAllAttributes(); - } - } - - /** - * Returns the value of the 'Id Class For Xml' containment reference. - * - *

    - * If the meaning of the 'Id Class For Xml' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class For Xml' containment reference. - * @see #setIdClassForXml(XmlIdClass) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_IdClassForXml() - * @model containment="true" - * @generated - */ - public XmlIdClass getIdClassForXml() { - return idClassForXml; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetIdClassForXml(XmlIdClass newIdClassForXml, NotificationChain msgs) { - XmlIdClass oldIdClassForXml = idClassForXml; - idClassForXml = newIdClassForXml; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML, oldIdClassForXml, newIdClassForXml); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getIdClassForXml Id Class For Xml}' containment reference. - * - * - * @param value the new value of the 'Id Class For Xml' containment reference. - * @see #getIdClassForXml() - * @generated - */ - public void setIdClassForXml(XmlIdClass newIdClassForXml) { - if (newIdClassForXml != idClassForXml) { - NotificationChain msgs = null; - if (idClassForXml != null) - msgs = ((InternalEObject) idClassForXml).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML, null, msgs); - if (newIdClassForXml != null) - msgs = ((InternalEObject) newIdClassForXml).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML, null, msgs); - msgs = basicSetIdClassForXml(newIdClassForXml, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML, newIdClassForXml, newIdClassForXml)); - } - - /** - * Returns the value of the 'Inheritance For Xml' containment reference. - * - *

    - * If the meaning of the 'Inheritance For Xml' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Inheritance For Xml' containment reference. - * @see #setInheritanceForXml(XmlInheritance) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml_InheritanceForXml() - * @model containment="true" - * @generated - */ - public XmlInheritance getInheritanceForXml() { - return inheritanceForXml; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetInheritanceForXml(XmlInheritance newInheritanceForXml, NotificationChain msgs) { - XmlInheritance oldInheritanceForXml = inheritanceForXml; - inheritanceForXml = newInheritanceForXml; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML, oldInheritanceForXml, newInheritanceForXml); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal#getInheritanceForXml Inheritance For Xml}' containment reference. - * - * - * @param value the new value of the 'Inheritance For Xml' containment reference. - * @see #getInheritanceForXml() - * @generated - */ - public void setInheritanceForXml(XmlInheritance newInheritanceForXml) { - if (newInheritanceForXml != inheritanceForXml) { - NotificationChain msgs = null; - if (inheritanceForXml != null) - msgs = ((InternalEObject) inheritanceForXml).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML, null, msgs); - if (newInheritanceForXml != null) - msgs = ((InternalEObject) newInheritanceForXml).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML, null, msgs); - msgs = basicSetInheritanceForXml(newInheritanceForXml, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML, newInheritanceForXml, newInheritanceForXml)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML : - return basicSetIdClassForXml(null, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML : - return basicSetInheritanceForXml(null, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__TABLE : - return basicSetTable(null, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES : - return ((InternalEList) getSpecifiedSecondaryTables()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getDefaultPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN : - return basicSetDiscriminatorColumn(null, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR : - return basicSetSequenceGenerator(null, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR : - return basicSetTableGenerator(null, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES : - return ((InternalEList) getAttributeOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getSpecifiedAttributeOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES : - return ((InternalEList) getDefaultAttributeOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES : - return ((InternalEList) getAssociationOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES : - return ((InternalEList) getSpecifiedAssociationOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES : - return ((InternalEList) getDefaultAssociationOverrides()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES : - return ((InternalEList) getNamedQueries()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES : - return ((InternalEList) getNamedNativeQueries()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES : - return ((InternalEList) getSecondaryTables()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES : - return ((InternalEList) getVirtualSecondaryTables()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - protected void setDefaultName(String newDefaultName) { - String oldDefaultName = this.defaultName; - this.defaultName = newDefaultName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_NAME, oldDefaultName, defaultName)); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_ENTITY_NAME_KEY)); - } - - public String getKey() { - return IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML : - return getTableForXml(); - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML : - return getDiscriminatorColumnForXml(); - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML : - return getIdClassForXml(); - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML : - return getInheritanceForXml(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME : - return getSpecifiedName(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_NAME : - return getDefaultName(); - case OrmPackage.XML_ENTITY_INTERNAL__TABLE : - return getTable(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES : - return getSpecifiedSecondaryTables(); - case OrmPackage.XML_ENTITY_INTERNAL__PRIMARY_KEY_JOIN_COLUMNS : - return getPrimaryKeyJoinColumns(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return getSpecifiedPrimaryKeyJoinColumns(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return getDefaultPrimaryKeyJoinColumns(); - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY : - return getInheritanceStrategy(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE : - return getDefaultDiscriminatorValue(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE : - return getSpecifiedDiscriminatorValue(); - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_VALUE : - return getDiscriminatorValue(); - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN : - return getDiscriminatorColumn(); - case OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR : - return getSequenceGenerator(); - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR : - return getTableGenerator(); - case OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES : - return getAttributeOverrides(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES : - return getSpecifiedAttributeOverrides(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES : - return getDefaultAttributeOverrides(); - case OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES : - return getAssociationOverrides(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES : - return getSpecifiedAssociationOverrides(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES : - return getDefaultAssociationOverrides(); - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES : - return getNamedQueries(); - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES : - return getNamedNativeQueries(); - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS : - return getIdClass(); - case OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES : - return getSecondaryTables(); - case OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES : - return getVirtualSecondaryTables(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML : - setTableForXml((XmlTable) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML : - setDiscriminatorColumnForXml((XmlDiscriminatorColumn) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML : - setIdClassForXml((XmlIdClass) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML : - setInheritanceForXml((XmlInheritance) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME : - setSpecifiedName((String) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES : - getSpecifiedSecondaryTables().clear(); - getSpecifiedSecondaryTables().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - getSpecifiedPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - getDefaultPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY : - setInheritanceStrategy((InheritanceType) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE : - setDefaultDiscriminatorValue((String) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE : - setSpecifiedDiscriminatorValue((String) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - getSpecifiedAttributeOverrides().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - getDefaultAttributeOverrides().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES : - getSpecifiedAssociationOverrides().clear(); - getSpecifiedAssociationOverrides().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES : - getDefaultAssociationOverrides().clear(); - getDefaultAssociationOverrides().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES : - getNamedQueries().clear(); - getNamedQueries().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES : - getNamedNativeQueries().clear(); - getNamedNativeQueries().addAll((Collection) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS : - setIdClass((String) newValue); - return; - case OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES : - getVirtualSecondaryTables().clear(); - getVirtualSecondaryTables().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML : - setTableForXml((XmlTable) null); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML : - setDiscriminatorColumnForXml((XmlDiscriminatorColumn) null); - return; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML : - setIdClassForXml((XmlIdClass) null); - return; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML : - setInheritanceForXml((XmlInheritance) null); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME : - setSpecifiedName(SPECIFIED_NAME_EDEFAULT); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES : - getSpecifiedSecondaryTables().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY : - setInheritanceStrategy(INHERITANCE_STRATEGY_EDEFAULT); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE : - setDefaultDiscriminatorValue(DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE : - setSpecifiedDiscriminatorValue(SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) null); - return; - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) null); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES : - getSpecifiedAttributeOverrides().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES : - getDefaultAttributeOverrides().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES : - getSpecifiedAssociationOverrides().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES : - getDefaultAssociationOverrides().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES : - getNamedQueries().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES : - getNamedNativeQueries().clear(); - return; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS : - setIdClass(ID_CLASS_EDEFAULT); - return; - case OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES : - getVirtualSecondaryTables().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML : - return getTableForXml() != null; - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML : - return getDiscriminatorColumnForXml() != null; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML : - return idClassForXml != null; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML : - return inheritanceForXml != null; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME : - return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_NAME : - return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); - case OrmPackage.XML_ENTITY_INTERNAL__TABLE : - return table != null; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES : - return specifiedSecondaryTables != null && !specifiedSecondaryTables.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__PRIMARY_KEY_JOIN_COLUMNS : - return !getPrimaryKeyJoinColumns().isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return specifiedPrimaryKeyJoinColumns != null && !specifiedPrimaryKeyJoinColumns.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return defaultPrimaryKeyJoinColumns != null && !defaultPrimaryKeyJoinColumns.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY : - return inheritanceStrategy != INHERITANCE_STRATEGY_EDEFAULT; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE : - return DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT == null ? defaultDiscriminatorValue != null : !DEFAULT_DISCRIMINATOR_VALUE_EDEFAULT.equals(defaultDiscriminatorValue); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE : - return SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT == null ? specifiedDiscriminatorValue != null : !SPECIFIED_DISCRIMINATOR_VALUE_EDEFAULT.equals(specifiedDiscriminatorValue); - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_VALUE : - return DISCRIMINATOR_VALUE_EDEFAULT == null ? getDiscriminatorValue() != null : !DISCRIMINATOR_VALUE_EDEFAULT.equals(getDiscriminatorValue()); - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN : - return discriminatorColumn != null; - case OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR : - return sequenceGenerator != null; - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR : - return tableGenerator != null; - case OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES : - return !getAttributeOverrides().isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES : - return specifiedAttributeOverrides != null && !specifiedAttributeOverrides.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES : - return defaultAttributeOverrides != null && !defaultAttributeOverrides.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES : - return !getAssociationOverrides().isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES : - return specifiedAssociationOverrides != null && !specifiedAssociationOverrides.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES : - return defaultAssociationOverrides != null && !defaultAssociationOverrides.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES : - return namedQueries != null && !namedQueries.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES : - return namedNativeQueries != null && !namedNativeQueries.isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS : - return ID_CLASS_EDEFAULT == null ? idClass != null : !ID_CLASS_EDEFAULT.equals(idClass); - case OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES : - return !getSecondaryTables().isEmpty(); - case OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES : - return virtualSecondaryTables != null && !virtualSecondaryTables.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == XmlEntityForXml.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML : - return OrmPackage.XML_ENTITY_FOR_XML__TABLE_FOR_XML; - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML : - return OrmPackage.XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML : - return OrmPackage.XML_ENTITY_FOR_XML__ID_CLASS_FOR_XML; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML : - return OrmPackage.XML_ENTITY_FOR_XML__INHERITANCE_FOR_XML; - default : - return -1; - } - } - if (baseClass == IEntity.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_NAME : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME; - case OrmPackage.XML_ENTITY_INTERNAL__TABLE : - return JpaCoreMappingsPackage.IENTITY__TABLE; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES; - case OrmPackage.XML_ENTITY_INTERNAL__PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IENTITY__PRIMARY_KEY_JOIN_COLUMNS; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - case OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY : - return JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE; - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_VALUE : - return JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_VALUE; - case OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN : - return JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_COLUMN; - case OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR : - return JpaCoreMappingsPackage.IENTITY__SEQUENCE_GENERATOR; - case OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR : - return JpaCoreMappingsPackage.IENTITY__TABLE_GENERATOR; - case OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__ATTRIBUTE_OVERRIDES; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES; - case OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__ASSOCIATION_OVERRIDES; - case OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES; - case OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES : - return JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES; - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES : - return JpaCoreMappingsPackage.IENTITY__NAMED_QUERIES; - case OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES : - return JpaCoreMappingsPackage.IENTITY__NAMED_NATIVE_QUERIES; - case OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS : - return JpaCoreMappingsPackage.IENTITY__ID_CLASS; - default : - return -1; - } - } - if (baseClass == XmlEntity.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES : - return OrmPackage.XML_ENTITY__SECONDARY_TABLES; - case OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES : - return OrmPackage.XML_ENTITY__VIRTUAL_SECONDARY_TABLES; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == XmlEntityForXml.class) { - switch (baseFeatureID) { - case OrmPackage.XML_ENTITY_FOR_XML__TABLE_FOR_XML : - return OrmPackage.XML_ENTITY_INTERNAL__TABLE_FOR_XML; - case OrmPackage.XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML : - return OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN_FOR_XML; - case OrmPackage.XML_ENTITY_FOR_XML__ID_CLASS_FOR_XML : - return OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS_FOR_XML; - case OrmPackage.XML_ENTITY_FOR_XML__INHERITANCE_FOR_XML : - return OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_FOR_XML; - default : - return -1; - } - } - if (baseClass == IEntity.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME : - return OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_NAME; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME : - return OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_NAME; - case JpaCoreMappingsPackage.IENTITY__TABLE : - return OrmPackage.XML_ENTITY_INTERNAL__TABLE; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES : - return OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_SECONDARY_TABLES; - case JpaCoreMappingsPackage.IENTITY__PRIMARY_KEY_JOIN_COLUMNS : - return OrmPackage.XML_ENTITY_INTERNAL__PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY : - return OrmPackage.XML_ENTITY_INTERNAL__INHERITANCE_STRATEGY; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE : - return OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_DISCRIMINATOR_VALUE; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE : - return OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_DISCRIMINATOR_VALUE; - case JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_VALUE : - return OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_VALUE; - case JpaCoreMappingsPackage.IENTITY__DISCRIMINATOR_COLUMN : - return OrmPackage.XML_ENTITY_INTERNAL__DISCRIMINATOR_COLUMN; - case JpaCoreMappingsPackage.IENTITY__SEQUENCE_GENERATOR : - return OrmPackage.XML_ENTITY_INTERNAL__SEQUENCE_GENERATOR; - case JpaCoreMappingsPackage.IENTITY__TABLE_GENERATOR : - return OrmPackage.XML_ENTITY_INTERNAL__TABLE_GENERATOR; - case JpaCoreMappingsPackage.IENTITY__ATTRIBUTE_OVERRIDES : - return OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - return OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - return OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ATTRIBUTE_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__ASSOCIATION_OVERRIDES : - return OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - return OrmPackage.XML_ENTITY_INTERNAL__SPECIFIED_ASSOCIATION_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - return OrmPackage.XML_ENTITY_INTERNAL__DEFAULT_ASSOCIATION_OVERRIDES; - case JpaCoreMappingsPackage.IENTITY__NAMED_QUERIES : - return OrmPackage.XML_ENTITY_INTERNAL__NAMED_QUERIES; - case JpaCoreMappingsPackage.IENTITY__NAMED_NATIVE_QUERIES : - return OrmPackage.XML_ENTITY_INTERNAL__NAMED_NATIVE_QUERIES; - case JpaCoreMappingsPackage.IENTITY__ID_CLASS : - return OrmPackage.XML_ENTITY_INTERNAL__ID_CLASS; - default : - return -1; - } - } - if (baseClass == XmlEntity.class) { - switch (baseFeatureID) { - case OrmPackage.XML_ENTITY__SECONDARY_TABLES : - return OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES; - case OrmPackage.XML_ENTITY__VIRTUAL_SECONDARY_TABLES : - return OrmPackage.XML_ENTITY_INTERNAL__VIRTUAL_SECONDARY_TABLES; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedName: "); - result.append(specifiedName); - result.append(", defaultName: "); - result.append(defaultName); - result.append(", inheritanceStrategy: "); - result.append(inheritanceStrategy); - result.append(", defaultDiscriminatorValue: "); - result.append(defaultDiscriminatorValue); - result.append(", specifiedDiscriminatorValue: "); - result.append(specifiedDiscriminatorValue); - result.append(", idClass: "); - result.append(idClass); - result.append(')'); - return result.toString(); - } - - @Override - public String getTableName() { - return getTable().getName(); - } - - public void makeTableForXmlNull() { - setTableForXmlGen(null); - } - - public void makeTableForXmlNonNull() { - setTableForXmlGen(getTableForXml()); - } - - public void makeDiscriminatorColumnForXmlNull() { - setDiscriminatorColumnForXmlGen(null); - } - - //um, this is an object on XmlInheritance, but a tag on entity in the xml, how to handle??? - public void makeDiscriminatorColumnForXmlNonNull() { - setDiscriminatorColumnForXmlGen(getDiscriminatorColumnForXml()); - } - - public String primaryKeyColumnName() { - String pkColumnName = null; - for (Iterator stream = getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute attribute = stream.next(); - String name = attribute.primaryKeyColumnName(); - if (pkColumnName == null) { - pkColumnName = name; - } - else if (name != null) { - // if we encounter a composite primary key, return null - return null; - } - } - // if we encounter only a single primary key column name, return it - return pkColumnName; - } - - public String primaryKeyAttributeName() { - String pkColumnName = null; - String pkAttributeName = null; - for (Iterator stream = getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute attribute = stream.next(); - String name = attribute.primaryKeyColumnName(); - if (pkColumnName == null) { - pkColumnName = name; - pkAttributeName = attribute.getName(); - } - else if (name != null) { - // if we encounter a composite primary key, return null - return null; - } - } - // if we encounter only a single primary key column name, return it - return pkAttributeName; - } - - public boolean tableNameIsInvalid(String tableName) { - return !CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName); - } - - private Iterator tableNames(Iterator tables) { - return new TransformationIterator(tables) { - @Override - protected Object transform(Object next) { - return ((ITable) next).getName(); - } - }; - } - - public Iterator associatedTableNamesIncludingInherited() { - return this.nonNullTableNames(this.associatedTablesIncludingInherited()); - } - - private Iterator nonNullTableNames(Iterator tables) { - return new FilteringIterator(this.tableNames(tables)) { - @Override - protected boolean accept(Object o) { - return o != null; - } - }; - } - - public Iterator associatedTables() { - return new CompositeIterator(this.getTable(), this.getSecondaryTables().iterator()); - } - - public Iterator associatedTablesIncludingInherited() { - return new CompositeIterator(new TransformationIterator(this.inheritanceHierarchy()) { - @Override - protected Object transform(Object next) { - return new FilteringIterator(((ITypeMapping) next).associatedTables()) { - @Override - protected boolean accept(Object o) { - return true; - //TODO - //filtering these out so as to avoid the duplicate table, root and children share the same table - //return !(o instanceof SingleTableInheritanceChildTableImpl); - } - }; - } - }); - } - - @Override - public Table primaryDbTable() { - return getTable().dbTable(); - } - - @Override - public Table dbTable(String tableName) { - for (Iterator stream = this.associatedTablesIncludingInherited(); stream.hasNext();) { - Table dbTable = stream.next().dbTable(); - if (dbTable != null && dbTable.matchesShortJavaClassName(tableName)) { - return dbTable; - } - } - return null; - } - - @Override - public Schema dbSchema() { - return getTable().dbSchema(); - } - - @Override - public int xmlSequence() { - return 1; - } - - /** - * Return an iterator of Entities, each which inherits from the one before, - * and terminates at the root entity (or at the point of cyclicity). - */ - private Iterator inheritanceHierarchy() { - return new TransformationIterator(getPersistentType().inheritanceHierarchy()) { - @Override - protected Object transform(Object next) { - return ((IPersistentType) next).getMapping(); - } - }; - //TODO once we support inheritance, which of these should we use?? - //return this.getInheritance().typeMappingLineage(); - } - - public Iterator allOverridableAttributeNames() { - return new CompositeIterator(new TransformationIterator(this.inheritanceHierarchy()) { - protected Object transform(Object next) { - return ((ITypeMapping) next).overridableAttributeNames(); - } - }); - } - - public Iterator allOverridableAssociationNames() { - return new CompositeIterator(new TransformationIterator(this.inheritanceHierarchy()) { - protected Object transform(Object next) { - return ((ITypeMapping) next).overridableAssociationNames(); - } - }); - } - - public IAttributeOverride createAttributeOverride(int index) { - return OrmFactory.eINSTANCE.createXmlAttributeOverride(new IEntity.AttributeOverrideOwner(this)); - } - - public IAssociationOverride createAssociationOverride(int index) { - return OrmFactory.eINSTANCE.createXmlAssociationOverride(new IEntity.AssociationOverrideOwner(this)); - } - - public IAttributeOverride attributeOverrideNamed(String name) { - return (IAttributeOverride) overrideNamed(name, getAttributeOverrides()); - } - - public boolean containsAttributeOverride(String name) { - return containsOverride(name, getAttributeOverrides()); - } - - public boolean containsSpecifiedAttributeOverride(String name) { - return containsOverride(name, getSpecifiedAttributeOverrides()); - } - - public boolean containsAssociationOverride(String name) { - return containsOverride(name, getAssociationOverrides()); - } - - public boolean containsSpecifiedAssociationOverride(String name) { - return containsOverride(name, getSpecifiedAssociationOverrides()); - } - - private IOverride overrideNamed(String name, List overrides) { - for (IOverride override : overrides) { - String overrideName = override.getName(); - if (overrideName == null && name == null) { - return override; - } - if (overrideName != null && overrideName.equals(name)) { - return override; - } - } - return null; - } - - private boolean containsOverride(String name, List overrides) { - return overrideNamed(name, overrides) != null; - } - - public ISecondaryTable createSecondaryTable(int index) { - return OrmFactory.eINSTANCE.createXmlSecondaryTable(buildSecondaryTableOwner()); - } - - private ITable.Owner buildSecondaryTableOwner() { - return new ITable.Owner() { - public ITextRange validationTextRange() { - return XmlEntityInternal.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return XmlEntityInternal.this; - } - }; - } - - public boolean containsSpecifiedPrimaryKeyJoinColumns() { - return !this.getSpecifiedPrimaryKeyJoinColumns().isEmpty(); - } - - public IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index) { - return OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn(new IEntity.PrimaryKeyJoinColumnOwner(this)); - } - - public INamedQuery createNamedQuery(int index) { - return OrmFactory.eINSTANCE.createXmlNamedQuery(); - } - - public INamedNativeQuery createNamedNativeQuery(int index) { - return OrmFactory.eINSTANCE.createXmlNamedNativeQuery(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityProvider.java deleted file mode 100644 index 05696fa549..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - - -public class XmlEntityProvider implements IXmlTypeMappingProvider -{ - public XmlTypeMapping buildTypeMapping() { - return OrmFactory.eINSTANCE.createXmlEntityInternal(); - } - - public String key() { - return IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGeneratedValue.java deleted file mode 100644 index f0aa80d772..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGeneratedValue.java +++ /dev/null @@ -1,297 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.GenerationType; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Xml Generated Value'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlGeneratedValue() - * @model kind="class" - * @generated - */ -public class XmlGeneratedValue extends XmlEObject implements IGeneratedValue -{ - /** - * The default value of the '{@link #getStrategy() Strategy}' attribute. - * - * - * @see #getStrategy() - * @generated - * @ordered - */ - protected static final GenerationType STRATEGY_EDEFAULT = GenerationType.DEFAULT; - - /** - * The cached value of the '{@link #getStrategy() Strategy}' attribute. - * - * - * @see #getStrategy() - * @generated - * @ordered - */ - protected GenerationType strategy = STRATEGY_EDEFAULT; - - /** - * The default value of the '{@link #getGenerator() Generator}' attribute. - * - * - * @see #getGenerator() - * @generated - * @ordered - */ - protected static final String GENERATOR_EDEFAULT = null; - - /** - * The cached value of the '{@link #getGenerator() Generator}' attribute. - * - * - * @see #getGenerator() - * @generated - * @ordered - */ - protected String generator = GENERATOR_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlGeneratedValue() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_GENERATED_VALUE; - } - - /** - * Returns the value of the 'Strategy' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.GenerationType}. - * - *

    - * If the meaning of the 'Strategy' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see #setStrategy(GenerationType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGeneratedValue_Strategy() - * @model - * @generated - */ - public GenerationType getStrategy() { - return strategy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue#getStrategy Strategy}' attribute. - * - * - * @param value the new value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see #getStrategy() - * @generated - */ - public void setStrategy(GenerationType newStrategy) { - GenerationType oldStrategy = strategy; - strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATED_VALUE__STRATEGY, oldStrategy, strategy)); - } - - /** - * Returns the value of the 'Generator' attribute. - * - *

    - * If the meaning of the 'Generator' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Generator' attribute. - * @see #setGenerator(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGeneratedValue_Generator() - * @model - * @generated - */ - public String getGenerator() { - return generator; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue#getGenerator Generator}' attribute. - * - * - * @param value the new value of the 'Generator' attribute. - * @see #getGenerator() - * @generated - */ - public void setGenerator(String newGenerator) { - String oldGenerator = generator; - generator = newGenerator; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATED_VALUE__GENERATOR, oldGenerator, generator)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_GENERATED_VALUE__STRATEGY : - return getStrategy(); - case OrmPackage.XML_GENERATED_VALUE__GENERATOR : - return getGenerator(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_GENERATED_VALUE__STRATEGY : - setStrategy((GenerationType) newValue); - return; - case OrmPackage.XML_GENERATED_VALUE__GENERATOR : - setGenerator((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_GENERATED_VALUE__STRATEGY : - setStrategy(STRATEGY_EDEFAULT); - return; - case OrmPackage.XML_GENERATED_VALUE__GENERATOR : - setGenerator(GENERATOR_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_GENERATED_VALUE__STRATEGY : - return strategy != STRATEGY_EDEFAULT; - case OrmPackage.XML_GENERATED_VALUE__GENERATOR : - return GENERATOR_EDEFAULT == null ? generator != null : !GENERATOR_EDEFAULT.equals(generator); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IGeneratedValue.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_GENERATED_VALUE__STRATEGY : - return JpaCoreMappingsPackage.IGENERATED_VALUE__STRATEGY; - case OrmPackage.XML_GENERATED_VALUE__GENERATOR : - return JpaCoreMappingsPackage.IGENERATED_VALUE__GENERATOR; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IGeneratedValue.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IGENERATED_VALUE__STRATEGY : - return OrmPackage.XML_GENERATED_VALUE__STRATEGY; - case JpaCoreMappingsPackage.IGENERATED_VALUE__GENERATOR : - return OrmPackage.XML_GENERATED_VALUE__GENERATOR; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (strategy: "); - result.append(strategy); - result.append(", generator: "); - result.append(generator); - result.append(')'); - return result.toString(); - } - - public ITextRange generatorTextRange() { - if (node == null) { - return ((XmlEObject) eContainer()).validationTextRange(); - } - IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.GENERATED_VALUE__GENERATOR); - return (nameNode == null) ? validationTextRange() : buildTextRange(nameNode); - } -} // XmlGeneratedValue diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGenerator.java deleted file mode 100644 index bdadaaa49a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGenerator.java +++ /dev/null @@ -1,490 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Generator'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlGenerator() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlGenerator extends XmlEObject implements IGenerator -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getInitialValue() Initial Value}' attribute. - * - * - * @see #getInitialValue() - * @generated - * @ordered - */ - protected static final int INITIAL_VALUE_EDEFAULT = 0; - - /** - * The default value of the '{@link #getSpecifiedInitialValue() Specified Initial Value}' attribute. - * - * - * @see #getSpecifiedInitialValue() - * @generated - * @ordered - */ - protected static final int SPECIFIED_INITIAL_VALUE_EDEFAULT = -1; - - /** - * The cached value of the '{@link #getSpecifiedInitialValue() Specified Initial Value}' attribute. - * - * - * @see #getSpecifiedInitialValue() - * @generated - * @ordered - */ - protected int specifiedInitialValue = SPECIFIED_INITIAL_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultInitialValue() Default Initial Value}' attribute. - * - * - * @see #getDefaultInitialValue() - * @generated - * @ordered - */ - protected static final int DEFAULT_INITIAL_VALUE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getDefaultInitialValue() Default Initial Value}' attribute. - * - * - * @see #getDefaultInitialValue() - * @generated - * @ordered - */ - protected int defaultInitialValue = DEFAULT_INITIAL_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getAllocationSize() Allocation Size}' attribute. - * - * - * @see #getAllocationSize() - * @generated - * @ordered - */ - protected static final int ALLOCATION_SIZE_EDEFAULT = 0; - - /** - * The default value of the '{@link #getSpecifiedAllocationSize() Specified Allocation Size}' attribute. - * - * - * @see #getSpecifiedAllocationSize() - * @generated - * @ordered - */ - protected static final int SPECIFIED_ALLOCATION_SIZE_EDEFAULT = -1; - - /** - * The cached value of the '{@link #getSpecifiedAllocationSize() Specified Allocation Size}' attribute. - * - * - * @see #getSpecifiedAllocationSize() - * @generated - * @ordered - */ - protected int specifiedAllocationSize = SPECIFIED_ALLOCATION_SIZE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultAllocationSize() Default Allocation Size}' attribute. - * - * - * @see #getDefaultAllocationSize() - * @generated - * @ordered - */ - protected static final int DEFAULT_ALLOCATION_SIZE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getDefaultAllocationSize() Default Allocation Size}' attribute. - * - * - * @see #getDefaultAllocationSize() - * @generated - * @ordered - */ - protected int defaultAllocationSize = DEFAULT_ALLOCATION_SIZE_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlGenerator() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_GENERATOR; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGenerator_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATOR__NAME, oldName, name)); - } - - public int getInitialValue() { - return (this.getSpecifiedInitialValue() == -1) ? this.getDefaultInitialValue() : this.getSpecifiedInitialValue(); - } - - /** - * Returns the value of the 'Specified Initial Value' attribute. - * The default value is "-1". - * - *

    - * If the meaning of the 'Specified Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Initial Value' attribute. - * @see #setSpecifiedInitialValue(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGenerator_SpecifiedInitialValue() - * @model default="-1" - * @generated - */ - public int getSpecifiedInitialValue() { - return specifiedInitialValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator#getSpecifiedInitialValue Specified Initial Value}' attribute. - * - * - * @param value the new value of the 'Specified Initial Value' attribute. - * @see #getSpecifiedInitialValue() - * @generated - */ - public void setSpecifiedInitialValue(int newSpecifiedInitialValue) { - int oldSpecifiedInitialValue = specifiedInitialValue; - specifiedInitialValue = newSpecifiedInitialValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE, oldSpecifiedInitialValue, specifiedInitialValue)); - } - - /** - * Returns the value of the 'Default Initial Value' attribute. - * - *

    - * If the meaning of the 'Default Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Initial Value' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGenerator_DefaultInitialValue() - * @model changeable="false" - * @generated - */ - public int getDefaultInitialValue() { - return defaultInitialValue; - } - - public int getAllocationSize() { - return (this.getSpecifiedAllocationSize() == -1) ? this.getDefaultAllocationSize() : this.getSpecifiedAllocationSize(); - } - - /** - * Returns the value of the 'Specified Allocation Size' attribute. - * The default value is "-1". - * - *

    - * If the meaning of the 'Specified Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Allocation Size' attribute. - * @see #setSpecifiedAllocationSize(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGenerator_SpecifiedAllocationSize() - * @model default="-1" - * @generated - */ - public int getSpecifiedAllocationSize() { - return specifiedAllocationSize; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator#getSpecifiedAllocationSize Specified Allocation Size}' attribute. - * - * - * @param value the new value of the 'Specified Allocation Size' attribute. - * @see #getSpecifiedAllocationSize() - * @generated - */ - public void setSpecifiedAllocationSize(int newSpecifiedAllocationSize) { - int oldSpecifiedAllocationSize = specifiedAllocationSize; - specifiedAllocationSize = newSpecifiedAllocationSize; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE, oldSpecifiedAllocationSize, specifiedAllocationSize)); - } - - /** - * Returns the value of the 'Default Allocation Size' attribute. - * - *

    - * If the meaning of the 'Default Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Allocation Size' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIGenerator_DefaultAllocationSize() - * @model changeable="false" - * @generated - */ - public int getDefaultAllocationSize() { - return defaultAllocationSize; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_GENERATOR__NAME : - return getName(); - case OrmPackage.XML_GENERATOR__INITIAL_VALUE : - return new Integer(getInitialValue()); - case OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE : - return new Integer(getSpecifiedInitialValue()); - case OrmPackage.XML_GENERATOR__DEFAULT_INITIAL_VALUE : - return new Integer(getDefaultInitialValue()); - case OrmPackage.XML_GENERATOR__ALLOCATION_SIZE : - return new Integer(getAllocationSize()); - case OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - return new Integer(getSpecifiedAllocationSize()); - case OrmPackage.XML_GENERATOR__DEFAULT_ALLOCATION_SIZE : - return new Integer(getDefaultAllocationSize()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_GENERATOR__NAME : - setName((String) newValue); - return; - case OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE : - setSpecifiedInitialValue(((Integer) newValue).intValue()); - return; - case OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - setSpecifiedAllocationSize(((Integer) newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_GENERATOR__NAME : - setName(NAME_EDEFAULT); - return; - case OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE : - setSpecifiedInitialValue(SPECIFIED_INITIAL_VALUE_EDEFAULT); - return; - case OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - setSpecifiedAllocationSize(SPECIFIED_ALLOCATION_SIZE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_GENERATOR__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case OrmPackage.XML_GENERATOR__INITIAL_VALUE : - return getInitialValue() != INITIAL_VALUE_EDEFAULT; - case OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE : - return specifiedInitialValue != SPECIFIED_INITIAL_VALUE_EDEFAULT; - case OrmPackage.XML_GENERATOR__DEFAULT_INITIAL_VALUE : - return defaultInitialValue != DEFAULT_INITIAL_VALUE_EDEFAULT; - case OrmPackage.XML_GENERATOR__ALLOCATION_SIZE : - return getAllocationSize() != ALLOCATION_SIZE_EDEFAULT; - case OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - return specifiedAllocationSize != SPECIFIED_ALLOCATION_SIZE_EDEFAULT; - case OrmPackage.XML_GENERATOR__DEFAULT_ALLOCATION_SIZE : - return defaultAllocationSize != DEFAULT_ALLOCATION_SIZE_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IGenerator.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_GENERATOR__NAME : - return JpaCoreMappingsPackage.IGENERATOR__NAME; - case OrmPackage.XML_GENERATOR__INITIAL_VALUE : - return JpaCoreMappingsPackage.IGENERATOR__INITIAL_VALUE; - case OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE : - return JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_INITIAL_VALUE; - case OrmPackage.XML_GENERATOR__DEFAULT_INITIAL_VALUE : - return JpaCoreMappingsPackage.IGENERATOR__DEFAULT_INITIAL_VALUE; - case OrmPackage.XML_GENERATOR__ALLOCATION_SIZE : - return JpaCoreMappingsPackage.IGENERATOR__ALLOCATION_SIZE; - case OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE : - return JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_ALLOCATION_SIZE; - case OrmPackage.XML_GENERATOR__DEFAULT_ALLOCATION_SIZE : - return JpaCoreMappingsPackage.IGENERATOR__DEFAULT_ALLOCATION_SIZE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IGenerator.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IGENERATOR__NAME : - return OrmPackage.XML_GENERATOR__NAME; - case JpaCoreMappingsPackage.IGENERATOR__INITIAL_VALUE : - return OrmPackage.XML_GENERATOR__INITIAL_VALUE; - case JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_INITIAL_VALUE : - return OrmPackage.XML_GENERATOR__SPECIFIED_INITIAL_VALUE; - case JpaCoreMappingsPackage.IGENERATOR__DEFAULT_INITIAL_VALUE : - return OrmPackage.XML_GENERATOR__DEFAULT_INITIAL_VALUE; - case JpaCoreMappingsPackage.IGENERATOR__ALLOCATION_SIZE : - return OrmPackage.XML_GENERATOR__ALLOCATION_SIZE; - case JpaCoreMappingsPackage.IGENERATOR__SPECIFIED_ALLOCATION_SIZE : - return OrmPackage.XML_GENERATOR__SPECIFIED_ALLOCATION_SIZE; - case JpaCoreMappingsPackage.IGENERATOR__DEFAULT_ALLOCATION_SIZE : - return OrmPackage.XML_GENERATOR__DEFAULT_ALLOCATION_SIZE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", specifiedInitialValue: "); - result.append(specifiedInitialValue); - result.append(", defaultInitialValue: "); - result.append(defaultInitialValue); - result.append(", specifiedAllocationSize: "); - result.append(specifiedAllocationSize); - result.append(", defaultAllocationSize: "); - result.append(defaultAllocationSize); - result.append(')'); - return result.toString(); - } -} // XmlGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java deleted file mode 100644 index b45ab2960c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java +++ /dev/null @@ -1,682 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; - -/** - * - * A representation of the model object 'Xml Id'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlId() - * @model kind="class" - * @generated - */ -public class XmlId extends XmlAttributeMapping - implements IId, IXmlColumnMapping -{ - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - /** - * The cached value of the '{@link #getGeneratedValue() Generated Value}' containment reference. - * - * - * @see #getGeneratedValue() - * @generated - * @ordered - */ - protected IGeneratedValue generatedValue; - - /** - * The default value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected static final TemporalType TEMPORAL_EDEFAULT = TemporalType.NULL; - - /** - * The cached value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected TemporalType temporal = TEMPORAL_EDEFAULT; - - /** - * The cached value of the '{@link #getTableGenerator() Table Generator}' containment reference. - * - * - * @see #getTableGenerator() - * @generated - * @ordered - */ - protected ITableGenerator tableGenerator; - - /** - * The cached value of the '{@link #getSequenceGenerator() Sequence Generator}' containment reference. - * - * - * @see #getSequenceGenerator() - * @generated - * @ordered - */ - protected ISequenceGenerator sequenceGenerator; - - /** - * - * - * @generated NOT - */ - protected XmlId() { - super(); - this.column = OrmFactory.eINSTANCE.createXmlColumn(buildOwner()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__COLUMN, null, null); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ID; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIId_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Generated Value' containment reference. - * - *

    - * If the meaning of the 'Generated Value' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Generated Value' containment reference. - * @see #setGeneratedValue(IGeneratedValue) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIId_GeneratedValue() - * @model containment="true" - * @generated - */ - public IGeneratedValue getGeneratedValue() { - return generatedValue; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetGeneratedValue(IGeneratedValue newGeneratedValue, NotificationChain msgs) { - IGeneratedValue oldGeneratedValue = generatedValue; - generatedValue = newGeneratedValue; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__GENERATED_VALUE, oldGeneratedValue, newGeneratedValue); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId#getGeneratedValue Generated Value}' containment reference. - * - * - * @param value the new value of the 'Generated Value' containment reference. - * @see #getGeneratedValue() - * @generated - */ - public void setGeneratedValue(IGeneratedValue newGeneratedValue) { - if (newGeneratedValue != generatedValue) { - NotificationChain msgs = null; - if (generatedValue != null) - msgs = ((InternalEObject) generatedValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__GENERATED_VALUE, null, msgs); - if (newGeneratedValue != null) - msgs = ((InternalEObject) newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__GENERATED_VALUE, null, msgs); - msgs = basicSetGeneratedValue(newGeneratedValue, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__GENERATED_VALUE, newGeneratedValue, newGeneratedValue)); - } - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

    - * If the meaning of the 'Temporal' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIId_Temporal() - * @model - * @generated - */ - public TemporalType getTemporal() { - return temporal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - public void setTemporal(TemporalType newTemporal) { - TemporalType oldTemporal = temporal; - temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__TEMPORAL, oldTemporal, temporal)); - } - - /** - * Returns the value of the 'Table Generator' containment reference. - * - *

    - * If the meaning of the 'Table Generator' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table Generator' containment reference. - * @see #setTableGenerator(ITableGenerator) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIId_TableGenerator() - * @model containment="true" - * @generated - */ - public ITableGenerator getTableGenerator() { - return tableGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTableGenerator(ITableGenerator newTableGenerator, NotificationChain msgs) { - ITableGenerator oldTableGenerator = tableGenerator; - tableGenerator = newTableGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__TABLE_GENERATOR, oldTableGenerator, newTableGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId#getTableGenerator Table Generator}' containment reference. - * - * - * @param value the new value of the 'Table Generator' containment reference. - * @see #getTableGenerator() - * @generated - */ - public void setTableGenerator(ITableGenerator newTableGenerator) { - if (newTableGenerator != tableGenerator) { - NotificationChain msgs = null; - if (tableGenerator != null) - msgs = ((InternalEObject) tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__TABLE_GENERATOR, null, msgs); - if (newTableGenerator != null) - msgs = ((InternalEObject) newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__TABLE_GENERATOR, null, msgs); - msgs = basicSetTableGenerator(newTableGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__TABLE_GENERATOR, newTableGenerator, newTableGenerator)); - } - - /** - * Returns the value of the 'Sequence Generator' containment reference. - * - *

    - * If the meaning of the 'Sequence Generator' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Sequence Generator' containment reference. - * @see #setSequenceGenerator(ISequenceGenerator) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIId_SequenceGenerator() - * @model containment="true" - * @generated - */ - public ISequenceGenerator getSequenceGenerator() { - return sequenceGenerator; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSequenceGenerator(ISequenceGenerator newSequenceGenerator, NotificationChain msgs) { - ISequenceGenerator oldSequenceGenerator = sequenceGenerator; - sequenceGenerator = newSequenceGenerator; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId#getSequenceGenerator Sequence Generator}' containment reference. - * - * - * @param value the new value of the 'Sequence Generator' containment reference. - * @see #getSequenceGenerator() - * @generated - */ - public void setSequenceGenerator(ISequenceGenerator newSequenceGenerator) { - if (newSequenceGenerator != sequenceGenerator) { - NotificationChain msgs = null; - if (sequenceGenerator != null) - msgs = ((InternalEObject) sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__SEQUENCE_GENERATOR, null, msgs); - if (newSequenceGenerator != null) - msgs = ((InternalEObject) newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__SEQUENCE_GENERATOR, null, msgs); - msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator)); - } - - /** - * Returns the value of the 'Column For Xml' reference. - * - *

    - * If the meaning of the 'Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column For Xml' reference. - * @see #setColumnForXml(XmlColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping_ColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public XmlColumn getColumnForXml() { - if (((XmlColumn) getColumn()).isAllFeaturesUnset()) { - return null; - } - return (XmlColumn) getColumn(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId#getColumnForXml Column For Xml}' reference. - * - * - * @param value the new value of the 'Column For Xml' reference. - * @see #getColumnForXml() - * @generated NOT - */ - public void setColumnForXmlGen(XmlColumn newColumnForXml) { - XmlColumn oldValue = newColumnForXml == null ? (XmlColumn) getColumn() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__COLUMN_FOR_XML, oldValue, newColumnForXml)); - } - - public void setColumnForXml(XmlColumn newColumnForXml) { - setColumnForXmlGen(newColumnForXml); - if (newColumnForXml == null) { - ((XmlColumn) getColumn()).unsetAllAttributes(); - } - } - - public void makeColumnForXmlNonNull() { - setColumnForXmlGen(getColumnForXml()); - } - - public void makeColumnForXmlNull() { - setColumnForXmlGen(null); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ID__COLUMN : - return basicSetColumn(null, msgs); - case OrmPackage.XML_ID__GENERATED_VALUE : - return basicSetGeneratedValue(null, msgs); - case OrmPackage.XML_ID__TABLE_GENERATOR : - return basicSetTableGenerator(null, msgs); - case OrmPackage.XML_ID__SEQUENCE_GENERATOR : - return basicSetSequenceGenerator(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ID__COLUMN : - return getColumn(); - case OrmPackage.XML_ID__GENERATED_VALUE : - return getGeneratedValue(); - case OrmPackage.XML_ID__TEMPORAL : - return getTemporal(); - case OrmPackage.XML_ID__TABLE_GENERATOR : - return getTableGenerator(); - case OrmPackage.XML_ID__SEQUENCE_GENERATOR : - return getSequenceGenerator(); - case OrmPackage.XML_ID__COLUMN_FOR_XML : - return getColumnForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ID__GENERATED_VALUE : - setGeneratedValue((IGeneratedValue) newValue); - return; - case OrmPackage.XML_ID__TEMPORAL : - setTemporal((TemporalType) newValue); - return; - case OrmPackage.XML_ID__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) newValue); - return; - case OrmPackage.XML_ID__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) newValue); - return; - case OrmPackage.XML_ID__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ID__GENERATED_VALUE : - setGeneratedValue((IGeneratedValue) null); - return; - case OrmPackage.XML_ID__TEMPORAL : - setTemporal(TEMPORAL_EDEFAULT); - return; - case OrmPackage.XML_ID__TABLE_GENERATOR : - setTableGenerator((ITableGenerator) null); - return; - case OrmPackage.XML_ID__SEQUENCE_GENERATOR : - setSequenceGenerator((ISequenceGenerator) null); - return; - case OrmPackage.XML_ID__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ID__COLUMN : - return column != null; - case OrmPackage.XML_ID__GENERATED_VALUE : - return generatedValue != null; - case OrmPackage.XML_ID__TEMPORAL : - return temporal != TEMPORAL_EDEFAULT; - case OrmPackage.XML_ID__TABLE_GENERATOR : - return tableGenerator != null; - case OrmPackage.XML_ID__SEQUENCE_GENERATOR : - return sequenceGenerator != null; - case OrmPackage.XML_ID__COLUMN_FOR_XML : - return getColumnForXml() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IId.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ID__COLUMN : - return JpaCoreMappingsPackage.IID__COLUMN; - case OrmPackage.XML_ID__GENERATED_VALUE : - return JpaCoreMappingsPackage.IID__GENERATED_VALUE; - case OrmPackage.XML_ID__TEMPORAL : - return JpaCoreMappingsPackage.IID__TEMPORAL; - case OrmPackage.XML_ID__TABLE_GENERATOR : - return JpaCoreMappingsPackage.IID__TABLE_GENERATOR; - case OrmPackage.XML_ID__SEQUENCE_GENERATOR : - return JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ID__COLUMN_FOR_XML : - return OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IId.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IID__COLUMN : - return OrmPackage.XML_ID__COLUMN; - case JpaCoreMappingsPackage.IID__GENERATED_VALUE : - return OrmPackage.XML_ID__GENERATED_VALUE; - case JpaCoreMappingsPackage.IID__TEMPORAL : - return OrmPackage.XML_ID__TEMPORAL; - case JpaCoreMappingsPackage.IID__TABLE_GENERATOR : - return OrmPackage.XML_ID__TABLE_GENERATOR; - case JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR : - return OrmPackage.XML_ID__SEQUENCE_GENERATOR; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (baseFeatureID) { - case OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML : - return OrmPackage.XML_ID__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (temporal: "); - result.append(temporal); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY; - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlIdMapping(this); - } - - @Override - public void initializeFromXmlBasicMapping(XmlBasic oldMapping) { - super.initializeFromXmlBasicMapping(oldMapping); - setTemporal(oldMapping.getTemporal()); - } - - @Override - public int xmlSequence() { - return 0; - } - - public String primaryKeyColumnName() { - return this.getColumn().getName(); - } - - public IGeneratedValue createGeneratedValue() { - return OrmFactory.eINSTANCE.createXmlGeneratedValue(); - } - - public ISequenceGenerator createSequenceGenerator() { - return OrmFactory.eINSTANCE.createXmlSequenceGenerator(); - } - - public ITableGenerator createTableGenerator() { - return OrmFactory.eINSTANCE.createXmlTableGenerator(); - } - - @Override - public boolean isOverridableAttributeMapping() { - return true; - } - - @Override - public boolean isIdMapping() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java deleted file mode 100644 index 84025b6c24..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * This class is purely used to hack around a problem with the translators and representing - * the IEntity.idClass feature in the xml. Added this object to correspend to the - * id-class type in the xml since the translator path approach caused the id-class element - * to be added even when the idClass was null. This occurred when you added a new persistent - * type to the orm.xml via the structure view. - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass#getValue Value}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlIdClass() - * @model kind="class" - * @generated - */ -public class XmlIdClass extends XmlEObject -{ - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = ""; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - protected XmlIdClass() { - super(); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - XmlIdClass.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - switch (notification.getFeatureID(XmlIdClass.class)) { - case OrmPackage.XML_ID_CLASS__VALUE : - valueChanged(); - break; - default : - break; - } - } - - private Owner owner() { - return (Owner) eContainer(); - } - - protected void valueChanged() { - owner().setIdClass(getValue()); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ID_CLASS; - } - - /** - * Returns the value of the 'Value' attribute. - * The default value is "". - * - *

    - * If the meaning of the 'Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlIdClass_Value() - * @model default="" - * @generated - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_CLASS__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ID_CLASS__VALUE : - return getValue(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ID_CLASS__VALUE : - setValue((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ID_CLASS__VALUE : - setValue(VALUE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ID_CLASS__VALUE : - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (value: "); - result.append(value); - result.append(')'); - return result.toString(); - } - - - public interface Owner - { - void setIdClass(String idClass); - } -} // XmlIdClass diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdProvider.java deleted file mode 100644 index aaf75f91c0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlIdProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlIdProvider INSTANCE = new XmlIdProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlIdProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlId(); - } - - public String key() { - return IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlInheritance.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlInheritance.java deleted file mode 100644 index 6e06610ee6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlInheritance.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; - -/** - * - * This class is purely used to hack around a problem with the translators and representing - * the IEntity.inheritanceStrategy feature in the xml. Added this object to correspend to the - * inheritance type in the xml since the translator path approach caused the inheritance element - * to be added even when the strategy was default was null. This occurred when you added a new persistent - * type to the orm.xml via the structure view. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance#getStrategy Strategy}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlInheritance() - * @model kind="class" - * @generated - */ -public class XmlInheritance extends XmlEObject -{ - /** - * The default value of the '{@link #getStrategy() Strategy}' attribute. - * - * - * @see #getStrategy() - * @generated - * @ordered - */ - protected static final InheritanceType STRATEGY_EDEFAULT = InheritanceType.DEFAULT; - - /** - * The cached value of the '{@link #getStrategy() Strategy}' attribute. - * - * - * @see #getStrategy() - * @generated - * @ordered - */ - protected InheritanceType strategy = STRATEGY_EDEFAULT; - - protected XmlInheritance() { - super(); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - XmlInheritance.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - switch (notification.getFeatureID(XmlInheritance.class)) { - case OrmPackage.XML_INHERITANCE__STRATEGY : - strategyChanged(); - break; - default : - break; - } - } - - private XmlEntityInternal xmlEntity() { - return (XmlEntityInternal) eContainer(); - } - - protected void strategyChanged() { - xmlEntity().setInheritanceStrategy(getStrategy()); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_INHERITANCE; - } - - /** - * Returns the value of the 'Strategy' attribute. - * The default value is "". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.InheritanceType}. - * - *

    - * If the meaning of the 'Strategy' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #setStrategy(InheritanceType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlInheritance_Strategy() - * @model default="" - * @generated - */ - public InheritanceType getStrategy() { - return strategy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance#getStrategy Strategy}' attribute. - * - * - * @param value the new value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #getStrategy() - * @generated - */ - public void setStrategy(InheritanceType newStrategy) { - InheritanceType oldStrategy = strategy; - strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_INHERITANCE__STRATEGY, oldStrategy, strategy)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_INHERITANCE__STRATEGY : - return getStrategy(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_INHERITANCE__STRATEGY : - setStrategy((InheritanceType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_INHERITANCE__STRATEGY : - setStrategy(STRATEGY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_INHERITANCE__STRATEGY : - return strategy != STRATEGY_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (strategy: "); - result.append(strategy); - result.append(')'); - return result.toString(); - } -} // XmlInheritance diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinColumn.java deleted file mode 100644 index 97ba34651b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinColumn.java +++ /dev/null @@ -1,457 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Xml Join Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn#getSpecifiedReferencedColumnNameForXml Specified Referenced Column Name For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinColumn() - * @model kind="class" - * @generated - */ -public class XmlJoinColumn extends AbstractXmlColumn implements IJoinColumn -{ - /** - * The default value of the '{@link #getReferencedColumnName() Referenced Column Name}' attribute. - * - * - * @see #getReferencedColumnName() - * @generated - * @ordered - */ - protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected String specifiedReferencedColumnName = SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected String defaultReferencedColumnName = DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedReferencedColumnNameForXml() Specified Referenced Column Name For Xml}' attribute. - * - * - * @see #getSpecifiedReferencedColumnNameForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT = null; - - /** - * - * - * @generated NOT - */ - protected XmlJoinColumn() { - throw new UnsupportedOperationException(); - } - - protected XmlJoinColumn(IJoinColumn.Owner owner) { - super(owner); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_JOIN_COLUMN; - } - - /** - * Returns the value of the 'Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinColumn_ReferencedColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getReferencedColumnName() { - return (this.getSpecifiedReferencedColumnName() == null) ? getDefaultReferencedColumnName() : this.getSpecifiedReferencedColumnName(); - } - - /** - * Returns the value of the 'Specified Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Referenced Column Name' attribute. - * @see #setSpecifiedReferencedColumnName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractJoinColumn_SpecifiedReferencedColumnName() - * @model - * @generated - */ - public String getSpecifiedReferencedColumnName() { - return specifiedReferencedColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name' attribute. - * @see #getSpecifiedReferencedColumnName() - * @generated - */ - public void setSpecifiedReferencedColumnNameGen(String newSpecifiedReferencedColumnName) { - String oldSpecifiedReferencedColumnName = specifiedReferencedColumnName; - specifiedReferencedColumnName = newSpecifiedReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME, oldSpecifiedReferencedColumnName, specifiedReferencedColumnName)); - } - - public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) { - setSpecifiedReferencedColumnNameGen(newSpecifiedReferencedColumnName); - setSpecifiedReferencedColumnNameForXml(newSpecifiedReferencedColumnName); - } - - /** - * Returns the value of the 'Default Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Default Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractJoinColumn_DefaultReferencedColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultReferencedColumnName() { - return defaultReferencedColumnName; - } - - protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) { - String oldDefaultReferencedColumnName = this.defaultReferencedColumnName; - this.defaultReferencedColumnName = newDefaultReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME, oldDefaultReferencedColumnName, newDefaultReferencedColumnName)); - } - - /** - * Returns the value of the 'Specified Referenced Column Name For Xml' attribute. - * - *

    - * If the meaning of the 'Specified Referenced Column Name For Xml' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Referenced Column Name For Xml' attribute. - * @see #setSpecifiedReferencedColumnNameForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinColumn_SpecifiedReferencedColumnNameForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSpecifiedReferencedColumnNameForXml() { - return getSpecifiedReferencedColumnName(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn#getSpecifiedReferencedColumnNameForXml Specified Referenced Column Name For Xml}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name For Xml' attribute. - * @see #getSpecifiedReferencedColumnNameForXml() - * @generated NOT - */ - public void setSpecifiedReferencedColumnNameForXml(String newSpecifiedReferencedColumnNameForXml) { - setSpecifiedReferencedColumnNameGen(newSpecifiedReferencedColumnNameForXml); - if (eNotificationRequired()) - //make sure oldValue different from newValue because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML, newSpecifiedReferencedColumnNameForXml + " ", newSpecifiedReferencedColumnNameForXml)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return getReferencedColumnName(); - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return getSpecifiedReferencedColumnName(); - case OrmPackage.XML_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return getDefaultReferencedColumnName(); - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - return getSpecifiedReferencedColumnNameForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName((String) newValue); - return; - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - setSpecifiedReferencedColumnNameForXml((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName(SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT); - return; - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - setSpecifiedReferencedColumnNameForXml(SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return REFERENCED_COLUMN_NAME_EDEFAULT == null ? getReferencedColumnName() != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(getReferencedColumnName()); - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT == null ? specifiedReferencedColumnName != null : !SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT.equals(specifiedReferencedColumnName); - case OrmPackage.XML_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT == null ? defaultReferencedColumnName != null : !DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT.equals(defaultReferencedColumnName); - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - return SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT == null ? getSpecifiedReferencedColumnNameForXml() != null : !SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT.equals(getSpecifiedReferencedColumnNameForXml()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case OrmPackage.XML_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IJoinColumn.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return OrmPackage.XML_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return OrmPackage.XML_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IJoinColumn.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedReferencedColumnName: "); - result.append(specifiedReferencedColumnName); - result.append(", defaultReferencedColumnName: "); - result.append(defaultReferencedColumnName); - result.append(')'); - return result.toString(); - } - - public void setSpecifiedName(String newSpecifiedName) { - setSpecifiedNameGen(newSpecifiedName); - setSpecifiedNameForXml(newSpecifiedName); - } - - public void setUnique(DefaultFalseBoolean newUnique) { - setUniqueGen(newUnique); - setUniqueForXml(newUnique); - } - - public void setNullable(DefaultTrueBoolean newNullable) { - setNullableGen(newNullable); - setNullableForXml(newNullable); - } - - public void setInsertable(DefaultTrueBoolean newInsertable) { - setInsertableGen(newInsertable); - setInsertableForXml(newInsertable); - } - - public void setUpdatable(DefaultTrueBoolean newUpdatable) { - setUpdatableGen(newUpdatable); - setUpdatableForXml(newUpdatable); - } - - public void setColumnDefinition(String newColumnDefinition) { - setColumnDefinitionGen(newColumnDefinition); - setColumnDefinitionForXml(newColumnDefinition); - } - - public void setSpecifiedTable(String newSpecifiedTable) { - setSpecifiedTableGen(newSpecifiedTable); - setSpecifiedTableForXml(newSpecifiedTable); - } - - public IJoinColumn.Owner getOwner() { - return (IJoinColumn.Owner) this.owner; - } - - public Table dbReferencedColumnTable() { - return getOwner().dbReferencedColumnTable(); - } - - public Column dbReferencedColumn() { - Table table = dbReferencedColumnTable(); - return (table == null) ? null : table.columnNamed(getReferencedColumnName()); - } - - public boolean isReferencedColumnResolved() { - return dbReferencedColumn() != null; - } - - public ITextRange referencedColumnNameTextRange() { - if (node == null) { - return owner.validationTextRange(); - } - IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.REFERENCED_COLUMN_NAME); - return (referencedColumnNameNode == null) ? validationTextRange() : buildTextRange(referencedColumnNameNode); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultReferencedColumnName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY)); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_NAME_KEY)); - setDefaultTable((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_TABLE_KEY)); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java deleted file mode 100644 index bc63a52579..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java +++ /dev/null @@ -1,511 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import java.util.Set; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - * A representation of the model object 'Xml Join Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlJoinTable() - * @model kind="class" - * @generated - */ -public class XmlJoinTable extends AbstractXmlTable implements IJoinTable -{ - /** - * The cached value of the '{@link #getSpecifiedJoinColumns() Specified Join Columns}' containment reference list. - * - * - * @see #getSpecifiedJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedJoinColumns; - - /** - * The cached value of the '{@link #getDefaultJoinColumns() Default Join Columns}' containment reference list. - * - * - * @see #getDefaultJoinColumns() - * @generated - * @ordered - */ - protected EList defaultJoinColumns; - - /** - * The cached value of the '{@link #getSpecifiedInverseJoinColumns() Specified Inverse Join Columns}' containment reference list. - * - * - * @see #getSpecifiedInverseJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedInverseJoinColumns; - - /** - * The cached value of the '{@link #getDefaultInverseJoinColumns() Default Inverse Join Columns}' containment reference list. - * - * - * @see #getDefaultInverseJoinColumns() - * @generated - * @ordered - */ - protected EList defaultInverseJoinColumns; - - /** - * - * - * @generated NOT - */ - protected XmlJoinTable() { - throw new UnsupportedOperationException(); - } - - protected XmlJoinTable(IJoinTable.Owner owner) { - super(owner); - this.getDefaultJoinColumns().add(this.createJoinColumn(new JoinColumnOwner(this))); - this.getDefaultInverseJoinColumns().add(this.createJoinColumn(new InverseJoinColumnOwner(this))); - this.eAdapters().add(this.buildListener()); - } - - @Override - protected void addInsignificantXmlFeatureIdsTo(Set insignificantXmlFeatureIds) { - super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_JOIN_COLUMNS); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IJOIN_TABLE__JOIN_COLUMNS); - insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IJOIN_TABLE__INVERSE_JOIN_COLUMNS); - } - - private IJoinColumn createJoinColumn(IJoinColumn.Owner owner) { - return OrmFactory.eINSTANCE.createXmlJoinColumn(owner); - } - - private Adapter buildListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - XmlJoinTable.this.notifyChanged(notification); - } - }; - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - void notifyChanged(Notification notification) { - switch (notification.getFeatureID(IJoinTable.class)) { - case JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_JOIN_COLUMNS : - defaultJoinColumnsChanged(notification); - break; - case JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - defaultInverseJoinColumnsChanged(notification); - break; - default : - break; - } - } - - void defaultJoinColumnsChanged(Notification notification) { - throw new IllegalStateException("'defaultJoinColumns' cannot be changed"); - } - - void defaultInverseJoinColumnsChanged(Notification notification) { - throw new IllegalStateException("'defaultInverseJoinColumns' cannot be changed"); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_JOIN_TABLE; - } - - /** - * Returns the value of the 'Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinTable_JoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public EList getJoinColumns() { - return this.getSpecifiedJoinColumns().isEmpty() ? this.getDefaultJoinColumns() : this.getSpecifiedJoinColumns(); - } - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinTable_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedJoinColumns() { - if (specifiedJoinColumns == null) { - specifiedJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS); - } - return specifiedJoinColumns; - } - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinTable_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultJoinColumns() { - if (defaultJoinColumns == null) { - defaultJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS); - } - return defaultJoinColumns; - } - - /** - * Returns the value of the 'Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinTable_InverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public EList getInverseJoinColumns() { - return this.getSpecifiedInverseJoinColumns().isEmpty() ? this.getDefaultInverseJoinColumns() : this.getSpecifiedInverseJoinColumns(); - } - - /** - * Returns the value of the 'Specified Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinTable_SpecifiedInverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedInverseJoinColumns() { - if (specifiedInverseJoinColumns == null) { - specifiedInverseJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS); - } - return specifiedInverseJoinColumns; - } - - /** - * Returns the value of the 'Default Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJoinTable_DefaultInverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultInverseJoinColumns() { - if (defaultInverseJoinColumns == null) { - defaultInverseJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS); - } - return defaultInverseJoinColumns; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS : - return ((InternalEList) getJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return ((InternalEList) getDefaultJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return ((InternalEList) getInverseJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedInverseJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return ((InternalEList) getDefaultInverseJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS : - return getJoinColumns(); - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return getSpecifiedJoinColumns(); - case OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return getDefaultJoinColumns(); - case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return getInverseJoinColumns(); - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return getSpecifiedInverseJoinColumns(); - case OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return getDefaultInverseJoinColumns(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - getSpecifiedJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - getDefaultJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - getSpecifiedInverseJoinColumns().clear(); - getSpecifiedInverseJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - getDefaultInverseJoinColumns().clear(); - getDefaultInverseJoinColumns().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - return; - case OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - return; - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - getSpecifiedInverseJoinColumns().clear(); - return; - case OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - getDefaultInverseJoinColumns().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS : - return !getJoinColumns().isEmpty(); - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return specifiedJoinColumns != null && !specifiedJoinColumns.isEmpty(); - case OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return defaultJoinColumns != null && !defaultJoinColumns.isEmpty(); - case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return !getInverseJoinColumns().isEmpty(); - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return specifiedInverseJoinColumns != null && !specifiedInverseJoinColumns.isEmpty(); - case OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return defaultInverseJoinColumns != null && !defaultInverseJoinColumns.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJoinTable.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__JOIN_COLUMNS; - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS; - case OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_JOIN_COLUMNS; - case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__INVERSE_JOIN_COLUMNS; - case OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS; - case OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJoinTable.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IJOIN_TABLE__JOIN_COLUMNS : - return OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS : - return OrmPackage.XML_JOIN_TABLE__SPECIFIED_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_JOIN_COLUMNS : - return OrmPackage.XML_JOIN_TABLE__DEFAULT_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__INVERSE_JOIN_COLUMNS : - return OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS : - return OrmPackage.XML_JOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS; - case JpaCoreMappingsPackage.IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS : - return OrmPackage.XML_JOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - private XmlMultiRelationshipMappingInternal getMultiRelationshipMapping() { - return (XmlMultiRelationshipMappingInternal) eContainer(); - } - - @Override - protected void makeTableForXmlNonNull() { - getMultiRelationshipMapping().makeJoinTableForXmlNonNull(); - } - - @Override - protected void makeTableForXmlNull() { - getMultiRelationshipMapping().makeJoinTableForXmlNull(); - } - - // ********** IJoinTable implementation ********** - public IJoinColumn createJoinColumn(int index) { - return this.createXmlJoinColumn(index); - } - - private XmlJoinColumn createXmlJoinColumn(int index) { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new JoinColumnOwner(this)); - //return XmlJoinColumn.createJoinTableJoinColumn(new JoinColumnOwner(), this.getMember(), index); - } - - public IJoinColumn createInverseJoinColumn(int index) { - return this.createXmlInverseJoinColumn(index); - } - - private XmlJoinColumn createXmlInverseJoinColumn(int index) { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new InverseJoinColumnOwner(this)); - //return JavaJoinColumn.createJoinTableInverseJoinColumn(new InverseJoinColumnOwner(), this.getMember(), index); - } - - public boolean containsSpecifiedJoinColumns() { - return !this.getSpecifiedJoinColumns().isEmpty(); - } - - public boolean containsSpecifiedInverseJoinColumns() { - return !this.getSpecifiedInverseJoinColumns().isEmpty(); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_TABLE_NAME_KEY)); - } - - public boolean isSpecified() { - return node != null; - } - - public IRelationshipMapping relationshipMapping() { - return (IRelationshipMapping) this.eContainer(); - } -} // XmlJoinTable diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToMany.java deleted file mode 100644 index 183e112595..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToMany.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; - -/** - * - * A representation of the model object 'Xml Many To Many'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToMany() - * @model kind="class" - * @generated - */ -public class XmlManyToMany extends XmlMultiRelationshipMappingInternal - implements IManyToMany -{ - /** - * - * - * @generated - */ - protected XmlManyToMany() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_MANY_TO_MANY; - } - - public String getKey() { - return IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlManyToManyMapping(this); - } - - @Override - public int xmlSequence() { - return 6; - } - - // ********** INonOwningMapping implementation ********** - public boolean mappedByIsValid(IAttributeMapping mappedByMapping) { - String mappedByKey = mappedByMapping.getKey(); - return (mappedByKey == IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToManyProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToManyProvider.java deleted file mode 100644 index 2ddab39dac..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToManyProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlManyToManyProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlManyToManyProvider INSTANCE = new XmlManyToManyProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlManyToManyProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlManyToMany(); - } - - public String key() { - return IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java deleted file mode 100644 index 244e45f066..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; - -/** - * - * A representation of the model object 'Xml Many To One'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToOne() - * @model kind="class" - * @generated - */ -public class XmlManyToOne extends XmlSingleRelationshipMapping - implements IManyToOne -{ - /** - * - * - * @generated - */ - protected XmlManyToOne() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_MANY_TO_ONE; - } - - @Override - public int xmlSequence() { - return 3; - } - - public String getKey() { - return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlManyToOneMapping(this); - } - - @Override - public boolean isOverridableAssociationMapping() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOneProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOneProvider.java deleted file mode 100644 index 6c23d15ed9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOneProvider.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlManyToOneProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlManyToOneProvider INSTANCE = new XmlManyToOneProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlManyToOneProvider() { - super(); - } - - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlManyToOne(); - } - - public String key() { - return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMapKey.java deleted file mode 100644 index c2a9fa38ff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMapKey.java +++ /dev/null @@ -1,209 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * This class is purely used to hack around a problem with the translators and representing - * the IMultiRelationshipMapping.mapKey feature in the xml. Added this object to correspend to the - * map-key type in the xml since the translator path approach caused the map-key element - * to be added even when the mapKey String was null. This occurred when you added a new 1-m or m-m - * mapping to the orm.xml via the structure view. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey#getName Name}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMapKey() - * @model kind="class" - * @generated - */ -public class XmlMapKey extends XmlEObject -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - protected XmlMapKey() { - super(); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - XmlMapKey.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - switch (notification.getFeatureID(XmlMapKey.class)) { - case OrmPackage.XML_MAP_KEY__NAME : - nameChanged(); - break; - default : - break; - } - } - - private XmlMultiRelationshipMapping xmlMultiRelationshipMapping() { - return (XmlMultiRelationshipMapping) eContainer(); - } - - protected void nameChanged() { - xmlMultiRelationshipMapping().setMapKey(getName()); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_MAP_KEY; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMapKey_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAP_KEY__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_MAP_KEY__NAME : - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_MAP_KEY__NAME : - setName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_MAP_KEY__NAME : - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_MAP_KEY__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @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(); - } -} // XmlMapKey diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java deleted file mode 100644 index 7340896db3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java +++ /dev/null @@ -1,422 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * An implementation of the model object 'Xml Mapped Superclass'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml Id Class For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass() - * @model kind="class" - * @generated - */ -public class XmlMappedSuperclass extends XmlTypeMapping - implements IMappedSuperclass -{ - /** - * The default value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected static final String ID_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getIdClass() Id Class}' attribute. - * - * - * @see #getIdClass() - * @generated - * @ordered - */ - protected String idClass = ID_CLASS_EDEFAULT; - - /** - * The cached value of the '{@link #getIdClassForXml() Id Class For Xml}' containment reference. - * - * - * @see #getIdClassForXml() - * @generated - * @ordered - */ - protected XmlIdClass idClassForXml; - - protected XmlMappedSuperclass() { - super(); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - XmlMappedSuperclass.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - switch (notification.getFeatureID(IMappedSuperclass.class)) { - case JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS : - idClassChanged(); - break; - default : - break; - } - switch (notification.getFeatureID(XmlMappedSuperclass.class)) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML : - xmlIdClassChanged(); - break; - default : - break; - } - } - - protected void idClassChanged() { - if (getIdClass() == null) { - setIdClassForXml(null); - } - else { - if (getIdClassForXml() == null) { - setIdClassForXml(OrmFactory.eINSTANCE.createXmlIdClass()); - } - getIdClassForXml().setValue(getIdClass()); - } - } - - protected void xmlIdClassChanged() { - if (getIdClassForXml() == null) { - setIdClass(null); - } - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_MAPPED_SUPERCLASS; - } - - /** - * Returns the value of the 'Id Class' attribute. - * - *

    - * If the meaning of the 'Id Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class' attribute. - * @see #setIdClass(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMappedSuperclass_IdClass() - * @model - * @generated - */ - public String getIdClass() { - return idClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClass Id Class}' attribute. - * - * - * @param value the new value of the 'Id Class' attribute. - * @see #getIdClass() - * @generated - */ - public void setIdClass(String newIdClass) { - String oldIdClass = idClass; - idClass = newIdClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, oldIdClass, idClass)); - } - - /** - * Returns the value of the 'Id Class For Xml' containment reference. - * - *

    - * If the meaning of the 'Id Class For Xml' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class For Xml' containment reference. - * @see #setIdClassForXml(XmlIdClass) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass_IdClassForXml() - * @model containment="true" - * @generated - */ - public XmlIdClass getIdClassForXml() { - return idClassForXml; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetIdClassForXml(XmlIdClass newIdClassForXml, NotificationChain msgs) { - XmlIdClass oldIdClassForXml = idClassForXml; - idClassForXml = newIdClassForXml; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, oldIdClassForXml, newIdClassForXml); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml Id Class For Xml}' containment reference. - * - * - * @param value the new value of the 'Id Class For Xml' containment reference. - * @see #getIdClassForXml() - * @generated - */ - public void setIdClassForXml(XmlIdClass newIdClassForXml) { - if (newIdClassForXml != idClassForXml) { - NotificationChain msgs = null; - if (idClassForXml != null) - msgs = ((InternalEObject) idClassForXml).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, null, msgs); - if (newIdClassForXml != null) - msgs = ((InternalEObject) newIdClassForXml).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, null, msgs); - msgs = basicSetIdClassForXml(newIdClassForXml, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, newIdClassForXml, newIdClassForXml)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML : - return basicSetIdClassForXml(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS : - return getIdClass(); - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML : - return getIdClassForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS : - setIdClass((String) newValue); - return; - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML : - setIdClassForXml((XmlIdClass) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS : - setIdClass(ID_CLASS_EDEFAULT); - return; - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML : - setIdClassForXml((XmlIdClass) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS : - return ID_CLASS_EDEFAULT == null ? idClass != null : !ID_CLASS_EDEFAULT.equals(idClass); - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML : - return idClassForXml != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IMappedSuperclass.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS : - return JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IMappedSuperclass.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS : - return OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (idClass: "); - result.append(idClass); - result.append(')'); - return result.toString(); - } - - public String getKey() { - return IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY; - } - - public boolean tableNameIsInvalid(String tableName) { - return false; - } - - public Iterator associatedTableNamesIncludingInherited() { - return EmptyIterator.instance(); - } - - public Iterator associatedTables() { - return EmptyIterator.instance(); - } - - public Iterator associatedTablesIncludingInherited() { - return EmptyIterator.instance(); - } - - public Iterator overridableAttributeNames() { - return this.namesOf(this.overridableAttributes()); - } - - public Iterator overridableAttributes() { - return new FilteringIterator(this.getPersistentType().attributes()) { - @Override - protected boolean accept(Object o) { - return ((IPersistentAttribute) o).isOverridableAttribute(); - } - }; - } - - public Iterator overridableAssociationNames() { - return this.namesOf(this.overridableAssociations()); - } - - public Iterator overridableAssociations() { - return new FilteringIterator(this.getPersistentType().attributes()) { - @Override - protected boolean accept(Object o) { - return ((IPersistentAttribute) o).isOverridableAssociation(); - } - }; - } - - private Iterator namesOf(Iterator attributes) { - return new TransformationIterator(attributes) { - @Override - protected String transform(IPersistentAttribute attribute) { - return attribute.getName(); - } - }; - } - - @Override - public int xmlSequence() { - return 0; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclassProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclassProvider.java deleted file mode 100644 index da76c35612..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclassProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - - -public class XmlMappedSuperclassProvider implements IXmlTypeMappingProvider -{ - public XmlTypeMapping buildTypeMapping() { - return OrmFactory.eINSTANCE.createXmlMappedSuperclass(); - } - - public String key() { - return IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMapping.java deleted file mode 100644 index d5f17f8b56..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMapping.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; - -/** - * - * A representation of the model object 'Xml Multi Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface XmlMultiRelationshipMapping extends IMultiRelationshipMapping -{} // XmlMultiRelationshipMapping diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java deleted file mode 100644 index 333d0cc30c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Xml Multi Relationship Mapping For Xml'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getJoinTableForXml Join Table For Xml}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getMapKeyForXml Map Key For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface XmlMultiRelationshipMappingForXml extends EObject -{ - /** - * Returns the value of the 'Join Table For Xml' reference. - * - *

    - * If the meaning of the 'Join Table For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Table For Xml' reference. - * @see #setJoinTableForXml(XmlJoinTable) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml_JoinTableForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - XmlJoinTable getJoinTableForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getJoinTableForXml Join Table For Xml}' reference. - * - * - * @param value the new value of the 'Join Table For Xml' reference. - * @see #getJoinTableForXml() - * @generated - */ - void setJoinTableForXml(XmlJoinTable value); - - /** - * Returns the value of the 'Map Key For Xml' containment reference. - * - *

    - * If the meaning of the 'Map Key For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Map Key For Xml' containment reference. - * @see #setMapKeyForXml(XmlMapKey) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml_MapKeyForXml() - * @model containment="true" - * @generated - */ - XmlMapKey getMapKeyForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getMapKeyForXml Map Key For Xml}' containment reference. - * - * - * @param value the new value of the 'Map Key For Xml' containment reference. - * @see #getMapKeyForXml() - * @generated - */ - void setMapKeyForXml(XmlMapKey value); -} // XmlMultiRelationshipMappingForXml diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java deleted file mode 100644 index a93d5d6186..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java +++ /dev/null @@ -1,846 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Xml Multi Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingInternal() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlMultiRelationshipMappingInternal - extends XmlRelationshipMapping - implements IMultiRelationshipMapping, XmlMultiRelationshipMappingForXml, - XmlMultiRelationshipMapping -{ - /** - * The default value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected static final String MAPPED_BY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected String mappedBy = MAPPED_BY_EDEFAULT; - - /** - * The default value of the '{@link #getOrderBy() Order By}' attribute. - * - * - * @see #getOrderBy() - * @generated - * @ordered - */ - protected static final String ORDER_BY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getOrderBy() Order By}' attribute. - * - * - * @see #getOrderBy() - * @generated - * @ordered - */ - protected String orderBy = ORDER_BY_EDEFAULT; - - /** - * The default value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected static final DefaultLazyFetchType FETCH_EDEFAULT = DefaultLazyFetchType.DEFAULT; - - /** - * The cached value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected DefaultLazyFetchType fetch = FETCH_EDEFAULT; - - /** - * The cached value of the '{@link #getJoinTable() Join Table}' containment reference. - * - * - * @see #getJoinTable() - * @generated - * @ordered - */ - protected IJoinTable joinTable; - - /** - * The default value of the '{@link #getMapKey() Map Key}' attribute. - * - * - * @see #getMapKey() - * @generated - * @ordered - */ - protected static final String MAP_KEY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMapKey() Map Key}' attribute. - * - * - * @see #getMapKey() - * @generated - * @ordered - */ - protected String mapKey = MAP_KEY_EDEFAULT; - - /** - * The cached value of the '{@link #getMapKeyForXml() Map Key For Xml}' containment reference. - * - * - * @see #getMapKeyForXml() - * @generated - * @ordered - */ - protected XmlMapKey mapKeyForXml; - - protected XmlMultiRelationshipMappingInternal() { - super(); - this.joinTable = OrmFactory.eINSTANCE.createXmlJoinTable(buildJoinTableOwner()); - ((InternalEObject) this.joinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE, null, null); - this.eAdapters().add(this.buildListener()); - } - - protected Adapter buildListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - XmlMultiRelationshipMappingInternal.this.notifyChanged(notification); - } - }; - } - - protected void notifyChanged(Notification notification) { - switch (notification.getFeatureID(IMultiRelationshipMapping.class)) { - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : - mapKeyChanged(); - break; - default : - break; - } - switch (notification.getFeatureID(XmlMultiRelationshipMappingForXml.class)) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - xmlMapKeyChanged(); - break; - default : - break; - } - } - - protected void mapKeyChanged() { - if (getMapKey() == null) { - setMapKeyForXml(null); - } - else { - if (getMapKeyForXml() == null) { - setMapKeyForXml(OrmFactory.eINSTANCE.createXmlMapKey()); - } - getMapKeyForXml().setName(getMapKey()); - } - } - - protected void xmlMapKeyChanged() { - if (getMapKeyForXml() == null) { - setMapKey(null); - } - } - - private IJoinTable.Owner buildJoinTableOwner() { - return new IJoinTable.Owner() { - public ITextRange validationTextRange() { - return XmlMultiRelationshipMappingInternal.this.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return XmlMultiRelationshipMappingInternal.this.typeMapping(); - } - }; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL; - } - - /** - * Returns the value of the 'Mapped By' attribute. - * - *

    - * If the meaning of the 'Mapped By' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Mapped By' attribute. - * @see #setMappedBy(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINonOwningMapping_MappedBy() - * @model - * @generated - */ - public String getMappedBy() { - return mappedBy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal#getMappedBy Mapped By}' attribute. - * - * - * @param value the new value of the 'Mapped By' attribute. - * @see #getMappedBy() - * @generated - */ - public void setMappedBy(String newMappedBy) { - String oldMappedBy = mappedBy; - mappedBy = newMappedBy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY, oldMappedBy, mappedBy)); - } - - /** - * Returns the value of the 'Order By' attribute. - * - *

    - * If the meaning of the 'Order By' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Order By' attribute. - * @see #setOrderBy(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMultiRelationshipMapping_OrderBy() - * @model unique="false" ordered="false" - * @generated - */ - public String getOrderBy() { - return orderBy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal#getOrderBy Order By}' attribute. - * - * - * @param value the new value of the 'Order By' attribute. - * @see #getOrderBy() - * @generated - */ - public void setOrderBy(String newOrderBy) { - String oldOrderBy = orderBy; - orderBy = newOrderBy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY, oldOrderBy, orderBy)); - } - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated NOT - */ - public boolean isNoOrdering() { - return getOrderBy() == null; - } - - /** - * - * - * @model - * @generated NOT - */ - public void setNoOrdering() { - setOrderBy(null); - } - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated NOT - */ - public boolean isOrderByPk() { - return "".equals(getOrderBy()); - } - - /** - * - * - * @model - * @generated NOT - */ - public void setOrderByPk() { - setOrderBy(""); - } - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated NOT - */ - public boolean isCustomOrdering() { - return ! StringTools.stringIsEmpty(getOrderBy()); - } - - public ITextRange mappedByTextRange() { - if (node == null) { - return typeMapping().validationTextRange(); - } - IDOMNode mappedByNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.MAPPED_BY); - return (mappedByNode == null) ? validationTextRange() : buildTextRange(mappedByNode); - } - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType}. - * - *

    - * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see #setFetch(DefaultLazyFetchType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMultiRelationshipMapping_Fetch() - * @model - * @generated - */ - public DefaultLazyFetchType getFetch() { - return fetch; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see #getFetch() - * @generated - */ - public void setFetch(DefaultLazyFetchType newFetch) { - DefaultLazyFetchType oldFetch = fetch; - fetch = newFetch == null ? FETCH_EDEFAULT : newFetch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH, oldFetch, fetch)); - } - - /** - * Returns the value of the 'Join Table' containment reference. - * - *

    - * If the meaning of the 'Join Table' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Table' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMultiRelationshipMapping_JoinTable() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IJoinTable getJoinTable() { - return joinTable; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetJoinTable(IJoinTable newJoinTable, NotificationChain msgs) { - IJoinTable oldJoinTable = joinTable; - joinTable = newJoinTable; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE, oldJoinTable, newJoinTable); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - public boolean isJoinTableSpecified() { - XmlJoinTable table = getJoinTableForXml(); - return table != null && table.isSpecified(); - } - - /** - * Returns the value of the 'Map Key' attribute. - * - *

    - * If the meaning of the 'Map Key' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Map Key' attribute. - * @see #setMapKey(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMultiRelationshipMapping_MapKey() - * @model - * @generated - */ - public String getMapKey() { - return mapKey; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal#getMapKey Map Key}' attribute. - * - * - * @param value the new value of the 'Map Key' attribute. - * @see #getMapKey() - * @generated - */ - public void setMapKey(String newMapKey) { - String oldMapKey = mapKey; - mapKey = newMapKey; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY, oldMapKey, mapKey)); - } - - private XmlJoinTable getJoinTableInternal() { - return (XmlJoinTable) getJoinTable(); - } - - public XmlJoinTable getJoinTableForXml() { - if (getJoinTableInternal().isAllFeaturesUnset()) { - return null; - } - return getJoinTableInternal(); - } - - public void setJoinTableForXmlGen(XmlJoinTable newJoinTableForXml) { - XmlJoinTable oldValue = newJoinTableForXml == null ? (XmlJoinTable) getJoinTable() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML, oldValue, newJoinTableForXml)); - } - - public void setJoinTableForXml(XmlJoinTable newJoinTableForXml) { - setJoinTableForXmlGen(newJoinTableForXml); - if (newJoinTableForXml == null) { - getJoinTableInternal().unsetAllAttributes(); - } - } - - /** - * Returns the value of the 'Map Key For Xml' containment reference. - * - *

    - * If the meaning of the 'Map Key For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Map Key For Xml' containment reference. - * @see #setMapKeyForXml(XmlMapKey) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml_MapKeyForXml() - * @model containment="true" - * @generated - */ - public XmlMapKey getMapKeyForXml() { - return mapKeyForXml; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetMapKeyForXml(XmlMapKey newMapKeyForXml, NotificationChain msgs) { - XmlMapKey oldMapKeyForXml = mapKeyForXml; - mapKeyForXml = newMapKeyForXml; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML, oldMapKeyForXml, newMapKeyForXml); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal#getMapKeyForXml Map Key For Xml}' containment reference. - * - * - * @param value the new value of the 'Map Key For Xml' containment reference. - * @see #getMapKeyForXml() - * @generated - */ - public void setMapKeyForXml(XmlMapKey newMapKeyForXml) { - if (newMapKeyForXml != mapKeyForXml) { - NotificationChain msgs = null; - if (mapKeyForXml != null) - msgs = ((InternalEObject) mapKeyForXml).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML, null, msgs); - if (newMapKeyForXml != null) - msgs = ((InternalEObject) newMapKeyForXml).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML, null, msgs); - msgs = basicSetMapKeyForXml(newMapKeyForXml, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML, newMapKeyForXml, newMapKeyForXml)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : - return basicSetJoinTable(null, msgs); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - return basicSetMapKeyForXml(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : - return getMappedBy(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return getOrderBy(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : - return getFetch(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : - return getJoinTable(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : - return getMapKey(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : - return getJoinTableForXml(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - return getMapKeyForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : - setMappedBy((String) newValue); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - setOrderBy((String) newValue); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : - setFetch((DefaultLazyFetchType) newValue); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : - setMapKey((String) newValue); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : - setJoinTableForXml((XmlJoinTable) newValue); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - setMapKeyForXml((XmlMapKey) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : - setMappedBy(MAPPED_BY_EDEFAULT); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - setOrderBy(ORDER_BY_EDEFAULT); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : - setFetch(FETCH_EDEFAULT); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : - setMapKey(MAP_KEY_EDEFAULT); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : - setJoinTableForXml((XmlJoinTable) null); - return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - setMapKeyForXml((XmlMapKey) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : - return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : - return fetch != FETCH_EDEFAULT; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : - return joinTable != null; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : - return MAP_KEY_EDEFAULT == null ? mapKey != null : !MAP_KEY_EDEFAULT.equals(mapKey); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : - return getJoinTableForXml() != null; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - return mapKeyForXml != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : - return JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IMultiRelationshipMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; - default : - return -1; - } - } - if (baseClass == XmlMultiRelationshipMappingForXml.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML; - default : - return -1; - } - } - if (baseClass == XmlMultiRelationshipMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IMultiRelationshipMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY; - default : - return -1; - } - } - if (baseClass == XmlMultiRelationshipMappingForXml.class) { - switch (baseFeatureID) { - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML; - default : - return -1; - } - } - if (baseClass == XmlMultiRelationshipMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mappedBy: "); - result.append(mappedBy); - result.append(", orderBy: "); - result.append(orderBy); - result.append(", fetch: "); - result.append(fetch); - result.append(", mapKey: "); - result.append(mapKey); - result.append(')'); - return result.toString(); - } - - public void makeJoinTableForXmlNull() { - setJoinTableForXmlGen(null); - } - - public void makeJoinTableForXmlNonNull() { - setJoinTableForXmlGen(getJoinTableForXml()); - } - - @Override - public void initializeFromXmlMulitRelationshipMapping(XmlMultiRelationshipMappingInternal oldMapping) { - super.initializeFromXmlMulitRelationshipMapping(oldMapping); - setFetch(oldMapping.getFetch()); - } - - public Iterator candidateMapKeyNames() { - return this.allTargetEntityAttributeNames(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - // TODO - // if (isOrderByPk()) { - // refreshDefaultOrderBy(defaultsContext); - // } - } - - //primary key ordering when just the @OrderBy annotation is present - protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) { - IEntity targetEntity = getResolvedTargetEntity(); - if (targetEntity != null) { - setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC"); - } - } - - //TODO copied from JavaMultiRelationshipMapping - /** - * extract the element type from the specified container signature and - * convert it into a reference entity type name; - * return null if the type is not a valid reference entity type (e.g. it's - * another container or an array or a primitive or other Basic type) - */ - @Override - public String javaDefaultTargetEntity(String signature) { - String typeName = super.javaDefaultTargetEntity(signature); - return JavaRelationshipMapping.typeNamedIsContainer(typeName) ? this.javaDefaultTargetEntityFromContainer(signature) : null; - } - - protected String javaDefaultTargetEntityFromContainer(String signature) { - String[] parmSignatures = Signature.getTypeArguments(signature); - if ((parmSignatures == null) || (parmSignatures.length != 1)) { - return null; - } - IType iType = getPersistentType().findJdtType(); - if (iType == null) { - return null; - } - String elementSignature = parmSignatures[0]; - String elementTypeName = buildReferenceEntityTypeName(elementSignature, iType); - return JavaRelationshipMapping.typeNamedIsContainer(elementTypeName) ? null : elementTypeName; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedNativeQuery.java deleted file mode 100644 index e1de3f77ee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedNativeQuery.java +++ /dev/null @@ -1,281 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Named Native Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedNativeQuery() - * @model kind="class" - * @generated - */ -public class XmlNamedNativeQuery extends AbstractXmlQuery - implements INamedNativeQuery -{ - /** - * The default value of the '{@link #getResultClass() Result Class}' attribute. - * - * - * @see #getResultClass() - * @generated - * @ordered - */ - protected static final String RESULT_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResultClass() Result Class}' attribute. - * - * - * @see #getResultClass() - * @generated - * @ordered - */ - protected String resultClass = RESULT_CLASS_EDEFAULT; - - /** - * The default value of the '{@link #getResultSetMapping() Result Set Mapping}' attribute. - * - * - * @see #getResultSetMapping() - * @generated - * @ordered - */ - protected static final String RESULT_SET_MAPPING_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResultSetMapping() Result Set Mapping}' attribute. - * - * - * @see #getResultSetMapping() - * @generated - * @ordered - */ - protected String resultSetMapping = RESULT_SET_MAPPING_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlNamedNativeQuery() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_NAMED_NATIVE_QUERY; - } - - /** - * Returns the value of the 'Result Class' attribute. - * - *

    - * If the meaning of the 'Result Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Result Class' attribute. - * @see #setResultClass(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINamedNativeQuery_ResultClass() - * @model - * @generated - */ - public String getResultClass() { - return resultClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery#getResultClass Result Class}' attribute. - * - * - * @param value the new value of the 'Result Class' attribute. - * @see #getResultClass() - * @generated - */ - public void setResultClass(String newResultClass) { - String oldResultClass = resultClass; - resultClass = newResultClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS, oldResultClass, resultClass)); - } - - /** - * Returns the value of the 'Result Set Mapping' attribute. - * - *

    - * If the meaning of the 'Result Set Mapping' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Result Set Mapping' attribute. - * @see #setResultSetMapping(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINamedNativeQuery_ResultSetMapping() - * @model - * @generated - */ - public String getResultSetMapping() { - return resultSetMapping; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery#getResultSetMapping Result Set Mapping}' attribute. - * - * - * @param value the new value of the 'Result Set Mapping' attribute. - * @see #getResultSetMapping() - * @generated - */ - public void setResultSetMapping(String newResultSetMapping) { - String oldResultSetMapping = resultSetMapping; - resultSetMapping = newResultSetMapping; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING, oldResultSetMapping, resultSetMapping)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS : - return getResultClass(); - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return getResultSetMapping(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS : - setResultClass((String) newValue); - return; - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - setResultSetMapping((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS : - setResultClass(RESULT_CLASS_EDEFAULT); - return; - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - setResultSetMapping(RESULT_SET_MAPPING_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS : - return RESULT_CLASS_EDEFAULT == null ? resultClass != null : !RESULT_CLASS_EDEFAULT.equals(resultClass); - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return RESULT_SET_MAPPING_EDEFAULT == null ? resultSetMapping != null : !RESULT_SET_MAPPING_EDEFAULT.equals(resultSetMapping); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INamedNativeQuery.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS : - return JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_CLASS; - case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_SET_MAPPING; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INamedNativeQuery.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_CLASS : - return OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS; - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY__RESULT_SET_MAPPING : - return OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (resultClass: "); - result.append(resultClass); - result.append(", resultSetMapping: "); - result.append(resultSetMapping); - result.append(')'); - return result.toString(); - } -} // XmlNamedNativeQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedQuery.java deleted file mode 100644 index 1d63078e2f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedQuery.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; - -/** - * - * A representation of the model object 'Xml Named Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedQuery() - * @model kind="class" - * @generated - */ -public class XmlNamedQuery extends AbstractXmlQuery implements INamedQuery -{ - /** - * - * - * @generated - */ - protected XmlNamedQuery() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_NAMED_QUERY; - } -} // XmlNamedQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNullAttributeMapping.java deleted file mode 100644 index d296e94131..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNullAttributeMapping.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; - -/** - * - * A representation of the model object 'Xml Null Attribute Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNullAttributeMapping() - * @model kind="class" - * @generated - */ -public class XmlNullAttributeMapping extends XmlAttributeMapping -{ - /** - * - * - * @generated - */ - protected XmlNullAttributeMapping() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_NULL_ATTRIBUTE_MAPPING; - } - - @Override - public int xmlSequence() { - return -1; - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlAttributeMapping(this); - } - - public String getKey() { - return null; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToMany.java deleted file mode 100644 index 2a01ead6fe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToMany.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; - -/** - * - * A representation of the model object 'Xml One To Many'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToMany() - * @model kind="class" - * @generated - */ -public class XmlOneToMany extends XmlMultiRelationshipMappingInternal - implements IOneToMany -{ - /** - * - * - * @generated - */ - protected XmlOneToMany() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ONE_TO_MANY; - } - - public String getKey() { - return IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlOneToManyMapping(this); - } - - public int xmlSequence() { - return 4; - } - - // ********** INonOwningMapping implementation ********** - public boolean mappedByIsValid(IAttributeMapping mappedByMapping) { - String mappedByKey = mappedByMapping.getKey(); - return (mappedByKey == IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToManyProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToManyProvider.java deleted file mode 100644 index cb25ed79fb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToManyProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlOneToManyProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlOneToManyProvider INSTANCE = new XmlOneToManyProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlOneToManyProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlOneToMany(); - } - - public String key() { - return IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java deleted file mode 100644 index f51105b5a2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java +++ /dev/null @@ -1,263 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Xml One To One'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToOne() - * @model kind="class" - * @generated - */ -public class XmlOneToOne extends XmlSingleRelationshipMapping - implements IOneToOne -{ - /** - * The default value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected static final String MAPPED_BY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMappedBy() Mapped By}' attribute. - * - * - * @see #getMappedBy() - * @generated - * @ordered - */ - protected String mappedBy = MAPPED_BY_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlOneToOne() { - super(); - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlOneToOneMapping(this); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ONE_TO_ONE; - } - - /** - * Returns the value of the 'Mapped By' attribute. - * - *

    - * If the meaning of the 'Mapped By' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Mapped By' attribute. - * @see #setMappedBy(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getINonOwningMapping_MappedBy() - * @model - * @generated - */ - public String getMappedBy() { - return mappedBy; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToOne#getMappedBy Mapped By}' attribute. - * - * - * @param value the new value of the 'Mapped By' attribute. - * @see #getMappedBy() - * @generated - */ - public void setMappedBy(String newMappedBy) { - String oldMappedBy = mappedBy; - mappedBy = newMappedBy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE__MAPPED_BY, oldMappedBy, mappedBy)); - } - - public boolean mappedByIsValid(IAttributeMapping mappedByMapping) { - String mappedByKey = mappedByMapping.getKey(); - return (mappedByKey == IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); - } - - public ITextRange mappedByTextRange() { - if (node == null) { - return typeMapping().validationTextRange(); - } - IDOMNode mappedByNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.MAPPED_BY); - return (mappedByNode == null) ? validationTextRange() : buildTextRange(mappedByNode); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY : - return getMappedBy(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY : - setMappedBy((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY : - setMappedBy(MAPPED_BY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY : - return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY : - return JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IOneToOne.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == INonOwningMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - return OrmPackage.XML_ONE_TO_ONE__MAPPED_BY; - default : - return -1; - } - } - if (baseClass == IOneToOne.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mappedBy: "); - result.append(mappedBy); - result.append(')'); - return result.toString(); - } - - @Override - public int xmlSequence() { - return 5; - } - - public String getKey() { - return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - @Override - public boolean isOverridableAssociationMapping() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOneProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOneProvider.java deleted file mode 100644 index 420fdc0678..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOneProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlOneToOneProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlOneToOneProvider INSTANCE = new XmlOneToOneProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlOneToOneProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlOneToOne(); - } - - public String key() { - return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOverride.java deleted file mode 100644 index 5b66e1ff3d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOverride.java +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Override'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOverride() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlOverride extends XmlEObject implements IOverride -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - private final Owner owner; - - protected XmlOverride() { - throw new UnsupportedOperationException(); - } - - protected XmlOverride(IOverride.Owner owner) { - super(); - this.owner = owner; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_OVERRIDE; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIOverride_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOverride#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_OVERRIDE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_OVERRIDE__NAME : - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_OVERRIDE__NAME : - setName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_OVERRIDE__NAME : - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_OVERRIDE__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IOverride.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_OVERRIDE__NAME : - return JpaCoreMappingsPackage.IOVERRIDE__NAME; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IOverride.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IOVERRIDE__NAME : - return OrmPackage.XML_OVERRIDE__NAME; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @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 boolean isVirtual() { - return getOwner().isVirtual(this); - } - - @Override - public ITextRange validationTextRange() { - if (node == null) { - return getOwner().validationTextRange(); - } - else { - return super.validationTextRange(); - } - } - - public Owner getOwner() { - return this.owner; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java deleted file mode 100644 index b17c58319f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java +++ /dev/null @@ -1,365 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Xml Persistent Attribute'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName Name}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute() - * @model kind="class" - * @generated - */ -public class XmlPersistentAttribute extends XmlEObject - implements IPersistentAttribute -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - private List attributeMappingProviders; - - protected XmlPersistentAttribute() { - super(); - this.attributeMappingProviders = buildAttributeMappingProviders(); - } - - protected List buildAttributeMappingProviders() { - List list = new ArrayList(); - list.add(XmlEmbeddedProvider.instance()); //bug 190344 need to test default embedded before basic - list.add(XmlBasicProvider.instance()); - list.add(XmlTransientProvider.instance()); - list.add(XmlIdProvider.instance()); - list.add(XmlManyToManyProvider.instance()); - list.add(XmlOneToManyProvider.instance()); - list.add(XmlManyToOneProvider.instance()); - list.add(XmlOneToOneProvider.instance()); - list.add(XmlVersionProvider.instance()); - list.add(XmlEmbeddedIdProvider.instance()); - return list; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_PERSISTENT_ATTRIBUTE; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING : - return getMapping(); - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME : - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME : - setName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME : - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING : - return getMapping() != null; - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentAttribute.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING : - return JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentAttribute.class) { - switch (baseFeatureID) { - case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING : - return OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @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 XmlAttributeMapping getMapping() { - return (XmlAttributeMapping) eContainer(); - } - - public String mappingKey() { - return this.getMapping().getKey(); - } - - public String defaultMappingKey() { - return null; - } - - public void setSpecifiedMappingKey(String newKey) { - String oldKey = this.mappingKey(); - if (newKey == oldKey) { - return; - } - XmlAttributeMapping oldMapping = getMapping(); - this.persistentType().changeMapping(this.getMapping(), newKey); - XmlAttributeMapping newMapping = getMapping(); - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING, oldMapping, newMapping)); - } - } - - public Object getId() { - return IXmlContentNodes.PERSISTENT_ATTRIBUTE_ID; - } - - public Iterator candidateMappingKeys() { - return new TransformationIterator(this.attributeMappingProviders.iterator()) { - @Override - protected String transform(IXmlAttributeMappingProvider provider) { - return provider.key(); - } - }; - } - - public Collection attributeMappingProviders() { - return this.attributeMappingProviders; - } - - public XmlPersistentType persistentType() { - return getMapping().getPersistentType(); - } - - public XmlTypeMapping typeMapping() { - return persistentType().getMapping(); - } - - public boolean isVirtual() { - return getMapping().isVirtual(); - } - - public void setVirtual(boolean virtual) { - getMapping().setVirtual(virtual); - } - - public Attribute getAttribute() { - JavaPersistentType javaPersistentType = ((XmlPersistentType) typeMapping().getPersistentType()).findJavaPersistentType(); - if (javaPersistentType == null) { - return null; - } - for (Iterator i = javaPersistentType.attributes(); i.hasNext();) { - JavaPersistentAttribute persistentAttribute = i.next(); - if (persistentAttribute.getName().equals(getName())) { - return persistentAttribute.getAttribute(); - } - } - return null; - } - - public String primaryKeyColumnName() { - return getMapping().primaryKeyColumnName(); - } - - @Override - public ITextRange fullTextRange() { - return (this.isVirtual()) ? null : super.fullTextRange(); - } - - @Override - public ITextRange validationTextRange() { - return (this.isVirtual()) ? this.persistentType().attributesTextRange() : this.getMapping().validationTextRange(); - } - - @Override - public ITextRange selectionTextRange() { - return (isVirtual()) ? null : this.getMapping().selectionTextRange(); - } - - public ITextRange nameTextRange() { - return getMapping().nameTextRange(); - } - - public boolean isOverridableAttribute() { - return this.getMapping().isOverridableAttributeMapping(); - } - - public boolean isOverridableAssociation() { - return this.getMapping().isOverridableAssociationMapping(); - } - - public boolean isIdAttribute() { - return this.getMapping().isIdMapping(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java deleted file mode 100644 index aa14ad2995..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java +++ /dev/null @@ -1,1025 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -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.EObjectEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.ChainIterator; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * - * A representation of the model object 'Xml Persistent Type'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getClass_ Class}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getAttributeMappings Attribute Mappings}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getSpecifiedAttributeMappings Specified Attribute Mappings}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getVirtualAttributeMappings Virtual Attribute Mappings}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getPersistentAttributes Persistent Attributes}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getSpecifiedPersistentAttributes Specified Persistent Attributes}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getVirtualPersistentAttributes Virtual Persistent Attributes}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType() - * @model kind="class" - * @generated - */ -public class XmlPersistentType extends XmlEObject implements IPersistentType -{ - /** - * The default value of the '{@link #getMappingKey() Mapping Key}' attribute. - * - * - * @see #getMappingKey() - * @generated - * @ordered - */ - protected static final String MAPPING_KEY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMappingKey() Mapping Key}' attribute. - * - * - * @see #getMappingKey() - * @generated - * @ordered - */ - protected String mappingKey = MAPPING_KEY_EDEFAULT; - - /** - * The default value of the '{@link #getClass_() Class}' attribute. - * - * - * @see #getClass_() - * @generated - * @ordered - */ - protected static final String CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getClass_() Class}' attribute. - * - * - * @see #getClass_() - * @generated - * @ordered - */ - protected String class_ = CLASS_EDEFAULT; - - /** - * The cached value of the '{@link #getSpecifiedAttributeMappings() Specified Attribute Mappings}' containment reference list. - * - * - * @see #getSpecifiedAttributeMappings() - * @generated - * @ordered - */ - protected EList specifiedAttributeMappings; - - /** - * The cached value of the '{@link #getVirtualAttributeMappings() Virtual Attribute Mappings}' containment reference list. - * - * - * @see #getVirtualAttributeMappings() - * @generated - * @ordered - */ - protected EList virtualAttributeMappings; - - /** - * The cached value of the '{@link #getSpecifiedPersistentAttributes() Specified Persistent Attributes}' reference list. - * - * - * @see #getSpecifiedPersistentAttributes() - * @generated - * @ordered - */ - protected EList specifiedPersistentAttributes; - - /** - * The cached value of the '{@link #getVirtualPersistentAttributes() Virtual Persistent Attributes}' reference list. - * - * - * @see #getVirtualPersistentAttributes() - * @generated - * @ordered - */ - protected EList virtualPersistentAttributes; - - private Collection typeMappingProviders; - - private IPersistentType parentPersistentType; - - /** - * - * - * @generated NOT - */ - protected XmlPersistentType() { - super(); - this.typeMappingProviders = buildTypeMappingProviders(); - } - - protected XmlPersistentType(String theMappingKey) { - this(); - mappingKey = theMappingKey; - } - - @Override - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIds.add(OrmPackage.XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS); - insignificantFeatureIds.add(OrmPackage.XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES); - insignificantFeatureIds.add(OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES); - insignificantFeatureIds.add(OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES); - } - - protected Collection buildTypeMappingProviders() { - Collection collection = new ArrayList(); - collection.add(new XmlEntityProvider()); - collection.add(new XmlMappedSuperclassProvider()); - collection.add(new XmlEmbeddableProvider()); - return collection; - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_PERSISTENT_TYPE; - } - - public XmlTypeMapping getMapping() { - return (XmlTypeMapping) eContainer(); - } - - /* @see IJpaContentNode#getId() */ - public Object getId() { - return IXmlContentNodes.PERSISTENT_TYPE_ID; - } - - /** - * Returns the value of the 'Mapping Key' attribute. - * - *

    - * If the meaning of the 'Mapping Key' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Mapping Key' attribute. - * @see #setMappingKey(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIPersistentType_MappingKey() - * @model required="true" - * @generated - */ - public String getMappingKey() { - return mappingKey; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getMappingKey Mapping Key}' attribute. - * - * - * @param value the new value of the 'Mapping Key' attribute. - * @see #getMappingKey() - * @generated - */ - public void setMappingKeyGen(String newMappingKey) { - String oldMappingKey = mappingKey; - mappingKey = newMappingKey; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY, oldMappingKey, mappingKey)); - } - - public void setMappingKey(String newMappingKey) { - if (mappingKey.equals(newMappingKey)) { - return; - } - XmlTypeMapping oldMapping = getMapping(); - EntityMappings entityMappings = oldMapping.getEntityMappings(); - entityMappings.changeMapping(oldMapping, newMappingKey); - setMappingKeyGen(newMappingKey); - } - - /** - * Returns the value of the 'Class' attribute. - * - *

    - * If the meaning of the 'Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Class' attribute. - * @see #setClass(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_Class() - * @model - * @generated - */ - public String getClass_() { - return class_; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType#getClass_ Class}' attribute. - * - * - * @param value the new value of the 'Class' attribute. - * @see #getClass_() - * @generated - */ - public void setClass(String newClass) { - String oldClass = class_; - class_ = newClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_TYPE__CLASS, oldClass, class_)); - } - - /** - * Returns the value of the 'Attribute Mappings' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping}. - * - *

    - * If the meaning of the 'Attribute Mappings' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Attribute Mappings' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_AttributeMappings() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping" containment="true" transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public EList getAttributeMappings() { - EList list = new EObjectEList(XmlAttributeMapping.class, this, OrmPackage.XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS); - list.addAll(getSpecifiedAttributeMappings()); - list.addAll(getVirtualAttributeMappings()); - return list; - } - - /** - * Returns the value of the 'Specified Attribute Mappings' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping}. - * - *

    - * If the meaning of the 'Specified Attribute Mappings' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Attribute Mappings' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_SpecifiedAttributeMappings() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping" containment="true" - * @generated - */ - public EList getSpecifiedAttributeMappingsGen() { - if (specifiedAttributeMappings == null) { - specifiedAttributeMappings = new EObjectContainmentEList(XmlAttributeMapping.class, this, OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS); - } - return specifiedAttributeMappings; - } - - public EList getSpecifiedAttributeMappings() { - if (specifiedAttributeMappings == null) { - specifiedAttributeMappings = new SpecifiedAttributeMappingsList(); - } - return getSpecifiedAttributeMappingsGen(); - } - - /** - * Returns the value of the 'Virtual Attribute Mappings' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping}. - * - *

    - * If the meaning of the 'Virtual Attribute Mappings' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Virtual Attribute Mappings' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_VirtualAttributeMappings() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping" containment="true" - * @generated - */ - public EList getVirtualAttributeMappingsGen() { - if (virtualAttributeMappings == null) { - virtualAttributeMappings = new EObjectContainmentEList(XmlAttributeMapping.class, this, OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS); - } - return virtualAttributeMappings; - } - - public EList getVirtualAttributeMappings() { - if (virtualAttributeMappings == null) { - virtualAttributeMappings = new VirtualAttributeMappingsList(); - } - return getVirtualAttributeMappingsGen(); - } - - /** - * Returns the value of the 'Persistent Attributes' reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute}. - * - *

    - * If the meaning of the 'Persistent Attributes' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Persistent Attributes' reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_PersistentAttributes() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute" resolveProxies="false" transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public EList getPersistentAttributes() { - EList list = new EObjectEList(XmlPersistentAttribute.class, this, OrmPackage.XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES); - list.addAll(getSpecifiedPersistentAttributes()); - list.addAll(getVirtualPersistentAttributes()); - return list; - } - - /** - * Returns the value of the 'Specified Persistent Attributes' reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute}. - * - *

    - * If the meaning of the 'Specified Persistent Attributes' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Persistent Attributes' reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_SpecifiedPersistentAttributes() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute" resolveProxies="false" - * @generated - */ - public EList getSpecifiedPersistentAttributes() { - if (specifiedPersistentAttributes == null) { - specifiedPersistentAttributes = new EObjectEList(XmlPersistentAttribute.class, this, OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES); - } - return specifiedPersistentAttributes; - } - - /** - * Returns the value of the 'Virtual Persistent Attributes' reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute}. - * - *

    - * If the meaning of the 'Default Persistent Attributes' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Virtual Persistent Attributes' reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType_VirtualPersistentAttributes() - * @model type="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute" resolveProxies="false" - * @generated - */ - public EList getVirtualPersistentAttributes() { - if (virtualPersistentAttributes == null) { - virtualPersistentAttributes = new EObjectEList(XmlPersistentAttribute.class, this, OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES); - } - return virtualPersistentAttributes; - } - - protected void changeMapping(XmlAttributeMapping oldMapping, String newMappingKey) { - boolean virtual = oldMapping.isVirtual(); - XmlAttributeMapping newAttributeMapping = buildAttributeMapping(oldMapping.getPersistentAttribute().attributeMappingProviders(), newMappingKey); - // we can't set the attribute to null, but we can set it to a dummy placeholder one - // we do this to get the translators to *wake up* and remove adapters from the attribute - XmlPersistentAttribute nullAttribute = OrmFactory.eINSTANCE.createXmlPersistentAttribute(); - XmlPersistentAttribute attribute = oldMapping.getPersistentAttribute(); - oldMapping.setPersistentAttribute(nullAttribute); - - if (virtual) { - getVirtualPersistentAttributes().remove(attribute); - getVirtualAttributeMappings().remove(oldMapping); - } - else { - getSpecifiedPersistentAttributes().remove(attribute); - getSpecifiedAttributeMappings().remove(oldMapping); - } - newAttributeMapping.setPersistentAttribute(attribute); - oldMapping.initializeOn(newAttributeMapping); - if (virtual) { - insertAttributeMapping(newAttributeMapping, getVirtualAttributeMappings()); - } - else { - insertAttributeMapping(newAttributeMapping, getSpecifiedAttributeMappings()); - } - } - - private XmlAttributeMapping buildAttributeMapping(Collection providers, String key) { - for (IXmlAttributeMappingProvider provider : providers) { - if (provider.key().equals(key)) { - return provider.buildAttributeMapping(); - } - } - return OrmFactory.eINSTANCE.createXmlNullAttributeMapping(); - } - - public Collection typeMappingProviders() { - return this.typeMappingProviders; - } - - protected void setMappingVirtual(XmlAttributeMapping attributeMapping, boolean virtual) { - boolean oldVirtual = attributeMapping.isVirtual(); - if (oldVirtual == virtual) { - return; - } - if (virtual) { - getSpecifiedAttributeMappings().remove(attributeMapping); - insertAttributeMapping(attributeMapping, getVirtualAttributeMappings()); - } - else { - getVirtualAttributeMappings().remove(attributeMapping); - insertAttributeMapping(attributeMapping, getSpecifiedAttributeMappings()); - } - } - - private void insertAttributeMapping(XmlAttributeMapping newMapping, List attributeMappings) { - int newIndex = CollectionTools.insertionIndexOf(attributeMappings, newMapping, buildMappingComparator()); - attributeMappings.add(newIndex, newMapping); - } - - private Comparator buildMappingComparator() { - return new Comparator() { - public int compare(XmlAttributeMapping o1, XmlAttributeMapping o2) { - int o1Sequence = o1.xmlSequence(); - int o2Sequence = o2.xmlSequence(); - if (o1Sequence < o2Sequence) { - return -1; - } - if (o1Sequence == o2Sequence) { - return 0; - } - return 1; - } - }; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS : - return ((InternalEList) getAttributeMappings()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS : - return ((InternalEList) getSpecifiedAttributeMappings()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS : - return ((InternalEList) getVirtualAttributeMappings()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - public Iterator candidateMappingKeys() { - Collection mappingKeys = new ArrayList(); - for (IXmlTypeMappingProvider provider : typeMappingProviders()) { - mappingKeys.add(provider.key()); - } - return mappingKeys.iterator(); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY : - return getMappingKey(); - case OrmPackage.XML_PERSISTENT_TYPE__CLASS : - return getClass_(); - case OrmPackage.XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS : - return getAttributeMappings(); - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS : - return getSpecifiedAttributeMappings(); - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS : - return getVirtualAttributeMappings(); - case OrmPackage.XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES : - return getPersistentAttributes(); - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES : - return getSpecifiedPersistentAttributes(); - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES : - return getVirtualPersistentAttributes(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY : - setMappingKey((String) newValue); - return; - case OrmPackage.XML_PERSISTENT_TYPE__CLASS : - setClass((String) newValue); - return; - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS : - getSpecifiedAttributeMappings().clear(); - getSpecifiedAttributeMappings().addAll((Collection) newValue); - return; - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS : - getVirtualAttributeMappings().clear(); - getVirtualAttributeMappings().addAll((Collection) newValue); - return; - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES : - getSpecifiedPersistentAttributes().clear(); - getSpecifiedPersistentAttributes().addAll((Collection) newValue); - return; - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES : - getVirtualPersistentAttributes().clear(); - getVirtualPersistentAttributes().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY : - setMappingKey(MAPPING_KEY_EDEFAULT); - return; - case OrmPackage.XML_PERSISTENT_TYPE__CLASS : - setClass(CLASS_EDEFAULT); - return; - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS : - getSpecifiedAttributeMappings().clear(); - return; - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS : - getVirtualAttributeMappings().clear(); - return; - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES : - getSpecifiedPersistentAttributes().clear(); - return; - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES : - getVirtualPersistentAttributes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY : - return MAPPING_KEY_EDEFAULT == null ? mappingKey != null : !MAPPING_KEY_EDEFAULT.equals(mappingKey); - case OrmPackage.XML_PERSISTENT_TYPE__CLASS : - return CLASS_EDEFAULT == null ? class_ != null : !CLASS_EDEFAULT.equals(class_); - case OrmPackage.XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS : - return !getAttributeMappings().isEmpty(); - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS : - return specifiedAttributeMappings != null && !specifiedAttributeMappings.isEmpty(); - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS : - return virtualAttributeMappings != null && !virtualAttributeMappings.isEmpty(); - case OrmPackage.XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES : - return !getPersistentAttributes().isEmpty(); - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES : - return specifiedPersistentAttributes != null && !specifiedPersistentAttributes.isEmpty(); - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES : - return virtualPersistentAttributes != null && !virtualPersistentAttributes.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentType.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY : - return JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IPersistentType.class) { - switch (baseFeatureID) { - case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY : - return OrmPackage.XML_PERSISTENT_TYPE__MAPPING_KEY; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mappingKey: "); - result.append(mappingKey); - result.append(", class: "); - result.append(class_); - result.append(')'); - return result.toString(); - } - - public IType findJdtType() { - String fqName = getClass_(); - if (StringTools.stringIsEmpty(fqName)) { - return null; - } - // try to resolve by only the locally specified name - IType type = resolveJdtType(fqName); - if (type == null) { - // try to resolve by prepending the global package name - fqName = getMapping().getEntityMappings().getPackage() + "." + getClass_(); - type = resolveJdtType(fqName); - } - return type; - } - - private IType resolveJdtType(String fullyQualifiedName) { - // this name could be of the form "package.name.ClassName" - // or the form "package.name.ClassName.MemberClassName" - // so we must try multiple package and class names here - String[] name = new String[] { - fullyQualifiedName, "" - }; - while (name[0].length() != 0) { - name = moveDot(name); - IType type = JDTTools.findType(name[0], name[1], getJpaProject().getJavaProject()); - if (type != null) - return type; - } - return null; - } - - /** - * Returns a String array based on the given string array by - * moving a package segment from the end of the first to the - * beginning of the second - * - * e.g. ["foo.bar", "Baz"] -> ["foo", "bar.Baz"] - */ - private String[] moveDot(String[] packageAndClassName) { - if (packageAndClassName[0].length() == 0) { - throw new IllegalArgumentException(); - } - String segmentToMove; - String packageName = packageAndClassName[0]; - String className = packageAndClassName[1]; - if (packageName.indexOf('.') == -1) { - segmentToMove = packageName; - packageAndClassName[0] = ""; - } - else { - int dotIndex = packageName.lastIndexOf('.'); - segmentToMove = packageName.substring(dotIndex + 1, packageName.length()); - packageAndClassName[0] = packageName.substring(0, dotIndex); - } - if (className.length() == 0) { - packageAndClassName[1] = segmentToMove; - } - else { - packageAndClassName[1] = segmentToMove + '.' + className; - } - return packageAndClassName; - } - - public JavaPersistentType findJavaPersistentType() { - IType iType = findJdtType(); - if (iType != null) { - for (IJpaFile jpaFile : getJpaProject().jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE)) { - for (JavaPersistentType javaPersistentType : ((JpaCompilationUnit) jpaFile.getContent()).getTypes()) { - if (javaPersistentType.jdtType().equals(iType)) { - return javaPersistentType; - } - } - } - } - return null; - } - - public Type findType() { - JavaPersistentType javaPersistentType = findJavaPersistentType(); - return (javaPersistentType == null) ? null : javaPersistentType.getType(); - } - - public Iterator attributes() { - return new ReadOnlyIterator(getPersistentAttributes()); - } - - public Iterator attributeNames() { - return this.attributeNames(this.attributes()); - } - - private Iterator attributeNames(Iterator attrs) { - return new TransformationIterator(attrs) { - @Override - protected String transform(IPersistentAttribute attribute) { - return attribute.getName(); - } - }; - } - - public Iterator allAttributes() { - return new CompositeIterator(new TransformationIterator>(this.inheritanceHierarchy()) { - @Override - protected Iterator transform(IPersistentType pt) { - //TODO how to remove this warning? - return (Iterator) pt.attributes(); - } - }); - } - - public Iterator allAttributeNames() { - return this.attributeNames(this.allAttributes()); - } - - public Iterator inheritanceHierarchy() { - // using a chain iterator to traverse up the inheritance tree - return new ChainIterator(this) { - protected Object nextLink(Object currentLink) { - return ((IPersistentType) currentLink).parentPersistentType(); - } - }; - } - - public IPersistentType parentPersistentType() { - return this.parentPersistentType; - } - - private String superclassTypeSignature() { - IType javaType = this.findJdtType(); - if (javaType == null) { - return null; - } - try { - return javaType.getSuperclassTypeSignature(); - } - catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - public IJpaContentNode getContentNode(int offset) { - for (Iterator i = getSpecifiedAttributeMappings().iterator(); i.hasNext();) { - XmlAttributeMapping mapping = (XmlAttributeMapping) i.next(); - if (mapping.getNode().contains(offset)) { - return mapping.getContentNode(offset); - } - } - return this; - } - - public void refreshDefaults(DefaultsContext context) { - refreshParentPersistentType(context); - } - - private void refreshParentPersistentType(DefaultsContext context) { - String superclassTypeSignature = this.superclassTypeSignature(); - if (superclassTypeSignature == null) { - this.parentPersistentType = null; - return; - } - IType jdtType = this.findJdtType(); - if (jdtType == null) { - this.parentPersistentType = null; - return; - } - String fullyQualifiedTypeName = JDTTools.resolveSignature(superclassTypeSignature, jdtType); - if (fullyQualifiedTypeName == null) { - this.parentPersistentType = null; - return; - } - IPersistentType possibleParent = context.persistentType(fullyQualifiedTypeName); - if (possibleParent != null) { - if (possibleParent.getMappingKey() != null) { - this.parentPersistentType = possibleParent; - } - else { - this.parentPersistentType = possibleParent.parentPersistentType(); - } - } - else { - this.parentPersistentType = null; - } - } - - protected Iterator attributesNamed(final String attributeName) { - return new FilteringIterator(getPersistentAttributes().iterator()) { - @Override - protected boolean accept(Object o) { - return attributeName.equals(((XmlPersistentAttribute) o).getName()); - } - }; - } - - public XmlPersistentAttribute attributeNamed(String attributeName) { - Iterator attributes = attributesNamed(attributeName); - if (attributes.hasNext()) { - return attributes.next(); - } - else { - return null; - } - } - - public IPersistentAttribute resolveAttribute(String attributeName) { - Iterator attributes = attributesNamed(attributeName); - if (attributes.hasNext()) { - XmlPersistentAttribute attribute = attributes.next(); - if (attributes.hasNext()) { - // more than one - return null; - } - else { - return attribute; - } - } - else if (parentPersistentType() != null) { - return parentPersistentType().resolveAttribute(attributeName); - } - else { - return null; - } - } - - @Override - public ITextRange validationTextRange() { - return selectionTextRange(); - } - - @Override - public ITextRange selectionTextRange() { - return getMapping().selectionTextRange(); - } - - public ITextRange classTextRange() { - return getMapping().classTextRange(); - } - - public ITextRange attributesTextRange() { - return getMapping().attributesTextRange(); - } - - - private abstract class AttributeMappingsList - extends EObjectContainmentEList - { - private AttributeMappingsList(int feature) { - super(XmlAttributeMapping.class, XmlPersistentType.this, feature); - } - - protected abstract EList persistentAttributes(); - - @Override - protected void didAdd(int index, XmlAttributeMapping newObject) { - if (newObject.getPersistentAttribute() == null) { - throw new IllegalStateException("Must set the PersistentAttribute during creation"); - } - persistentAttributes().add(index, newObject.getPersistentAttribute()); - } - - @Override - protected void didChange() { - // TODO Auto-generated method stub - super.didChange(); - } - - @Override - protected void didClear(int size, Object[] oldObjects) { - persistentAttributes().clear(); - } - - @Override - protected void didMove(int index, XmlAttributeMapping movedObject, int oldIndex) { - persistentAttributes().move(index, movedObject.getPersistentAttribute()); - } - - @Override - protected void didRemove(int index, XmlAttributeMapping oldObject) { - persistentAttributes().remove(oldObject.getPersistentAttribute()); - } - - @Override - protected void didSet(int index, XmlAttributeMapping newObject, XmlAttributeMapping oldObject) { - persistentAttributes().set(index, newObject.getPersistentAttribute()); - } - } - - - private class SpecifiedAttributeMappingsList - extends AttributeMappingsList - { - private SpecifiedAttributeMappingsList() { - super(OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS); - } - - @Override - protected EList persistentAttributes() { - return getSpecifiedPersistentAttributes(); - } - } - - - private class VirtualAttributeMappingsList - extends AttributeMappingsList - { - private VirtualAttributeMappingsList() { - super(OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_ATTRIBUTE_MAPPINGS); - } - - @Override - protected EList persistentAttributes() { - return getVirtualPersistentAttributes(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java deleted file mode 100644 index bbb7425837..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java +++ /dev/null @@ -1,431 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Xml Primary Key Join Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn#getSpecifiedReferencedColumnNameForXml Specified Referenced Column Name For Xml}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPrimaryKeyJoinColumn() - * @model kind="class" - * @generated - */ -public class XmlPrimaryKeyJoinColumn extends AbstractXmlNamedColumn - implements IPrimaryKeyJoinColumn -{ - /** - * The default value of the '{@link #getReferencedColumnName() Referenced Column Name}' attribute. - * - * - * @see #getReferencedColumnName() - * @generated - * @ordered - */ - protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedReferencedColumnName() Specified Referenced Column Name}' attribute. - * - * - * @see #getSpecifiedReferencedColumnName() - * @generated - * @ordered - */ - protected String specifiedReferencedColumnName = SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultReferencedColumnName() Default Referenced Column Name}' attribute. - * - * - * @see #getDefaultReferencedColumnName() - * @generated - * @ordered - */ - protected String defaultReferencedColumnName = DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedReferencedColumnNameForXml() Specified Referenced Column Name For Xml}' attribute. - * - * - * @see #getSpecifiedReferencedColumnNameForXml() - * @generated - * @ordered - */ - protected static final String SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT = null; - - protected XmlPrimaryKeyJoinColumn() { - throw new UnsupportedOperationException("Use XmlPrimaryKeyJoinColumn(INamedColumn.Owner) instead"); - } - - protected XmlPrimaryKeyJoinColumn(IAbstractJoinColumn.Owner owner) { - super(owner); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_PRIMARY_KEY_JOIN_COLUMN; - } - - public void setSpecifiedName(String newSpecifiedName) { - setSpecifiedNameGen(newSpecifiedName); - setSpecifiedNameForXml(newSpecifiedName); - } - - /** - * Returns the value of the 'Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIPrimaryKeyJoinColumn_ReferencedColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getReferencedColumnName() { - return (this.getSpecifiedReferencedColumnName() == null) ? getDefaultReferencedColumnName() : this.getSpecifiedReferencedColumnName(); - } - - /** - * Returns the value of the 'Specified Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Referenced Column Name' attribute. - * @see #setSpecifiedReferencedColumnName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractJoinColumn_SpecifiedReferencedColumnName() - * @model - * @generated - */ - public String getSpecifiedReferencedColumnName() { - return specifiedReferencedColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name' attribute. - * @see #getSpecifiedReferencedColumnName() - * @generated - */ - public void setSpecifiedReferencedColumnNameGen(String newSpecifiedReferencedColumnName) { - String oldSpecifiedReferencedColumnName = specifiedReferencedColumnName; - specifiedReferencedColumnName = newSpecifiedReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME, oldSpecifiedReferencedColumnName, specifiedReferencedColumnName)); - } - - public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) { - setSpecifiedReferencedColumnNameGen(newSpecifiedReferencedColumnName); - setSpecifiedReferencedColumnNameForXml(newSpecifiedReferencedColumnName); - } - - /** - * Returns the value of the 'Default Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Default Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIAbstractJoinColumn_DefaultReferencedColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultReferencedColumnName() { - return defaultReferencedColumnName; - } - - protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) { - String oldDefaultReferencedColumnName = this.defaultReferencedColumnName; - this.defaultReferencedColumnName = newDefaultReferencedColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME, oldDefaultReferencedColumnName, newDefaultReferencedColumnName)); - } - - public void setColumnDefinition(String newColumnDefinition) { - setColumnDefinitionGen(newColumnDefinition); - setColumnDefinitionForXml(newColumnDefinition); - } - - /** - * Returns the value of the 'Specified Referenced Column Name For Xml' attribute. - * - *

    - * If the meaning of the 'Specified Referenced Column Name For Xml' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Referenced Column Name For Xml' attribute. - * @see #setSpecifiedReferencedColumnNameForXml(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPrimaryKeyJoinColumn_SpecifiedReferencedColumnNameForXml() - * @model volatile="true" - * @generated NOT - */ - public String getSpecifiedReferencedColumnNameForXml() { - return getSpecifiedReferencedColumnName(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn#getSpecifiedReferencedColumnNameForXml Specified Referenced Column Name For Xml}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name For Xml' attribute. - * @see #getSpecifiedReferencedColumnNameForXml() - * @generated NOT - */ - public void setSpecifiedReferencedColumnNameForXml(String newSpecifiedReferencedColumnNameForXml) { - setSpecifiedReferencedColumnNameGen(newSpecifiedReferencedColumnNameForXml); - if (eNotificationRequired()) - //make sure oldValue different from newValue because we don't store the value from the xml, see super.eNotify() - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML, newSpecifiedReferencedColumnNameForXml + " ", newSpecifiedReferencedColumnNameForXml)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return getReferencedColumnName(); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return getSpecifiedReferencedColumnName(); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return getDefaultReferencedColumnName(); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - return getSpecifiedReferencedColumnNameForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName((String) newValue); - return; - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - setSpecifiedReferencedColumnNameForXml((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - setSpecifiedReferencedColumnName(SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT); - return; - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - setSpecifiedReferencedColumnNameForXml(SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return REFERENCED_COLUMN_NAME_EDEFAULT == null ? getReferencedColumnName() != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(getReferencedColumnName()); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT == null ? specifiedReferencedColumnName != null : !SPECIFIED_REFERENCED_COLUMN_NAME_EDEFAULT.equals(specifiedReferencedColumnName); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT == null ? defaultReferencedColumnName != null : !DEFAULT_REFERENCED_COLUMN_NAME_EDEFAULT.equals(defaultReferencedColumnName); - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML : - return SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT == null ? getSpecifiedReferencedColumnNameForXml() != null : !SPECIFIED_REFERENCED_COLUMN_NAME_FOR_XML_EDEFAULT.equals(getSpecifiedReferencedColumnNameForXml()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IPrimaryKeyJoinColumn.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IAbstractJoinColumn.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME : - return OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME : - return OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME : - return OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - default : - return -1; - } - } - if (baseClass == IPrimaryKeyJoinColumn.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedReferencedColumnName: "); - result.append(specifiedReferencedColumnName); - result.append(", defaultReferencedColumnName: "); - result.append(defaultReferencedColumnName); - result.append(')'); - return result.toString(); - } - - public IAbstractJoinColumn.Owner getOwner() { - return (IAbstractJoinColumn.Owner) this.owner; - } - - public Column dbReferencedColumn() { - Table table = this.dbReferencedColumnTable(); - return (table == null) ? null : table.columnNamed(this.getReferencedColumnName()); - } - - public Table dbReferencedColumnTable() { - return getOwner().dbReferencedColumnTable(); - } - - @Override - protected String tableName() { - return this.getOwner().getTypeMapping().getTableName(); - } - - public boolean isReferencedColumnResolved() { - return dbReferencedColumn() != null; - } - - public ITextRange referencedColumnNameTextRange() { - if (node == null) { - return owner.validationTextRange(); - } - IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.REFERENCED_COLUMN_NAME); - return (referencedColumnNameNode == null) ? validationTextRange() : buildTextRange(referencedColumnNameNode); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultReferencedColumnName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY)); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_NAME_KEY)); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlQueryHint.java deleted file mode 100644 index a8480f3a3a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlQueryHint.java +++ /dev/null @@ -1,281 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Query Hint'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlQueryHint() - * @model kind="class" - * @generated - */ -public class XmlQueryHint extends XmlEObject implements IQueryHint -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlQueryHint() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_QUERY_HINT; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIQueryHint_Name() - * @model - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlQueryHint#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_QUERY_HINT__NAME, oldName, name)); - } - - /** - * Returns the value of the 'Value' attribute. - * - *

    - * If the meaning of the 'Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIQueryHint_Value() - * @model - * @generated - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlQueryHint#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_QUERY_HINT__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_QUERY_HINT__NAME : - return getName(); - case OrmPackage.XML_QUERY_HINT__VALUE : - return getValue(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_QUERY_HINT__NAME : - setName((String) newValue); - return; - case OrmPackage.XML_QUERY_HINT__VALUE : - setValue((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_QUERY_HINT__NAME : - setName(NAME_EDEFAULT); - return; - case OrmPackage.XML_QUERY_HINT__VALUE : - setValue(VALUE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_QUERY_HINT__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case OrmPackage.XML_QUERY_HINT__VALUE : - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IQueryHint.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_QUERY_HINT__NAME : - return JpaCoreMappingsPackage.IQUERY_HINT__NAME; - case OrmPackage.XML_QUERY_HINT__VALUE : - return JpaCoreMappingsPackage.IQUERY_HINT__VALUE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IQueryHint.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IQUERY_HINT__NAME : - return OrmPackage.XML_QUERY_HINT__NAME; - case JpaCoreMappingsPackage.IQUERY_HINT__VALUE : - return OrmPackage.XML_QUERY_HINT__VALUE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", value: "); - result.append(value); - result.append(')'); - return result.toString(); - } -} // XmlQueryHint diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java deleted file mode 100644 index de47356025..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java +++ /dev/null @@ -1,582 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.RelationshipMappingTools; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -/** - * - * A representation of the model object 'Xml Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRelationshipMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlRelationshipMapping extends XmlAttributeMapping - implements IRelationshipMapping -{ - /** - * The default value of the '{@link #getTargetEntity() Target Entity}' attribute. - * - * - * @see #getTargetEntity() - * @generated - * @ordered - */ - protected static final String TARGET_ENTITY_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedTargetEntity() Specified Target Entity}' attribute. - * - * - * @see #getSpecifiedTargetEntity() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TARGET_ENTITY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedTargetEntity() Specified Target Entity}' attribute. - * - * - * @see #getSpecifiedTargetEntity() - * @generated - * @ordered - */ - protected String specifiedTargetEntity = SPECIFIED_TARGET_ENTITY_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultTargetEntity() Default Target Entity}' attribute. - * - * - * @see #getDefaultTargetEntity() - * @generated - * @ordered - */ - protected static final String DEFAULT_TARGET_ENTITY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultTargetEntity() Default Target Entity}' attribute. - * - * - * @see #getDefaultTargetEntity() - * @generated - * @ordered - */ - protected String defaultTargetEntity = DEFAULT_TARGET_ENTITY_EDEFAULT; - - /** - * The cached value of the '{@link #getResolvedTargetEntity() Resolved Target Entity}' reference. - * - * - * @see #getResolvedTargetEntity() - * @generated - * @ordered - */ - protected IEntity resolvedTargetEntity; - - /** - * The cached value of the '{@link #getCascade() Cascade}' containment reference. - * - * - * @see #getCascade() - * @generated - * @ordered - */ - protected ICascade cascade; - - /** - * - * - * @generated - */ - protected XmlRelationshipMapping() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_RELATIONSHIP_MAPPING; - } - - /** - * Returns the value of the 'Target Entity' attribute. - * - *

    - * If the meaning of the 'Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Target Entity' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIRelationshipMapping_TargetEntity() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getTargetEntity() { - return (this.getSpecifiedTargetEntity() == null) ? getDefaultTargetEntity() : this.getSpecifiedTargetEntity(); - } - - /** - * Returns the value of the 'Specified Target Entity' attribute. - * - *

    - * If the meaning of the 'Specified Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Target Entity' attribute. - * @see #setSpecifiedTargetEntity(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIRelationshipMapping_SpecifiedTargetEntity() - * @model - * @generated - */ - public String getSpecifiedTargetEntity() { - return specifiedTargetEntity; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping#getSpecifiedTargetEntity Specified Target Entity}' attribute. - * - * - * @param value the new value of the 'Specified Target Entity' attribute. - * @see #getSpecifiedTargetEntity() - * @generated - */ - public void setSpecifiedTargetEntity(String newSpecifiedTargetEntity) { - String oldSpecifiedTargetEntity = specifiedTargetEntity; - specifiedTargetEntity = newSpecifiedTargetEntity; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY, oldSpecifiedTargetEntity, specifiedTargetEntity)); - } - - /** - * Returns the value of the 'Default Target Entity' attribute. - * - *

    - * If the meaning of the 'Default Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Target Entity' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIRelationshipMapping_DefaultTargetEntity() - * @model changeable="false" - * @generated - */ - public String getDefaultTargetEntity() { - return defaultTargetEntity; - } - - /** - * Returns the value of the 'Resolved Target Entity' reference. - * - *

    - * If the meaning of the 'Resolved Target Entity' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Resolved Target Entity' reference. - * @see #setResolvedTargetEntity(IEntity) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIRelationshipMapping_ResolvedTargetEntity() - * @model - * @generated - */ - public IEntity getResolvedTargetEntity() { - if (resolvedTargetEntity != null && resolvedTargetEntity.eIsProxy()) { - InternalEObject oldResolvedTargetEntity = (InternalEObject) resolvedTargetEntity; - resolvedTargetEntity = (IEntity) eResolveProxy(oldResolvedTargetEntity); - if (resolvedTargetEntity != oldResolvedTargetEntity) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY, oldResolvedTargetEntity, resolvedTargetEntity)); - } - } - return resolvedTargetEntity; - } - - /** - * - * - * @generated - */ - public IEntity basicGetResolvedTargetEntity() { - return resolvedTargetEntity; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping#getResolvedTargetEntity Resolved Target Entity}' reference. - * - * - * @param value the new value of the 'Resolved Target Entity' reference. - * @see #getResolvedTargetEntity() - * @generated - */ - public void setResolvedTargetEntity(IEntity newResolvedTargetEntity) { - IEntity oldResolvedTargetEntity = resolvedTargetEntity; - resolvedTargetEntity = newResolvedTargetEntity; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY, oldResolvedTargetEntity, resolvedTargetEntity)); - } - - /** - * Returns the value of the 'Cascade' containment reference. - * - *

    - * If the meaning of the 'Cascade' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Cascade' containment reference. - * @see #setCascade(ICascade) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIRelationshipMapping_Cascade() - * @model containment="true" - * @generated - */ - public ICascade getCascade() { - return cascade; - } - - public ICascade createCascade() { - return OrmFactory.eINSTANCE.createXmlCascade(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetCascade(ICascade newCascade, NotificationChain msgs) { - ICascade oldCascade = cascade; - cascade = newCascade; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, oldCascade, newCascade); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping#getCascade Cascade}' containment reference. - * - * - * @param value the new value of the 'Cascade' containment reference. - * @see #getCascade() - * @generated - */ - public void setCascade(ICascade newCascade) { - if (newCascade != cascade) { - NotificationChain msgs = null; - if (cascade != null) - msgs = ((InternalEObject) cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, null, msgs); - if (newCascade != null) - msgs = ((InternalEObject) newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, null, msgs); - msgs = basicSetCascade(newCascade, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, newCascade, newCascade)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE : - return basicSetCascade(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - //TODO should we allow setting through the ecore, that would make this method - //public and part of the ITable api. only the model needs to be setting the default, - //but the ui needs to be listening for changes to the default. - protected void setDefaultTargetEntity(String newDefaultTargetEntity) { - String oldDefaultTargetEntity = this.defaultTargetEntity; - this.defaultTargetEntity = newDefaultTargetEntity; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY, oldDefaultTargetEntity, this.defaultTargetEntity)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY : - return getTargetEntity(); - case OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return getSpecifiedTargetEntity(); - case OrmPackage.XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return getDefaultTargetEntity(); - case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - if (resolve) - return getResolvedTargetEntity(); - return basicGetResolvedTargetEntity(); - case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE : - return getCascade(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - setSpecifiedTargetEntity((String) newValue); - return; - case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - setResolvedTargetEntity((IEntity) newValue); - return; - case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE : - setCascade((ICascade) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - setSpecifiedTargetEntity(SPECIFIED_TARGET_ENTITY_EDEFAULT); - return; - case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - setResolvedTargetEntity((IEntity) null); - return; - case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE : - setCascade((ICascade) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY : - return TARGET_ENTITY_EDEFAULT == null ? getTargetEntity() != null : !TARGET_ENTITY_EDEFAULT.equals(getTargetEntity()); - case OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return SPECIFIED_TARGET_ENTITY_EDEFAULT == null ? specifiedTargetEntity != null : !SPECIFIED_TARGET_ENTITY_EDEFAULT.equals(specifiedTargetEntity); - case OrmPackage.XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return DEFAULT_TARGET_ENTITY_EDEFAULT == null ? defaultTargetEntity != null : !DEFAULT_TARGET_ENTITY_EDEFAULT.equals(defaultTargetEntity); - case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - return resolvedTargetEntity != null; - case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE : - return cascade != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IRelationshipMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__TARGET_ENTITY; - case OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - case OrmPackage.XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE : - return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IRelationshipMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__TARGET_ENTITY : - return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY : - return OrmPackage.XML_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY : - return OrmPackage.XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY : - return OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE : - return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedTargetEntity: "); - result.append(specifiedTargetEntity); - result.append(", defaultTargetEntity: "); - result.append(defaultTargetEntity); - result.append(')'); - return result.toString(); - } - - @Override - public void initializeFromXmlRelationshipMapping(XmlRelationshipMapping oldMapping) { - super.initializeFromXmlRelationshipMapping(oldMapping); - setSpecifiedTargetEntity(oldMapping.getSpecifiedTargetEntity()); - } - - public boolean targetEntityIsValid(String targetEntity) { - return RelationshipMappingTools.targetEntityIsValid(targetEntity); - } - - public IEntity getEntity() { - ITypeMapping typeMapping = getPersistentType().getMapping(); - if (typeMapping instanceof IEntity) { - return (IEntity) typeMapping; - } - return null; - } - - public String fullyQualifiedTargetEntity() { - if (getTargetEntity() == null) { - return null; - } - if (targetEntityIncludesPackage()) { - return getTargetEntity(); - } - String package_ = getPersistentType().getMapping().getEntityMappings().getPackage(); - if (package_ != null) { - return package_ + '.' + getTargetEntity(); - } - return getTargetEntity(); - } - - private boolean targetEntityIncludesPackage() { - return getTargetEntity().lastIndexOf('.') != -1; - } - - public Iterator allTargetEntityAttributeNames() { - IEntity targetEntity = this.getResolvedTargetEntity(); - return (targetEntity == null) ? EmptyIterator. instance() : targetEntity.getPersistentType().allAttributeNames(); - } - - public Iterator candidateMappedByAttributeNames() { - return this.allTargetEntityAttributeNames(); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - setDefaultTargetEntity((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TARGET_ENTITY_KEY)); - String targetEntity = fullyQualifiedTargetEntity(); - if (targetEntity != null) { - IPersistentType persistentType = defaultsContext.persistentType(targetEntity); - if (persistentType != null) { - if (persistentType.getMapping() instanceof IEntity) { - setResolvedTargetEntity((IEntity) persistentType.getMapping()); - return; - } - } - } - setResolvedTargetEntity(null); - } - - /** - * the default 'targetEntity' is calculated from the attribute type; - * return null if the attribute type cannot possibly be an entity - */ - public String javaDefaultTargetEntity() { - return this.javaDefaultTargetEntity(this.getPersistentAttribute().getAttribute().typeSignature()); - } - - protected String javaDefaultTargetEntity(String signature) { - IType iType = getPersistentType().findJdtType(); - if (iType != null) { - return buildReferenceEntityTypeName(signature, iType); - } - return null; - } - - // TODO Embeddable??? - public static String buildReferenceEntityTypeName(String signature, IType jdtType) { - if (Signature.getArrayCount(signature) > 0) { - return null; // arrays cannot be entities - } - return JDTTools.resolve(Signature.toString(signature), jdtType); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRootContentNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRootContentNode.java deleted file mode 100644 index f75b4fc1cb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRootContentNode.java +++ /dev/null @@ -1,351 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.JpaFile; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * A representation of the model object 'Xml Root Content Node'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode#getEntityMappings Entity Mappings}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRootContentNode() - * @model kind="class" - * @generated - */ -public class XmlRootContentNode extends XmlEObject - implements IJpaRootContentNode -{ - /** - * The cached value of the '{@link #getEntityMappings() Entity Mappings}' reference. - * - * - * @see #getEntityMappings() - * @generated - * @ordered - */ - protected EntityMappingsInternal entityMappings; - - /** - * - * - * @generated - */ - protected XmlRootContentNode() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ROOT_CONTENT_NODE; - } - - /* @see IJpaContentNode#getId() */ - public Object getId() { - return IXmlContentNodes.XML_ROOT_ID; - } - - /** - * Returns the value of the 'Jpa File' container reference. - * The default value is "". - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}'. - * - *

    - * If the meaning of the 'File' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Jpa File' container reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIJpaRootContentNode_JpaFile() - * @see org.eclipse.jpt.core.internal.JpaFile#getContent - * @model opposite="content" changeable="false" - * @generated - */ - public IJpaFile getJpaFile() { - if (eContainerFeatureID != OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE) - return null; - return (IJpaFile) eContainer(); - } - - public IResource getResource() { - return getJpaFile().getResource(); - } - - /** - * Returns the value of the 'Entity Mappings' reference. - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getRoot Root}'. - * - *

    - * If the meaning of the 'Entity Mappings' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Entity Mappings' reference. - * @see #setEntityMappings(EntityMappingsInternal) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlRootContentNode_EntityMappings() - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getRoot - * @model opposite="root" resolveProxies="false" required="true" ordered="false" - * @generated - */ - public EntityMappingsInternal getEntityMappings() { - return entityMappings; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetEntityMappings(EntityMappingsInternal newEntityMappings, NotificationChain msgs) { - EntityMappingsInternal oldEntityMappings = entityMappings; - entityMappings = newEntityMappings; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS, oldEntityMappings, newEntityMappings); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode#getEntityMappings Entity Mappings}' reference. - * - * - * @param value the new value of the 'Entity Mappings' reference. - * @see #getEntityMappings() - * @generated - */ - public void setEntityMappings(EntityMappingsInternal newEntityMappings) { - if (newEntityMappings != entityMappings) { - NotificationChain msgs = null; - if (entityMappings != null) - msgs = ((InternalEObject) entityMappings).eInverseRemove(this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT, EntityMappingsInternal.class, msgs); - if (newEntityMappings != null) - msgs = ((InternalEObject) newEntityMappings).eInverseAdd(this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT, EntityMappingsInternal.class, msgs); - msgs = basicSetEntityMappings(newEntityMappings, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS, newEntityMappings, newEntityMappings)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE : - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE, msgs); - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS : - if (entityMappings != null) - msgs = ((InternalEObject) entityMappings).eInverseRemove(this, OrmPackage.ENTITY_MAPPINGS_INTERNAL__ROOT, EntityMappingsInternal.class, msgs); - return basicSetEntityMappings((EntityMappingsInternal) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE : - return eBasicSetContainer(null, OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE, msgs); - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS : - return basicSetEntityMappings(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE : - return eInternalContainer().eInverseRemove(this, JpaCorePackage.JPA_FILE__CONTENT, JpaFile.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE : - return getJpaFile(); - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS : - return getEntityMappings(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS : - setEntityMappings((EntityMappingsInternal) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS : - setEntityMappings((EntityMappingsInternal) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE : - return getJpaFile() != null; - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS : - return entityMappings != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IJpaRootContentNode.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE : - return JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IJpaRootContentNode.class) { - switch (baseFeatureID) { - case JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE : - return OrmPackage.XML_ROOT_CONTENT_NODE__JPA_FILE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /* (non-Javadoc) - * - * @see IJpaRootContentNode#getContentNode(int) - */ - public IJpaContentNode getContentNode(int offset) { - if (getEntityMappings() == null || !getEntityMappings().getNode().contains(offset)) { - return this; - } - return getEntityMappings().getContentNode(offset); - } - - /* (non-Javadoc) - * - * @see IJpaRootContentNode#handleJavaElementChangedEvent(ElementChangedEvent) - */ - public void handleJavaElementChangedEvent(ElementChangedEvent event) { - getEntityMappings().handleJavaElementChangedEvent(event); - } - - /* (non-Javadoc) - * - * @see IJpaRootContentNode#dispose() - */ - public void dispose() { - // TODO - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java deleted file mode 100644 index 8295c68dfe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java +++ /dev/null @@ -1,286 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Secondary Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSecondaryTable() - * @model kind="class" - * @generated - */ -public class XmlSecondaryTable extends AbstractXmlTable - implements ISecondaryTable -{ - /** - * The cached value of the '{@link #getSpecifiedPrimaryKeyJoinColumns() Specified Primary Key Join Columns}' containment reference list. - * - * - * @see #getSpecifiedPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedPrimaryKeyJoinColumns; - - /** - * The cached value of the '{@link #getDefaultPrimaryKeyJoinColumns() Default Primary Key Join Columns}' containment reference list. - * - * - * @see #getDefaultPrimaryKeyJoinColumns() - * @generated - * @ordered - */ - protected EList defaultPrimaryKeyJoinColumns; - - private XmlSecondaryTable() { - super(); - } - - protected XmlSecondaryTable(Owner owner) { - super(owner); - this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(0)); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_SECONDARY_TABLE; - } - - public EList getPrimaryKeyJoinColumns() { - return this.getSpecifiedPrimaryKeyJoinColumns().isEmpty() ? this.getDefaultPrimaryKeyJoinColumns() : this.getSpecifiedPrimaryKeyJoinColumns(); - } - - /** - * Returns the value of the 'Specified Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Specified Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISecondaryTable_SpecifiedPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedPrimaryKeyJoinColumns() { - if (specifiedPrimaryKeyJoinColumns == null) { - specifiedPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS); - } - return specifiedPrimaryKeyJoinColumns; - } - - /** - * Returns the value of the 'Default Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Default Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISecondaryTable_DefaultPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - public EList getDefaultPrimaryKeyJoinColumns() { - if (defaultPrimaryKeyJoinColumns == null) { - defaultPrimaryKeyJoinColumns = new EObjectContainmentEList(IPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS); - } - return defaultPrimaryKeyJoinColumns; - } - - public ITypeMapping typeMapping() { - return (ITypeMapping) eContainer(); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return ((InternalEList) getDefaultPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return getPrimaryKeyJoinColumns(); - case OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return getSpecifiedPrimaryKeyJoinColumns(); - case OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return getDefaultPrimaryKeyJoinColumns(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - getSpecifiedPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - getDefaultPrimaryKeyJoinColumns().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - getSpecifiedPrimaryKeyJoinColumns().clear(); - return; - case OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - getDefaultPrimaryKeyJoinColumns().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return !getPrimaryKeyJoinColumns().isEmpty(); - case OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return specifiedPrimaryKeyJoinColumns != null && !specifiedPrimaryKeyJoinColumns.isEmpty(); - case OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return defaultPrimaryKeyJoinColumns != null && !defaultPrimaryKeyJoinColumns.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ISecondaryTable.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS; - case OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ISecondaryTable.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS : - return OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS : - return OrmPackage.XML_SECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS : - return OrmPackage.XML_SECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - private XmlEntityInternal entity() { - return (XmlEntityInternal) eContainer(); - } - - @Override - protected void makeTableForXmlNonNull() { - //secondaryTables are part of a collection, the secondary-table element will be removed/added - //when the XmlSecondaryTable is removed/added to the XmlEntity collection - } - - @Override - protected void makeTableForXmlNull() { - //secondaryTables are part of a collection, the secondary-table element will be removed/added - //when the XmlSecondaryTable is removed/added to the XmlEntity collection - } - - public boolean containsSpecifiedPrimaryKeyJoinColumns() { - return !this.getSpecifiedPrimaryKeyJoinColumns().isEmpty(); - } - - public IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index) { - return OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn(new ISecondaryTable.PrimaryKeyJoinColumnOwner(this)); - } -} // XmlSecondaryTable diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSequenceGenerator.java deleted file mode 100644 index e9d9a07d75..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSequenceGenerator.java +++ /dev/null @@ -1,281 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Sequence Generator'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSequenceGenerator() - * @model kind="class" - * @generated - */ -public class XmlSequenceGenerator extends XmlGenerator - implements ISequenceGenerator -{ - /** - * The default value of the '{@link #getSequenceName() Sequence Name}' attribute. - * - * - * @see #getSequenceName() - * @generated - * @ordered - */ - protected static final String SEQUENCE_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSequenceName() Specified Sequence Name}' attribute. - * - * - * @see #getSpecifiedSequenceName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SEQUENCE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSequenceName() Specified Sequence Name}' attribute. - * - * - * @see #getSpecifiedSequenceName() - * @generated - * @ordered - */ - protected String specifiedSequenceName = SPECIFIED_SEQUENCE_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSequenceName() Default Sequence Name}' attribute. - * - * - * @see #getDefaultSequenceName() - * @generated - * @ordered - */ - protected static final String DEFAULT_SEQUENCE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSequenceName() Default Sequence Name}' attribute. - * - * - * @see #getDefaultSequenceName() - * @generated - * @ordered - */ - protected String defaultSequenceName = DEFAULT_SEQUENCE_NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected XmlSequenceGenerator() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_SEQUENCE_GENERATOR; - } - - public String getSequenceName() { - return (this.getSpecifiedSequenceName() == null) ? getDefaultSequenceName() : this.getSpecifiedSequenceName(); - } - - /** - * Returns the value of the 'Specified Sequence Name' attribute. - * - *

    - * If the meaning of the 'Specified Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Sequence Name' attribute. - * @see #setSpecifiedSequenceName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISequenceGenerator_SpecifiedSequenceName() - * @model - * @generated - */ - public String getSpecifiedSequenceName() { - return specifiedSequenceName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator#getSpecifiedSequenceName Specified Sequence Name}' attribute. - * - * - * @param value the new value of the 'Specified Sequence Name' attribute. - * @see #getSpecifiedSequenceName() - * @generated - */ - public void setSpecifiedSequenceName(String newSpecifiedSequenceName) { - String oldSpecifiedSequenceName = specifiedSequenceName; - specifiedSequenceName = newSpecifiedSequenceName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME, oldSpecifiedSequenceName, specifiedSequenceName)); - } - - /** - * Returns the value of the 'Default Sequence Name' attribute. - * - *

    - * If the meaning of the 'Default Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Sequence Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISequenceGenerator_DefaultSequenceName() - * @model changeable="false" - * @generated - */ - public String getDefaultSequenceName() { - return defaultSequenceName; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME : - return getSequenceName(); - case OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return getSpecifiedSequenceName(); - case OrmPackage.XML_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return getDefaultSequenceName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - setSpecifiedSequenceName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - setSpecifiedSequenceName(SPECIFIED_SEQUENCE_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME : - return SEQUENCE_NAME_EDEFAULT == null ? getSequenceName() != null : !SEQUENCE_NAME_EDEFAULT.equals(getSequenceName()); - case OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return SPECIFIED_SEQUENCE_NAME_EDEFAULT == null ? specifiedSequenceName != null : !SPECIFIED_SEQUENCE_NAME_EDEFAULT.equals(specifiedSequenceName); - case OrmPackage.XML_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return DEFAULT_SEQUENCE_NAME_EDEFAULT == null ? defaultSequenceName != null : !DEFAULT_SEQUENCE_NAME_EDEFAULT.equals(defaultSequenceName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ISequenceGenerator.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME : - return JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SEQUENCE_NAME; - case OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME; - case OrmPackage.XML_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ISequenceGenerator.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SEQUENCE_NAME : - return OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME; - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME : - return OrmPackage.XML_SEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME; - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME : - return OrmPackage.XML_SEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedSequenceName: "); - result.append(specifiedSequenceName); - result.append(", defaultSequenceName: "); - result.append(defaultSequenceName); - result.append(')'); - return result.toString(); - } -} // XmlSequenceGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSingleRelationshipMapping.java deleted file mode 100644 index f392d9f033..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSingleRelationshipMapping.java +++ /dev/null @@ -1,483 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Single Relationship Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlSingleRelationshipMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlSingleRelationshipMapping - extends XmlRelationshipMapping implements ISingleRelationshipMapping -{ - /** - * The default value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected static final DefaultEagerFetchType FETCH_EDEFAULT = DefaultEagerFetchType.DEFAULT; - - /** - * The cached value of the '{@link #getFetch() Fetch}' attribute. - * - * - * @see #getFetch() - * @generated - * @ordered - */ - protected DefaultEagerFetchType fetch = FETCH_EDEFAULT; - - /** - * The cached value of the '{@link #getSpecifiedJoinColumns() Specified Join Columns}' containment reference list. - * - * - * @see #getSpecifiedJoinColumns() - * @generated - * @ordered - */ - protected EList specifiedJoinColumns; - - /** - * The cached value of the '{@link #getDefaultJoinColumns() Default Join Columns}' containment reference list. - * - * - * @see #getDefaultJoinColumns() - * @generated - * @ordered - */ - protected EList defaultJoinColumns; - - /** - * The default value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected static final DefaultTrueBoolean OPTIONAL_EDEFAULT = DefaultTrueBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getOptional() Optional}' attribute. - * - * - * @see #getOptional() - * @generated - * @ordered - */ - protected DefaultTrueBoolean optional = OPTIONAL_EDEFAULT; - - /** - * - * - * @generated NOT - */ - protected XmlSingleRelationshipMapping() { - super(); - this.getDefaultJoinColumns().add(this.createJoinColumn(new JoinColumnOwner(this))); - this.eAdapters().add(this.buildListener()); - } - - private IJoinColumn createJoinColumn(IJoinColumn.Owner owner) { - return OrmFactory.eINSTANCE.createXmlJoinColumn(owner); - } - - private Adapter buildListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - XmlSingleRelationshipMapping.this.notifyChanged(notification); - } - }; - } - - /** - * check for changes to the 'specifiedJoinColumns' and - * 'specifiedInverseJoinColumns' lists so we can notify the - * model adapter of any changes; - * also listen for changes to the 'defaultJoinColumns' and - * 'defaultInverseJoinColumns' lists so we can spank the developer - */ - void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ISingleRelationshipMapping.class)) { - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - defaultJoinColumnsChanged(notification); - break; - default : - break; - } - } - - void defaultJoinColumnsChanged(Notification notification) { - throw new IllegalStateException("'defaultJoinColumns' cannot be changed"); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_SINGLE_RELATIONSHIP_MAPPING; - } - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType}. - * - *

    - * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #setFetch(DefaultEagerFetchType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISingleRelationshipMapping_Fetch() - * @model - * @generated - */ - public DefaultEagerFetchType getFetch() { - return fetch; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #getFetch() - * @generated - */ - public void setFetch(DefaultEagerFetchType newFetch) { - DefaultEagerFetchType oldFetch = fetch; - fetch = newFetch == null ? FETCH_EDEFAULT : newFetch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH, oldFetch, fetch)); - } - - /** - * Returns the value of the 'Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISingleRelationshipMapping_JoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public EList getJoinColumns() { - return this.getSpecifiedJoinColumns().isEmpty() ? this.getDefaultJoinColumns() : this.getSpecifiedJoinColumns(); - } - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISingleRelationshipMapping_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getSpecifiedJoinColumns() { - if (specifiedJoinColumns == null) { - specifiedJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS); - } - return specifiedJoinColumns; - } - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISingleRelationshipMapping_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - public EList getDefaultJoinColumns() { - if (defaultJoinColumns == null) { - defaultJoinColumns = new EObjectContainmentEList(IJoinColumn.class, this, OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS); - } - return defaultJoinColumns; - } - - /** - * Returns the value of the 'Optional' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Optional' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setOptional(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getISingleRelationshipMapping_Optional() - * @model - * @generated - */ - public DefaultTrueBoolean getOptional() { - return optional; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping#getOptional Optional}' attribute. - * - * - * @param value the new value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getOptional() - * @generated - */ - public void setOptional(DefaultTrueBoolean newOptional) { - DefaultTrueBoolean oldOptional = optional; - optional = newOptional == null ? OPTIONAL_EDEFAULT : newOptional; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL, oldOptional, optional)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return ((InternalEList) getJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return ((InternalEList) getSpecifiedJoinColumns()).basicRemove(otherEnd, msgs); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return ((InternalEList) getDefaultJoinColumns()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH : - return getFetch(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return getJoinColumns(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return getSpecifiedJoinColumns(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return getDefaultJoinColumns(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return getOptional(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH : - setFetch((DefaultEagerFetchType) newValue); - return; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - getSpecifiedJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - getDefaultJoinColumns().addAll((Collection) newValue); - return; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - setOptional((DefaultTrueBoolean) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH : - setFetch(FETCH_EDEFAULT); - return; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - getSpecifiedJoinColumns().clear(); - return; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - getDefaultJoinColumns().clear(); - return; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - setOptional(OPTIONAL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH : - return fetch != FETCH_EDEFAULT; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return !getJoinColumns().isEmpty(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return specifiedJoinColumns != null && !specifiedJoinColumns.isEmpty(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return defaultJoinColumns != null && !defaultJoinColumns.isEmpty(); - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return optional != OPTIONAL_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ISingleRelationshipMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ISingleRelationshipMapping.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH : - return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__FETCH; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS : - return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS : - return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS : - return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL : - return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fetch: "); - result.append(fetch); - result.append(", optional: "); - result.append(optional); - result.append(')'); - return result.toString(); - } - - @Override - public void initializeFromXmlSingleRelationshipMapping(XmlSingleRelationshipMapping oldMapping) { - super.initializeFromXmlSingleRelationshipMapping(oldMapping); - setFetch(oldMapping.getFetch()); - } - - public IJoinColumn createJoinColumn(int index) { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new JoinColumnOwner(this)); - } - - public boolean containsSpecifiedJoinColumns() { - return !this.getSpecifiedJoinColumns().isEmpty(); - } -} // XmlSingleRelationshipMapping diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTable.java deleted file mode 100644 index eaf623b6fa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTable.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - * A representation of the model object 'Xml Table'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTable() - * @model kind="class" - * @generated - */ -public class XmlTable extends AbstractXmlTable -{ - /** - * - * - * @generated - */ - protected XmlTable() { - super(); - } - - protected XmlTable(Owner owner) { - super(owner); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_TABLE; - } - - private XmlEntityInternal entity() { - return (XmlEntityInternal) eContainer(); - } - - @Override - protected void makeTableForXmlNonNull() { - entity().makeTableForXmlNonNull(); - } - - @Override - protected void makeTableForXmlNull() { - entity().makeTableForXmlNull(); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY)); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java deleted file mode 100644 index cf10c7787c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java +++ /dev/null @@ -1,1070 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'Xml Table Generator'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTableGenerator() - * @model kind="class" - * @generated - */ -public class XmlTableGenerator extends XmlGenerator implements ITableGenerator -{ - /** - * The default value of the '{@link #getTable() Table}' attribute. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected static final String TABLE_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected static final String SPECIFIED_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedTable() Specified Table}' attribute. - * - * - * @see #getSpecifiedTable() - * @generated - * @ordered - */ - protected String specifiedTable = SPECIFIED_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected static final String DEFAULT_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultTable() Default Table}' attribute. - * - * - * @see #getDefaultTable() - * @generated - * @ordered - */ - protected String defaultTable = DEFAULT_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #getCatalog() Catalog}' attribute. - * - * - * @see #getCatalog() - * @generated - * @ordered - */ - protected static final String CATALOG_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected static final String SPECIFIED_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedCatalog() Specified Catalog}' attribute. - * - * - * @see #getSpecifiedCatalog() - * @generated - * @ordered - */ - protected String specifiedCatalog = SPECIFIED_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected static final String DEFAULT_CATALOG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultCatalog() Default Catalog}' attribute. - * - * - * @see #getDefaultCatalog() - * @generated - * @ordered - */ - protected String defaultCatalog = DEFAULT_CATALOG_EDEFAULT; - - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected static final String SPECIFIED_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedSchema() Specified Schema}' attribute. - * - * - * @see #getSpecifiedSchema() - * @generated - * @ordered - */ - protected String specifiedSchema = SPECIFIED_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected static final String DEFAULT_SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSchema() Default Schema}' attribute. - * - * - * @see #getDefaultSchema() - * @generated - * @ordered - */ - protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getPkColumnName() Pk Column Name}' attribute. - * - * - * @see #getPkColumnName() - * @generated - * @ordered - */ - protected static final String PK_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedPkColumnName() Specified Pk Column Name}' attribute. - * - * - * @see #getSpecifiedPkColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_PK_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedPkColumnName() Specified Pk Column Name}' attribute. - * - * - * @see #getSpecifiedPkColumnName() - * @generated - * @ordered - */ - protected String specifiedPkColumnName = SPECIFIED_PK_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultPkColumnName() Default Pk Column Name}' attribute. - * - * - * @see #getDefaultPkColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_PK_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultPkColumnName() Default Pk Column Name}' attribute. - * - * - * @see #getDefaultPkColumnName() - * @generated - * @ordered - */ - protected String defaultPkColumnName = DEFAULT_PK_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getValueColumnName() Value Column Name}' attribute. - * - * - * @see #getValueColumnName() - * @generated - * @ordered - */ - protected static final String VALUE_COLUMN_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedValueColumnName() Specified Value Column Name}' attribute. - * - * - * @see #getSpecifiedValueColumnName() - * @generated - * @ordered - */ - protected static final String SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedValueColumnName() Specified Value Column Name}' attribute. - * - * - * @see #getSpecifiedValueColumnName() - * @generated - * @ordered - */ - protected String specifiedValueColumnName = SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultValueColumnName() Default Value Column Name}' attribute. - * - * - * @see #getDefaultValueColumnName() - * @generated - * @ordered - */ - protected static final String DEFAULT_VALUE_COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultValueColumnName() Default Value Column Name}' attribute. - * - * - * @see #getDefaultValueColumnName() - * @generated - * @ordered - */ - protected String defaultValueColumnName = DEFAULT_VALUE_COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPkColumnValue() Pk Column Value}' attribute. - * - * - * @see #getPkColumnValue() - * @generated - * @ordered - */ - protected static final String PK_COLUMN_VALUE_EDEFAULT = null; - - /** - * The default value of the '{@link #getSpecifiedPkColumnValue() Specified Pk Column Value}' attribute. - * - * - * @see #getSpecifiedPkColumnValue() - * @generated - * @ordered - */ - protected static final String SPECIFIED_PK_COLUMN_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSpecifiedPkColumnValue() Specified Pk Column Value}' attribute. - * - * - * @see #getSpecifiedPkColumnValue() - * @generated - * @ordered - */ - protected String specifiedPkColumnValue = SPECIFIED_PK_COLUMN_VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getDefaultPkColumnValue() Default Pk Column Value}' attribute. - * - * - * @see #getDefaultPkColumnValue() - * @generated - * @ordered - */ - protected static final String DEFAULT_PK_COLUMN_VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultPkColumnValue() Default Pk Column Value}' attribute. - * - * - * @see #getDefaultPkColumnValue() - * @generated - * @ordered - */ - protected String defaultPkColumnValue = DEFAULT_PK_COLUMN_VALUE_EDEFAULT; - - /** - * The cached value of the '{@link #getUniqueConstraints() Unique Constraints}' containment reference list. - * - * - * @see #getUniqueConstraints() - * @generated - * @ordered - */ - protected EList uniqueConstraints; - - /** - * - * - * @generated - */ - protected XmlTableGenerator() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_TABLE_GENERATOR; - } - - public String getTable() { - return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable(); - } - - /** - * Returns the value of the 'Specified Table' attribute. - * - *

    - * If the meaning of the 'Specified Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Table' attribute. - * @see #setSpecifiedTable(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_SpecifiedTable() - * @model - * @generated - */ - public String getSpecifiedTable() { - return specifiedTable; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator#getSpecifiedTable Specified Table}' attribute. - * - * - * @param value the new value of the 'Specified Table' attribute. - * @see #getSpecifiedTable() - * @generated - */ - public void setSpecifiedTable(String newSpecifiedTable) { - String oldSpecifiedTable = specifiedTable; - specifiedTable = newSpecifiedTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE, oldSpecifiedTable, specifiedTable)); - } - - /** - * Returns the value of the 'Default Table' attribute. - * - *

    - * If the meaning of the 'Default Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Table' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_DefaultTable() - * @model changeable="false" - * @generated - */ - public String getDefaultTable() { - return defaultTable; - } - - public String getCatalog() { - return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog(); - } - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

    - * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_SpecifiedCatalog() - * @model - * @generated - */ - public String getSpecifiedCatalog() { - return specifiedCatalog; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - public void setSpecifiedCatalog(String newSpecifiedCatalog) { - String oldSpecifiedCatalog = specifiedCatalog; - specifiedCatalog = newSpecifiedCatalog; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG, oldSpecifiedCatalog, specifiedCatalog)); - } - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

    - * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Catalog' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_DefaultCatalog() - * @model changeable="false" - * @generated - */ - public String getDefaultCatalog() { - return defaultCatalog; - } - - public String getSchema() { - return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema(); - } - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

    - * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_SpecifiedSchema() - * @model - * @generated - */ - public String getSpecifiedSchema() { - return specifiedSchema; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - public void setSpecifiedSchema(String newSpecifiedSchema) { - String oldSpecifiedSchema = specifiedSchema; - specifiedSchema = newSpecifiedSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA, oldSpecifiedSchema, specifiedSchema)); - } - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

    - * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Schema' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_DefaultSchema() - * @model changeable="false" - * @generated - */ - public String getDefaultSchema() { - return defaultSchema; - } - - protected void setDefaultSchema(String newDefaultSchema) { - String oldDefaultSchema = this.defaultSchema; - this.defaultSchema = newDefaultSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__DEFAULT_SCHEMA, oldDefaultSchema, this.defaultSchema)); - } - - public String getPkColumnName() { - return (this.getSpecifiedPkColumnName() == null) ? getDefaultPkColumnName() : this.getSpecifiedPkColumnName(); - } - - /** - * Returns the value of the 'Specified Pk Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Pk Column Name' attribute. - * @see #setSpecifiedPkColumnName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_SpecifiedPkColumnName() - * @model - * @generated - */ - public String getSpecifiedPkColumnName() { - return specifiedPkColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator#getSpecifiedPkColumnName Specified Pk Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Pk Column Name' attribute. - * @see #getSpecifiedPkColumnName() - * @generated - */ - public void setSpecifiedPkColumnName(String newSpecifiedPkColumnName) { - String oldSpecifiedPkColumnName = specifiedPkColumnName; - specifiedPkColumnName = newSpecifiedPkColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME, oldSpecifiedPkColumnName, specifiedPkColumnName)); - } - - /** - * Returns the value of the 'Default Pk Column Name' attribute. - * - *

    - * If the meaning of the 'Default Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Pk Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_DefaultPkColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultPkColumnName() { - return defaultPkColumnName; - } - - public String getValueColumnName() { - return (this.getSpecifiedValueColumnName() == null) ? getDefaultValueColumnName() : this.getSpecifiedValueColumnName(); - } - - /** - * Returns the value of the 'Specified Value Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Value Column Name' attribute. - * @see #setSpecifiedValueColumnName(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_SpecifiedValueColumnName() - * @model - * @generated - */ - public String getSpecifiedValueColumnName() { - return specifiedValueColumnName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator#getSpecifiedValueColumnName Specified Value Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Value Column Name' attribute. - * @see #getSpecifiedValueColumnName() - * @generated - */ - public void setSpecifiedValueColumnName(String newSpecifiedValueColumnName) { - String oldSpecifiedValueColumnName = specifiedValueColumnName; - specifiedValueColumnName = newSpecifiedValueColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME, oldSpecifiedValueColumnName, specifiedValueColumnName)); - } - - /** - * Returns the value of the 'Default Value Column Name' attribute. - * - *

    - * If the meaning of the 'Default Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Value Column Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_DefaultValueColumnName() - * @model changeable="false" - * @generated - */ - public String getDefaultValueColumnName() { - return defaultValueColumnName; - } - - public String getPkColumnValue() { - return (this.getSpecifiedPkColumnValue() == null) ? getDefaultPkColumnValue() : this.getSpecifiedPkColumnValue(); - } - - /** - * Returns the value of the 'Specified Pk Column Value' attribute. - * - *

    - * If the meaning of the 'Specified Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Pk Column Value' attribute. - * @see #setSpecifiedPkColumnValue(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_SpecifiedPkColumnValue() - * @model - * @generated - */ - public String getSpecifiedPkColumnValue() { - return specifiedPkColumnValue; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator#getSpecifiedPkColumnValue Specified Pk Column Value}' attribute. - * - * - * @param value the new value of the 'Specified Pk Column Value' attribute. - * @see #getSpecifiedPkColumnValue() - * @generated - */ - public void setSpecifiedPkColumnValue(String newSpecifiedPkColumnValue) { - String oldSpecifiedPkColumnValue = specifiedPkColumnValue; - specifiedPkColumnValue = newSpecifiedPkColumnValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE, oldSpecifiedPkColumnValue, specifiedPkColumnValue)); - } - - /** - * Returns the value of the 'Default Pk Column Value' attribute. - * - *

    - * If the meaning of the 'Default Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Pk Column Value' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_DefaultPkColumnValue() - * @model changeable="false" - * @generated - */ - public String getDefaultPkColumnValue() { - return defaultPkColumnValue; - } - - /** - * Returns the value of the 'Unique Constraints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}. - * - *

    - * If the meaning of the 'Unique Constraints' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Unique Constraints' containment reference list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_UniqueConstraints() - * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true" - * @generated - */ - public EList getUniqueConstraints() { - if (uniqueConstraints == null) { - uniqueConstraints = new EObjectContainmentEList(IUniqueConstraint.class, this, OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS); - } - return uniqueConstraints; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return ((InternalEList) getUniqueConstraints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_TABLE_GENERATOR__TABLE : - return getTable(); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE : - return getSpecifiedTable(); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_TABLE : - return getDefaultTable(); - case OrmPackage.XML_TABLE_GENERATOR__CATALOG : - return getCatalog(); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG : - return getSpecifiedCatalog(); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_CATALOG : - return getDefaultCatalog(); - case OrmPackage.XML_TABLE_GENERATOR__SCHEMA : - return getSchema(); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA : - return getSpecifiedSchema(); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_SCHEMA : - return getDefaultSchema(); - case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME : - return getPkColumnName(); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return getSpecifiedPkColumnName(); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return getDefaultPkColumnName(); - case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME : - return getValueColumnName(); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return getSpecifiedValueColumnName(); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return getDefaultValueColumnName(); - case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE : - return getPkColumnValue(); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return getSpecifiedPkColumnValue(); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return getDefaultPkColumnValue(); - case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return getUniqueConstraints(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE : - setSpecifiedTable((String) newValue); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG : - setSpecifiedCatalog((String) newValue); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA : - setSpecifiedSchema((String) newValue); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - setSpecifiedPkColumnName((String) newValue); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - setSpecifiedValueColumnName((String) newValue); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - setSpecifiedPkColumnValue((String) newValue); - return; - case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - getUniqueConstraints().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE : - setSpecifiedTable(SPECIFIED_TABLE_EDEFAULT); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG : - setSpecifiedCatalog(SPECIFIED_CATALOG_EDEFAULT); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA : - setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - setSpecifiedPkColumnName(SPECIFIED_PK_COLUMN_NAME_EDEFAULT); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - setSpecifiedValueColumnName(SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT); - return; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - setSpecifiedPkColumnValue(SPECIFIED_PK_COLUMN_VALUE_EDEFAULT); - return; - case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - getUniqueConstraints().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_TABLE_GENERATOR__TABLE : - return TABLE_EDEFAULT == null ? getTable() != null : !TABLE_EDEFAULT.equals(getTable()); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE : - return SPECIFIED_TABLE_EDEFAULT == null ? specifiedTable != null : !SPECIFIED_TABLE_EDEFAULT.equals(specifiedTable); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_TABLE : - return DEFAULT_TABLE_EDEFAULT == null ? defaultTable != null : !DEFAULT_TABLE_EDEFAULT.equals(defaultTable); - case OrmPackage.XML_TABLE_GENERATOR__CATALOG : - return CATALOG_EDEFAULT == null ? getCatalog() != null : !CATALOG_EDEFAULT.equals(getCatalog()); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG : - return SPECIFIED_CATALOG_EDEFAULT == null ? specifiedCatalog != null : !SPECIFIED_CATALOG_EDEFAULT.equals(specifiedCatalog); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_CATALOG : - return DEFAULT_CATALOG_EDEFAULT == null ? defaultCatalog != null : !DEFAULT_CATALOG_EDEFAULT.equals(defaultCatalog); - case OrmPackage.XML_TABLE_GENERATOR__SCHEMA : - return SCHEMA_EDEFAULT == null ? getSchema() != null : !SCHEMA_EDEFAULT.equals(getSchema()); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA : - return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_SCHEMA : - return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema); - case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME : - return PK_COLUMN_NAME_EDEFAULT == null ? getPkColumnName() != null : !PK_COLUMN_NAME_EDEFAULT.equals(getPkColumnName()); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return SPECIFIED_PK_COLUMN_NAME_EDEFAULT == null ? specifiedPkColumnName != null : !SPECIFIED_PK_COLUMN_NAME_EDEFAULT.equals(specifiedPkColumnName); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return DEFAULT_PK_COLUMN_NAME_EDEFAULT == null ? defaultPkColumnName != null : !DEFAULT_PK_COLUMN_NAME_EDEFAULT.equals(defaultPkColumnName); - case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME : - return VALUE_COLUMN_NAME_EDEFAULT == null ? getValueColumnName() != null : !VALUE_COLUMN_NAME_EDEFAULT.equals(getValueColumnName()); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT == null ? specifiedValueColumnName != null : !SPECIFIED_VALUE_COLUMN_NAME_EDEFAULT.equals(specifiedValueColumnName); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return DEFAULT_VALUE_COLUMN_NAME_EDEFAULT == null ? defaultValueColumnName != null : !DEFAULT_VALUE_COLUMN_NAME_EDEFAULT.equals(defaultValueColumnName); - case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE : - return PK_COLUMN_VALUE_EDEFAULT == null ? getPkColumnValue() != null : !PK_COLUMN_VALUE_EDEFAULT.equals(getPkColumnValue()); - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return SPECIFIED_PK_COLUMN_VALUE_EDEFAULT == null ? specifiedPkColumnValue != null : !SPECIFIED_PK_COLUMN_VALUE_EDEFAULT.equals(specifiedPkColumnValue); - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return DEFAULT_PK_COLUMN_VALUE_EDEFAULT == null ? defaultPkColumnValue != null : !DEFAULT_PK_COLUMN_VALUE_EDEFAULT.equals(defaultPkColumnValue); - case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return uniqueConstraints != null && !uniqueConstraints.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ITableGenerator.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_TABLE_GENERATOR__TABLE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__TABLE; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_TABLE; - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_TABLE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_TABLE; - case OrmPackage.XML_TABLE_GENERATOR__CATALOG : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__CATALOG; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_CATALOG; - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_CATALOG : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_CATALOG; - case OrmPackage.XML_TABLE_GENERATOR__SCHEMA : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SCHEMA; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_SCHEMA; - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_SCHEMA : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_SCHEMA; - case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_NAME; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME; - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME; - case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__VALUE_COLUMN_NAME; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME; - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME; - case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_VALUE; - case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE; - case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE; - case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ITableGenerator.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.ITABLE_GENERATOR__TABLE : - return OrmPackage.XML_TABLE_GENERATOR__TABLE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_TABLE : - return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_TABLE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_TABLE : - return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_TABLE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__CATALOG : - return OrmPackage.XML_TABLE_GENERATOR__CATALOG; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_CATALOG : - return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_CATALOG; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_CATALOG : - return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_CATALOG; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SCHEMA : - return OrmPackage.XML_TABLE_GENERATOR__SCHEMA; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_SCHEMA : - return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_SCHEMA; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_SCHEMA : - return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_SCHEMA; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_NAME : - return OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME : - return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME : - return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__VALUE_COLUMN_NAME : - return OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME : - return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME : - return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__PK_COLUMN_VALUE : - return OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE : - return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE : - return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE; - case JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS : - return OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (specifiedTable: "); - result.append(specifiedTable); - result.append(", defaultTable: "); - result.append(defaultTable); - result.append(", specifiedCatalog: "); - result.append(specifiedCatalog); - result.append(", defaultCatalog: "); - result.append(defaultCatalog); - result.append(", specifiedSchema: "); - result.append(specifiedSchema); - result.append(", defaultSchema: "); - result.append(defaultSchema); - result.append(", specifiedPkColumnName: "); - result.append(specifiedPkColumnName); - result.append(", defaultPkColumnName: "); - result.append(defaultPkColumnName); - result.append(", specifiedValueColumnName: "); - result.append(specifiedValueColumnName); - result.append(", defaultValueColumnName: "); - result.append(defaultValueColumnName); - result.append(", specifiedPkColumnValue: "); - result.append(specifiedPkColumnValue); - result.append(", defaultPkColumnValue: "); - result.append(defaultPkColumnValue); - result.append(')'); - return result.toString(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - setDefaultSchema((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY)); - } - - public IUniqueConstraint createUniqueConstraint(int index) { - return createXmlJavaUniqueConstraint(index); - } - - protected XmlUniqueConstraint createXmlJavaUniqueConstraint(int index) { - return OrmFactory.eINSTANCE.createXmlUniqueConstraint(); - } - - public Table dbTable() { - Schema schema = this.dbSchema(); - return (schema == null) ? null : schema.tableNamed(this.getTable()); - } - - public Schema dbSchema() { - return this.database().schemaNamed(this.getSchema()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransient.java deleted file mode 100644 index f6666d4f2a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransient.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.ITransient; - -/** - * - * A representation of the model object 'Xml Transient'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTransient() - * @model kind="class" - * @generated - */ -public class XmlTransient extends XmlAttributeMapping implements ITransient -{ - /** - * - * - * @generated - */ - protected XmlTransient() { - super(); - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlTransientMapping(this); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_TRANSIENT; - } - - @Override - public int xmlSequence() { - return 8; - } - - public String getKey() { - return IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } -} // XmlTransient diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransientProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransientProvider.java deleted file mode 100644 index 39bb80daee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransientProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlTransientProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlTransientProvider INSTANCE = new XmlTransientProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlTransientProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlTransient(); - } - - public String key() { - return IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTypeMapping.java deleted file mode 100644 index 51a6f2c4f1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTypeMapping.java +++ /dev/null @@ -1,683 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Iterator; -import java.util.Set; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; -import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * An implementation of the model object 'Xml Persistent Type Mapping'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getDefaultAccess Default Access}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getSpecifiedAccess Specified Access}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getAccess Access}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getMetadataComplete Metadata Complete}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getPersistentType Persistent Type}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping() - * @model kind="class" abstract="true" - * @generated - */ -public abstract class XmlTypeMapping extends XmlEObject implements ITypeMapping -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getTableName() Table Name}' attribute. - * - * - * @see #getTableName() - * @generated - * @ordered - */ - protected static final String TABLE_NAME_EDEFAULT = null; - - /** - * The default value of the '{@link #getDefaultAccess() Default Access}' attribute. - * - * - * @see #getDefaultAccess() - * @generated - * @ordered - */ - protected static final AccessType DEFAULT_ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getDefaultAccess() Default Access}' attribute. - * - * - * @see #getDefaultAccess() - * @generated - * @ordered - */ - protected AccessType defaultAccess = DEFAULT_ACCESS_EDEFAULT; - - /** - * The default value of the '{@link #getSpecifiedAccess() Specified Access}' attribute. - * - * - * @see #getSpecifiedAccess() - * @generated - * @ordered - */ - protected static final AccessType SPECIFIED_ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The cached value of the '{@link #getSpecifiedAccess() Specified Access}' attribute. - * - * - * @see #getSpecifiedAccess() - * @generated - * @ordered - */ - protected AccessType specifiedAccess = SPECIFIED_ACCESS_EDEFAULT; - - /** - * The default value of the '{@link #getAccess() Access}' attribute. - * - * - * @see #getAccess() - * @generated - * @ordered - */ - protected static final AccessType ACCESS_EDEFAULT = AccessType.DEFAULT; - - /** - * The default value of the '{@link #getMetadataComplete() Metadata Complete}' attribute. - * - * - * @see #getMetadataComplete() - * @generated - * @ordered - */ - protected static final DefaultFalseBoolean METADATA_COMPLETE_EDEFAULT = DefaultFalseBoolean.DEFAULT; - - /** - * The cached value of the '{@link #getMetadataComplete() Metadata Complete}' attribute. - * - * - * @see #getMetadataComplete() - * @generated - * @ordered - */ - protected DefaultFalseBoolean metadataComplete = METADATA_COMPLETE_EDEFAULT; - - /** - * The cached value of the '{@link #getPersistentType() Persistent Type}' containment reference. - * - * - * @see #getPersistentType() - * @generated - * @ordered - */ - protected XmlPersistentType persistentType; - - /** - * - * - * @generated NOT - */ - protected XmlTypeMapping() { - super(); - XmlPersistentType persistentType = createXmlPersistentType(); - setPersistentType(persistentType); - } - - protected XmlPersistentType createXmlPersistentType() { - return OrmFactory.eINSTANCE.createXmlPersistentType(getKey()); - } - - @Override - protected void addInsignificantFeatureIdsTo(Set insignificantFeatureIds) { - super.addInsignificantFeatureIdsTo(insignificantFeatureIds); - insignificantFeatureIds.add(OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_TYPE_MAPPING; - } - - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITypeMapping_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getName() { - Type type = getPersistentType().findType(); - return (type == null) ? "" : type.getName(); - } - - /** - * Returns the value of the 'Table Name' attribute. - * - *

    - * If the meaning of the 'Table Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table Name' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITypeMapping_TableName() - * @model changeable="false" volatile="true" derived="true" - * @generated NOT - */ - public String getTableName() { - return ""; - } - - /** - * Returns the value of the 'Default Access' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

    - * If the meaning of the 'Default Access' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setDefaultAccess(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping_DefaultAccess() - * @model - * @generated - */ - public AccessType getDefaultAccess() { - return defaultAccess; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getDefaultAccess Default Access}' attribute. - * - * - * @param value the new value of the 'Default Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #getDefaultAccess() - * @generated - */ - public void setDefaultAccess(AccessType newDefaultAccess) { - AccessType oldDefaultAccess = defaultAccess; - defaultAccess = newDefaultAccess == null ? DEFAULT_ACCESS_EDEFAULT : newDefaultAccess; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TYPE_MAPPING__DEFAULT_ACCESS, oldDefaultAccess, defaultAccess)); - } - - /** - * Returns the value of the 'Specified Access' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.AccessType}. - * - *

    - * If the meaning of the 'Specified Access' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #setSpecifiedAccess(AccessType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping_SpecifiedAccess() - * @model - * @generated - */ - public AccessType getSpecifiedAccess() { - return specifiedAccess; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getSpecifiedAccess Specified Access}' attribute. - * - * - * @param value the new value of the 'Specified Access' attribute. - * @see org.eclipse.jpt.core.internal.AccessType - * @see #getSpecifiedAccess() - * @generated - */ - public void setSpecifiedAccess(AccessType newSpecifiedAccess) { - AccessType oldSpecifiedAccess = specifiedAccess; - specifiedAccess = newSpecifiedAccess == null ? SPECIFIED_ACCESS_EDEFAULT : newSpecifiedAccess; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS, oldSpecifiedAccess, specifiedAccess)); - } - - /** - * Returns the value of the 'Access' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.content.orm.AccessType}. - * - *

    - * If the meaning of the 'Access' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Access' attribute. - * @see org.eclipse.jpt.core.internal.content.orm.AccessType - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping_Access() - * @model transient="true" changeable="false" volatile="true" - * @generated NOT - */ - public AccessType getAccess() { - return (this.getSpecifiedAccess() == null) ? this.getDefaultAccess() : this.getSpecifiedAccess(); - } - - public EntityMappings getEntityMappings() { - return (EntityMappings) eContainer(); - } - - /** - * Returns the value of the 'Metadata Complete' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean}. - * - * - * @return the value of the 'Metadata Complete' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #setMetadataComplete(DefaultFalseBoolean) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping_MetadataComplete() - * @model - * @generated - */ - public DefaultFalseBoolean getMetadataComplete() { - return metadataComplete; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getMetadataComplete Metadata Complete}' attribute. - * - * - * @param value the new value of the 'Metadata Complete' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #getMetadataComplete() - * @generated - */ - public void setMetadataComplete(DefaultFalseBoolean newMetadataComplete) { - DefaultFalseBoolean oldMetadataComplete = metadataComplete; - metadataComplete = newMetadataComplete == null ? METADATA_COMPLETE_EDEFAULT : newMetadataComplete; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE, oldMetadataComplete, metadataComplete)); - } - - public boolean isXmlMetadataComplete() { - return isPersistenceUnitXmlMetadataComplete() || (getMetadataComplete() == DefaultFalseBoolean.TRUE); - } - - protected boolean isPersistenceUnitXmlMetadataComplete() { - return ((XmlRootContentNode) getRoot()).entityMappings.getPersistenceUnitMetadata().isXmlMappingMetadataComplete(); - } - - /** - * Returns the value of the 'Persistent Type' containment reference. - * - * - * @return the value of the 'Persistent Type' containment reference. - * @see #setPersistentType(XmlPersistentType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping_PersistentType() - * @model containment="true" required="true" - * @generated - */ - public XmlPersistentType getPersistentType() { - return persistentType; - } - - public IPersistentType javaPersistentType() { - return getPersistentType().findJavaPersistentType(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetPersistentType(XmlPersistentType newPersistentType, NotificationChain msgs) { - XmlPersistentType oldPersistentType = persistentType; - persistentType = newPersistentType; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE, oldPersistentType, newPersistentType); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping#getPersistentType Persistent Type}' containment reference. - * - * - * @param value the new value of the 'Persistent Type' containment reference. - * @see #getPersistentType() - * @generated - */ - public void setPersistentType(XmlPersistentType newPersistentType) { - if (newPersistentType != persistentType) { - NotificationChain msgs = null; - if (persistentType != null) - msgs = ((InternalEObject) persistentType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE, null, msgs); - if (newPersistentType != null) - msgs = ((InternalEObject) newPersistentType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE, null, msgs); - msgs = basicSetPersistentType(newPersistentType, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE, newPersistentType, newPersistentType)); - } - - /** - * - *

    - * If the meaning of the 'Attribute Mappings' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE : - return basicSetPersistentType(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_TYPE_MAPPING__NAME : - return getName(); - case OrmPackage.XML_TYPE_MAPPING__TABLE_NAME : - return getTableName(); - case OrmPackage.XML_TYPE_MAPPING__DEFAULT_ACCESS : - return getDefaultAccess(); - case OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS : - return getSpecifiedAccess(); - case OrmPackage.XML_TYPE_MAPPING__ACCESS : - return getAccess(); - case OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE : - return getMetadataComplete(); - case OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE : - return getPersistentType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_TYPE_MAPPING__DEFAULT_ACCESS : - setDefaultAccess((AccessType) newValue); - return; - case OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS : - setSpecifiedAccess((AccessType) newValue); - return; - case OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE : - setMetadataComplete((DefaultFalseBoolean) newValue); - return; - case OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE : - setPersistentType((XmlPersistentType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_TYPE_MAPPING__DEFAULT_ACCESS : - setDefaultAccess(DEFAULT_ACCESS_EDEFAULT); - return; - case OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS : - setSpecifiedAccess(SPECIFIED_ACCESS_EDEFAULT); - return; - case OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE : - setMetadataComplete(METADATA_COMPLETE_EDEFAULT); - return; - case OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE : - setPersistentType((XmlPersistentType) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_TYPE_MAPPING__NAME : - return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); - case OrmPackage.XML_TYPE_MAPPING__TABLE_NAME : - return TABLE_NAME_EDEFAULT == null ? getTableName() != null : !TABLE_NAME_EDEFAULT.equals(getTableName()); - case OrmPackage.XML_TYPE_MAPPING__DEFAULT_ACCESS : - return defaultAccess != DEFAULT_ACCESS_EDEFAULT; - case OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS : - return specifiedAccess != SPECIFIED_ACCESS_EDEFAULT; - case OrmPackage.XML_TYPE_MAPPING__ACCESS : - return getAccess() != ACCESS_EDEFAULT; - case OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE : - return metadataComplete != METADATA_COMPLETE_EDEFAULT; - case OrmPackage.XML_TYPE_MAPPING__PERSISTENT_TYPE : - return persistentType != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == ITypeMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_TYPE_MAPPING__NAME : - return JpaCorePackage.ITYPE_MAPPING__NAME; - case OrmPackage.XML_TYPE_MAPPING__TABLE_NAME : - return JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == ITypeMapping.class) { - switch (baseFeatureID) { - case JpaCorePackage.ITYPE_MAPPING__NAME : - return OrmPackage.XML_TYPE_MAPPING__NAME; - case JpaCorePackage.ITYPE_MAPPING__TABLE_NAME : - return OrmPackage.XML_TYPE_MAPPING__TABLE_NAME; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (defaultAccess: "); - result.append(defaultAccess); - result.append(", specifiedAccess: "); - result.append(specifiedAccess); - result.append(", metadataComplete: "); - result.append(metadataComplete); - result.append(')'); - return result.toString(); - } - - public void initialize() { - //do nothing as this will be handle by the Xml Translators - } - - /** - * ITypeMapping is changed and various ITypeMappings may have - * common settings. In this method initialize the new ITypeMapping (this) - * fromthe old ITypeMapping (oldMapping) - * @param oldMapping - */ - public void initializeFrom(XmlTypeMapping oldMapping) { - } - - public IJpaContentNode getContentNode(int offset) { - return getPersistentType().getContentNode(offset); - } - - public Table primaryDbTable() { - return null; - } - - public Table dbTable(String tableName) { - return null; - } - - public Schema dbSchema() { - return null; - } - - public void refreshDefaults(DefaultsContext defaultsContext) {} - - public ITextRange classTextRange() { - IDOMNode classNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.CLASS); - if (classNode != null) { - return buildTextRange(classNode); - } - else { - return validationTextRange(); - } - } - - public ITextRange attributesTextRange() { - IDOMNode attributesNode = (IDOMNode) DOMUtilities.getNodeChild(node, OrmXmlMapper.ATTRIBUTES); - if (attributesNode != null) { - return buildTextRange(attributesNode); - } - else { - return validationTextRange(); - } - } - - /** - * type mappings are a sequence in the orm schema. We must keep - * the list of type mappings in the appropriate order so the wtp xml - * translators will write them to the xml in that order and they - * will adhere to the schema. - * - * Each concrete subclass of XmlTypeMapping must implement this - * method and return an int that matches it's order in the schema - * @return - */ - public abstract int xmlSequence(); - - /** - * @see ITypeMapping#attributeMappingKeyAllowed(String) - * - * Default implementation: override where needed - */ - public boolean attributeMappingKeyAllowed(String attributeMappingKey) { - return true; - } - - public Iterator overridableAssociationNames() { - return EmptyIterator.instance(); - } - - public Iterator overridableAttributeNames() { - return EmptyIterator.instance(); - } - - public Iterator allOverridableAssociationNames() { - return EmptyIterator.instance(); - } - - public Iterator allOverridableAttributeNames() { - return EmptyIterator.instance(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java deleted file mode 100644 index e590a8aa51..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import java.util.Collection; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * A representation of the model object 'Xml Unique Constraint'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint() - * @model kind="class" - * @generated - */ -public class XmlUniqueConstraint extends XmlEObject - implements IUniqueConstraint -{ - /** - * The cached value of the '{@link #getColumnNames() Column Names}' attribute list. - * - * - * @see #getColumnNames() - * @generated - * @ordered - */ - protected EList columnNames; - - /** - * - * - * @generated - */ - protected XmlUniqueConstraint() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_UNIQUE_CONSTRAINT; - } - - /** - * Returns the value of the 'Column Names' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

    - * If the meaning of the 'Column Names' attribute list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column Names' attribute list. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIUniqueConstraint_ColumnNames() - * @model type="java.lang.String" - * @generated - */ - public EList getColumnNames() { - if (columnNames == null) { - columnNames = new EDataTypeUniqueEList(String.class, this, OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES); - } - return columnNames; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES : - return getColumnNames(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES : - getColumnNames().clear(); - getColumnNames().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES : - getColumnNames().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES : - return columnNames != null && !columnNames.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IUniqueConstraint.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES : - return JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IUniqueConstraint.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES : - return OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @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(); - } -} // XmlUniqueConstraint diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersion.java deleted file mode 100644 index b1613b0de2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersion.java +++ /dev/null @@ -1,387 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; - -/** - * - * A representation of the model object 'Xml Version'. - * - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlVersion() - * @model kind="class" - * @generated - */ -public class XmlVersion extends XmlAttributeMapping - implements IVersion, IXmlColumnMapping -{ - /** - * The cached value of the '{@link #getColumn() Column}' containment reference. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected IColumn column; - - /** - * The default value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected static final TemporalType TEMPORAL_EDEFAULT = TemporalType.NULL; - - /** - * The cached value of the '{@link #getTemporal() Temporal}' attribute. - * - * - * @see #getTemporal() - * @generated - * @ordered - */ - protected TemporalType temporal = TEMPORAL_EDEFAULT; - - protected XmlVersion() { - super(); - this.column = OrmFactory.eINSTANCE.createXmlColumn(buildOwner()); - ((InternalEObject) this.column).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__COLUMN, null, null); - } - - @Override - protected void initializeOn(XmlAttributeMapping newMapping) { - newMapping.initializeFromXmlVersionMapping(this); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_VERSION; - } - - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIVersion_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IColumn getColumn() { - return column; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetColumn(IColumn newColumn, NotificationChain msgs) { - IColumn oldColumn = column; - column = newColumn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__COLUMN, oldColumn, newColumn); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

    - * If the meaning of the 'Temporal' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIVersion_Temporal() - * @model - * @generated - */ - public TemporalType getTemporal() { - return temporal; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlVersion#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - public void setTemporal(TemporalType newTemporal) { - TemporalType oldTemporal = temporal; - temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__TEMPORAL, oldTemporal, temporal)); - } - - /** - * Returns the value of the 'Column For Xml' reference. - * - *

    - * If the meaning of the 'Column For Xml' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column For Xml' reference. - * @see #setColumnForXml(XmlColumn) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIXmlColumnMapping_ColumnForXml() - * @model resolveProxies="false" volatile="true" - * @generated NOT - */ - public XmlColumn getColumnForXml() { - if (((XmlColumn) getColumn()).isAllFeaturesUnset()) { - return null; - } - return (XmlColumn) getColumn(); - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlVersion#getColumnForXml Column For Xml}' reference. - * - * - * @param value the new value of the 'Column For Xml' reference. - * @see #getColumnForXml() - * @generated NOT - */ - public void setColumnForXmlGen(XmlColumn newColumnForXml) { - XmlColumn oldValue = newColumnForXml == null ? (XmlColumn) getColumn() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__COLUMN_FOR_XML, oldValue, newColumnForXml)); - } - - public void setColumnForXml(XmlColumn newColumnForXml) { - setColumnForXmlGen(newColumnForXml); - if (newColumnForXml == null) { - ((XmlColumn) getColumn()).unsetAllAttributes(); - } - } - - public void makeColumnForXmlNonNull() { - setColumnForXmlGen(getColumnForXml()); - } - - public void makeColumnForXmlNull() { - setColumnForXmlGen(null); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case OrmPackage.XML_VERSION__COLUMN : - return basicSetColumn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_VERSION__COLUMN : - return getColumn(); - case OrmPackage.XML_VERSION__TEMPORAL : - return getTemporal(); - case OrmPackage.XML_VERSION__COLUMN_FOR_XML : - return getColumnForXml(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_VERSION__TEMPORAL : - setTemporal((TemporalType) newValue); - return; - case OrmPackage.XML_VERSION__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_VERSION__TEMPORAL : - setTemporal(TEMPORAL_EDEFAULT); - return; - case OrmPackage.XML_VERSION__COLUMN_FOR_XML : - setColumnForXml((XmlColumn) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_VERSION__COLUMN : - return column != null; - case OrmPackage.XML_VERSION__TEMPORAL : - return temporal != TEMPORAL_EDEFAULT; - case OrmPackage.XML_VERSION__COLUMN_FOR_XML : - return getColumnForXml() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IVersion.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_VERSION__COLUMN : - return JpaCoreMappingsPackage.IVERSION__COLUMN; - case OrmPackage.XML_VERSION__TEMPORAL : - return JpaCoreMappingsPackage.IVERSION__TEMPORAL; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_VERSION__COLUMN_FOR_XML : - return OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IColumnMapping.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IVersion.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IVERSION__COLUMN : - return OrmPackage.XML_VERSION__COLUMN; - case JpaCoreMappingsPackage.IVERSION__TEMPORAL : - return OrmPackage.XML_VERSION__TEMPORAL; - default : - return -1; - } - } - if (baseClass == IXmlColumnMapping.class) { - switch (baseFeatureID) { - case OrmPackage.IXML_COLUMN_MAPPING__COLUMN_FOR_XML : - return OrmPackage.XML_VERSION__COLUMN_FOR_XML; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (temporal: "); - result.append(temporal); - result.append(')'); - return result.toString(); - } - - @Override - public int xmlSequence() { - return 2; - } - - public String getKey() { - return IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY; - } -} // XmlVersion diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersionProvider.java deleted file mode 100644 index 60f8d25a45..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersionProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm; - -import org.eclipse.jpt.core.internal.IMappingKeys; - -public class XmlVersionProvider implements IXmlAttributeMappingProvider -{ - // singleton - private static final XmlVersionProvider INSTANCE = new XmlVersionProvider(); - - /** - * Return the singleton. - */ - public static IXmlAttributeMappingProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private XmlVersionProvider() { - super(); - } - - public XmlAttributeMapping buildAttributeMapping() { - return OrmFactory.eINSTANCE.createXmlVersion(); - } - - public String key() { - return IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractColumnTranslator.java deleted file mode 100644 index a10227f091..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractColumnTranslator.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class AbstractColumnTranslator extends Translator - implements OrmXmlMapper -{ - private Translator[] children; - - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - protected static final OrmFactory JPA_CORE_XML_FACTORY = - OrmFactory.eINSTANCE; - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - - public AbstractColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, END_TAG_NO_INDENT); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - - protected abstract Translator[] createChildren(); - - protected Translator createNameTranslator() { - return new Translator(COLUMN__NAME, JPA_CORE_XML_PKG.getAbstractXmlNamedColumn_SpecifiedNameForXml(), DOM_ATTRIBUTE); - } - - protected Translator createTableTranslator() { - return new Translator(COLUMN__TABLE, JPA_CORE_XML_PKG.getAbstractXmlColumn_SpecifiedTableForXml(), DOM_ATTRIBUTE); - } - - protected Translator createUniqueTranslator() { - return new BooleanEnumeratorTranslator(COLUMN__UNIQUE, JPA_CORE_XML_PKG.getAbstractXmlColumn_UniqueForXml(), DOM_ATTRIBUTE); - } - - protected Translator createNullableTranslator() { - return new BooleanEnumeratorTranslator(COLUMN__NULLABLE, JPA_CORE_XML_PKG.getAbstractXmlColumn_NullableForXml(), DOM_ATTRIBUTE); - } - - protected Translator createInsertableTranslator() { - return new BooleanEnumeratorTranslator(COLUMN__INSERTABLE, JPA_CORE_XML_PKG.getAbstractXmlColumn_InsertableForXml(), DOM_ATTRIBUTE); - } - - protected Translator createUpdatableTranslator() { - return new BooleanEnumeratorTranslator(COLUMN__UPDATABLE, JPA_CORE_XML_PKG.getAbstractXmlColumn_UpdatableForXml(), DOM_ATTRIBUTE); - } - - protected Translator createColumnDefinitionTranslator() { - return new Translator(COLUMN__COLUMN_DEFINITION, JPA_CORE_XML_PKG.getAbstractXmlNamedColumn_ColumnDefinitionForXml(), DOM_ATTRIBUTE); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java deleted file mode 100644 index fb809d2ca4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class AbstractTableTranslator extends Translator - implements OrmXmlMapper -{ - private Translator[] children; - - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - protected static final OrmFactory JPA_CORE_XML_FACTORY = - OrmFactory.eINSTANCE; - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - - public AbstractTableTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath,aFeature); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - - protected abstract Translator[] createChildren(); - - protected Translator createNameTranslator() { - return new Translator(NAME, JPA_CORE_XML_PKG.getAbstractXmlTable_SpecifiedNameForXml(), DOM_ATTRIBUTE); - } - - protected Translator createCatalogTranslator() { - return new Translator(CATALOG, JPA_CORE_XML_PKG.getAbstractXmlTable_SpecifiedCatalogForXml(), DOM_ATTRIBUTE); - } - - protected Translator createSchemaTranslator() { - return new Translator(SCHEMA, JPA_CORE_XML_PKG.getAbstractXmlTable_SpecifiedSchemaForXml(), DOM_ATTRIBUTE); - } - - protected Translator createUniqueConstraintTranslator() { - return new Translator(UNIQUE_CONSTRAINT, (EStructuralFeature) null); - //TODO return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, MAPPINGS_PKG.getITable_UniqueConstraints()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AccessTypeElementTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AccessTypeElementTranslator.java deleted file mode 100644 index 8444938762..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AccessTypeElementTranslator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.AccessType; - -/** - * There is a bug in the translator framework that causes - * enumerators in xml elements and enumerators in xml attributes - * to be treated differently. When the enumerator is an attribute - * setting the model to the default causes the attribute to be removed. - * With an element is causes the default literal to be placed in - * the tag. - * - * The problem is wrapped up in the emf unsettable attribute as well. - * For attributes the eIsSet method returns false for the default value - * For elements the eIsSet method returns true for the default value. - * I don't want to have to use the unsettable option in emf since that would - * require that I call different api. I am not sure yet what the bug is in - * the translator, so I have entered one ~KFM - */ -public class AccessTypeElementTranslator extends EnumeratorTranslator -{ - - public AccessTypeElementTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - } - - @Override - public Object getMOFValue(EObject mofObject) { - AccessType access = (AccessType) super.getMOFValue(mofObject); - if (access == AccessType.DEFAULT) { - return null; - } - return access; - } - - @Override - public List getMOFChildren(EObject mofObject) { - List result = super.getMOFChildren(mofObject); - if(result != null && result.size() > 0) { - AccessType accessType = (AccessType) result.get(0); - if(accessType.getValue() == AccessType.DEFAULT_VALUE) - result = Collections.EMPTY_LIST; - } - return result; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverrideTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverrideTranslator.java deleted file mode 100644 index faba3fa29e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverrideTranslator.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.resource.JoinColumnTranslator.JoinColumnBuilder; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride.JoinColumnOwner; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class AssociationOverrideTranslator extends Translator implements OrmXmlMapper -{ - private AssociationOverrideBuilder associationOverrideBuilder; - - private IAssociationOverride associationOverride; - - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - private JoinColumnTranslator joinColumnsTranslator; - - public AssociationOverrideTranslator(String domNameAndPath, EStructuralFeature aFeature, AssociationOverrideBuilder associationOverrideBuilder) { - super(domNameAndPath, aFeature); - this.associationOverrideBuilder = associationOverrideBuilder; - this.joinColumnsTranslator = createJoinColumnsTranslator(); - } - - protected JoinColumnTranslator createJoinColumnsTranslator() { - return new JoinColumnTranslator( - JOIN_COLUMN, - JpaCoreMappingsPackage.eINSTANCE.getIAssociationOverride_SpecifiedJoinColumns(), - buildJoinColumnsBuilder()); - } - - private JoinColumnBuilder buildJoinColumnsBuilder() { - return new JoinColumnBuilder() { - public IJoinColumn createJoinColumn() { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new JoinColumnOwner(associationOverride)); - } - }; - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - joinColumnsTranslator, - }; - } - protected Translator createNameTranslator() { - return new Translator(ATTRIBUTE_OVERRIDE_NAME, MAPPINGS_PKG.getIOverride_Name(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - this.associationOverride = this.associationOverrideBuilder.createAssociationOverride(); - return this.associationOverride; - } - - public interface AssociationOverrideBuilder { - IAssociationOverride createAssociationOverride(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverridesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverridesTranslator.java deleted file mode 100644 index f44c0e38b3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverridesTranslator.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.resource.AssociationOverrideTranslator.AssociationOverrideBuilder; -import org.eclipse.wst.common.internal.emf.resource.MultiObjectTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * Created this class so there would be a 1-1 association between - * AssociationOverride and AssociationOverrideTranslator. Without this the state - * stored on AssociationOverrideTranslator will be invalid for multiple AssociationOverrides. - * see bug 188901. - * - * TODO 189767 - memory leak if an associationOverride is removed from the model, it is still - * stored along with its translator in the translator map - */ -public class AssociationOverridesTranslator extends MultiObjectTranslator implements OrmXmlMapper -{ - private AssociationOverrideBuilder associationOverrideBuilder; - - private Map translatorMap; - - public AssociationOverridesTranslator(String domNameAndPath, EStructuralFeature aFeature, AssociationOverrideBuilder associationOverrideBuilder) { - super(domNameAndPath, aFeature); - this.associationOverrideBuilder = associationOverrideBuilder; - this.translatorMap = new HashMap(); - } - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - AssociationOverrideTranslator translator = (AssociationOverrideTranslator) getDelegateFor(nodeName, readAheadName); - EObject eObject = translator.createEMFObject(nodeName, readAheadName); - this.translatorMap.put(eObject, translator); - return eObject; - } - - /* (non-Javadoc) - * @see MultiObjectTranslator#getDelegateFor(EObject) - */ - @Override - public Translator getDelegateFor(EObject o) { - Translator translator = translatorMap.get(o); - if (translator != null) { - return translator; - } - - switch (o.eClass().getClassifierID()) { - case OrmPackage.XML_ASSOCIATION_OVERRIDE : - return new AssociationOverrideTranslator(this.domNameAndPath, getFeature(), this.associationOverrideBuilder); - } - - return null; - } - - @Override - public Translator getDelegateFor(String domName, String readAheadName) { - if (domName.equals(ENTITY__ASSOCIATION_OVERRIDE)) { - return new AssociationOverrideTranslator(this.domNameAndPath, getFeature(), this.associationOverrideBuilder); - } - throw new IllegalStateException("Illegal dom name: " + domName); //$NON-NLS-1$ - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingTranslator.java deleted file mode 100644 index 39dab93292..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingTranslator.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class AttributeMappingTranslator extends Translator - implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - protected static final OrmFactory JPA_CORE_XML_FACTORY = - OrmFactory.eINSTANCE; - - - private Translator[] children; - - - public AttributeMappingTranslator(String domNameAndPath, int style) { - super(domNameAndPath, JPA_CORE_XML_PKG.getXmlPersistentType_SpecifiedAttributeMappings(), style); - dependencyFeature = JPA_CORE_XML_PKG.getXmlAttributeMapping_PersistentAttribute(); - } - - - public Translator[] getChildren(Object target, int versionID) { - if (this.children == null) { - this.children = createChildren(); - } - return this.children; - } - - protected abstract Translator[] createChildren(); - - - protected Translator createNameTranslator() { - return new AttributeNameTranslator(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingsTranslator.java deleted file mode 100644 index 71d37e572d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingsTranslator.java +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class AttributeMappingsTranslator extends MultiObjectDependencyTranslator - implements OrmXmlMapper -{ - public static final String ATTRIBUTES_PATH = - ATTRIBUTES + '/' + ID + ',' + EMBEDDED_ID + ','+ BASIC + ',' + VERSION +',' + MANY_TO_ONE + "," + ONE_TO_MANY + ',' + ONE_TO_ONE + ',' + MANY_TO_MANY + ',' + EMBEDDED+ ',' + TRANSIENT; - - private static final OrmPackage JPA_CORE_XML_PKG = OrmPackage.eINSTANCE; - - public AttributeMappingsTranslator() { - super(ATTRIBUTES_PATH, JPA_CORE_XML_PKG.getXmlPersistentType_SpecifiedAttributeMappings(), JPA_CORE_XML_PKG.getXmlTypeMapping_PersistentType()); - } - - //TODO we're not putting the translator in the translator map in this situation - public Translator getDelegateFor(EObject o) { - Translator translator = super.getDelegateFor(o); - - if (translator != null) { - return translator; - } - - switch (o.eClass().getClassifierID()) { - case OrmPackage.XML_ID : - translator = new IdTranslator(); - ((IdTranslator) translator).setId(((IId) o)); - break; - case OrmPackage.XML_BASIC : - translator = new BasicTranslator(); - ((BasicTranslator) translator).setBasic(((IBasic) o)); - break; - case OrmPackage.XML_ONE_TO_MANY : - translator = new OneToManyTranslator(); - ((OneToManyTranslator) translator).setMapping((IMultiRelationshipMapping) o); - break; - case OrmPackage.XML_MANY_TO_MANY : - translator = new ManyToManyTranslator(); - ((ManyToManyTranslator) translator).setMapping((IMultiRelationshipMapping) o); - break; - case OrmPackage.XML_MANY_TO_ONE : - translator = new ManyToOneTranslator(); - break; - case OrmPackage.XML_TRANSIENT : - translator = new TransientTranslator(); - break; - case OrmPackage.XML_EMBEDDED : - translator = new EmbeddedTranslator(); - ((EmbeddedTranslator) translator).setEmbedded((IEmbedded) o); - break; - case OrmPackage.XML_EMBEDDED_ID : - translator = new EmbeddedIdTranslator(); - break; - case OrmPackage.XML_ONE_TO_ONE : - translator = new OneToOneTranslator(); - break; - case OrmPackage.XML_VERSION : - translator = new VersionTranslator(); - break; - } - - setDelegateFor(o, translator); - return translator; - } - - - @Override - public Translator getDelegateFor(String domName, String readAheadName) { - if (domName.equals(ID)) { - return new IdTranslator(); - } - if (domName.equals(BASIC)) { - return new BasicTranslator(); - } - if (domName.equals(MANY_TO_ONE)) { - return new ManyToOneTranslator(); - } - if (domName.equals(ONE_TO_MANY)) { - return new OneToManyTranslator(); - } - if (domName.equals(MANY_TO_MANY)) { - return new ManyToManyTranslator(); - } - if (domName.equals(TRANSIENT)) { - return new TransientTranslator(); - } - if (domName.equals(EMBEDDED)) { - return new EmbeddedTranslator(); - } - if (domName.equals(EMBEDDED_ID)) { - return new EmbeddedIdTranslator(); - } - if (domName.equals(ONE_TO_ONE)) { - return new OneToOneTranslator(); - } - if (domName.equals(VERSION)) { - return new VersionTranslator(); - } - throw new IllegalStateException("Illegal dom name: " + domName); //$NON-NLS-1$ - } - - @Override - public boolean isDependencyParent() { - return true; - } - - @Override - public EStructuralFeature getDependencyFeature() { - return JPA_CORE_XML_PKG.getXmlAttributeMapping_PersistentAttribute(); - } - - @Override - public EObject basicGetDependencyObject(EObject parent) { - Translator delegate = getDelegateFor(parent); - - if (delegate != null) { - return delegate.basicGetDependencyObject(parent); - } - else { - return super.basicGetDependencyObject(parent); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeNameTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeNameTranslator.java deleted file mode 100644 index 2278da6527..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeNameTranslator.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.DependencyTranslator; - -public class AttributeNameTranslator extends DependencyTranslator - implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - public AttributeNameTranslator() { - super(NAME, JPA_CORE_XML_PKG.getXmlPersistentAttribute_Name(), - JPA_CORE_XML_PKG.getXmlAttributeMapping_PersistentAttribute()); - fStyle = DOM_ATTRIBUTE; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverrideTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverrideTranslator.java deleted file mode 100644 index 824b14e04d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverrideTranslator.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class AttributeOverrideTranslator extends Translator implements OrmXmlMapper -{ - private AttributeOverrideBuilder attributeOverrideBuilder; - - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - private ColumnTranslator columnTranslator; - - public AttributeOverrideTranslator(String domNameAndPath, EStructuralFeature aFeature, AttributeOverrideBuilder attributeOverrideBuilder) { - super(domNameAndPath, aFeature); - this.attributeOverrideBuilder = attributeOverrideBuilder; - this.columnTranslator = createColumnTranslator(); - } - - private ColumnTranslator createColumnTranslator() { - return new ColumnTranslator(ATTRIBUTE_OVERRIDE_COLUMN, JPA_CORE_XML_PKG.getIXmlColumnMapping_ColumnForXml()); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - columnTranslator, - }; - } - protected Translator createNameTranslator() { - return new Translator(ATTRIBUTE_OVERRIDE_NAME, MAPPINGS_PKG.getIOverride_Name(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - IAttributeOverride attributeOverride = this.attributeOverrideBuilder.createAttributeOverride(); - this.columnTranslator.setColumnMapping(attributeOverride); - return attributeOverride; - } - - public interface AttributeOverrideBuilder { - IAttributeOverride createAttributeOverride(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverridesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverridesTranslator.java deleted file mode 100644 index 9762ecbd0e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverridesTranslator.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.resource.AttributeOverrideTranslator.AttributeOverrideBuilder; -import org.eclipse.wst.common.internal.emf.resource.MultiObjectTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * Created this class so there would be a 1-1 association between - * AttributeOverride and AttributeOverrideTranslator. Without this the state - * stored on AttributeOverrideTranslator will be invalid for multiple AttributeOverrides. - * see bug 188901. - * - * TODO 189767 - memory leak if an associationOverride is removed from the model, it is still - * stored along with its translator in the translator map - */ -public class AttributeOverridesTranslator extends MultiObjectTranslator implements OrmXmlMapper -{ - private AttributeOverrideBuilder attributeOverrideBuilder; - - private Map translatorMap; - - public AttributeOverridesTranslator(String domNameAndPath, EStructuralFeature aFeature, AttributeOverrideBuilder attributeOverrideBuilder) { - super(domNameAndPath, aFeature); - this.attributeOverrideBuilder = attributeOverrideBuilder; - this.translatorMap = new HashMap(); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - AttributeOverrideTranslator translator = (AttributeOverrideTranslator) getDelegateFor(nodeName, readAheadName); - EObject eObject = translator.createEMFObject(nodeName, readAheadName); - this.translatorMap.put(eObject, translator); - return eObject; - } - - /* (non-Javadoc) - * @see MultiObjectTranslator#getDelegateFor(EObject) - */ - @Override - public Translator getDelegateFor(EObject o) { - Translator translator = translatorMap.get(o); - if (translator != null) { - return translator; - } - - switch (o.eClass().getClassifierID()) { - case OrmPackage.XML_ATTRIBUTE_OVERRIDE : - return new AttributeOverrideTranslator(this.domNameAndPath, getFeature(), this.attributeOverrideBuilder); - } - - return null; - } - - @Override - public Translator getDelegateFor(String domName, String readAheadName) { - if (domName.equals(ENTITY__ATTRIBUTE_OVERRIDE)) { - return new AttributeOverrideTranslator(this.domNameAndPath, getFeature(), this.attributeOverrideBuilder); - } - throw new IllegalStateException("Illegal dom name: " + domName); //$NON-NLS-1$ - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BasicTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BasicTranslator.java deleted file mode 100644 index 9168a09920..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BasicTranslator.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class BasicTranslator extends AttributeMappingTranslator -{ - private ColumnTranslator columnTranslator; - - - public BasicTranslator() { - super(BASIC, NO_STYLE); - this.columnTranslator = createColumnTranslator(); - } - - private ColumnTranslator createColumnTranslator() { - return new ColumnTranslator(COLUMN, JPA_CORE_XML_PKG.getIXmlColumnMapping_ColumnForXml()); - } - - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - IBasic xmlBasic = JPA_CORE_XML_FACTORY.createXmlBasic(); - this.setBasic(xmlBasic); - return xmlBasic; - } - - protected void setBasic(IBasic basic) { - this.columnTranslator.setColumnMapping(basic); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createFetchTypeTranslator(), - createOptionalTranslator(), - columnTranslator, - createLobTranslator(), - createTemporalTranslator(), - createEnumeratedTranslator(), - }; - } - - private Translator createPlaceHolderTranslator(String domNameAndPath) { - return new Translator(domNameAndPath, (EStructuralFeature) null); - } - - private Translator createFetchTypeTranslator() { - return new EnumeratorTranslator(FETCH, JpaCoreMappingsPackage.eINSTANCE.getIBasic_Fetch(), DOM_ATTRIBUTE); - } - - private Translator createOptionalTranslator() { - return new BooleanEnumeratorTranslator(OPTIONAL, JpaCoreMappingsPackage.eINSTANCE.getIBasic_Optional(), DOM_ATTRIBUTE); - } - - private Translator createLobTranslator() { - return new EmptyTagBooleanTranslator(LOB, JpaCoreMappingsPackage.eINSTANCE.getIBasic_Lob()); - } - - private Translator createTemporalTranslator() { - return new TemporalTypeElementTranslator(TEMPORAL, JpaCoreMappingsPackage.eINSTANCE.getIBasic_Temporal(), NO_STYLE); - } - - private Translator createEnumeratedTranslator() { - return new EnumeratedTypeElementTranslator(BASIC__ENUMERATED, JpaCoreMappingsPackage.eINSTANCE.getIBasic_Enumerated(), NO_STYLE); - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BooleanEnumeratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BooleanEnumeratorTranslator.java deleted file mode 100644 index 7235dbef0f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BooleanEnumeratorTranslator.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; - -public class BooleanEnumeratorTranslator extends EnumeratorTranslator -{ - public BooleanEnumeratorTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE); - } - - public BooleanEnumeratorTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE | style); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java deleted file mode 100644 index 3312b47e51..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class CascadeTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public CascadeTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createCascadeAllTranslator(), - createCascadePersistTranslator(), - createCascadeMergeTranslator(), - createCascadeRemoveTranslator(), - createCascadeRefreshTranslator(), - }; - } - - protected Translator createCascadeAllTranslator() { - return new EmptyTagBooleanTranslator(CASCADE__CASCADE_ALL, MAPPINGS_PKG.getICascade_All()); - } - - protected Translator createCascadePersistTranslator() { - return new EmptyTagBooleanTranslator(CASCADE__CASCADE_PERSIST, MAPPINGS_PKG.getICascade_Persist()); - } - - protected Translator createCascadeMergeTranslator() { - return new EmptyTagBooleanTranslator(CASCADE__CASCADE_MERGE, MAPPINGS_PKG.getICascade_Merge()); - } - - protected Translator createCascadeRemoveTranslator() { - return new EmptyTagBooleanTranslator(CASCADE__CASCADE_REMOVE, MAPPINGS_PKG.getICascade_Remove()); - } - - protected Translator createCascadeRefreshTranslator() { - return new EmptyTagBooleanTranslator(CASCADE__CASCADE_REFRESH, MAPPINGS_PKG.getICascade_Refresh()); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlCascade(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ColumnTranslator.java deleted file mode 100644 index 57db33d7dd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ColumnTranslator.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class ColumnTranslator extends AbstractColumnTranslator - implements OrmXmlMapper -{ - - private IColumnMapping columnMapping; - - public ColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return getColumnMapping().getColumn(); - } - - private IColumnMapping getColumnMapping() { - return this.columnMapping; - } - - void setColumnMapping(IColumnMapping columnMapping) { - this.columnMapping = columnMapping; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createUniqueTranslator(), - createNullableTranslator(), - createInsertableTranslator(), - createUpdatableTranslator(), - createColumnDefinitionTranslator(), - createTableTranslator(), - createLengthTranslator(), - createPrecisionTranslator(), - createScaleTranslator(), - }; - } - - protected Translator createLengthTranslator() { - return new Translator(COLUMN__LENGTH, JPA_CORE_XML_PKG.getXmlColumn_LengthForXml(), DOM_ATTRIBUTE); - } - - protected Translator createPrecisionTranslator() { - return new Translator(COLUMN__PRECISION, JPA_CORE_XML_PKG.getXmlColumn_PrecisionForXml(), DOM_ATTRIBUTE); - } - - protected Translator createScaleTranslator() { - return new Translator(COLUMN__SCALE, JPA_CORE_XML_PKG.getXmlColumn_ScaleForXml(), DOM_ATTRIBUTE); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DebugTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DebugTranslator.java deleted file mode 100644 index 2ee8a8484f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DebugTranslator.java +++ /dev/null @@ -1,431 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.List; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.wst.common.internal.emf.resource.ReadAheadHelper; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorPath; -import org.eclipse.wst.common.internal.emf.resource.VariableTranslatorFactory; - -public class DebugTranslator extends Translator -{ - @Override - public String getDOMPath() { - // TODO Auto-generated method stub - return super.getDOMPath(); - } - - public DebugTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - // TODO Auto-generated constructor stub - } - - public DebugTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - // TODO Auto-generated constructor stub - } - - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - // TODO Auto-generated method stub - return super.createEMFObject(nodeName, readAheadName); - } - - @Override - public Translator[] getChildren(Object target, int versionID) { - // TODO Auto-generated method stub - return super.getChildren(target, versionID); - } - - @Override - public String getDOMName(Object value) { - // TODO Auto-generated method stub - return super.getDOMName(value); - } - - @Override - public boolean isManagedByParent() { - // TODO Auto-generated method stub - return super.isManagedByParent(); - } - - @Override - public void addReadAheadHelper(ReadAheadHelper helper) { - // TODO Auto-generated method stub - super.addReadAheadHelper(helper); - } - - @Override - public EObject basicGetDependencyObject(EObject parent) { - // TODO Auto-generated method stub - return super.basicGetDependencyObject(parent); - } - - @Override - public void clearList(EObject mofObject) { - // TODO Auto-generated method stub - super.clearList(mofObject); - } - - @Override - public Object convertStringToValue(String strValue, EObject owner) { - // TODO Auto-generated method stub - return super.convertStringToValue(strValue, owner); - } - - @Override - public Object convertStringToValue(String nodeName, String readAheadName, - String value, Notifier owner) { - // TODO Auto-generated method stub - return super.convertStringToValue(nodeName, readAheadName, value, owner); - } - - @Override - public String convertValueToString(Object value, EObject owner) { - // TODO Auto-generated method stub - return super.convertValueToString(value, owner); - } - - @Override - public boolean equals(Object object) { - // TODO Auto-generated method stub - return super.equals(object); - } - - @Override - public String extractStringValue(EObject emfObject) { - // TODO Auto-generated method stub - return super.extractStringValue(emfObject); - } - - @Override - public boolean featureExists(EObject emfObject) { - // TODO Auto-generated method stub - return super.featureExists(emfObject); - } - - @Override - public Translator findChild(String tagName, Object target, int versionID) { - // TODO Auto-generated method stub - return super.findChild(tagName, target, versionID); - } - - @Override - protected Translator[] getChildren() { - // TODO Auto-generated method stub - return super.getChildren(); - } - - @Override - public EStructuralFeature getDependencyFeature() { - // TODO Auto-generated method stub - return super.getDependencyFeature(); - } - - @Override - public String[] getDOMNames() { - // TODO Auto-generated method stub - return super.getDOMNames(); - } - - @Override - public EStructuralFeature getFeature() { - // TODO Auto-generated method stub - return super.getFeature(); - } - - @Override - public List getMOFChildren(EObject mofObject) { - // TODO Auto-generated method stub - return super.getMOFChildren(mofObject); - } - - @Override - public Object getMOFValue(EObject mofObject) { - // TODO Auto-generated method stub - return super.getMOFValue(mofObject); - } - - @Override - public String getNameSpace() { - // TODO Auto-generated method stub - return super.getNameSpace(); - } - - @Override - public ReadAheadHelper getReadAheadHelper(String parentName) { - // TODO Auto-generated method stub - return super.getReadAheadHelper(parentName); - } - - @Override - public TranslatorPath[] getTranslatorPaths() { - // TODO Auto-generated method stub - return super.getTranslatorPaths(); - } - - @Override - public Translator[] getVariableChildren(Notifier target, int version) { - // TODO Auto-generated method stub - return super.getVariableChildren(target, version); - } - - @Override - public VariableTranslatorFactory getVariableTranslatorFactory() { - // TODO Auto-generated method stub - return super.getVariableTranslatorFactory(); - } - - @Override - public boolean hasDOMPath() { - // TODO Auto-generated method stub - return super.hasDOMPath(); - } - - @Override - public boolean hasReadAheadNames() { - // TODO Auto-generated method stub - return super.hasReadAheadNames(); - } - - @Override - protected void initializeDOMNameAndPath(String domNameAndPathArg) { - // TODO Auto-generated method stub - super.initializeDOMNameAndPath(domNameAndPathArg); - } - - @Override - public boolean isBooleanFeature() { - // TODO Auto-generated method stub - return super.isBooleanFeature(); - } - - @Override - public boolean isBooleanUppercase() { - // TODO Auto-generated method stub - return super.isBooleanUppercase(); - } - - @Override - public boolean isCDATAContent() { - // TODO Auto-generated method stub - return super.isCDATAContent(); - } - - @Override - public boolean isComment() { - // TODO Auto-generated method stub - return super.isComment(); - } - - @Override - public boolean isDataType() { - // TODO Auto-generated method stub - return super.isDataType(); - } - - @Override - public boolean isDependencyChild() { - // TODO Auto-generated method stub - return super.isDependencyChild(); - } - - @Override - public boolean isDependencyParent() { - // TODO Auto-generated method stub - return super.isDependencyParent(); - } - - @Override - public boolean isDOMAttribute() { - // TODO Auto-generated method stub - return super.isDOMAttribute(); - } - - @Override - public boolean isDOMTextValue() { - // TODO Auto-generated method stub - return super.isDOMTextValue(); - } - - @Override - public boolean isEmptyContentSignificant() { - // TODO Auto-generated method stub - return super.isEmptyContentSignificant(); - } - - @Override - public boolean isEmptyTag() { - // TODO Auto-generated method stub - return super.isEmptyTag(); - } - - @Override - public boolean isEnumFeature() { - // TODO Auto-generated method stub - return super.isEnumFeature(); - } - - @Override - public boolean isEnumWithHyphens() { - // TODO Auto-generated method stub - return super.isEnumWithHyphens(); - } - - @Override - public boolean isIDMap() { - // TODO Auto-generated method stub - return super.isIDMap(); - } - - @Override - public boolean isLinkMap() { - // TODO Auto-generated method stub - return super.isLinkMap(); - } - - @Override - public boolean isMapFor(Object aFeature, Object oldValue, Object newValue) { - // TODO Auto-generated method stub - return super.isMapFor(aFeature, oldValue, newValue); - } - - @Override - public boolean isMapFor(String domName) { - // TODO Auto-generated method stub - return super.isMapFor(domName); - } - - @Override - public boolean isMultiValued() { - // TODO Auto-generated method stub - return super.isMultiValued(); - } - - @Override - public boolean isObjectMap() { - // TODO Auto-generated method stub - return super.isObjectMap(); - } - - @Override - public boolean isSetMOFValue(EObject emfObject) { - // TODO Auto-generated method stub - return super.isSetMOFValue(emfObject); - } - - @Override - public boolean isShared() { - // TODO Auto-generated method stub - return super.isShared(); - } - - @Override - public boolean isTargetLinkMap() { - // TODO Auto-generated method stub - return super.isTargetLinkMap(); - } - - @Override - public boolean isUnsettable() { - // TODO Auto-generated method stub - return super.isUnsettable(); - } - - @Override - protected String[] parseDOMNames(String domNamesString) { - // TODO Auto-generated method stub - return super.parseDOMNames(domNamesString); - } - - @Override - public void removeMOFValue(Notifier owner, Object value) { - // TODO Auto-generated method stub - super.removeMOFValue(owner, value); - } - - @Override - protected void setEMFClass(EClass anEClass) { - // TODO Auto-generated method stub - super.setEMFClass(anEClass); - } - - @Override - protected void setFeature(EStructuralFeature aFeature) { - // TODO Auto-generated method stub - super.setFeature(aFeature); - } - - @Override - public void setMOFValue(EObject emfObject, Object value) { - // TODO Auto-generated method stub - super.setMOFValue(emfObject, value); - } - - @Override - public void setMOFValue(Notifier owner, Object value, int newIndex) { - // TODO Auto-generated method stub - super.setMOFValue(owner, value, newIndex); - } - - @Override - public void setMOFValue(Notifier owner, Object value) { - // TODO Auto-generated method stub - super.setMOFValue(owner, value); - } - - @Override - public void setMOFValue(Resource res, Object value) { - // TODO Auto-generated method stub - super.setMOFValue(res, value); - } - - @Override - public void setMOFValueFromEmptyDOMPath(EObject eObject) { - // TODO Auto-generated method stub - super.setMOFValueFromEmptyDOMPath(eObject); - } - - @Override - public void setNameSpace(String string) { - // TODO Auto-generated method stub - super.setNameSpace(string); - } - - @Override - public void setTextValueIfNecessary(String textValue, Notifier owner, int versionId) { - // TODO Auto-generated method stub - super.setTextValueIfNecessary(textValue, owner, versionId); - } - - @Override - public boolean shouldIndentEndTag() { - // TODO Auto-generated method stub - return super.shouldIndentEndTag(); - } - - @Override - public boolean shouldRenderEmptyDOMPath(EObject eObject) { - // TODO Auto-generated method stub - return super.shouldRenderEmptyDOMPath(eObject); - } - - @Override - public void unSetMOFValue(EObject emfObject) { - // TODO Auto-generated method stub - super.unSetMOFValue(emfObject); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java deleted file mode 100644 index 8f493eeb13..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class DiscriminatorColumnTranslator extends AbstractColumnTranslator - implements OrmXmlMapper -{ - - private IEntity entity; - - public DiscriminatorColumnTranslator() { - super(ENTITY__DISCRIMINATOR_COLUMN, JPA_CORE_XML_PKG.getXmlEntityForXml_DiscriminatorColumnForXml()); - } - - protected IEntity getEntity() { - return this.entity; - } - - void setEntity(IEntity entity) { - this.entity = entity; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return getEntity().getDiscriminatorColumn(); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createDiscrminiatorTypeTranslator(), - createColumnDefinitionTranslator(), - createLengthTranslator(), - }; - } - - protected Translator createDiscrminiatorTypeTranslator() { - return new EnumeratorTranslator(DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, JPA_CORE_XML_PKG.getXmlDiscriminatorColumn_DiscriminatorTypeForXml(), DOM_ATTRIBUTE); - } - - protected Translator createLengthTranslator() { - return new Translator(DISCRIMINATOR_COLUMN__LENGTH, JPA_CORE_XML_PKG.getXmlDiscriminatorColumn_SpecifiedLengthForXml(), DOM_ATTRIBUTE); - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddableTranslator.java deleted file mode 100644 index 2ea7194414..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddableTranslator.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EmbeddableTranslator extends TypeMappingTranslator -{ - protected static final OrmPackage XML_PKG = - OrmPackage.eINSTANCE; - - - public EmbeddableTranslator() { - super(EMBEDDABLE); - } - - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return JPA_CORE_XML_FACTORY.createXmlEmbeddable(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createJavaClassTranslator(), - createAccessTypeTranslator(), - createMetadataCompleteTranslator(), - createPlaceHolderTranslator(EMBEDDABLE__DESCRIPTION), - createPersistentAttributesTranslator() - }; - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedIdTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedIdTranslator.java deleted file mode 100644 index 1874a2d58c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedIdTranslator.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EmbeddedIdTranslator extends AttributeMappingTranslator -{ - public EmbeddedIdTranslator() { - super(EMBEDDED_ID, NO_STYLE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return JPA_CORE_XML_FACTORY.createXmlEmbeddedId(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createPlaceHolderTranslator(EMBEDDED_ID__ATTRIBUTE_OVERRIDE), - }; - } - private Translator createPlaceHolderTranslator(String domNameAndPath) { - return new Translator(domNameAndPath, (EStructuralFeature) null); - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedTranslator.java deleted file mode 100644 index 23a850aa29..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedTranslator.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.resource.AttributeOverrideTranslator.AttributeOverrideBuilder; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EmbeddedTranslator extends AttributeMappingTranslator -{ - private IEmbedded embedded; - - public EmbeddedTranslator() { - super(EMBEDDED, NO_STYLE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - IEmbedded embedded = JPA_CORE_XML_FACTORY.createXmlEmbedded(); - this.setEmbedded(embedded); - return embedded; - } - - protected void setEmbedded(IEmbedded embedded) { - this.embedded = embedded; - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createAttributeOverridesTranslator(), - }; - } - private Translator createAttributeOverridesTranslator() { - return new AttributeOverridesTranslator(EMBEDDED__ATTRIBUTE_OVERRIDE, MAPPINGS_PKG.getIEmbedded_SpecifiedAttributeOverrides(), buildAttributeOverrideBuilder()); - } - - private AttributeOverrideBuilder buildAttributeOverrideBuilder() { - return new AttributeOverrideBuilder() { - public IAttributeOverride createAttributeOverride() { - return EmbeddedTranslator.this.embedded.createAttributeOverride(0); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmptyTagBooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmptyTagBooleanTranslator.java deleted file mode 100644 index 1ccac741ba..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmptyTagBooleanTranslator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * This translator is to be used for empty xml tags that correspond - * to a boolean attribute in the emf model. - * cascade-persist is an example from the orm.xsd: - * - * - * - * ==> cascadePersist == true - * - * vs. - * - * - * ==> cascadePersist == false - * - */ -public class EmptyTagBooleanTranslator extends Translator -{ - public EmptyTagBooleanTranslator(String domNameAndPath, EStructuralFeature feature) { - super(domNameAndPath, feature, EMPTY_TAG | BOOLEAN_FEATURE); - } - - public EmptyTagBooleanTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style | EMPTY_TAG | BOOLEAN_FEATURE); - } - - @Override - public Object getMOFValue(EObject mofObject) { - // I am overriding this method. This is so the tag will be removed when - // the value is false. - // I'm not sure if this is a bug in the ecore or maybe in the translators, - // but I really don't think that we should have to depend on the boolean - // being "unset" to remove the tag. - Boolean value = (Boolean) super.getMOFValue(mofObject); - return (value == true) ? value : null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityMappingsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityMappingsTranslator.java deleted file mode 100644 index 9ba1785e42..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityMappingsTranslator.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EntityMappingsTranslator extends RootTranslator - implements OrmXmlMapper -{ - private Translator[] children; - - private PersistenceUnitMetadataTranslator persistenceUnitMetadataTranslator; - - public EntityMappingsTranslator() { - super(ENTITY_MAPPINGS, OrmPackage.eINSTANCE.getEntityMappingsInternal()); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - private Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - new ConstantAttributeTranslator(XML_NS, PERSISTENCE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, PERSISTENCE_NS_URL + ' ' + ORM_SCHEMA_LOC_1_0), - createVersionTranslator(), - createPlaceHolderTranslator(ENTITY_MAPPINGS__DESCRIPTION), - createPersistenceUnitMetadataTranslator(), - createPackageTranslator(), - createSchemaTranslator(), - createCatalogTranslator(), - createAccessTranslator(), - createSequenceGeneratorTranslator(), - createTableGeneratorTranslator(), - createNamedQueryTranslator(), - createNamedNativeQueryTranslator(), - createPlaceHolderTranslator(ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPING), - createTypeMappingsTranslator() - }; - } - - private Translator createPlaceHolderTranslator(String domNameAndPath) { - return new Translator(domNameAndPath, (EStructuralFeature) null); - } - - protected Translator createVersionTranslator() { - return new Translator(VERSION, OrmPackage.eINSTANCE.getEntityMappingsInternal_Version(), DOM_ATTRIBUTE); - } - - protected Translator createPersistenceUnitMetadataTranslator() { - this.persistenceUnitMetadataTranslator = new PersistenceUnitMetadataTranslator(); - return this.persistenceUnitMetadataTranslator; - } - - protected Translator createPackageTranslator() { - return new Translator(ENTITY_MAPPINGS__PACKAGE, OrmPackage.eINSTANCE.getEntityMappingsForXml_PackageForXml()); - } - - protected Translator createSchemaTranslator() { - return new Translator(ENTITY_MAPPINGS__SCHEMA, OrmPackage.eINSTANCE.getEntityMappingsInternal_SpecifiedSchema()); - } - - protected Translator createCatalogTranslator() { - return new Translator(ENTITY_MAPPINGS__CATALOG, OrmPackage.eINSTANCE.getEntityMappingsInternal_SpecifiedCatalog()); - } - - protected Translator createAccessTranslator() { - return new AccessTypeElementTranslator(ENTITY_MAPPINGS__ACCESS, OrmPackage.eINSTANCE.getEntityMappingsInternal_SpecifiedAccess(), NO_STYLE); - } - - protected Translator createTypeMappingsTranslator() { - return new TypeMappingsTranslator(); - } - - private Translator createTableGeneratorTranslator() { - return new TableGeneratorTranslator(TABLE_GENERATOR, OrmPackage.eINSTANCE.getEntityMappingsInternal_TableGenerators()); - } - - private Translator createSequenceGeneratorTranslator() { - return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getEntityMappingsInternal_SequenceGenerators()); - } - - private Translator createNamedQueryTranslator() { - return new NamedQueryTranslator(NAMED_QUERY, OrmPackage.eINSTANCE.getEntityMappingsInternal_NamedQueries()); - } - - private Translator createNamedNativeQueryTranslator() { - return new NamedNativeQueryTranslator(NAMED_NATIVE_QUERY, OrmPackage.eINSTANCE.getEntityMappingsInternal_NamedNativeQueries()); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - EntityMappings entityMappings = (EntityMappings) super.createEMFObject(nodeName, readAheadName); - this.persistenceUnitMetadataTranslator.setEntityMappings(entityMappings); - return entityMappings; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityTranslator.java deleted file mode 100644 index f2177576ba..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityTranslator.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.resource.AssociationOverrideTranslator.AssociationOverrideBuilder; -import org.eclipse.jpt.core.internal.content.orm.resource.AttributeOverrideTranslator.AttributeOverrideBuilder; -import org.eclipse.jpt.core.internal.content.orm.resource.PrimaryKeyJoinColumnTranslator.PrimaryKeyJoinColumnBuilder; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EntityTranslator extends TypeMappingTranslator -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - - private TableTranslator tableTranslator; - private SecondaryTablesTranslator secondaryTablesTranslator; - private DiscriminatorColumnTranslator discriminatorColumnTranslator; - - private IEntity entity; - - public EntityTranslator() { - super(ENTITY); - this.tableTranslator = createTableTranslator(); - this.secondaryTablesTranslator = createSecondaryTableTranslator(); - this.discriminatorColumnTranslator = createDiscriminatorColumnTranslator(); - } - - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - IEntity entity = JPA_CORE_XML_FACTORY.createXmlEntityInternal(); - this.setEntity(entity); - return entity; - } - - protected void setEntity(IEntity entity) { - this.entity = entity; - this.tableTranslator.setEntity(this.entity); - this.secondaryTablesTranslator.setEntity(this.entity); - this.discriminatorColumnTranslator.setEntity(this.entity); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createJavaClassTranslator(), - createAccessTypeTranslator(), - createMetadataCompleteTranslator(), - createPlaceHolderTranslator(ENTITY__DESCRIPTION), - getTableTranslator(), - getSecondaryTableTranslator(), - createPrimaryKeyJoinColumnsTranslator(), - createIdClassTranslator(), - createInheritanceTranslator(), - createDiscriminatorValueTranslator(), - getDiscriminatorColumnTranslator(), - createSequenceGeneratorTranslator(), - createTableGeneratorTranslator(), - createNamedQueryTranslator(), - createNamedNativeQueryTranslator(), - createPlaceHolderTranslator(ENTITY__SQL_RESULT_SET_MAPPING), - createPlaceHolderTranslator(ENTITY__EXCLUDE_DEFAULT_LISTENERS), - createPlaceHolderTranslator(ENTITY__EXCLUDE_SUPERCLASS_LISTENERS), - createPlaceHolderTranslator(ENTITY__ENTITY_LISTENERS), - createPlaceHolderTranslator(ENTITY__PRE_PERSIST), - createPlaceHolderTranslator(ENTITY__POST_PERSIST), - createPlaceHolderTranslator(ENTITY__PRE_REMOVE), - createPlaceHolderTranslator(ENTITY__POST_REMOVE), - createPlaceHolderTranslator(ENTITY__PRE_UPDATE), - createPlaceHolderTranslator(ENTITY__POST_UPDATE), - createPlaceHolderTranslator(ENTITY__POST_LOAD), - createAttributeOverridesTranslator(), - createAssociationOverridesTranslator(), - createPersistentAttributesTranslator() - }; - } - - private Translator createNameTranslator() { - return new Translator(NAME, MAPPINGS_PKG.getIEntity_SpecifiedName(), DOM_ATTRIBUTE); - } - - private Translator getTableTranslator() { - return this.tableTranslator; - } - - private Translator getSecondaryTableTranslator() { - return this.secondaryTablesTranslator; - } - - private Translator getDiscriminatorColumnTranslator() { - return this.discriminatorColumnTranslator; - } - - private TableTranslator createTableTranslator() { - return new TableTranslator(); - } - - private SecondaryTablesTranslator createSecondaryTableTranslator() { - return new SecondaryTablesTranslator(); - } - - private DiscriminatorColumnTranslator createDiscriminatorColumnTranslator() { - return new DiscriminatorColumnTranslator(); - } - - private Translator createTableGeneratorTranslator() { - return new TableGeneratorTranslator(TABLE_GENERATOR, JpaCoreMappingsPackage.eINSTANCE.getIEntity_TableGenerator()); - } - - private Translator createSequenceGeneratorTranslator() { - return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, JpaCoreMappingsPackage.eINSTANCE.getIEntity_SequenceGenerator()); - } - - private Translator createNamedQueryTranslator() { - return new NamedQueryTranslator(NAMED_QUERY, JpaCoreMappingsPackage.eINSTANCE.getIEntity_NamedQueries()); - } - - private Translator createNamedNativeQueryTranslator() { - return new NamedNativeQueryTranslator(NAMED_NATIVE_QUERY, JpaCoreMappingsPackage.eINSTANCE.getIEntity_NamedNativeQueries()); - } - - protected Translator createDiscriminatorValueTranslator() { - return new Translator(ENTITY__DISCRIMINATOR_VALUE, MAPPINGS_PKG.getIEntity_SpecifiedDiscriminatorValue(), NO_STYLE); - } - - protected Translator createInheritanceTranslator() { - return new InheritanceTranslator(ENTITY__INHERITANCE, JPA_CORE_XML_PKG.getXmlEntityForXml_InheritanceForXml()); - } - - protected Translator createPrimaryKeyJoinColumnsTranslator() { - return new PrimaryKeyJoinColumnTranslator( - ENTITY__PRIMARY_KEY_JOIN_COLUMN, - JpaCoreMappingsPackage.eINSTANCE.getIEntity_SpecifiedPrimaryKeyJoinColumns(), - buildPrimaryKeyJoinColumnsBuilder()); - } - - private PrimaryKeyJoinColumnBuilder buildPrimaryKeyJoinColumnsBuilder() { - return new PrimaryKeyJoinColumnBuilder() { - public IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn() { - return OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn(new IEntity.PrimaryKeyJoinColumnOwner(entity)); - } - }; - } - - private Translator createAttributeOverridesTranslator() { - return new AttributeOverridesTranslator(ENTITY__ATTRIBUTE_OVERRIDE, MAPPINGS_PKG.getIEntity_SpecifiedAttributeOverrides(), buildAttributeOverrideBuilder()); - } - - private AttributeOverrideBuilder buildAttributeOverrideBuilder() { - return new AttributeOverrideBuilder() { - public IAttributeOverride createAttributeOverride() { - return EntityTranslator.this.entity.createAttributeOverride(0); - } - }; - } - - private Translator createAssociationOverridesTranslator() { - return new AssociationOverridesTranslator(ENTITY__ASSOCIATION_OVERRIDE, MAPPINGS_PKG.getIEntity_SpecifiedAssociationOverrides(), buildAssociationOverrideBuilder()); - } - - private AssociationOverrideBuilder buildAssociationOverrideBuilder() { - return new AssociationOverrideBuilder() { - public IAssociationOverride createAssociationOverride() { - return EntityTranslator.this.entity.createAssociationOverride(0); - } - }; - } - - protected Translator createIdClassTranslator() { - return new IdClassTranslator(ID_CLASS, JPA_CORE_XML_PKG.getXmlEntityForXml_IdClassForXml()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratedTypeElementTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratedTypeElementTranslator.java deleted file mode 100644 index c926b883d7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratedTypeElementTranslator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.EnumType; - -/** - * There is a bug in the translator framework that causes - * enumerators in xml elements and enumerators in xml attributes - * to be treated differently. When the enumerator is an attribute - * setting the model to the default causes the attribute to be removed. - * With an element is causes the default literal to be placed in - * the tag. - * - * The problem is wrapped up in the emf unsettable attribute as well. - * For attributes the eIsSet method returns false for the default value - * For elements the eIsSet method returns true for the default value. - * I don't want to have to use the unsettable option in emf since that would - * require that I call different api. I am not sure yet what the bug is in - * the translator, so I have entered one ~KFM - */ -public class EnumeratedTypeElementTranslator extends EnumeratorTranslator -{ - - public EnumeratedTypeElementTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - } - - @Override - public Object getMOFValue(EObject mofObject) { - EnumType type = (EnumType) super.getMOFValue(mofObject); - if (type == EnumType.DEFAULT) { - return null; - } - return type; - } - - @Override - public List getMOFChildren(EObject mofObject) { - List result = super.getMOFChildren(mofObject); - if(result != null && result.size() > 0) { - EnumType type = (EnumType) result.get(0); - if(type.getValue() == EnumType.DEFAULT_VALUE) - result = Collections.EMPTY_LIST; - } - return result; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratorTranslator.java deleted file mode 100644 index 743531d55b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratorTranslator.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorPath; - -public class EnumeratorTranslator extends Translator -{ - - public EnumeratorTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - } - - public EnumeratorTranslator(String domNameAndPath, EStructuralFeature aFeature, TranslatorPath translatorPath) { - super(domNameAndPath, aFeature, translatorPath); - } - - /** - * Overriding this because the default functionality is to return - * the toString of the Enumerator. This returns the literal value - * while we want to return the name instead. - * - * An example is fetchType where the literal value is going to be "Lazy" - * and the name is "LAZY". The xml needs "LAZY" to be placed in it - * while the ui wants to display "Lazy" - */ - @Override - public String convertValueToString(Object value, EObject owner) { - Enumerator enumerator = (Enumerator) value; - return enumerator.getName(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratedValueTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratedValueTranslator.java deleted file mode 100644 index e44adb6175..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratedValueTranslator.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class GeneratedValueTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public GeneratedValueTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, END_TAG_NO_INDENT); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createStrategyTranslator(), - createGeneratorTranslator(), - }; - } - - protected Translator createStrategyTranslator() { - return new EnumeratorTranslator(GENERATED_VALUE__STRATEGY, MAPPINGS_PKG.getIGeneratedValue_Strategy(), DOM_ATTRIBUTE); - } - - protected Translator createGeneratorTranslator() { - return new Translator(GENERATED_VALUE__GENERATOR, MAPPINGS_PKG.getIGeneratedValue_Generator(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlGeneratedValue(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratorTranslator.java deleted file mode 100644 index 0ad1f08982..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratorTranslator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class GeneratorTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public GeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected abstract Translator[] createChildren(); - - - protected Translator createNameTranslator() { - return new Translator(GENERATOR__NAME, MAPPINGS_PKG.getIGenerator_Name(), DOM_ATTRIBUTE); - } - - protected Translator createInitialValueTranslator() { - return new Translator(GENERATOR__INITIAL_VALUE, MAPPINGS_PKG.getIGenerator_SpecifiedInitialValue(), DOM_ATTRIBUTE); - } - - protected Translator createAllocationSizeTranslator() { - return new Translator(GENERATOR__ALLOCATION_SIZE, MAPPINGS_PKG.getIGenerator_SpecifiedAllocationSize(), DOM_ATTRIBUTE); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdClassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdClassTranslator.java deleted file mode 100644 index 4d10df1e2f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdClassTranslator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class IdClassTranslator extends Translator implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public IdClassTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createValueTranslator(), - }; - } - - protected Translator createValueTranslator() { - return new Translator(ID_CLASS__CLASS, JPA_CORE_XML_PKG.getXmlIdClass_Value(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlIdClass(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdTranslator.java deleted file mode 100644 index efa31b19db..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdTranslator.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class IdTranslator extends AttributeMappingTranslator -{ - private ColumnTranslator columnTranslator; - - public IdTranslator() { - super(ID, NO_STYLE); - this.columnTranslator = createColumnTranslator(); - } - - private ColumnTranslator createColumnTranslator() { - return new ColumnTranslator(COLUMN, JPA_CORE_XML_PKG.getIXmlColumnMapping_ColumnForXml()); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - IId xmlId = JPA_CORE_XML_FACTORY.createXmlId(); - this.setId(xmlId); - return xmlId; - } - - protected void setId(IId id) { - this.columnTranslator.setColumnMapping(id); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - columnTranslator, - createGeneratedValueTranslator(), - createTemporalTranslator(), - createTableGeneratorTranslator(), - createSequenceGeneratorTranslator(), - }; - } - - private Translator createGeneratedValueTranslator() { - return new GeneratedValueTranslator(GENERATED_VALUE, JpaCoreMappingsPackage.eINSTANCE.getIId_GeneratedValue()); - } - - private Translator createTemporalTranslator() { - return new TemporalTypeElementTranslator(ID__TEMPORAL, JpaCoreMappingsPackage.eINSTANCE.getIId_Temporal(), NO_STYLE); - } - - private Translator createTableGeneratorTranslator() { - return new TableGeneratorTranslator(TABLE_GENERATOR, JpaCoreMappingsPackage.eINSTANCE.getIId_TableGenerator()); - } - - private Translator createSequenceGeneratorTranslator() { - return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, JpaCoreMappingsPackage.eINSTANCE.getIId_SequenceGenerator()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/InheritanceTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/InheritanceTranslator.java deleted file mode 100644 index ee3a823835..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/InheritanceTranslator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class InheritanceTranslator extends Translator implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public InheritanceTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, END_TAG_NO_INDENT); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createStrategyTranslator(), - }; - } - - protected Translator createStrategyTranslator() { - return new EnumeratorTranslator(INHERITANCE__STRATEGY, JPA_CORE_XML_PKG.getXmlInheritance_Strategy(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlInheritance(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinColumnTranslator.java deleted file mode 100644 index 95472e4324..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinColumnTranslator.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class JoinColumnTranslator extends AbstractColumnTranslator - implements OrmXmlMapper -{ - private JoinColumnBuilder joinColumnBuilder; - - public JoinColumnTranslator(String domNameAndPath, EStructuralFeature aFeature, JoinColumnBuilder joinColumnBuilder) { - super(domNameAndPath, aFeature); - this.joinColumnBuilder = joinColumnBuilder; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return joinColumnBuilder.createJoinColumn(); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createReferencedColumnNameTranslator(), - createUniqueTranslator(), - createNullableTranslator(), - createInsertableTranslator(), - createUpdatableTranslator(), - createColumnDefinitionTranslator(), - createTableTranslator(), - }; - } - - protected Translator createReferencedColumnNameTranslator() { - return new Translator(REFERENCED_COLUMN_NAME, JPA_CORE_XML_PKG.getXmlJoinColumn_SpecifiedReferencedColumnNameForXml(), DOM_ATTRIBUTE); - } - - public interface JoinColumnBuilder { - IJoinColumn createJoinColumn(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinTableTranslator.java deleted file mode 100644 index a84833a83d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinTableTranslator.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.resource.JoinColumnTranslator.JoinColumnBuilder; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.IJoinTable.InverseJoinColumnOwner; -import org.eclipse.jpt.core.internal.mappings.IJoinTable.JoinColumnOwner; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class JoinTableTranslator extends AbstractTableTranslator -{ - - private IMultiRelationshipMapping mapping; - - - public JoinTableTranslator() { - super(JOIN_TABLE, JPA_CORE_XML_PKG.getXmlMultiRelationshipMappingForXml_JoinTableForXml()); - } - - protected IMultiRelationshipMapping getMapping() { - return this.mapping; - } - - void setMapping(IMultiRelationshipMapping mapping) { - this.mapping = mapping; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return getMapping().getJoinTable(); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createCatalogTranslator(), - createSchemaTranslator(), - createJoinColumnsTranslator(), - createInverseJoinColumnsTranslator(), - createUniqueConstraintTranslator(), - }; - } - - protected Translator createJoinColumnsTranslator() { - return new JoinColumnTranslator( - JOIN_COLUMN, - JpaCoreMappingsPackage.eINSTANCE.getIJoinTable_SpecifiedJoinColumns(), - buildJoinColumnsBuilder()); - } - - private JoinColumnBuilder buildJoinColumnsBuilder() { - return new JoinColumnBuilder() { - public IJoinColumn createJoinColumn() { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new JoinColumnOwner(getMapping().getJoinTable())); - } - }; - } - - protected Translator createInverseJoinColumnsTranslator() { - return new JoinColumnTranslator( - INVERSE_JOIN_COLUMN, - JpaCoreMappingsPackage.eINSTANCE.getIJoinTable_SpecifiedInverseJoinColumns(), - buildInverseJoinColumnsBuilder()); - } - - private JoinColumnBuilder buildInverseJoinColumnsBuilder() { - return new JoinColumnBuilder() { - public IJoinColumn createJoinColumn() { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new InverseJoinColumnOwner(getMapping().getJoinTable())); - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java deleted file mode 100644 index f2775fcbf2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToMany; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class ManyToManyTranslator extends MultiRelationshipTranslator -{ - public ManyToManyTranslator() { - super(MANY_TO_MANY); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - XmlManyToMany mapping = JPA_CORE_XML_FACTORY.createXmlManyToMany(); - this.setMapping(mapping); - return mapping; - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createTargetEntityTranslator(), - createFetchTypeTranslator(), - createMappedByTranslator(), - createOrderByTranslator(), - createMapKeyTranslator(), - getJoinTableTranslator(), - createCascadeTranslator() - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToOneTranslator.java deleted file mode 100644 index 9c1b100681..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToOneTranslator.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class ManyToOneTranslator extends SingleRelationshipTranslator -{ - public ManyToOneTranslator() { - super(MANY_TO_ONE); - } - - @Override - protected ISingleRelationshipMapping createMapping() { - return JPA_CORE_XML_FACTORY.createXmlManyToOne(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createTargetEntityTranslator(), - createFetchTypeTranslator(), - createOptionalTranslator(), - createJoinColumnsTranslator(), - createCascadeTranslator() - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MapKeyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MapKeyTranslator.java deleted file mode 100644 index 8206e09ca3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MapKeyTranslator.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - -public class MapKeyTranslator extends Translator implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public MapKeyTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - }; - } - - protected Translator createNameTranslator() { - return new Translator(MAP_KEY__NAME, JPA_CORE_XML_PKG.getXmlMapKey_Name(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlIdClass(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java deleted file mode 100644 index aaf4743429..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class MappedSuperclassTranslator extends TypeMappingTranslator -{ - protected static final OrmPackage XML_PKG = - OrmPackage.eINSTANCE; - - - public MappedSuperclassTranslator() { - super(MAPPED_SUPERCLASS); - } - - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return JPA_CORE_XML_FACTORY.createXmlMappedSuperclass(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createJavaClassTranslator(), - createAccessTypeTranslator(), - createMetadataCompleteTranslator(), - createPlaceHolderTranslator(ENTITY__DESCRIPTION), - createIdClassTranslator(), - createPlaceHolderTranslator(ENTITY__EXCLUDE_DEFAULT_LISTENERS), - createPlaceHolderTranslator(ENTITY__EXCLUDE_SUPERCLASS_LISTENERS), - createPlaceHolderTranslator(ENTITY__ENTITY_LISTENERS), - createPlaceHolderTranslator(ENTITY__PRE_PERSIST), - createPlaceHolderTranslator(ENTITY__POST_PERSIST), - createPlaceHolderTranslator(ENTITY__PRE_REMOVE), - createPlaceHolderTranslator(ENTITY__POST_REMOVE), - createPlaceHolderTranslator(ENTITY__PRE_UPDATE), - createPlaceHolderTranslator(ENTITY__POST_UPDATE), - createPlaceHolderTranslator(ENTITY__POST_LOAD), - createPersistentAttributesTranslator() - }; - } - - protected Translator createIdClassTranslator() { - return new IdClassTranslator(ID_CLASS, JPA_CORE_XML_PKG.getXmlMappedSuperclass_IdClassForXml()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiObjectDependencyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiObjectDependencyTranslator.java deleted file mode 100644 index 9ace901605..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiObjectDependencyTranslator.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.common.internal.emf.resource.DependencyTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class MultiObjectDependencyTranslator extends DependencyTranslator -{ - private static final Translator[] EMPTY_TRANSLATORS = new Translator[]{}; - - - private Map translatorMap; - - public MultiObjectDependencyTranslator(String domNameAndPath, EStructuralFeature aFeature, EStructuralFeature aDependentFeature) { - super(domNameAndPath, aFeature, aDependentFeature); - this.translatorMap = new HashMap(); - } - - - public Translator getDelegateFor(EObject o) { - return translatorMap.get(o); - } - - public void setDelegateFor(EObject o, Translator t) { - translatorMap.put(o, t); - } - - public abstract Translator getDelegateFor(String domName, String readAheadName); - - public EObject createEMFObject(String nodeName, String readAheadName) { - Translator translator = getDelegateFor(nodeName, readAheadName); - EObject eObject = translator.createEMFObject(nodeName, readAheadName); - this.translatorMap.put(eObject, translator); - return eObject; - } - - public Translator[] getChildren(Object o, int version) { - if (o == null) { - return EMPTY_TRANSLATORS; - } - Translator[] children = getDelegateFor((EObject) o).getChildren(o, version); - if (children == null) { - return EMPTY_TRANSLATORS; - } - return children; - } - - public String getDOMName(Object value) { - return getDelegateFor((EObject) value).getDOMName(value); - } - - public boolean isManagedByParent() { - return false; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java deleted file mode 100644 index 20b5c7be42..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class MultiRelationshipTranslator extends RelationshipTranslator -{ - private JoinTableTranslator tableTranslator; - - public MultiRelationshipTranslator(String domNameAndPath) { - super(domNameAndPath); - this.tableTranslator = createTableTranslator(); - } - - protected Translator createFetchTypeTranslator() { - return new EnumeratorTranslator(FETCH, JpaCoreMappingsPackage.eINSTANCE.getIMultiRelationshipMapping_Fetch(), DOM_ATTRIBUTE); - } - - protected JoinTableTranslator getJoinTableTranslator() { - return this.tableTranslator; - } - - protected JoinTableTranslator createTableTranslator() { - this.tableTranslator = new JoinTableTranslator(); - return this.tableTranslator; - } - - protected OrderByTranslator createOrderByTranslator() { - return new OrderByTranslator(); - } - - protected Translator createMapKeyTranslator() { - return new MapKeyTranslator(MAP_KEY, JPA_CORE_XML_PKG.getXmlMultiRelationshipMappingForXml_MapKeyForXml()); - } - - protected void setMapping(IMultiRelationshipMapping multiRelationshipMapping) { - this.getJoinTableTranslator().setMapping(multiRelationshipMapping); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedNativeQueryTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedNativeQueryTranslator.java deleted file mode 100644 index 480a67f36b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedNativeQueryTranslator.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class NamedNativeQueryTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public NamedNativeQueryTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, NO_STYLE); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createResultClassTranslator(), - createResultSetMappingTranslator(), - createQueryTranslator(), - createQueryHintTranslator(), - }; - } - - protected Translator createNameTranslator() { - return new Translator(NAMED_NATIVE_QUERY__NAME, MAPPINGS_PKG.getIQuery_Name(), DOM_ATTRIBUTE); - } - - protected Translator createQueryTranslator() { - return new Translator(NAMED_NATIVE_QUERY__QUERY, MAPPINGS_PKG.getIQuery_Query(), NO_STYLE); - } - - protected Translator createResultClassTranslator() { - return new Translator(NAMED_NATIVE_QUERY__RESULT_CLASS, MAPPINGS_PKG.getINamedNativeQuery_ResultClass(), DOM_ATTRIBUTE); - } - - protected Translator createResultSetMappingTranslator() { - return new Translator(NAMED_NATIVE_QUERY__RESULT_SET_MAPPING, MAPPINGS_PKG.getINamedNativeQuery_ResultSetMapping(), DOM_ATTRIBUTE); - } - - protected Translator createQueryHintTranslator() { - return new QueryHintTranslator(NAMED_NATIVE_QUERY__HINT, MAPPINGS_PKG.getIQuery_Hints()); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlNamedQuery(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedQueryTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedQueryTranslator.java deleted file mode 100644 index 44afa3ce69..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedQueryTranslator.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class NamedQueryTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public NamedQueryTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, NO_STYLE); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createQueryTranslator(), - createQueryHintTranslator(), - }; - } - - protected Translator createNameTranslator() { - return new Translator(NAMED_QUERY__NAME, MAPPINGS_PKG.getIQuery_Name(), DOM_ATTRIBUTE); - } - - protected Translator createQueryTranslator() { - return new Translator(NAMED_QUERY__QUERY, MAPPINGS_PKG.getIQuery_Query(), NO_STYLE); - } - - protected Translator createQueryHintTranslator() { - return new QueryHintTranslator(NAMED_QUERY__HINT, MAPPINGS_PKG.getIQuery_Hints()); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlNamedQuery(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java deleted file mode 100644 index 740d998852..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class OneToManyTranslator extends MultiRelationshipTranslator -{ - public OneToManyTranslator() { - super(ONE_TO_MANY); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - XmlOneToMany mapping = JPA_CORE_XML_FACTORY.createXmlOneToMany(); - this.setMapping(mapping); - return mapping; - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createTargetEntityTranslator(), - createFetchTypeTranslator(), - createMappedByTranslator(), - createOrderByTranslator(), - createMapKeyTranslator(), - getJoinTableTranslator(), - createCascadeTranslator() - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToOneTranslator.java deleted file mode 100644 index b73ed4760e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToOneTranslator.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class OneToOneTranslator extends SingleRelationshipTranslator -{ - public OneToOneTranslator() { - super(ONE_TO_ONE); - } - - @Override - protected ISingleRelationshipMapping createMapping() { - return JPA_CORE_XML_FACTORY.createXmlOneToOne(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createTargetEntityTranslator(), - createFetchTypeTranslator(), - createOptionalTranslator(), - createMappedByTranslator(), - createPlaceHolderTranslator(ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS), - createJoinColumnsTranslator(), - createPlaceHolderTranslator(ONE_TO_ONE__JOIN_TABLE), - createCascadeTranslator() - }; - } - private Translator createPlaceHolderTranslator(String domNameAndPath) { - return new Translator(domNameAndPath, (EStructuralFeature) null); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java deleted file mode 100644 index 78f118d7d5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class OrderByTranslator extends Translator implements OrmXmlMapper -{ - public OrderByTranslator() { - super(ORDER_BY, JpaCoreMappingsPackage.eINSTANCE.getIMultiRelationshipMapping_OrderBy(), END_TAG_NO_INDENT); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java deleted file mode 100644 index 26d6540174..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -public interface OrmXmlMapper -{ - String XML_NS = "xmlns"; //$NON-NLS-1$ - String XML_NS_XSI = "xmlns:xsi"; //$NON-NLS-1$ - String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$ - String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$ - String PERSISTENCE_NS_URL = "http://java.sun.com/xml/ns/persistence/orm"; //$NON-NLS-1$ - String ORM_SCHEMA_LOC_1_0 = "http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"; //$NON-NLS-1$ - - String FOO="foo"; //$NON-NLS-1$ - String BAR="bar"; //$NON-NLS-1$ - - String ACCESS = "access"; //$NON-NLS-1$ - String ATTRIBUTES = "attributes"; //$NON-NLS-1$ - String ATTRIBUTE_OVERRIDE_NAME = "name"; //$NON-NLS-1$ - String ATTRIBUTE_OVERRIDE_COLUMN = "column"; //$NON-NLS-1$ - String ASSOCIATION_OVERRIDE_NAME = "name"; //$NON-NLS-1$ - String ASSOCIATION_OVERRIDE_JOIN_COLUMN = "join-column"; //$NON-NLS-1$ - String BASIC = "basic"; //$NON-NLS-1$ - String BASIC__ENUMERATED = "enumerated"; //$NON-NLS-1$ - - String CASCADE = "cascade"; //$NON-NLS-1$ - String CASCADE__CASCADE_ALL = "cascade-all"; //$NON-NLS-1$ - String CASCADE__CASCADE_PERSIST = "cascade-persist"; //$NON-NLS-1$ - String CASCADE__CASCADE_MERGE = "cascade-merge"; //$NON-NLS-1$ - String CASCADE__CASCADE_REMOVE = "cascade-remove"; //$NON-NLS-1$ - String CASCADE__CASCADE_REFRESH = "cascade-refresh"; //$NON-NLS-1$ - - String CASCADE_PERSIST = "cascade-persist"; //$NON-NLS-1$ - - String CATALOG = "catalog"; //$NON-NLS-1$ - String CLASS = "class"; //$NON-NLS-1$ - String COLUMN = "column"; //$NON-NLS-1$ - String COLUMN__LENGTH = "length"; //$NON-NLS-1$ - String COLUMN__PRECISION= "precision"; //$NON-NLS-1$ - String COLUMN__SCALE= "scale"; //$NON-NLS-1$ - String COLUMN__COLUMN_DEFINITION= "column-definition"; //$NON-NLS-1$ - String COLUMN__NULLABLE = "nullable"; //$NON-NLS-1$ - String COLUMN__UNIQUE = "unique"; //$NON-NLS-1$ - String COLUMN__UPDATABLE = "updatable"; //$NON-NLS-1$ - String COLUMN__INSERTABLE = "insertable"; //$NON-NLS-1$ - String COLUMN__TABLE = "table"; //$NON-NLS-1$ - String COLUMN__NAME = "name"; //$NON-NLS-1$ - - String DISCRIMINATOR_COLUMN__NAME = "name"; //$NON-NLS-1$ - String DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminator-type"; //$NON-NLS-1$ - String DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "column-definition"; //$NON-NLS-1$ - String DISCRIMINATOR_COLUMN__LENGTH = "length"; //$NON-NLS-1$ - String EMBEDDABLE = "embeddable"; //$NON-NLS-1$ - String EMBEDDABLE__DESCRIPTION = "description"; //$NON-NLS-1$ - - String EMBEDDED = "embedded"; //$NON-NLS-1$ - String EMBEDDED__ATTRIBUTE_OVERRIDE = "attribute-override"; //$NON-NLS-1$ - String EMBEDDED_ID = "embedded-id"; //$NON-NLS-1$ - String EMBEDDED_ID__ATTRIBUTE_OVERRIDE = "attribute-override"; //$NON-NLS-1$ - - String ENTITY = "entity"; //$NON-NLS-1$ - String ENTITY__DESCRIPTION = "description"; //$NON-NLS-1$ - String ENTITY__TABLE = "table"; //$NON-NLS-1$ - String ENTITY__PRIMARY_KEY_JOIN_COLUMN = "primary-key-join-column"; //$NON-NLS-1$ - String ENTITY__INHERITANCE = "inheritance"; //$NON-NLS-1$ - String INHERITANCE__STRATEGY = "strategy"; //$NON-NLS-1$ - String ENTITY__DISCRIMINATOR_VALUE = "discriminator-value"; //$NON-NLS-1$ - String ENTITY__DISCRIMINATOR_COLUMN = "discriminator-column"; //$NON-NLS-1$ - String ENTITY__SEQUENCE_GENERATOR = "sequence-generator"; //$NON-NLS-1$ - String ENTITY__TABLE_GENERATOR = "table-generator"; //$NON-NLS-1$ - String ENTITY__NAMED_QUERY = "named-query"; //$NON-NLS-1$ - String ENTITY__NAMED_NATIVE_QUERY = "named-native-query"; //$NON-NLS-1$ - String ENTITY__SQL_RESULT_SET_MAPPING = "sql-result-set-mapping"; //$NON-NLS-1$ - String ENTITY__EXCLUDE_DEFAULT_LISTENERS = "exclude-default-listeners"; //$NON-NLS-1$ - String ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = "exclude-superclass-listeners"; //$NON-NLS-1$ - String ENTITY__ENTITY_LISTENERS = "entity-listeners"; //$NON-NLS-1$ - String ENTITY__PRE_PERSIST = "pre-persist"; //$NON-NLS-1$ - String ENTITY__POST_PERSIST = "post-persist"; //$NON-NLS-1$ - String ENTITY__PRE_REMOVE = "pre-remove"; //$NON-NLS-1$ - String ENTITY__POST_REMOVE = "post-remove"; //$NON-NLS-1$ - String ENTITY__PRE_UPDATE = "pre-update"; //$NON-NLS-1$ - String ENTITY__POST_UPDATE = "post-update"; //$NON-NLS-1$ - String ENTITY__POST_LOAD = "post-load"; //$NON-NLS-1$ - String ENTITY__ATTRIBUTE_OVERRIDE = "attribute-override"; //$NON-NLS-1$ - String ENTITY__ASSOCIATION_OVERRIDE = "association-override"; //$NON-NLS-1$ - - String ENTITY_MAPPINGS = "entity-mappings"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__DESCRIPTION = "description"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = "persistence-unit-metadata"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__PACKAGE = "package"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__SCHEMA = "schema"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__CATALOG = "catalog"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__ACCESS = "access"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__SEQUENCE_GENERATOR = "sequence-generator"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__TABLE_GENERATOR = "table-generator"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__NAMED_QUERY = "named-query"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__NAMED_NATIVE_QUERY = "named-native-query"; //$NON-NLS-1$ - String ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPING = "sql-result-set-mapping"; //$NON-NLS-1$ - - String FETCH = "fetch"; //$NON-NLS-1$ - String JOIN_COLUMN = "join-column"; //$NON-NLS-1$ - String JOIN_TABLE = "join-table"; //$NON-NLS-1$ - String ID = "id"; //$NON-NLS-1$ - String ID__TEMPORAL = "temporal"; //$NON-NLS-1$ - String ID_CLASS = "id-class"; //$NON-NLS-1$ - String ID_CLASS__CLASS = "class"; //$NON-NLS-1$ - - String GENERATED_VALUE = "generated-value"; //$NON-NLS-1$ - String GENERATED_VALUE__STRATEGY = "strategy"; //$NON-NLS-1$ - String GENERATED_VALUE__GENERATOR = "generator"; //$NON-NLS-1$ - String GENERATOR__NAME = "name"; //$NON-NLS-1$ - String GENERATOR__INITIAL_VALUE = "initial-value"; //$NON-NLS-1$ - String GENERATOR__ALLOCATION_SIZE = "allocation-size"; //$NON-NLS-1$ - - String INVERSE_JOIN_COLUMN = "inverse-join-column"; //$NON-NLS-1$ - String LOB = "lob"; //$NON-NLS-1$ - String MANY_TO_MANY = "many-to-many"; //$NON-NLS-1$ - String MANY_TO_ONE = "many-to-one"; //$NON-NLS-1$ - String MAP_KEY = "map-key"; //$NON-NLS-1$ - String MAP_KEY__NAME = "name"; //$NON-NLS-1$ - - String MAPPED_BY = "mapped-by"; //$NON-NLS-1$ - String MAPPED_SUPERCLASS = "mapped-superclass"; //$NON-NLS-1$ - String METADATA_COMPLETE = "metadata-complete"; //$NON-NLS-1$ - String NAME = "name"; //$NON-NLS-1$ - - String NAMED_NATIVE_QUERY = "named-native-query"; //$NON-NLS-1$ - String NAMED_NATIVE_QUERY__NAME = "name"; //$NON-NLS-1$ - String NAMED_NATIVE_QUERY__QUERY = "query"; //$NON-NLS-1$ - String NAMED_NATIVE_QUERY__RESULT_CLASS = "result-class"; //$NON-NLS-1$ - String NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = "result-set-mapping"; //$NON-NLS-1$ - String NAMED_NATIVE_QUERY__HINT = "hint"; //$NON-NLS-1$ - - String NAMED_QUERY = "named-query"; //$NON-NLS-1$ - String NAMED_QUERY__NAME = "name"; //$NON-NLS-1$ - String NAMED_QUERY__QUERY = "query"; //$NON-NLS-1$ - String NAMED_QUERY__HINT = "hint"; //$NON-NLS-1$ - - String QUERY_HINT__NAME = "name"; //$NON-NLS-1$ - String QUERY_HINT__VALUE = "value"; //$NON-NLS-1$ - - String ONE_TO_MANY = "one-to-many"; //$NON-NLS-1$ - String ONE_TO_ONE = "one-to-one"; //$NON-NLS-1$ - String ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = "primary-key-join-columns"; //$NON-NLS-1$ - String ONE_TO_ONE__JOIN_TABLE = "join-table"; //$NON-NLS-1$ - - String OPTIONAL = "optional"; //$NON-NLS-1$ - String ORDER_BY = "order-by"; //$NON-NLS-1$ - String PACKAGE="package"; //$NON-NLS-1$ - String PERSISTENCE_UNIT_DEFAULTS="persistence-unit-defaults"; //$NON-NLS-1$ - String PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS="entity-listeners"; //$NON-NLS-1$ - - String PERSISTENCE_UNIT_METADATA="persistence-unit-metadata"; //$NON-NLS-1$ - String REFERENCED_COLUMN_NAME="referenced-column-name"; //$NON-NLS-1$ - String SCHEMA="schema"; //$NON-NLS-1$ - String SECONDARY_TABLE = "secondary-table"; //$NON-NLS-1$ - String SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMN = "primary-key-join-column"; //$NON-NLS-1$ - String SEQUENCE_GENERATOR = "sequence-generator"; //$NON-NLS-1$ - String SEQUENCE_GENERATOR__SEQUENCE_NAME = "sequence-name"; //$NON-NLS-1$ - - String TABLE_GENERATOR = "table-generator"; //$NON-NLS-1$ - String TABLE_GENERATOR__TABLE = "table"; //$NON-NLS-1$ - String TABLE_GENERATOR__CATALOG = "catalog"; //$NON-NLS-1$ - String TABLE_GENERATOR__SCHEMA = "schema"; //$NON-NLS-1$ - String TABLE_GENERATOR__PK_COLUMN_NAME = "pk-column-name"; //$NON-NLS-1$ - String TABLE_GENERATOR__VALUE_COLUMN_NAME = "value-column-name"; //$NON-NLS-1$ - String TABLE_GENERATOR__PK_COLUMN_VALUE = "pk-column-value"; //$NON-NLS-1$ - String TARGET_ENTITY = "target-entity"; //$NON-NLS-1$ - String TEMPORAL = "temporal"; //$NON-NLS-1$ - String TRANSIENT = "transient"; //$NON-NLS-1$ - String UNIQUE_CONSTRAINT = "unique-constraint"; //$NON-NLS-1$ - String UNIQUE_CONSTRAINT__COLUMN_NAME = "column-name"; //$NON-NLS-1$ - String VERSION = "version"; //$NON-NLS-1$ - String XML_MAPPING_METADATA_COMPLETE = "xml-mapping-metadata-complete"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceFactory.java deleted file mode 100644 index 00b4b8fbce..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry; -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; -import org.eclipse.wst.xml.core.internal.emf2xml.EMF2DOMSSERendererFactory; - -public class OrmXmlResourceFactory extends TranslatorResourceFactory -{ - public static final String ORM_XML_FILE_NAME = "orm.xml"; //$NON-NLS-1$ - public static final URI ORM_XML_FILE_URI = URI.createURI(ORM_XML_FILE_NAME); //$NON-NLS-1$ - - /** - * Register myself with the Resource.Factory.Registry - */ - public static void registerWith(RendererFactory rendererFactory) { - WTPResourceFactoryRegistry.INSTANCE.registerLastFileSegment(ORM_XML_FILE_NAME, new OrmXmlResourceFactory(rendererFactory)); - } - - /** - * Register myself using the default renderer factory. - * @see #registerWith(RendererFactory) - */ - public static void register() { - registerWith(EMF2DOMSSERendererFactory.INSTANCE); - } - - public static Resource.Factory getRegisteredFactory() { - return WTPResourceFactoryRegistry.INSTANCE.getFactory(ORM_XML_FILE_URI); - } - - - public OrmXmlResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) { - super(aRendererFactory, listeningForUpdates); - } - - public OrmXmlResourceFactory(RendererFactory aRendererFactory) { - super(aRendererFactory); - } - - /** - * @see TranslatorResourceFactory#createResource(URI, Renderer) - */ - protected TranslatorResource createResource(URI uri, Renderer renderer) { - return new OrmXmlResourceImpl(uri, renderer); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceImpl.java deleted file mode 100644 index 62f1eab457..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.OrmXmlResource; -import org.eclipse.wst.common.internal.emf.resource.Renderer; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResource; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl; - -public class OrmXmlResourceImpl extends TranslatorResourceImpl - implements OrmXmlResource -{ - - private Translator rootTranslator; - - public OrmXmlResourceImpl(Renderer aRenderer) { - super(aRenderer); - } - - public OrmXmlResourceImpl(URI uri, Renderer aRenderer) { - super(uri, aRenderer); - } - - /** - * @see TranslatorResourceImpl#getDefaultPublicId() - */ - protected String getDefaultPublicId() { - return null; - // only applicable for DTD-based files - } - - /** - * @see TranslatorResourceImpl#getDefaultSystemId() - */ - protected String getDefaultSystemId() { - return null; - // only applicable for DTD-based files - } - - /** - * @see TranslatorResourceImpl#getDefaultVersionId() - */ - protected int getDefaultVersionID() { - return 10; - // this seems to be the default version of the spec for this doc - // and the id 10 maps to the version 1.0 - } - - /** - * @see TranslatorResource#getDoctype() - */ - public String getDoctype() { - return null; - // only applicable for DTD-based files - } - - /** - * @see TranslatorResource#getRootTranslator() - */ - public Translator getRootTranslator() { - if (this.rootTranslator == null) { - this.rootTranslator = buildRootTranslator(); - } - return this.rootTranslator; - } - - protected Translator buildRootTranslator() { - return new EntityMappingsTranslator(); - } - - /** - * @see OrmXmlResource#getXmlFileContent() - */ - public EntityMappingsInternal getXmlFileContent() { - return (EntityMappingsInternal) getRootObject(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitDefaultsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitDefaultsTranslator.java deleted file mode 100644 index db6ff8ff9b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitDefaultsTranslator.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class PersistenceUnitDefaultsTranslator extends Translator implements OrmXmlMapper -{ - private Translator[] children; - - private PersistenceUnitMetadata persistenceUnitMetadata; - - public PersistenceUnitDefaultsTranslator() { - super(PERSISTENCE_UNIT_DEFAULTS, OrmPackage.eINSTANCE.getPersistenceUnitMetadataForXml_PersistenceUnitDefaultsForXml()); - } - - public Translator[] getChildren(Object target, int versionID) { - if (this.children == null) { - this.children = createChildren(); - } - return this.children; - } - - private Translator[] createChildren() { - return new Translator[] { - createSchemaTranslator(), - createCatalogTranslator(), - createAccessTranslator(), - createCascadePersistTranslator(), - createPlaceHolderTranslator(PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS), - }; - } - - private Translator createPlaceHolderTranslator(String domNameAndPath) { - return new Translator(domNameAndPath, (EStructuralFeature) null); - } - - private Translator createSchemaTranslator() { - return new Translator(SCHEMA, OrmPackage.eINSTANCE.getPersistenceUnitDefaultsForXml_SchemaForXml()); - } - - private Translator createCatalogTranslator() { - return new Translator(CATALOG, OrmPackage.eINSTANCE.getPersistenceUnitDefaultsForXml_CatalogForXml()); - } - - private Translator createAccessTranslator() { - return new AccessTypeElementTranslator(ACCESS, OrmPackage.eINSTANCE.getPersistenceUnitDefaultsForXml_AccessForXml(), NO_STYLE); - } - - private Translator createCascadePersistTranslator() { - return new EmptyTagBooleanTranslator(CASCADE_PERSIST, OrmPackage.eINSTANCE.getPersistenceUnitDefaultsForXml_CascadePersistForXml()); - } - - @Override - //This is called when the persistence-unit-defaults tag is added - //by hand through the xml editor. In this situation PersistenceUnitMetaData.persistenceUnitDefaultsForXml - //is null and we don't want to create a new PersistenceUnitDefaults object, we just want to - //reuse the one already created by our internal model - public EObject createEMFObject(String nodeName, String readAheadName) { - return getPersistenceUnitMetadata().getPersistenceUnitDefaults(); - } - - private PersistenceUnitMetadata getPersistenceUnitMetadata() { - return this.persistenceUnitMetadata; - } - - void setPersistenceUnitMetadata(PersistenceUnitMetadata persistenceUnitMetadata) { - this.persistenceUnitMetadata = persistenceUnitMetadata; - } - - @Override - //if my object has containtment = true then the translators clear out all adapters - //even the ones it didn't add. if i have containtment = false then the translators - //are not removing the adapter they added - // the shared flag gets set when containment=true. isShared() is called in - //EMF2DOMAdapterImpl.primUpdateMOFFeature which then calls removeMOFValue() if - //isShared() returns false. removeMOFValue() removes the EMF2DOMSSEAdapter - //and then since isContainment() = false the call to ExtendedEcoreUtil.unload(value); - // does not occur. In that method the adapters are all cleared out thus my UI - //no longer has listeners on the model. Talk to KFM about this and maybe - //she'll remember the details. \ - - //Need to enter a bug against the translators as well. Now one other - //adapter is not being removed, the AnnotationsAdapter, this is being added by the translators - //and never removed. not sure - public boolean isShared() { - return false; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitMetadataTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitMetadataTranslator.java deleted file mode 100644 index a1244d89f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitMetadataTranslator.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class PersistenceUnitMetadataTranslator extends Translator implements OrmXmlMapper -{ - private Translator[] children; - - private PersistenceUnitDefaultsTranslator persistenceUnitDefaultsTranslator; - private EntityMappings entityMappings; - - public PersistenceUnitMetadataTranslator() { - super(PERSISTENCE_UNIT_METADATA, OrmPackage.eINSTANCE.getEntityMappingsForXml_PersistenceUnitMetadataForXml()); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - private Translator[] createChildren() { - return new Translator[] { - createXmlMappingMetadataCompleteTranslator(), - createPersistenceUnitDefaultsTranslator(), - }; - } - - private Translator createXmlMappingMetadataCompleteTranslator() { - return new EmptyTagBooleanTranslator(XML_MAPPING_METADATA_COMPLETE, OrmPackage.eINSTANCE.getPersistenceUnitMetadataForXml_XmlMappingMetadataCompleteForXml()); - } - - private Translator createPersistenceUnitDefaultsTranslator() { - this.persistenceUnitDefaultsTranslator = new PersistenceUnitDefaultsTranslator(); - return this.persistenceUnitDefaultsTranslator; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - PersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata(); - this.persistenceUnitDefaultsTranslator.setPersistenceUnitMetadata(persistenceUnitMetadata); - return persistenceUnitMetadata; - } - - private EntityMappings getEntityMappings() { - return this.entityMappings; - } - - public void setEntityMappings(EntityMappings entityMappings) { - this.entityMappings = entityMappings; - } - - @Override - //if my object has containtment = true then the translators clear out all adapters - //even the ones it didn't add. if i have containtment = false then the translators - //are not removing the adapter they added - // the shared flag gets set when containment=true. isShared() is called in - //EMF2DOMAdapterImpl.primUpdateMOFFeature which then calls removeMOFValue() if - //isShared() returns false. removeMOFValue() removes the EMF2DOMSSEAdapter - //and then since isContainment() = false the call to ExtendedEcoreUtil.unload(value); - // does not occur. In that method the adapters are all cleared out thus my UI - //no longer has listeners on the model. Talk to KFM about this and maybe - //she'll remember the details. \ - - //Need to enter a bug against the translators as well. Now one other - //adapter is not being removed, the AnnotationsAdapter, this is being added by the translators - //and never removed. not sure - public boolean isShared() { - return false; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PrimaryKeyJoinColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PrimaryKeyJoinColumnTranslator.java deleted file mode 100644 index 74a14c07a8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PrimaryKeyJoinColumnTranslator.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class PrimaryKeyJoinColumnTranslator extends AbstractColumnTranslator - implements OrmXmlMapper -{ - private PrimaryKeyJoinColumnBuilder joinColumnBuilder; - - public PrimaryKeyJoinColumnTranslator(String domNameAndPath, EStructuralFeature aFeature, PrimaryKeyJoinColumnBuilder joinColumnBuilder) { - super(domNameAndPath, aFeature); - this.joinColumnBuilder = joinColumnBuilder; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return joinColumnBuilder.createPrimaryKeyJoinColumn(); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createReferencedColumnNameTranslator(), - createColumnDefinitionTranslator(), - }; - } - - protected Translator createReferencedColumnNameTranslator() { - return new Translator(REFERENCED_COLUMN_NAME, JPA_CORE_XML_PKG.getXmlPrimaryKeyJoinColumn_SpecifiedReferencedColumnNameForXml(), DOM_ATTRIBUTE); - } - - public interface PrimaryKeyJoinColumnBuilder { - IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/QueryHintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/QueryHintTranslator.java deleted file mode 100644 index 502440429f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/QueryHintTranslator.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class QueryHintTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public QueryHintTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, NO_STYLE); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createValueTranslator(), - }; - } - - protected Translator createNameTranslator() { - return new Translator(QUERY_HINT__NAME, MAPPINGS_PKG.getIQueryHint_Name(), DOM_ATTRIBUTE); - } - - protected Translator createValueTranslator() { - return new Translator(QUERY_HINT__VALUE, MAPPINGS_PKG.getIQueryHint_Value(), DOM_ATTRIBUTE); - } - - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlQueryHint(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java deleted file mode 100644 index cee4d5218d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class RelationshipTranslator extends AttributeMappingTranslator -{ - public RelationshipTranslator(String domNameAndPath) { - super(domNameAndPath, NO_STYLE); - } - - protected Translator createTargetEntityTranslator() { - return new Translator(TARGET_ENTITY, JpaCoreMappingsPackage.eINSTANCE.getIRelationshipMapping_SpecifiedTargetEntity(), DOM_ATTRIBUTE); - } - - //placeholder until we support in our model, this allow us - //to keep the elements in the proper order - protected Translator createCascadeTranslator() { - return new CascadeTranslator(CASCADE , JpaCoreMappingsPackage.eINSTANCE.getIRelationshipMapping_Cascade()); - } - - protected Translator createMappedByTranslator() { - return new Translator(MAPPED_BY, JpaCoreMappingsPackage.eINSTANCE.getINonOwningMapping_MappedBy(), DOM_ATTRIBUTE); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTableTranslator.java deleted file mode 100644 index 85a4fd8b0c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTableTranslator.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.resource.PrimaryKeyJoinColumnTranslator.PrimaryKeyJoinColumnBuilder; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class SecondaryTableTranslator extends AbstractTableTranslator -{ - - private IEntity entity; - - private ISecondaryTable secondaryTable; - - public SecondaryTableTranslator() { - super(SECONDARY_TABLE, MAPPINGS_PKG.getIEntity_SpecifiedSecondaryTables()); - } - - - protected IEntity getEntity() { - return this.entity; - } - - void setEntity(IEntity entity) { - this.entity = entity; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - this.secondaryTable = getEntity().createSecondaryTable(0); - return this.secondaryTable; - } - - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createCatalogTranslator(), - createSchemaTranslator(), - createPrimaryKeyJoinColumnsTranslator(), - createUniqueConstraintTranslator(), - }; - } - - protected Translator createPrimaryKeyJoinColumnsTranslator() { - return new PrimaryKeyJoinColumnTranslator( - SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMN, - JpaCoreMappingsPackage.eINSTANCE.getISecondaryTable_SpecifiedPrimaryKeyJoinColumns(), - buildPrimaryKeyJoinColumnsBuilder()); - } - - private PrimaryKeyJoinColumnBuilder buildPrimaryKeyJoinColumnsBuilder() { - return new PrimaryKeyJoinColumnBuilder() { - public IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn() { - return OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn(new ISecondaryTable.PrimaryKeyJoinColumnOwner(secondaryTable)); - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTablesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTablesTranslator.java deleted file mode 100644 index 7819bf9ee0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTablesTranslator.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.MultiObjectTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * Created this class so there would be a 1-1 association between - * SecondaryTable and SecondaryTableTranslator. Without this the state - * stored on SecondaryTableTranslator will be invalid for multiple SecondaryTables. - * see bug 188901. - * - * TODO 189767 - memory leak if a SecondaryTable is removed from the model, it is still - * stored along with its translator in the translator map - */ -public class SecondaryTablesTranslator extends MultiObjectTranslator implements OrmXmlMapper -{ - - private IEntity entity; - - private Map translatorMap; - - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - - public SecondaryTablesTranslator() { - super(SECONDARY_TABLE, MAPPINGS_PKG.getIEntity_SpecifiedSecondaryTables()); - this.translatorMap = new HashMap(); - } - - - protected IEntity getEntity() { - return this.entity; - } - - void setEntity(IEntity entity) { - this.entity = entity; - for (SecondaryTableTranslator translator : translatorMap.values()) { - translator.setEntity(entity); - } - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - SecondaryTableTranslator translator = (SecondaryTableTranslator) getDelegateFor(nodeName, readAheadName); - EObject eObject = translator.createEMFObject(nodeName, readAheadName); - this.translatorMap.put(eObject, translator); - return eObject; - } - - /* (non-Javadoc) - * @see MultiObjectTranslator#getDelegateFor(EObject) - */ - @Override - public Translator getDelegateFor(EObject o) { - Translator translator = translatorMap.get(o); - if (translator != null) { - return translator; - } - - switch (o.eClass().getClassifierID()) { - case OrmPackage.XML_SECONDARY_TABLE : - SecondaryTableTranslator secondaryTableTranslator = new SecondaryTableTranslator(); - secondaryTableTranslator.setEntity(getEntity()); - return secondaryTableTranslator; - } - - return null; - } - - @Override - public Translator getDelegateFor(String domName, String readAheadName) { - if (domName.equals(SECONDARY_TABLE)) { - SecondaryTableTranslator secondaryTableTranslator = new SecondaryTableTranslator(); - secondaryTableTranslator.setEntity(getEntity()); - return secondaryTableTranslator; - } - throw new IllegalStateException("Illegal dom name: " + domName); //$NON-NLS-1$ - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SequenceGeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SequenceGeneratorTranslator.java deleted file mode 100644 index 054a61078a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SequenceGeneratorTranslator.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class SequenceGeneratorTranslator extends GeneratorTranslator -{ - - public SequenceGeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, END_TAG_NO_INDENT); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createSequenceNameTranslator(), - createInitialValueTranslator(), - createAllocationSizeTranslator(), - }; - } - - protected Translator createSequenceNameTranslator() { - return new Translator(SEQUENCE_GENERATOR__SEQUENCE_NAME, MAPPINGS_PKG.getISequenceGenerator_SpecifiedSequenceName(), DOM_ATTRIBUTE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlSequenceGenerator(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SingleRelationshipTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SingleRelationshipTranslator.java deleted file mode 100644 index c9291c8f7f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SingleRelationshipTranslator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.resource.JoinColumnTranslator.JoinColumnBuilder; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class SingleRelationshipTranslator extends RelationshipTranslator -{ - private ISingleRelationshipMapping singleRelationshipMapping; - - public SingleRelationshipTranslator(String domNameAndPath) { - super(domNameAndPath); - } - - @Override - public final EObject createEMFObject(String nodeName, String readAheadName) { - this.singleRelationshipMapping = createMapping(); - return this.singleRelationshipMapping; - } - - protected abstract ISingleRelationshipMapping createMapping(); - - protected Translator createFetchTypeTranslator() { - return new EnumeratorTranslator(FETCH, JpaCoreMappingsPackage.eINSTANCE.getISingleRelationshipMapping_Fetch(), DOM_ATTRIBUTE); - } - - protected Translator createOptionalTranslator() { - return new BooleanEnumeratorTranslator(OPTIONAL, JpaCoreMappingsPackage.eINSTANCE.getISingleRelationshipMapping_Optional(), DOM_ATTRIBUTE); - } - - protected Translator createJoinColumnsTranslator() { - return new JoinColumnTranslator( - JOIN_COLUMN, - JpaCoreMappingsPackage.eINSTANCE.getISingleRelationshipMapping_SpecifiedJoinColumns(), - buildJoinColumnsCreator()); - } - - private JoinColumnBuilder buildJoinColumnsCreator() { - return new JoinColumnBuilder() { - public IJoinColumn createJoinColumn() { - return OrmFactory.eINSTANCE.createXmlJoinColumn(new ISingleRelationshipMapping.JoinColumnOwner(singleRelationshipMapping)); - } - }; - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableGeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableGeneratorTranslator.java deleted file mode 100644 index 2dfcdcbb3c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableGeneratorTranslator.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class TableGeneratorTranslator extends GeneratorTranslator -{ - - public TableGeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, NO_STYLE); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createTableTranslator(), - createCatalogTranslator(), - createSchemaTranslator(), - createPkColumnNameTranslator(), - createValueColumnNameTranslator(), - createPkColumnValueTranslator(), - createInitialValueTranslator(), - createAllocationSizeTranslator(), - createUniqueConstraintTranslator(), - }; - } - - protected Translator createTableTranslator() { - return new Translator(TABLE_GENERATOR__TABLE, MAPPINGS_PKG.getITableGenerator_SpecifiedTable(), DOM_ATTRIBUTE); - } - - protected Translator createCatalogTranslator() { - return new Translator(TABLE_GENERATOR__CATALOG, MAPPINGS_PKG.getITableGenerator_SpecifiedCatalog(), DOM_ATTRIBUTE); - } - - protected Translator createSchemaTranslator() { - return new Translator(TABLE_GENERATOR__SCHEMA, MAPPINGS_PKG.getITableGenerator_SpecifiedSchema(), DOM_ATTRIBUTE); - } - - protected Translator createPkColumnNameTranslator() { - return new Translator(TABLE_GENERATOR__PK_COLUMN_NAME, MAPPINGS_PKG.getITableGenerator_SpecifiedPkColumnName(), DOM_ATTRIBUTE); - } - - protected Translator createValueColumnNameTranslator() { - return new Translator(TABLE_GENERATOR__VALUE_COLUMN_NAME, MAPPINGS_PKG.getITableGenerator_SpecifiedValueColumnName(), DOM_ATTRIBUTE); - } - - protected Translator createPkColumnValueTranslator() { - return new Translator(TABLE_GENERATOR__PK_COLUMN_VALUE, MAPPINGS_PKG.getITableGenerator_SpecifiedPkColumnValue(), DOM_ATTRIBUTE); - } - - protected Translator createUniqueConstraintTranslator() { - return new Translator(UNIQUE_CONSTRAINT, (EStructuralFeature) null); - //return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, MAPPINGS_PKG.getITableGenerator_UniqueConstraints()); - } - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlTableGenerator(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableTranslator.java deleted file mode 100644 index f27f9fde9f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableTranslator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class TableTranslator extends AbstractTableTranslator - implements OrmXmlMapper -{ - - private IEntity entity; - - - public TableTranslator() { - super(ENTITY__TABLE, JPA_CORE_XML_PKG.getXmlEntityForXml_TableForXml()); - } - - protected IEntity getEntity() { - return this.entity; - } - - void setEntity(IEntity entity) { - this.entity = entity; - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return getEntity().getTable(); - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - createCatalogTranslator(), - createSchemaTranslator(), - createUniqueConstraintTranslator(), - }; - } - - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TemporalTypeElementTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TemporalTypeElementTranslator.java deleted file mode 100644 index 85597bcd74..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TemporalTypeElementTranslator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.mappings.TemporalType; - -/** - * There is a bug in the translator framework that causes - * enumerators in xml elements and enumerators in xml attributes - * to be treated differently. When the enumerator is an attribute - * setting the model to the default causes the attribute to be removed. - * With an element is causes the default literal to be placed in - * the tag. - * - * The problem is wrapped up in the emf unsettable attribute as well. - * For attributes the eIsSet method returns false for the default value - * For elements the eIsSet method returns true for the default value. - * I don't want to have to use the unsettable option in emf since that would - * require that I call different api. I am not sure yet what the bug is in - * the translator, so I have entered one ~KFM - */ -public class TemporalTypeElementTranslator extends EnumeratorTranslator -{ - - public TemporalTypeElementTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - } - - @Override - public Object getMOFValue(EObject mofObject) { - TemporalType type = (TemporalType) super.getMOFValue(mofObject); - if (type == TemporalType.NULL) { - return null; - } - return type; - } - - @Override - public List getMOFChildren(EObject mofObject) { - List result = super.getMOFChildren(mofObject); - if(result != null && result.size() > 0) { - TemporalType type = (TemporalType) result.get(0); - if(type.getValue() == TemporalType.NULL_VALUE) - result = Collections.EMPTY_LIST; - } - return result; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TransientTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TransientTranslator.java deleted file mode 100644 index 461c9babf1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TransientTranslator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class TransientTranslator extends AttributeMappingTranslator -{ - public TransientTranslator() { - super(TRANSIENT, END_TAG_NO_INDENT); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return JPA_CORE_XML_FACTORY.createXmlTransient(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - }; - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeJavaClassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeJavaClassTranslator.java deleted file mode 100644 index cd392a6556..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeJavaClassTranslator.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.DependencyTranslator; - -public class TypeJavaClassTranslator extends DependencyTranslator - implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - public TypeJavaClassTranslator() { - super(CLASS, JPA_CORE_XML_PKG.getXmlPersistentType_Class(), - JPA_CORE_XML_PKG.getXmlTypeMapping_PersistentType()); - fStyle = DOM_ATTRIBUTE; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingTranslator.java deleted file mode 100644 index db34811c0a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingTranslator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public abstract class TypeMappingTranslator extends Translator - implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - protected static final OrmFactory JPA_CORE_XML_FACTORY = - OrmFactory.eINSTANCE; - - - private Translator[] children; - - - public TypeMappingTranslator(String domNameAndPath) { - super(domNameAndPath, JPA_CORE_XML_PKG.getEntityMappingsInternal_TypeMappings()); - dependencyFeature = JPA_CORE_XML_PKG.getXmlTypeMapping_PersistentType(); - } - - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected abstract Translator[] createChildren(); - - protected Translator createJavaClassTranslator() { - return new TypeJavaClassTranslator(); - } - - protected Translator createMetadataCompleteTranslator() { - return new BooleanEnumeratorTranslator(METADATA_COMPLETE, JPA_CORE_XML_PKG.getXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE); - } - - protected Translator createAccessTypeTranslator() { - return new EnumeratorTranslator(ACCESS, JPA_CORE_XML_PKG.getXmlTypeMapping_SpecifiedAccess(), DOM_ATTRIBUTE); - } - - protected Translator createPersistentAttributesTranslator() { - return new AttributeMappingsTranslator(); - } - - - protected Translator createPlaceHolderTranslator(String domNameAndPath) { - return new Translator(domNameAndPath, (EStructuralFeature) null); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingsTranslator.java deleted file mode 100644 index 7a66392e67..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingsTranslator.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.wst.common.internal.emf.resource.MultiObjectTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class TypeMappingsTranslator extends MultiObjectTranslator - implements OrmXmlMapper -{ - public static final String ENTITY_MAPPINGS_PATH = - MAPPED_SUPERCLASS + ',' + ENTITY + ',' + EMBEDDABLE; - - private static final OrmPackage JPA_CORE_XML_PKG = OrmPackage.eINSTANCE; - - private Map translatorMap; - - public TypeMappingsTranslator() { - super(ENTITY_MAPPINGS_PATH, JPA_CORE_XML_PKG.getEntityMappingsInternal_TypeMappings()); - this.translatorMap = new HashMap(); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - Translator translator = getDelegateFor(nodeName, readAheadName); - EObject eObject = translator.createEMFObject(nodeName, readAheadName); - this.translatorMap.put(eObject, translator); - return eObject; - } - /* (non-Javadoc) - * @see MultiObjectTranslator#getDelegateFor(EObject) - */ - @Override - public Translator getDelegateFor(EObject o) { - Translator translator = translatorMap.get(o); - if (translator != null) { - return translator; - } - - switch (o.eClass().getClassifierID()) { - case OrmPackage.XML_ENTITY_INTERNAL : - translator = new EntityTranslator(); - ((EntityTranslator) translator).setEntity((IEntity) o); - break; - case OrmPackage.XML_MAPPED_SUPERCLASS: - translator = new MappedSuperclassTranslator(); - break; - case OrmPackage.XML_EMBEDDABLE: - translator = new EmbeddableTranslator(); - break; - } - if (translator != null) { - this.translatorMap.put(o, translator); - } - - return translator; - } - - @Override - public Translator getDelegateFor(String domName, String readAheadName) { - if (domName.equals(ENTITY)) { - return new EntityTranslator(); - } - if (domName.equals(MAPPED_SUPERCLASS)) { - return new MappedSuperclassTranslator(); - } - if (domName.equals(EMBEDDABLE)) { - return new EmbeddableTranslator(); - } - throw new IllegalStateException("Illegal dom name: " + domName); //$NON-NLS-1$ - } - - @Override - public boolean isDependencyParent() { - return true; - } - - @Override - public EStructuralFeature getDependencyFeature() { - return JPA_CORE_XML_PKG.getXmlTypeMapping_PersistentType(); - } - - @Override - public EObject basicGetDependencyObject(EObject parent) { - Translator delegate = getDelegateFor(parent); - - if (delegate != null) { - return delegate.basicGetDependencyObject(parent); - } - else { - return super.basicGetDependencyObject(parent); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java deleted file mode 100644 index 258a2732b3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class UniqueConstraintTranslator extends Translator implements OrmXmlMapper -{ - protected static final JpaCoreMappingsPackage MAPPINGS_PKG = - JpaCoreMappingsPackage.eINSTANCE; - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - - private Translator[] children; - - public UniqueConstraintTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - creatColumnNamesTranslator(), - }; - } - - protected Translator creatColumnNamesTranslator() { - return new Translator(UNIQUE_CONSTRAINT__COLUMN_NAME, MAPPINGS_PKG.getITable_UniqueConstraints()); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return OrmFactory.eINSTANCE.createXmlUniqueConstraint(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/VersionTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/VersionTranslator.java deleted file mode 100644 index b34af52439..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/VersionTranslator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class VersionTranslator extends AttributeMappingTranslator -{ - public VersionTranslator() { - super(VERSION, NO_STYLE); - } - - @Override - public EObject createEMFObject(String nodeName, String readAheadName) { - return JPA_CORE_XML_FACTORY.createXmlVersion(); - } - - @Override - protected Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createNameTranslator(), - }; - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java deleted file mode 100644 index 2e42c3c2dd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java +++ /dev/null @@ -1,2384 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.IXmlEObject; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlBasic; -import org.eclipse.jpt.core.internal.content.orm.XmlCascade; -import org.eclipse.jpt.core.internal.content.orm.XmlColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbedded; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId; -import org.eclipse.jpt.core.internal.content.orm.XmlEntity; -import org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml; -import org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue; -import org.eclipse.jpt.core.internal.content.orm.XmlGenerator; -import org.eclipse.jpt.core.internal.content.orm.XmlId; -import org.eclipse.jpt.core.internal.content.orm.XmlIdClass; -import org.eclipse.jpt.core.internal.content.orm.XmlInheritance; -import org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlJoinTable; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToMany; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlMapKey; -import org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery; -import org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery; -import org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlQueryHint; -import org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode; -import org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable; -import org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator; -import org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlTable; -import org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator; -import org.eclipse.jpt.core.internal.content.orm.XmlTransient; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint; -import org.eclipse.jpt.core.internal.content.orm.XmlVersion; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.IVersion; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage - * @generated - */ -public class OrmAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static OrmPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public OrmAdapterFactory() { - if (modelPackage == null) { - modelPackage = OrmPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the createXXX methods. - * - * - * @generated - */ - protected OrmSwitch modelSwitch = new OrmSwitch() { - @Override - public Adapter caseXmlRootContentNode(XmlRootContentNode object) { - return createXmlRootContentNodeAdapter(); - } - - @Override - public Adapter caseEntityMappingsInternal(EntityMappingsInternal object) { - return createEntityMappingsInternalAdapter(); - } - - @Override - public Adapter caseEntityMappings(EntityMappings object) { - return createEntityMappingsAdapter(); - } - - @Override - public Adapter caseEntityMappingsForXml(EntityMappingsForXml object) { - return createEntityMappingsForXmlAdapter(); - } - - @Override - public Adapter caseXmlTypeMapping(XmlTypeMapping object) { - return createXmlTypeMappingAdapter(); - } - - @Override - public Adapter caseXmlPersistentType(XmlPersistentType object) { - return createXmlPersistentTypeAdapter(); - } - - @Override - public Adapter caseXmlMappedSuperclass(XmlMappedSuperclass object) { - return createXmlMappedSuperclassAdapter(); - } - - @Override - public Adapter caseXmlEntityInternal(XmlEntityInternal object) { - return createXmlEntityInternalAdapter(); - } - - @Override - public Adapter caseXmlEntityForXml(XmlEntityForXml object) { - return createXmlEntityForXmlAdapter(); - } - - @Override - public Adapter caseXmlEntity(XmlEntity object) { - return createXmlEntityAdapter(); - } - - @Override - public Adapter caseXmlEmbeddable(XmlEmbeddable object) { - return createXmlEmbeddableAdapter(); - } - - @Override - public Adapter caseXmlAttributeMapping(XmlAttributeMapping object) { - return createXmlAttributeMappingAdapter(); - } - - @Override - public Adapter caseXmlNullAttributeMapping(XmlNullAttributeMapping object) { - return createXmlNullAttributeMappingAdapter(); - } - - @Override - public Adapter caseXmlBasic(XmlBasic object) { - return createXmlBasicAdapter(); - } - - @Override - public Adapter caseXmlId(XmlId object) { - return createXmlIdAdapter(); - } - - @Override - public Adapter caseXmlTransient(XmlTransient object) { - return createXmlTransientAdapter(); - } - - @Override - public Adapter caseXmlEmbedded(XmlEmbedded object) { - return createXmlEmbeddedAdapter(); - } - - @Override - public Adapter caseXmlEmbeddedId(XmlEmbeddedId object) { - return createXmlEmbeddedIdAdapter(); - } - - @Override - public Adapter caseXmlVersion(XmlVersion object) { - return createXmlVersionAdapter(); - } - - @Override - public Adapter caseXmlMultiRelationshipMappingInternal(XmlMultiRelationshipMappingInternal object) { - return createXmlMultiRelationshipMappingInternalAdapter(); - } - - @Override - public Adapter caseXmlMultiRelationshipMappingForXml(XmlMultiRelationshipMappingForXml object) { - return createXmlMultiRelationshipMappingForXmlAdapter(); - } - - @Override - public Adapter caseXmlMultiRelationshipMapping(XmlMultiRelationshipMapping object) { - return createXmlMultiRelationshipMappingAdapter(); - } - - @Override - public Adapter caseXmlOneToMany(XmlOneToMany object) { - return createXmlOneToManyAdapter(); - } - - @Override - public Adapter caseXmlManyToMany(XmlManyToMany object) { - return createXmlManyToManyAdapter(); - } - - @Override - public Adapter caseXmlPersistentAttribute(XmlPersistentAttribute object) { - return createXmlPersistentAttributeAdapter(); - } - - @Override - public Adapter casePersistenceUnitMetadataInternal(PersistenceUnitMetadataInternal object) { - return createPersistenceUnitMetadataInternalAdapter(); - } - - @Override - public Adapter casePersistenceUnitMetadata(PersistenceUnitMetadata object) { - return createPersistenceUnitMetadataAdapter(); - } - - @Override - public Adapter casePersistenceUnitMetadataForXml(PersistenceUnitMetadataForXml object) { - return createPersistenceUnitMetadataForXmlAdapter(); - } - - @Override - public Adapter casePersistenceUnitDefaultsInternal(PersistenceUnitDefaultsInternal object) { - return createPersistenceUnitDefaultsInternalAdapter(); - } - - @Override - public Adapter casePersistenceUnitDefaults(PersistenceUnitDefaults object) { - return createPersistenceUnitDefaultsAdapter(); - } - - @Override - public Adapter casePersistenceUnitDefaultsForXml(PersistenceUnitDefaultsForXml object) { - return createPersistenceUnitDefaultsForXmlAdapter(); - } - - @Override - public Adapter caseXmlTable(XmlTable object) { - return createXmlTableAdapter(); - } - - @Override - public Adapter caseAbstractXmlNamedColumn(AbstractXmlNamedColumn object) { - return createAbstractXmlNamedColumnAdapter(); - } - - @Override - public Adapter caseAbstractXmlColumn(AbstractXmlColumn object) { - return createAbstractXmlColumnAdapter(); - } - - @Override - public Adapter caseXmlColumn(XmlColumn object) { - return createXmlColumnAdapter(); - } - - @Override - public Adapter caseXmlJoinColumn(XmlJoinColumn object) { - return createXmlJoinColumnAdapter(); - } - - @Override - public Adapter caseIXmlColumnMapping(IXmlColumnMapping object) { - return createIXmlColumnMappingAdapter(); - } - - @Override - public Adapter caseXmlManyToOne(XmlManyToOne object) { - return createXmlManyToOneAdapter(); - } - - @Override - public Adapter caseXmlOneToOne(XmlOneToOne object) { - return createXmlOneToOneAdapter(); - } - - @Override - public Adapter caseXmlSingleRelationshipMapping(XmlSingleRelationshipMapping object) { - return createXmlSingleRelationshipMappingAdapter(); - } - - @Override - public Adapter caseXmlRelationshipMapping(XmlRelationshipMapping object) { - return createXmlRelationshipMappingAdapter(); - } - - @Override - public Adapter caseXmlJoinTable(XmlJoinTable object) { - return createXmlJoinTableAdapter(); - } - - @Override - public Adapter caseAbstractXmlTable(AbstractXmlTable object) { - return createAbstractXmlTableAdapter(); - } - - @Override - public Adapter caseXmlOverride(XmlOverride object) { - return createXmlOverrideAdapter(); - } - - @Override - public Adapter caseXmlAttributeOverride(XmlAttributeOverride object) { - return createXmlAttributeOverrideAdapter(); - } - - @Override - public Adapter caseXmlAssociationOverride(XmlAssociationOverride object) { - return createXmlAssociationOverrideAdapter(); - } - - @Override - public Adapter caseXmlDiscriminatorColumn(XmlDiscriminatorColumn object) { - return createXmlDiscriminatorColumnAdapter(); - } - - @Override - public Adapter caseXmlSecondaryTable(XmlSecondaryTable object) { - return createXmlSecondaryTableAdapter(); - } - - @Override - public Adapter caseXmlPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn object) { - return createXmlPrimaryKeyJoinColumnAdapter(); - } - - @Override - public Adapter caseXmlGeneratedValue(XmlGeneratedValue object) { - return createXmlGeneratedValueAdapter(); - } - - @Override - public Adapter caseXmlGenerator(XmlGenerator object) { - return createXmlGeneratorAdapter(); - } - - @Override - public Adapter caseXmlSequenceGenerator(XmlSequenceGenerator object) { - return createXmlSequenceGeneratorAdapter(); - } - - @Override - public Adapter caseXmlTableGenerator(XmlTableGenerator object) { - return createXmlTableGeneratorAdapter(); - } - - @Override - public Adapter caseAbstractXmlQuery(AbstractXmlQuery object) { - return createAbstractXmlQueryAdapter(); - } - - @Override - public Adapter caseXmlNamedQuery(XmlNamedQuery object) { - return createXmlNamedQueryAdapter(); - } - - @Override - public Adapter caseXmlNamedNativeQuery(XmlNamedNativeQuery object) { - return createXmlNamedNativeQueryAdapter(); - } - - @Override - public Adapter caseXmlQueryHint(XmlQueryHint object) { - return createXmlQueryHintAdapter(); - } - - @Override - public Adapter caseXmlUniqueConstraint(XmlUniqueConstraint object) { - return createXmlUniqueConstraintAdapter(); - } - - @Override - public Adapter caseXmlCascade(XmlCascade object) { - return createXmlCascadeAdapter(); - } - - @Override - public Adapter caseXmlIdClass(XmlIdClass object) { - return createXmlIdClassAdapter(); - } - - @Override - public Adapter caseXmlInheritance(XmlInheritance object) { - return createXmlInheritanceAdapter(); - } - - @Override - public Adapter caseXmlMapKey(XmlMapKey object) { - return createXmlMapKeyAdapter(); - } - - @Override - public Adapter caseIJpaEObject(IJpaEObject object) { - return createIJpaEObjectAdapter(); - } - - @Override - public Adapter caseJpaEObject(JpaEObject object) { - return createJpaEObjectAdapter(); - } - - @Override - public Adapter caseIJpaSourceObject(IJpaSourceObject object) { - return createIJpaSourceObjectAdapter(); - } - - @Override - public Adapter caseIXmlEObject(IXmlEObject object) { - return createIXmlEObjectAdapter(); - } - - @Override - public Adapter caseXmlEObject(XmlEObject object) { - return createXmlEObjectAdapter(); - } - - @Override - public Adapter caseIJpaContentNode(IJpaContentNode object) { - return createIJpaContentNodeAdapter(); - } - - @Override - public Adapter caseIJpaRootContentNode(IJpaRootContentNode object) { - return createIJpaRootContentNodeAdapter(); - } - - @Override - public Adapter caseITypeMapping(ITypeMapping object) { - return createITypeMappingAdapter(); - } - - @Override - public Adapter caseIPersistentType(IPersistentType object) { - return createIPersistentTypeAdapter(); - } - - @Override - public Adapter caseIMappedSuperclass(IMappedSuperclass object) { - return createIMappedSuperclassAdapter(); - } - - @Override - public Adapter caseIEntity(IEntity object) { - return createIEntityAdapter(); - } - - @Override - public Adapter caseIEmbeddable(IEmbeddable object) { - return createIEmbeddableAdapter(); - } - - @Override - public Adapter caseIAttributeMapping(IAttributeMapping object) { - return createIAttributeMappingAdapter(); - } - - @Override - public Adapter caseIColumnMapping(IColumnMapping object) { - return createIColumnMappingAdapter(); - } - - @Override - public Adapter caseIBasic(IBasic object) { - return createIBasicAdapter(); - } - - @Override - public Adapter caseIId(IId object) { - return createIIdAdapter(); - } - - @Override - public Adapter caseITransient(ITransient object) { - return createITransientAdapter(); - } - - @Override - public Adapter caseIEmbedded(IEmbedded object) { - return createIEmbeddedAdapter(); - } - - @Override - public Adapter caseIEmbeddedId(IEmbeddedId object) { - return createIEmbeddedIdAdapter(); - } - - @Override - public Adapter caseIVersion(IVersion object) { - return createIVersionAdapter(); - } - - @Override - public Adapter caseIRelationshipMapping(IRelationshipMapping object) { - return createIRelationshipMappingAdapter(); - } - - @Override - public Adapter caseINonOwningMapping(INonOwningMapping object) { - return createINonOwningMappingAdapter(); - } - - @Override - public Adapter caseIMultiRelationshipMapping(IMultiRelationshipMapping object) { - return createIMultiRelationshipMappingAdapter(); - } - - @Override - public Adapter caseIOneToMany(IOneToMany object) { - return createIOneToManyAdapter(); - } - - @Override - public Adapter caseIManyToMany(IManyToMany object) { - return createIManyToManyAdapter(); - } - - @Override - public Adapter caseIPersistentAttribute(IPersistentAttribute object) { - return createIPersistentAttributeAdapter(); - } - - @Override - public Adapter caseITable(ITable object) { - return createITableAdapter(); - } - - @Override - public Adapter caseINamedColumn(INamedColumn object) { - return createINamedColumnAdapter(); - } - - @Override - public Adapter caseIAbstractColumn(IAbstractColumn object) { - return createIAbstractColumnAdapter(); - } - - @Override - public Adapter caseIColumn(IColumn object) { - return createIColumnAdapter(); - } - - @Override - public Adapter caseIAbstractJoinColumn(IAbstractJoinColumn object) { - return createIAbstractJoinColumnAdapter(); - } - - @Override - public Adapter caseIJoinColumn(IJoinColumn object) { - return createIJoinColumnAdapter(); - } - - @Override - public Adapter caseISingleRelationshipMapping(ISingleRelationshipMapping object) { - return createISingleRelationshipMappingAdapter(); - } - - @Override - public Adapter caseIManyToOne(IManyToOne object) { - return createIManyToOneAdapter(); - } - - @Override - public Adapter caseIOneToOne(IOneToOne object) { - return createIOneToOneAdapter(); - } - - @Override - public Adapter caseIJoinTable(IJoinTable object) { - return createIJoinTableAdapter(); - } - - @Override - public Adapter caseIOverride(IOverride object) { - return createIOverrideAdapter(); - } - - @Override - public Adapter caseIAttributeOverride(IAttributeOverride object) { - return createIAttributeOverrideAdapter(); - } - - @Override - public Adapter caseIAssociationOverride(IAssociationOverride object) { - return createIAssociationOverrideAdapter(); - } - - @Override - public Adapter caseIDiscriminatorColumn(IDiscriminatorColumn object) { - return createIDiscriminatorColumnAdapter(); - } - - @Override - public Adapter caseISecondaryTable(ISecondaryTable object) { - return createISecondaryTableAdapter(); - } - - @Override - public Adapter caseIPrimaryKeyJoinColumn(IPrimaryKeyJoinColumn object) { - return createIPrimaryKeyJoinColumnAdapter(); - } - - @Override - public Adapter caseIGeneratedValue(IGeneratedValue object) { - return createIGeneratedValueAdapter(); - } - - @Override - public Adapter caseIGenerator(IGenerator object) { - return createIGeneratorAdapter(); - } - - @Override - public Adapter caseISequenceGenerator(ISequenceGenerator object) { - return createISequenceGeneratorAdapter(); - } - - @Override - public Adapter caseITableGenerator(ITableGenerator object) { - return createITableGeneratorAdapter(); - } - - @Override - public Adapter caseIQuery(IQuery object) { - return createIQueryAdapter(); - } - - @Override - public Adapter caseINamedQuery(INamedQuery object) { - return createINamedQueryAdapter(); - } - - @Override - public Adapter caseINamedNativeQuery(INamedNativeQuery object) { - return createINamedNativeQueryAdapter(); - } - - @Override - public Adapter caseIQueryHint(IQueryHint object) { - return createIQueryHintAdapter(); - } - - @Override - public Adapter caseIUniqueConstraint(IUniqueConstraint object) { - return createIUniqueConstraintAdapter(); - } - - @Override - public Adapter caseICascade(ICascade object) { - return createICascadeAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.XmlEObject Xml EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.XmlEObject - * @generated - */ - public Adapter createXmlEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode Xml Root Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode - * @generated - */ - public Adapter createXmlRootContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal Entity Mappings Internal}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal - * @generated - */ - public Adapter createEntityMappingsInternalAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings Entity Mappings}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappings - * @generated - */ - public Adapter createEntityMappingsAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml Entity Mappings For Xml}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml - * @generated - */ - public Adapter createEntityMappingsForXmlAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping Xml Type Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping - * @generated - */ - public Adapter createXmlTypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType Xml Persistent Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType - * @generated - */ - public Adapter createXmlPersistentTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity Xml Entity}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity - * @generated - */ - public Adapter createXmlEntityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable Xml Embeddable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable - * @generated - */ - public Adapter createXmlEmbeddableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping Xml Attribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping - * @generated - */ - public Adapter createXmlAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping Xml Null Attribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping - * @generated - */ - public Adapter createXmlNullAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute Xml Persistent Attribute}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute - * @generated - */ - public Adapter createXmlPersistentAttributeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic Xml Basic}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlBasic - * @generated - */ - public Adapter createXmlBasicAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlId Xml Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlId - * @generated - */ - public Adapter createXmlIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTransient Xml Transient}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTransient - * @generated - */ - public Adapter createXmlTransientAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbedded Xml Embedded}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbedded - * @generated - */ - public Adapter createXmlEmbeddedAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId Xml Embedded Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId - * @generated - */ - public Adapter createXmlEmbeddedIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlVersion Xml Version}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlVersion - * @generated - */ - public Adapter createXmlVersionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal Xml Multi Relationship Mapping Internal}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal - * @generated - */ - public Adapter createXmlMultiRelationshipMappingInternalAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml Xml Multi Relationship Mapping For Xml}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml - * @generated - */ - public Adapter createXmlMultiRelationshipMappingForXmlAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping Xml Multi Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping - * @generated - */ - public Adapter createXmlMultiRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToMany Xml One To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToMany - * @generated - */ - public Adapter createXmlOneToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToMany Xml Many To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToMany - * @generated - */ - public Adapter createXmlManyToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal Persistence Unit Metadata Internal}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal - * @generated - */ - public Adapter createPersistenceUnitMetadataInternalAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata Persistence Unit Metadata}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata - * @generated - */ - public Adapter createPersistenceUnitMetadataAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml Persistence Unit Metadata For Xml}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml - * @generated - */ - public Adapter createPersistenceUnitMetadataForXmlAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal Persistence Unit Defaults Internal}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal - * @generated - */ - public Adapter createPersistenceUnitDefaultsInternalAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults Persistence Unit Defaults}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults - * @generated - */ - public Adapter createPersistenceUnitDefaultsAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml Persistence Unit Defaults For Xml}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml - * @generated - */ - public Adapter createPersistenceUnitDefaultsForXmlAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTable Xml Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTable - * @generated - */ - public Adapter createXmlTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn Abstract Xml Named Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn - * @generated - */ - public Adapter createAbstractXmlNamedColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn Abstract Xml Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn - * @generated - */ - public Adapter createAbstractXmlColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn Xml Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlColumn - * @generated - */ - public Adapter createXmlColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn Xml Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn - * @generated - */ - public Adapter createXmlJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping IXml Column Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping - * @generated - */ - public Adapter createIXmlColumnMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToOne Xml Many To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToOne - * @generated - */ - public Adapter createXmlManyToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToOne Xml One To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToOne - * @generated - */ - public Adapter createXmlOneToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping Xml Single Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping - * @generated - */ - public Adapter createXmlSingleRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping Xml Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping - * @generated - */ - public Adapter createXmlRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinTable Xml Join Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlJoinTable - * @generated - */ - public Adapter createXmlJoinTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable Abstract Xml Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable - * @generated - */ - public Adapter createAbstractXmlTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOverride Xml Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOverride - * @generated - */ - public Adapter createXmlOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride Xml Attribute Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride - * @generated - */ - public Adapter createXmlAttributeOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride Xml Association Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride - * @generated - */ - public Adapter createXmlAssociationOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn Xml Discriminator Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn - * @generated - */ - public Adapter createXmlDiscriminatorColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable Xml Secondary Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable - * @generated - */ - public Adapter createXmlSecondaryTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn Xml Primary Key Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn - * @generated - */ - public Adapter createXmlPrimaryKeyJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue Xml Generated Value}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue - * @generated - */ - public Adapter createXmlGeneratedValueAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlGenerator Xml Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlGenerator - * @generated - */ - public Adapter createXmlGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator Xml Sequence Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator - * @generated - */ - public Adapter createXmlSequenceGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator Xml Table Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator - * @generated - */ - public Adapter createXmlTableGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery Abstract Xml Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery - * @generated - */ - public Adapter createAbstractXmlQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery Xml Named Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery - * @generated - */ - public Adapter createXmlNamedQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery Xml Named Native Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery - * @generated - */ - public Adapter createXmlNamedNativeQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlQueryHint Xml Query Hint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlQueryHint - * @generated - */ - public Adapter createXmlQueryHintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint Xml Unique Constraint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint - * @generated - */ - public Adapter createXmlUniqueConstraintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade Xml Cascade}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade - * @generated - */ - public Adapter createXmlCascadeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlIdClass Xml Id Class}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlIdClass - * @generated - */ - public Adapter createXmlIdClassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlInheritance Xml Inheritance}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlInheritance - * @generated - */ - public Adapter createXmlInheritanceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMapKey Xml Map Key}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMapKey - * @generated - */ - public Adapter createXmlMapKeyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public Adapter createIJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaEObject - * @generated - */ - public Adapter createJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public Adapter createIJpaSourceObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IXmlEObject IXml EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IXmlEObject - * @generated - */ - public Adapter createIXmlEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @generated - */ - public Adapter createIJpaContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @generated - */ - public Adapter createIJpaRootContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass Xml Mapped Superclass}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass - * @generated - */ - public Adapter createXmlMappedSuperclassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal Xml Entity Internal}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal - * @generated - */ - public Adapter createXmlEntityInternalAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml Xml Entity For Xml}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml - * @generated - */ - public Adapter createXmlEntityForXmlAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @generated - */ - public Adapter createIAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping IColumn Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IColumnMapping - * @generated - */ - public Adapter createIColumnMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IPersistentAttribute IPersistent Attribute}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IPersistentAttribute - * @generated - */ - public Adapter createIPersistentAttributeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITable ITable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITable - * @generated - */ - public Adapter createITableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn INamed Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn - * @generated - */ - public Adapter createINamedColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn IAbstract Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn - * @generated - */ - public Adapter createIAbstractColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IColumn IColumn}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IColumn - * @generated - */ - public Adapter createIColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn IAbstract Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn - * @generated - */ - public Adapter createIAbstractJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IJoinColumn IJoin Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IJoinColumn - * @generated - */ - public Adapter createIJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping ISingle Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping - * @generated - */ - public Adapter createISingleRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IManyToOne IMany To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IManyToOne - * @generated - */ - public Adapter createIManyToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOneToOne IOne To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOneToOne - * @generated - */ - public Adapter createIOneToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable IJoin Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable - * @generated - */ - public Adapter createIJoinTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOverride IOverride}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOverride - * @generated - */ - public Adapter createIOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride IAttribute Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride - * @generated - */ - public Adapter createIAttributeOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride IAssociation Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride - * @generated - */ - public Adapter createIAssociationOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn IDiscriminator Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn - * @generated - */ - public Adapter createIDiscriminatorColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable ISecondary Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable - * @generated - */ - public Adapter createISecondaryTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn IPrimary Key Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn - * @generated - */ - public Adapter createIPrimaryKeyJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue IGenerated Value}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue - * @generated - */ - public Adapter createIGeneratedValueAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IGenerator IGenerator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator - * @generated - */ - public Adapter createIGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator ISequence Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator - * @generated - */ - public Adapter createISequenceGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator ITable Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator - * @generated - */ - public Adapter createITableGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQuery IQuery}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IQuery - * @generated - */ - public Adapter createIQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedQuery INamed Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedQuery - * @generated - */ - public Adapter createINamedQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery INamed Native Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery - * @generated - */ - public Adapter createINamedNativeQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint IQuery Hint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint - * @generated - */ - public Adapter createIQueryHintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint IUnique Constraint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint - * @generated - */ - public Adapter createIUniqueConstraintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ICascade ICascade}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ICascade - * @generated - */ - public Adapter createICascadeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IBasic IBasic}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IBasic - * @generated - */ - public Adapter createIBasicAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IId IId}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IId - * @generated - */ - public Adapter createIIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITransient ITransient}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITransient - * @generated - */ - public Adapter createITransientAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded IEmbedded}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded - * @generated - */ - public Adapter createIEmbeddedAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddedId IEmbedded Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddedId - * @generated - */ - public Adapter createIEmbeddedIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IVersion IVersion}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IVersion - * @generated - */ - public Adapter createIVersionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping IRelationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping - * @generated - */ - public Adapter createIRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping INon Owning Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping - * @generated - */ - public Adapter createINonOwningMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping IMulti Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping - * @generated - */ - public Adapter createIMultiRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOneToMany IOne To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOneToMany - * @generated - */ - public Adapter createIOneToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IManyToMany IMany To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IManyToMany - * @generated - */ - public Adapter createIManyToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IPersistentType IPersistent Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IPersistentType - * @generated - */ - public Adapter createIPersistentTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass IMapped Superclass}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass - * @generated - */ - public Adapter createIMappedSuperclassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEntity IEntity}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEntity - * @generated - */ - public Adapter createIEntityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddable IEmbeddable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddable - * @generated - */ - public Adapter createIEmbeddableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @generated - */ - public Adapter createITypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } -} //JpaCoreXmlAdapterFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java deleted file mode 100644 index 54e5ce9cda..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java +++ /dev/null @@ -1,3244 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.orm.util; - -import java.util.List; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.IXmlEObject; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlColumn; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlNamedColumn; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery; -import org.eclipse.jpt.core.internal.content.orm.AbstractXmlTable; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.IXmlColumnMapping; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlBasic; -import org.eclipse.jpt.core.internal.content.orm.XmlCascade; -import org.eclipse.jpt.core.internal.content.orm.XmlColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbedded; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId; -import org.eclipse.jpt.core.internal.content.orm.XmlEntity; -import org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml; -import org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlGeneratedValue; -import org.eclipse.jpt.core.internal.content.orm.XmlGenerator; -import org.eclipse.jpt.core.internal.content.orm.XmlId; -import org.eclipse.jpt.core.internal.content.orm.XmlIdClass; -import org.eclipse.jpt.core.internal.content.orm.XmlInheritance; -import org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlJoinTable; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToMany; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlMapKey; -import org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlNamedNativeQuery; -import org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery; -import org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.content.orm.XmlQueryHint; -import org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode; -import org.eclipse.jpt.core.internal.content.orm.XmlSecondaryTable; -import org.eclipse.jpt.core.internal.content.orm.XmlSequenceGenerator; -import org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlTable; -import org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator; -import org.eclipse.jpt.core.internal.content.orm.XmlTransient; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint; -import org.eclipse.jpt.core.internal.content.orm.XmlVersion; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.IVersion; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage - * @generated - */ -public class OrmSwitch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static OrmPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public OrmSwitch() { - if (modelPackage == null) { - modelPackage = OrmPackage.eINSTANCE; - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List eSuperTypes = theEClass.getESuperTypes(); - return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case OrmPackage.XML_ROOT_CONTENT_NODE : { - XmlRootContentNode xmlRootContentNode = (XmlRootContentNode) theEObject; - T result = caseXmlRootContentNode(xmlRootContentNode); - if (result == null) - result = caseXmlEObject(xmlRootContentNode); - if (result == null) - result = caseIJpaRootContentNode(xmlRootContentNode); - if (result == null) - result = caseJpaEObject(xmlRootContentNode); - if (result == null) - result = caseIXmlEObject(xmlRootContentNode); - if (result == null) - result = caseIJpaContentNode(xmlRootContentNode); - if (result == null) - result = caseIJpaEObject(xmlRootContentNode); - if (result == null) - result = caseIJpaSourceObject(xmlRootContentNode); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ENTITY_MAPPINGS_INTERNAL : { - EntityMappingsInternal entityMappingsInternal = (EntityMappingsInternal) theEObject; - T result = caseEntityMappingsInternal(entityMappingsInternal); - if (result == null) - result = caseXmlEObject(entityMappingsInternal); - if (result == null) - result = caseIJpaContentNode(entityMappingsInternal); - if (result == null) - result = caseEntityMappingsForXml(entityMappingsInternal); - if (result == null) - result = caseEntityMappings(entityMappingsInternal); - if (result == null) - result = caseJpaEObject(entityMappingsInternal); - if (result == null) - result = caseIXmlEObject(entityMappingsInternal); - if (result == null) - result = caseIJpaSourceObject(entityMappingsInternal); - if (result == null) - result = caseIJpaEObject(entityMappingsInternal); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ENTITY_MAPPINGS : { - EntityMappings entityMappings = (EntityMappings) theEObject; - T result = caseEntityMappings(entityMappings); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ENTITY_MAPPINGS_FOR_XML : { - EntityMappingsForXml entityMappingsForXml = (EntityMappingsForXml) theEObject; - T result = caseEntityMappingsForXml(entityMappingsForXml); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_TYPE_MAPPING : { - XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) theEObject; - T result = caseXmlTypeMapping(xmlTypeMapping); - if (result == null) - result = caseXmlEObject(xmlTypeMapping); - if (result == null) - result = caseITypeMapping(xmlTypeMapping); - if (result == null) - result = caseJpaEObject(xmlTypeMapping); - if (result == null) - result = caseIXmlEObject(xmlTypeMapping); - if (result == null) - result = caseIJpaSourceObject(xmlTypeMapping); - if (result == null) - result = caseIJpaEObject(xmlTypeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_PERSISTENT_TYPE : { - XmlPersistentType xmlPersistentType = (XmlPersistentType) theEObject; - T result = caseXmlPersistentType(xmlPersistentType); - if (result == null) - result = caseXmlEObject(xmlPersistentType); - if (result == null) - result = caseIPersistentType(xmlPersistentType); - if (result == null) - result = caseJpaEObject(xmlPersistentType); - if (result == null) - result = caseIXmlEObject(xmlPersistentType); - if (result == null) - result = caseIJpaContentNode(xmlPersistentType); - if (result == null) - result = caseIJpaEObject(xmlPersistentType); - if (result == null) - result = caseIJpaSourceObject(xmlPersistentType); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MAPPED_SUPERCLASS : { - XmlMappedSuperclass xmlMappedSuperclass = (XmlMappedSuperclass) theEObject; - T result = caseXmlMappedSuperclass(xmlMappedSuperclass); - if (result == null) - result = caseXmlTypeMapping(xmlMappedSuperclass); - if (result == null) - result = caseIMappedSuperclass(xmlMappedSuperclass); - if (result == null) - result = caseXmlEObject(xmlMappedSuperclass); - if (result == null) - result = caseITypeMapping(xmlMappedSuperclass); - if (result == null) - result = caseJpaEObject(xmlMappedSuperclass); - if (result == null) - result = caseIXmlEObject(xmlMappedSuperclass); - if (result == null) - result = caseIJpaSourceObject(xmlMappedSuperclass); - if (result == null) - result = caseIJpaEObject(xmlMappedSuperclass); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ENTITY_INTERNAL : { - XmlEntityInternal xmlEntityInternal = (XmlEntityInternal) theEObject; - T result = caseXmlEntityInternal(xmlEntityInternal); - if (result == null) - result = caseXmlTypeMapping(xmlEntityInternal); - if (result == null) - result = caseXmlEntityForXml(xmlEntityInternal); - if (result == null) - result = caseXmlEntity(xmlEntityInternal); - if (result == null) - result = caseXmlEObject(xmlEntityInternal); - if (result == null) - result = caseITypeMapping(xmlEntityInternal); - if (result == null) - result = caseIEntity(xmlEntityInternal); - if (result == null) - result = caseJpaEObject(xmlEntityInternal); - if (result == null) - result = caseIXmlEObject(xmlEntityInternal); - if (result == null) - result = caseIJpaSourceObject(xmlEntityInternal); - if (result == null) - result = caseIJpaEObject(xmlEntityInternal); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ENTITY_FOR_XML : { - XmlEntityForXml xmlEntityForXml = (XmlEntityForXml) theEObject; - T result = caseXmlEntityForXml(xmlEntityForXml); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ENTITY : { - XmlEntity xmlEntity = (XmlEntity) theEObject; - T result = caseXmlEntity(xmlEntity); - if (result == null) - result = caseIEntity(xmlEntity); - if (result == null) - result = caseITypeMapping(xmlEntity); - if (result == null) - result = caseIJpaSourceObject(xmlEntity); - if (result == null) - result = caseIJpaEObject(xmlEntity); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_EMBEDDABLE : { - XmlEmbeddable xmlEmbeddable = (XmlEmbeddable) theEObject; - T result = caseXmlEmbeddable(xmlEmbeddable); - if (result == null) - result = caseXmlTypeMapping(xmlEmbeddable); - if (result == null) - result = caseIEmbeddable(xmlEmbeddable); - if (result == null) - result = caseXmlEObject(xmlEmbeddable); - if (result == null) - result = caseITypeMapping(xmlEmbeddable); - if (result == null) - result = caseJpaEObject(xmlEmbeddable); - if (result == null) - result = caseIXmlEObject(xmlEmbeddable); - if (result == null) - result = caseIJpaSourceObject(xmlEmbeddable); - if (result == null) - result = caseIJpaEObject(xmlEmbeddable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ATTRIBUTE_MAPPING : { - XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) theEObject; - T result = caseXmlAttributeMapping(xmlAttributeMapping); - if (result == null) - result = caseXmlEObject(xmlAttributeMapping); - if (result == null) - result = caseIAttributeMapping(xmlAttributeMapping); - if (result == null) - result = caseJpaEObject(xmlAttributeMapping); - if (result == null) - result = caseIXmlEObject(xmlAttributeMapping); - if (result == null) - result = caseIJpaSourceObject(xmlAttributeMapping); - if (result == null) - result = caseIJpaEObject(xmlAttributeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_NULL_ATTRIBUTE_MAPPING : { - XmlNullAttributeMapping xmlNullAttributeMapping = (XmlNullAttributeMapping) theEObject; - T result = caseXmlNullAttributeMapping(xmlNullAttributeMapping); - if (result == null) - result = caseXmlAttributeMapping(xmlNullAttributeMapping); - if (result == null) - result = caseXmlEObject(xmlNullAttributeMapping); - if (result == null) - result = caseIAttributeMapping(xmlNullAttributeMapping); - if (result == null) - result = caseJpaEObject(xmlNullAttributeMapping); - if (result == null) - result = caseIXmlEObject(xmlNullAttributeMapping); - if (result == null) - result = caseIJpaSourceObject(xmlNullAttributeMapping); - if (result == null) - result = caseIJpaEObject(xmlNullAttributeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_BASIC : { - XmlBasic xmlBasic = (XmlBasic) theEObject; - T result = caseXmlBasic(xmlBasic); - if (result == null) - result = caseXmlAttributeMapping(xmlBasic); - if (result == null) - result = caseIBasic(xmlBasic); - if (result == null) - result = caseIXmlColumnMapping(xmlBasic); - if (result == null) - result = caseXmlEObject(xmlBasic); - if (result == null) - result = caseIAttributeMapping(xmlBasic); - if (result == null) - result = caseIColumnMapping(xmlBasic); - if (result == null) - result = caseJpaEObject(xmlBasic); - if (result == null) - result = caseIXmlEObject(xmlBasic); - if (result == null) - result = caseIJpaSourceObject(xmlBasic); - if (result == null) - result = caseIJpaEObject(xmlBasic); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ID : { - XmlId xmlId = (XmlId) theEObject; - T result = caseXmlId(xmlId); - if (result == null) - result = caseXmlAttributeMapping(xmlId); - if (result == null) - result = caseIId(xmlId); - if (result == null) - result = caseIXmlColumnMapping(xmlId); - if (result == null) - result = caseXmlEObject(xmlId); - if (result == null) - result = caseIAttributeMapping(xmlId); - if (result == null) - result = caseIColumnMapping(xmlId); - if (result == null) - result = caseJpaEObject(xmlId); - if (result == null) - result = caseIXmlEObject(xmlId); - if (result == null) - result = caseIJpaSourceObject(xmlId); - if (result == null) - result = caseIJpaEObject(xmlId); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_TRANSIENT : { - XmlTransient xmlTransient = (XmlTransient) theEObject; - T result = caseXmlTransient(xmlTransient); - if (result == null) - result = caseXmlAttributeMapping(xmlTransient); - if (result == null) - result = caseITransient(xmlTransient); - if (result == null) - result = caseXmlEObject(xmlTransient); - if (result == null) - result = caseIAttributeMapping(xmlTransient); - if (result == null) - result = caseJpaEObject(xmlTransient); - if (result == null) - result = caseIXmlEObject(xmlTransient); - if (result == null) - result = caseIJpaSourceObject(xmlTransient); - if (result == null) - result = caseIJpaEObject(xmlTransient); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_EMBEDDED : { - XmlEmbedded xmlEmbedded = (XmlEmbedded) theEObject; - T result = caseXmlEmbedded(xmlEmbedded); - if (result == null) - result = caseXmlAttributeMapping(xmlEmbedded); - if (result == null) - result = caseIEmbedded(xmlEmbedded); - if (result == null) - result = caseXmlEObject(xmlEmbedded); - if (result == null) - result = caseIAttributeMapping(xmlEmbedded); - if (result == null) - result = caseJpaEObject(xmlEmbedded); - if (result == null) - result = caseIXmlEObject(xmlEmbedded); - if (result == null) - result = caseIJpaSourceObject(xmlEmbedded); - if (result == null) - result = caseIJpaEObject(xmlEmbedded); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_EMBEDDED_ID : { - XmlEmbeddedId xmlEmbeddedId = (XmlEmbeddedId) theEObject; - T result = caseXmlEmbeddedId(xmlEmbeddedId); - if (result == null) - result = caseXmlAttributeMapping(xmlEmbeddedId); - if (result == null) - result = caseIEmbeddedId(xmlEmbeddedId); - if (result == null) - result = caseXmlEObject(xmlEmbeddedId); - if (result == null) - result = caseIAttributeMapping(xmlEmbeddedId); - if (result == null) - result = caseJpaEObject(xmlEmbeddedId); - if (result == null) - result = caseIXmlEObject(xmlEmbeddedId); - if (result == null) - result = caseIJpaSourceObject(xmlEmbeddedId); - if (result == null) - result = caseIJpaEObject(xmlEmbeddedId); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_VERSION : { - XmlVersion xmlVersion = (XmlVersion) theEObject; - T result = caseXmlVersion(xmlVersion); - if (result == null) - result = caseXmlAttributeMapping(xmlVersion); - if (result == null) - result = caseIVersion(xmlVersion); - if (result == null) - result = caseIXmlColumnMapping(xmlVersion); - if (result == null) - result = caseXmlEObject(xmlVersion); - if (result == null) - result = caseIAttributeMapping(xmlVersion); - if (result == null) - result = caseIColumnMapping(xmlVersion); - if (result == null) - result = caseJpaEObject(xmlVersion); - if (result == null) - result = caseIXmlEObject(xmlVersion); - if (result == null) - result = caseIJpaSourceObject(xmlVersion); - if (result == null) - result = caseIJpaEObject(xmlVersion); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL : { - XmlMultiRelationshipMappingInternal xmlMultiRelationshipMappingInternal = (XmlMultiRelationshipMappingInternal) theEObject; - T result = caseXmlMultiRelationshipMappingInternal(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseXmlRelationshipMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseIMultiRelationshipMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseXmlMultiRelationshipMappingForXml(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseXmlMultiRelationshipMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseXmlAttributeMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseIRelationshipMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseINonOwningMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseXmlEObject(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseIAttributeMapping(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseJpaEObject(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseIXmlEObject(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseIJpaSourceObject(xmlMultiRelationshipMappingInternal); - if (result == null) - result = caseIJpaEObject(xmlMultiRelationshipMappingInternal); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML : { - XmlMultiRelationshipMappingForXml xmlMultiRelationshipMappingForXml = (XmlMultiRelationshipMappingForXml) theEObject; - T result = caseXmlMultiRelationshipMappingForXml(xmlMultiRelationshipMappingForXml); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING : { - XmlMultiRelationshipMapping xmlMultiRelationshipMapping = (XmlMultiRelationshipMapping) theEObject; - T result = caseXmlMultiRelationshipMapping(xmlMultiRelationshipMapping); - if (result == null) - result = caseIMultiRelationshipMapping(xmlMultiRelationshipMapping); - if (result == null) - result = caseINonOwningMapping(xmlMultiRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(xmlMultiRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(xmlMultiRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(xmlMultiRelationshipMapping); - if (result == null) - result = caseIJpaEObject(xmlMultiRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ONE_TO_MANY : { - XmlOneToMany xmlOneToMany = (XmlOneToMany) theEObject; - T result = caseXmlOneToMany(xmlOneToMany); - if (result == null) - result = caseXmlMultiRelationshipMappingInternal(xmlOneToMany); - if (result == null) - result = caseIOneToMany(xmlOneToMany); - if (result == null) - result = caseXmlRelationshipMapping(xmlOneToMany); - if (result == null) - result = caseIMultiRelationshipMapping(xmlOneToMany); - if (result == null) - result = caseXmlMultiRelationshipMappingForXml(xmlOneToMany); - if (result == null) - result = caseXmlMultiRelationshipMapping(xmlOneToMany); - if (result == null) - result = caseXmlAttributeMapping(xmlOneToMany); - if (result == null) - result = caseIRelationshipMapping(xmlOneToMany); - if (result == null) - result = caseINonOwningMapping(xmlOneToMany); - if (result == null) - result = caseXmlEObject(xmlOneToMany); - if (result == null) - result = caseIAttributeMapping(xmlOneToMany); - if (result == null) - result = caseJpaEObject(xmlOneToMany); - if (result == null) - result = caseIXmlEObject(xmlOneToMany); - if (result == null) - result = caseIJpaSourceObject(xmlOneToMany); - if (result == null) - result = caseIJpaEObject(xmlOneToMany); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MANY_TO_MANY : { - XmlManyToMany xmlManyToMany = (XmlManyToMany) theEObject; - T result = caseXmlManyToMany(xmlManyToMany); - if (result == null) - result = caseXmlMultiRelationshipMappingInternal(xmlManyToMany); - if (result == null) - result = caseIManyToMany(xmlManyToMany); - if (result == null) - result = caseXmlRelationshipMapping(xmlManyToMany); - if (result == null) - result = caseIMultiRelationshipMapping(xmlManyToMany); - if (result == null) - result = caseXmlMultiRelationshipMappingForXml(xmlManyToMany); - if (result == null) - result = caseXmlMultiRelationshipMapping(xmlManyToMany); - if (result == null) - result = caseXmlAttributeMapping(xmlManyToMany); - if (result == null) - result = caseIRelationshipMapping(xmlManyToMany); - if (result == null) - result = caseINonOwningMapping(xmlManyToMany); - if (result == null) - result = caseXmlEObject(xmlManyToMany); - if (result == null) - result = caseIAttributeMapping(xmlManyToMany); - if (result == null) - result = caseJpaEObject(xmlManyToMany); - if (result == null) - result = caseIXmlEObject(xmlManyToMany); - if (result == null) - result = caseIJpaSourceObject(xmlManyToMany); - if (result == null) - result = caseIJpaEObject(xmlManyToMany); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_PERSISTENT_ATTRIBUTE : { - XmlPersistentAttribute xmlPersistentAttribute = (XmlPersistentAttribute) theEObject; - T result = caseXmlPersistentAttribute(xmlPersistentAttribute); - if (result == null) - result = caseXmlEObject(xmlPersistentAttribute); - if (result == null) - result = caseIPersistentAttribute(xmlPersistentAttribute); - if (result == null) - result = caseJpaEObject(xmlPersistentAttribute); - if (result == null) - result = caseIXmlEObject(xmlPersistentAttribute); - if (result == null) - result = caseIJpaContentNode(xmlPersistentAttribute); - if (result == null) - result = caseIJpaEObject(xmlPersistentAttribute); - if (result == null) - result = caseIJpaSourceObject(xmlPersistentAttribute); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.PERSISTENCE_UNIT_METADATA_INTERNAL : { - PersistenceUnitMetadataInternal persistenceUnitMetadataInternal = (PersistenceUnitMetadataInternal) theEObject; - T result = casePersistenceUnitMetadataInternal(persistenceUnitMetadataInternal); - if (result == null) - result = caseXmlEObject(persistenceUnitMetadataInternal); - if (result == null) - result = casePersistenceUnitMetadataForXml(persistenceUnitMetadataInternal); - if (result == null) - result = casePersistenceUnitMetadata(persistenceUnitMetadataInternal); - if (result == null) - result = caseJpaEObject(persistenceUnitMetadataInternal); - if (result == null) - result = caseIXmlEObject(persistenceUnitMetadataInternal); - if (result == null) - result = caseIJpaEObject(persistenceUnitMetadataInternal); - if (result == null) - result = caseIJpaSourceObject(persistenceUnitMetadataInternal); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.PERSISTENCE_UNIT_METADATA : { - PersistenceUnitMetadata persistenceUnitMetadata = (PersistenceUnitMetadata) theEObject; - T result = casePersistenceUnitMetadata(persistenceUnitMetadata); - if (result == null) - result = caseIXmlEObject(persistenceUnitMetadata); - if (result == null) - result = caseIJpaEObject(persistenceUnitMetadata); - if (result == null) - result = caseIJpaSourceObject(persistenceUnitMetadata); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.PERSISTENCE_UNIT_METADATA_FOR_XML : { - PersistenceUnitMetadataForXml persistenceUnitMetadataForXml = (PersistenceUnitMetadataForXml) theEObject; - T result = casePersistenceUnitMetadataForXml(persistenceUnitMetadataForXml); - if (result == null) - result = caseIXmlEObject(persistenceUnitMetadataForXml); - if (result == null) - result = caseIJpaEObject(persistenceUnitMetadataForXml); - if (result == null) - result = caseIJpaSourceObject(persistenceUnitMetadataForXml); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_INTERNAL : { - PersistenceUnitDefaultsInternal persistenceUnitDefaultsInternal = (PersistenceUnitDefaultsInternal) theEObject; - T result = casePersistenceUnitDefaultsInternal(persistenceUnitDefaultsInternal); - if (result == null) - result = caseXmlEObject(persistenceUnitDefaultsInternal); - if (result == null) - result = casePersistenceUnitDefaults(persistenceUnitDefaultsInternal); - if (result == null) - result = casePersistenceUnitDefaultsForXml(persistenceUnitDefaultsInternal); - if (result == null) - result = caseJpaEObject(persistenceUnitDefaultsInternal); - if (result == null) - result = caseIXmlEObject(persistenceUnitDefaultsInternal); - if (result == null) - result = caseIJpaEObject(persistenceUnitDefaultsInternal); - if (result == null) - result = caseIJpaSourceObject(persistenceUnitDefaultsInternal); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS : { - PersistenceUnitDefaults persistenceUnitDefaults = (PersistenceUnitDefaults) theEObject; - T result = casePersistenceUnitDefaults(persistenceUnitDefaults); - if (result == null) - result = caseIXmlEObject(persistenceUnitDefaults); - if (result == null) - result = caseIJpaEObject(persistenceUnitDefaults); - if (result == null) - result = caseIJpaSourceObject(persistenceUnitDefaults); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.PERSISTENCE_UNIT_DEFAULTS_FOR_XML : { - PersistenceUnitDefaultsForXml persistenceUnitDefaultsForXml = (PersistenceUnitDefaultsForXml) theEObject; - T result = casePersistenceUnitDefaultsForXml(persistenceUnitDefaultsForXml); - if (result == null) - result = caseIXmlEObject(persistenceUnitDefaultsForXml); - if (result == null) - result = caseIJpaEObject(persistenceUnitDefaultsForXml); - if (result == null) - result = caseIJpaSourceObject(persistenceUnitDefaultsForXml); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_TABLE : { - XmlTable xmlTable = (XmlTable) theEObject; - T result = caseXmlTable(xmlTable); - if (result == null) - result = caseAbstractXmlTable(xmlTable); - if (result == null) - result = caseITable(xmlTable); - if (result == null) - result = caseXmlEObject(xmlTable); - if (result == null) - result = caseIJpaSourceObject(xmlTable); - if (result == null) - result = caseJpaEObject(xmlTable); - if (result == null) - result = caseIXmlEObject(xmlTable); - if (result == null) - result = caseIJpaEObject(xmlTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ABSTRACT_XML_NAMED_COLUMN : { - AbstractXmlNamedColumn abstractXmlNamedColumn = (AbstractXmlNamedColumn) theEObject; - T result = caseAbstractXmlNamedColumn(abstractXmlNamedColumn); - if (result == null) - result = caseXmlEObject(abstractXmlNamedColumn); - if (result == null) - result = caseINamedColumn(abstractXmlNamedColumn); - if (result == null) - result = caseJpaEObject(abstractXmlNamedColumn); - if (result == null) - result = caseIXmlEObject(abstractXmlNamedColumn); - if (result == null) - result = caseIJpaSourceObject(abstractXmlNamedColumn); - if (result == null) - result = caseIJpaEObject(abstractXmlNamedColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ABSTRACT_XML_COLUMN : { - AbstractXmlColumn abstractXmlColumn = (AbstractXmlColumn) theEObject; - T result = caseAbstractXmlColumn(abstractXmlColumn); - if (result == null) - result = caseAbstractXmlNamedColumn(abstractXmlColumn); - if (result == null) - result = caseIAbstractColumn(abstractXmlColumn); - if (result == null) - result = caseXmlEObject(abstractXmlColumn); - if (result == null) - result = caseINamedColumn(abstractXmlColumn); - if (result == null) - result = caseJpaEObject(abstractXmlColumn); - if (result == null) - result = caseIXmlEObject(abstractXmlColumn); - if (result == null) - result = caseIJpaSourceObject(abstractXmlColumn); - if (result == null) - result = caseIJpaEObject(abstractXmlColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_COLUMN : { - XmlColumn xmlColumn = (XmlColumn) theEObject; - T result = caseXmlColumn(xmlColumn); - if (result == null) - result = caseAbstractXmlColumn(xmlColumn); - if (result == null) - result = caseIColumn(xmlColumn); - if (result == null) - result = caseAbstractXmlNamedColumn(xmlColumn); - if (result == null) - result = caseIAbstractColumn(xmlColumn); - if (result == null) - result = caseXmlEObject(xmlColumn); - if (result == null) - result = caseINamedColumn(xmlColumn); - if (result == null) - result = caseJpaEObject(xmlColumn); - if (result == null) - result = caseIXmlEObject(xmlColumn); - if (result == null) - result = caseIJpaSourceObject(xmlColumn); - if (result == null) - result = caseIJpaEObject(xmlColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_JOIN_COLUMN : { - XmlJoinColumn xmlJoinColumn = (XmlJoinColumn) theEObject; - T result = caseXmlJoinColumn(xmlJoinColumn); - if (result == null) - result = caseAbstractXmlColumn(xmlJoinColumn); - if (result == null) - result = caseIJoinColumn(xmlJoinColumn); - if (result == null) - result = caseAbstractXmlNamedColumn(xmlJoinColumn); - if (result == null) - result = caseIAbstractColumn(xmlJoinColumn); - if (result == null) - result = caseIAbstractJoinColumn(xmlJoinColumn); - if (result == null) - result = caseXmlEObject(xmlJoinColumn); - if (result == null) - result = caseINamedColumn(xmlJoinColumn); - if (result == null) - result = caseJpaEObject(xmlJoinColumn); - if (result == null) - result = caseIXmlEObject(xmlJoinColumn); - if (result == null) - result = caseIJpaSourceObject(xmlJoinColumn); - if (result == null) - result = caseIJpaEObject(xmlJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.IXML_COLUMN_MAPPING : { - IXmlColumnMapping iXmlColumnMapping = (IXmlColumnMapping) theEObject; - T result = caseIXmlColumnMapping(iXmlColumnMapping); - if (result == null) - result = caseIColumnMapping(iXmlColumnMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MANY_TO_ONE : { - XmlManyToOne xmlManyToOne = (XmlManyToOne) theEObject; - T result = caseXmlManyToOne(xmlManyToOne); - if (result == null) - result = caseXmlSingleRelationshipMapping(xmlManyToOne); - if (result == null) - result = caseIManyToOne(xmlManyToOne); - if (result == null) - result = caseXmlRelationshipMapping(xmlManyToOne); - if (result == null) - result = caseISingleRelationshipMapping(xmlManyToOne); - if (result == null) - result = caseXmlAttributeMapping(xmlManyToOne); - if (result == null) - result = caseIRelationshipMapping(xmlManyToOne); - if (result == null) - result = caseXmlEObject(xmlManyToOne); - if (result == null) - result = caseIAttributeMapping(xmlManyToOne); - if (result == null) - result = caseJpaEObject(xmlManyToOne); - if (result == null) - result = caseIXmlEObject(xmlManyToOne); - if (result == null) - result = caseIJpaSourceObject(xmlManyToOne); - if (result == null) - result = caseIJpaEObject(xmlManyToOne); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ONE_TO_ONE : { - XmlOneToOne xmlOneToOne = (XmlOneToOne) theEObject; - T result = caseXmlOneToOne(xmlOneToOne); - if (result == null) - result = caseXmlSingleRelationshipMapping(xmlOneToOne); - if (result == null) - result = caseIOneToOne(xmlOneToOne); - if (result == null) - result = caseXmlRelationshipMapping(xmlOneToOne); - if (result == null) - result = caseISingleRelationshipMapping(xmlOneToOne); - if (result == null) - result = caseINonOwningMapping(xmlOneToOne); - if (result == null) - result = caseXmlAttributeMapping(xmlOneToOne); - if (result == null) - result = caseIRelationshipMapping(xmlOneToOne); - if (result == null) - result = caseXmlEObject(xmlOneToOne); - if (result == null) - result = caseIAttributeMapping(xmlOneToOne); - if (result == null) - result = caseJpaEObject(xmlOneToOne); - if (result == null) - result = caseIXmlEObject(xmlOneToOne); - if (result == null) - result = caseIJpaSourceObject(xmlOneToOne); - if (result == null) - result = caseIJpaEObject(xmlOneToOne); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING : { - XmlSingleRelationshipMapping xmlSingleRelationshipMapping = (XmlSingleRelationshipMapping) theEObject; - T result = caseXmlSingleRelationshipMapping(xmlSingleRelationshipMapping); - if (result == null) - result = caseXmlRelationshipMapping(xmlSingleRelationshipMapping); - if (result == null) - result = caseISingleRelationshipMapping(xmlSingleRelationshipMapping); - if (result == null) - result = caseXmlAttributeMapping(xmlSingleRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(xmlSingleRelationshipMapping); - if (result == null) - result = caseXmlEObject(xmlSingleRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(xmlSingleRelationshipMapping); - if (result == null) - result = caseJpaEObject(xmlSingleRelationshipMapping); - if (result == null) - result = caseIXmlEObject(xmlSingleRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(xmlSingleRelationshipMapping); - if (result == null) - result = caseIJpaEObject(xmlSingleRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_RELATIONSHIP_MAPPING : { - XmlRelationshipMapping xmlRelationshipMapping = (XmlRelationshipMapping) theEObject; - T result = caseXmlRelationshipMapping(xmlRelationshipMapping); - if (result == null) - result = caseXmlAttributeMapping(xmlRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(xmlRelationshipMapping); - if (result == null) - result = caseXmlEObject(xmlRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(xmlRelationshipMapping); - if (result == null) - result = caseJpaEObject(xmlRelationshipMapping); - if (result == null) - result = caseIXmlEObject(xmlRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(xmlRelationshipMapping); - if (result == null) - result = caseIJpaEObject(xmlRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_JOIN_TABLE : { - XmlJoinTable xmlJoinTable = (XmlJoinTable) theEObject; - T result = caseXmlJoinTable(xmlJoinTable); - if (result == null) - result = caseAbstractXmlTable(xmlJoinTable); - if (result == null) - result = caseIJoinTable(xmlJoinTable); - if (result == null) - result = caseXmlEObject(xmlJoinTable); - if (result == null) - result = caseITable(xmlJoinTable); - if (result == null) - result = caseJpaEObject(xmlJoinTable); - if (result == null) - result = caseIXmlEObject(xmlJoinTable); - if (result == null) - result = caseIJpaSourceObject(xmlJoinTable); - if (result == null) - result = caseIJpaEObject(xmlJoinTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ABSTRACT_XML_TABLE : { - AbstractXmlTable abstractXmlTable = (AbstractXmlTable) theEObject; - T result = caseAbstractXmlTable(abstractXmlTable); - if (result == null) - result = caseXmlEObject(abstractXmlTable); - if (result == null) - result = caseITable(abstractXmlTable); - if (result == null) - result = caseJpaEObject(abstractXmlTable); - if (result == null) - result = caseIXmlEObject(abstractXmlTable); - if (result == null) - result = caseIJpaSourceObject(abstractXmlTable); - if (result == null) - result = caseIJpaEObject(abstractXmlTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_OVERRIDE : { - XmlOverride xmlOverride = (XmlOverride) theEObject; - T result = caseXmlOverride(xmlOverride); - if (result == null) - result = caseXmlEObject(xmlOverride); - if (result == null) - result = caseIOverride(xmlOverride); - if (result == null) - result = caseJpaEObject(xmlOverride); - if (result == null) - result = caseIXmlEObject(xmlOverride); - if (result == null) - result = caseIJpaSourceObject(xmlOverride); - if (result == null) - result = caseIJpaEObject(xmlOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ATTRIBUTE_OVERRIDE : { - XmlAttributeOverride xmlAttributeOverride = (XmlAttributeOverride) theEObject; - T result = caseXmlAttributeOverride(xmlAttributeOverride); - if (result == null) - result = caseXmlOverride(xmlAttributeOverride); - if (result == null) - result = caseIAttributeOverride(xmlAttributeOverride); - if (result == null) - result = caseIXmlColumnMapping(xmlAttributeOverride); - if (result == null) - result = caseXmlEObject(xmlAttributeOverride); - if (result == null) - result = caseIOverride(xmlAttributeOverride); - if (result == null) - result = caseIColumnMapping(xmlAttributeOverride); - if (result == null) - result = caseJpaEObject(xmlAttributeOverride); - if (result == null) - result = caseIXmlEObject(xmlAttributeOverride); - if (result == null) - result = caseIJpaSourceObject(xmlAttributeOverride); - if (result == null) - result = caseIJpaEObject(xmlAttributeOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ASSOCIATION_OVERRIDE : { - XmlAssociationOverride xmlAssociationOverride = (XmlAssociationOverride) theEObject; - T result = caseXmlAssociationOverride(xmlAssociationOverride); - if (result == null) - result = caseXmlOverride(xmlAssociationOverride); - if (result == null) - result = caseIAssociationOverride(xmlAssociationOverride); - if (result == null) - result = caseXmlEObject(xmlAssociationOverride); - if (result == null) - result = caseIOverride(xmlAssociationOverride); - if (result == null) - result = caseJpaEObject(xmlAssociationOverride); - if (result == null) - result = caseIXmlEObject(xmlAssociationOverride); - if (result == null) - result = caseIJpaSourceObject(xmlAssociationOverride); - if (result == null) - result = caseIJpaEObject(xmlAssociationOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_DISCRIMINATOR_COLUMN : { - XmlDiscriminatorColumn xmlDiscriminatorColumn = (XmlDiscriminatorColumn) theEObject; - T result = caseXmlDiscriminatorColumn(xmlDiscriminatorColumn); - if (result == null) - result = caseAbstractXmlNamedColumn(xmlDiscriminatorColumn); - if (result == null) - result = caseIDiscriminatorColumn(xmlDiscriminatorColumn); - if (result == null) - result = caseXmlEObject(xmlDiscriminatorColumn); - if (result == null) - result = caseINamedColumn(xmlDiscriminatorColumn); - if (result == null) - result = caseJpaEObject(xmlDiscriminatorColumn); - if (result == null) - result = caseIXmlEObject(xmlDiscriminatorColumn); - if (result == null) - result = caseIJpaSourceObject(xmlDiscriminatorColumn); - if (result == null) - result = caseIJpaEObject(xmlDiscriminatorColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_SECONDARY_TABLE : { - XmlSecondaryTable xmlSecondaryTable = (XmlSecondaryTable) theEObject; - T result = caseXmlSecondaryTable(xmlSecondaryTable); - if (result == null) - result = caseAbstractXmlTable(xmlSecondaryTable); - if (result == null) - result = caseISecondaryTable(xmlSecondaryTable); - if (result == null) - result = caseXmlEObject(xmlSecondaryTable); - if (result == null) - result = caseITable(xmlSecondaryTable); - if (result == null) - result = caseJpaEObject(xmlSecondaryTable); - if (result == null) - result = caseIXmlEObject(xmlSecondaryTable); - if (result == null) - result = caseIJpaSourceObject(xmlSecondaryTable); - if (result == null) - result = caseIJpaEObject(xmlSecondaryTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN : { - XmlPrimaryKeyJoinColumn xmlPrimaryKeyJoinColumn = (XmlPrimaryKeyJoinColumn) theEObject; - T result = caseXmlPrimaryKeyJoinColumn(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseAbstractXmlNamedColumn(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseIPrimaryKeyJoinColumn(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseXmlEObject(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseINamedColumn(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseIAbstractJoinColumn(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseJpaEObject(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseIXmlEObject(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseIJpaSourceObject(xmlPrimaryKeyJoinColumn); - if (result == null) - result = caseIJpaEObject(xmlPrimaryKeyJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_GENERATED_VALUE : { - XmlGeneratedValue xmlGeneratedValue = (XmlGeneratedValue) theEObject; - T result = caseXmlGeneratedValue(xmlGeneratedValue); - if (result == null) - result = caseXmlEObject(xmlGeneratedValue); - if (result == null) - result = caseIGeneratedValue(xmlGeneratedValue); - if (result == null) - result = caseJpaEObject(xmlGeneratedValue); - if (result == null) - result = caseIXmlEObject(xmlGeneratedValue); - if (result == null) - result = caseIJpaSourceObject(xmlGeneratedValue); - if (result == null) - result = caseIJpaEObject(xmlGeneratedValue); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_GENERATOR : { - XmlGenerator xmlGenerator = (XmlGenerator) theEObject; - T result = caseXmlGenerator(xmlGenerator); - if (result == null) - result = caseXmlEObject(xmlGenerator); - if (result == null) - result = caseIGenerator(xmlGenerator); - if (result == null) - result = caseJpaEObject(xmlGenerator); - if (result == null) - result = caseIXmlEObject(xmlGenerator); - if (result == null) - result = caseIJpaSourceObject(xmlGenerator); - if (result == null) - result = caseIJpaEObject(xmlGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_SEQUENCE_GENERATOR : { - XmlSequenceGenerator xmlSequenceGenerator = (XmlSequenceGenerator) theEObject; - T result = caseXmlSequenceGenerator(xmlSequenceGenerator); - if (result == null) - result = caseXmlGenerator(xmlSequenceGenerator); - if (result == null) - result = caseISequenceGenerator(xmlSequenceGenerator); - if (result == null) - result = caseXmlEObject(xmlSequenceGenerator); - if (result == null) - result = caseIGenerator(xmlSequenceGenerator); - if (result == null) - result = caseJpaEObject(xmlSequenceGenerator); - if (result == null) - result = caseIXmlEObject(xmlSequenceGenerator); - if (result == null) - result = caseIJpaSourceObject(xmlSequenceGenerator); - if (result == null) - result = caseIJpaEObject(xmlSequenceGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_TABLE_GENERATOR : { - XmlTableGenerator xmlTableGenerator = (XmlTableGenerator) theEObject; - T result = caseXmlTableGenerator(xmlTableGenerator); - if (result == null) - result = caseXmlGenerator(xmlTableGenerator); - if (result == null) - result = caseITableGenerator(xmlTableGenerator); - if (result == null) - result = caseXmlEObject(xmlTableGenerator); - if (result == null) - result = caseIGenerator(xmlTableGenerator); - if (result == null) - result = caseJpaEObject(xmlTableGenerator); - if (result == null) - result = caseIXmlEObject(xmlTableGenerator); - if (result == null) - result = caseIJpaSourceObject(xmlTableGenerator); - if (result == null) - result = caseIJpaEObject(xmlTableGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.ABSTRACT_XML_QUERY : { - AbstractXmlQuery abstractXmlQuery = (AbstractXmlQuery) theEObject; - T result = caseAbstractXmlQuery(abstractXmlQuery); - if (result == null) - result = caseXmlEObject(abstractXmlQuery); - if (result == null) - result = caseIQuery(abstractXmlQuery); - if (result == null) - result = caseJpaEObject(abstractXmlQuery); - if (result == null) - result = caseIXmlEObject(abstractXmlQuery); - if (result == null) - result = caseIJpaSourceObject(abstractXmlQuery); - if (result == null) - result = caseIJpaEObject(abstractXmlQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_NAMED_QUERY : { - XmlNamedQuery xmlNamedQuery = (XmlNamedQuery) theEObject; - T result = caseXmlNamedQuery(xmlNamedQuery); - if (result == null) - result = caseAbstractXmlQuery(xmlNamedQuery); - if (result == null) - result = caseINamedQuery(xmlNamedQuery); - if (result == null) - result = caseXmlEObject(xmlNamedQuery); - if (result == null) - result = caseIQuery(xmlNamedQuery); - if (result == null) - result = caseIJpaSourceObject(xmlNamedQuery); - if (result == null) - result = caseJpaEObject(xmlNamedQuery); - if (result == null) - result = caseIXmlEObject(xmlNamedQuery); - if (result == null) - result = caseIJpaEObject(xmlNamedQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_NAMED_NATIVE_QUERY : { - XmlNamedNativeQuery xmlNamedNativeQuery = (XmlNamedNativeQuery) theEObject; - T result = caseXmlNamedNativeQuery(xmlNamedNativeQuery); - if (result == null) - result = caseAbstractXmlQuery(xmlNamedNativeQuery); - if (result == null) - result = caseINamedNativeQuery(xmlNamedNativeQuery); - if (result == null) - result = caseXmlEObject(xmlNamedNativeQuery); - if (result == null) - result = caseIQuery(xmlNamedNativeQuery); - if (result == null) - result = caseIJpaSourceObject(xmlNamedNativeQuery); - if (result == null) - result = caseJpaEObject(xmlNamedNativeQuery); - if (result == null) - result = caseIXmlEObject(xmlNamedNativeQuery); - if (result == null) - result = caseIJpaEObject(xmlNamedNativeQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_QUERY_HINT : { - XmlQueryHint xmlQueryHint = (XmlQueryHint) theEObject; - T result = caseXmlQueryHint(xmlQueryHint); - if (result == null) - result = caseXmlEObject(xmlQueryHint); - if (result == null) - result = caseIQueryHint(xmlQueryHint); - if (result == null) - result = caseJpaEObject(xmlQueryHint); - if (result == null) - result = caseIXmlEObject(xmlQueryHint); - if (result == null) - result = caseIJpaSourceObject(xmlQueryHint); - if (result == null) - result = caseIJpaEObject(xmlQueryHint); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_UNIQUE_CONSTRAINT : { - XmlUniqueConstraint xmlUniqueConstraint = (XmlUniqueConstraint) theEObject; - T result = caseXmlUniqueConstraint(xmlUniqueConstraint); - if (result == null) - result = caseXmlEObject(xmlUniqueConstraint); - if (result == null) - result = caseIUniqueConstraint(xmlUniqueConstraint); - if (result == null) - result = caseJpaEObject(xmlUniqueConstraint); - if (result == null) - result = caseIXmlEObject(xmlUniqueConstraint); - if (result == null) - result = caseIJpaSourceObject(xmlUniqueConstraint); - if (result == null) - result = caseIJpaEObject(xmlUniqueConstraint); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_CASCADE : { - XmlCascade xmlCascade = (XmlCascade) theEObject; - T result = caseXmlCascade(xmlCascade); - if (result == null) - result = caseXmlEObject(xmlCascade); - if (result == null) - result = caseICascade(xmlCascade); - if (result == null) - result = caseJpaEObject(xmlCascade); - if (result == null) - result = caseIXmlEObject(xmlCascade); - if (result == null) - result = caseIJpaSourceObject(xmlCascade); - if (result == null) - result = caseIJpaEObject(xmlCascade); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_ID_CLASS : { - XmlIdClass xmlIdClass = (XmlIdClass) theEObject; - T result = caseXmlIdClass(xmlIdClass); - if (result == null) - result = caseXmlEObject(xmlIdClass); - if (result == null) - result = caseJpaEObject(xmlIdClass); - if (result == null) - result = caseIXmlEObject(xmlIdClass); - if (result == null) - result = caseIJpaEObject(xmlIdClass); - if (result == null) - result = caseIJpaSourceObject(xmlIdClass); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_INHERITANCE : { - XmlInheritance xmlInheritance = (XmlInheritance) theEObject; - T result = caseXmlInheritance(xmlInheritance); - if (result == null) - result = caseXmlEObject(xmlInheritance); - if (result == null) - result = caseJpaEObject(xmlInheritance); - if (result == null) - result = caseIXmlEObject(xmlInheritance); - if (result == null) - result = caseIJpaEObject(xmlInheritance); - if (result == null) - result = caseIJpaSourceObject(xmlInheritance); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case OrmPackage.XML_MAP_KEY : { - XmlMapKey xmlMapKey = (XmlMapKey) theEObject; - T result = caseXmlMapKey(xmlMapKey); - if (result == null) - result = caseXmlEObject(xmlMapKey); - if (result == null) - result = caseJpaEObject(xmlMapKey); - if (result == null) - result = caseIXmlEObject(xmlMapKey); - if (result == null) - result = caseIJpaEObject(xmlMapKey); - if (result == null) - result = caseIJpaSourceObject(xmlMapKey); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEObject(XmlEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Root Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Root Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlRootContentNode(XmlRootContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Entity Mappings Internal'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Entity Mappings Internal'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEntityMappingsInternal(EntityMappingsInternal object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Entity Mappings'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Entity Mappings'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEntityMappings(EntityMappings object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Entity Mappings For Xml'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Entity Mappings For Xml'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEntityMappingsForXml(EntityMappingsForXml object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Type Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Type Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlTypeMapping(XmlTypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Persistent Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Persistent Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlPersistentType(XmlPersistentType object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Embeddable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Embeddable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEmbeddable(XmlEmbeddable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Attribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Attribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlAttributeMapping(XmlAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Null Attribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Null Attribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlNullAttributeMapping(XmlNullAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Persistent Attribute'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Persistent Attribute'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlPersistentAttribute(XmlPersistentAttribute object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Basic'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Basic'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlBasic(XmlBasic object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlId(XmlId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Transient'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Transient'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlTransient(XmlTransient object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Embedded'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Embedded'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEmbedded(XmlEmbedded object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Embedded Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Embedded Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEmbeddedId(XmlEmbeddedId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Version'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Version'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlVersion(XmlVersion object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Multi Relationship Mapping Internal'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Multi Relationship Mapping Internal'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlMultiRelationshipMappingInternal(XmlMultiRelationshipMappingInternal object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Multi Relationship Mapping For Xml'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Multi Relationship Mapping For Xml'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlMultiRelationshipMappingForXml(XmlMultiRelationshipMappingForXml object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Multi Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Multi Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlMultiRelationshipMapping(XmlMultiRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml One To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml One To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlOneToMany(XmlOneToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Many To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Many To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlManyToMany(XmlManyToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence Unit Metadata Internal'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence Unit Metadata Internal'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnitMetadataInternal(PersistenceUnitMetadataInternal object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence Unit Metadata'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence Unit Metadata'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnitMetadata(PersistenceUnitMetadata object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence Unit Metadata For Xml'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence Unit Metadata For Xml'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnitMetadataForXml(PersistenceUnitMetadataForXml object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence Unit Defaults Internal'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence Unit Defaults Internal'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnitDefaultsInternal(PersistenceUnitDefaultsInternal object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence Unit Defaults'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence Unit Defaults'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnitDefaults(PersistenceUnitDefaults object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence Unit Defaults For Xml'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence Unit Defaults For Xml'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnitDefaultsForXml(PersistenceUnitDefaultsForXml object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlTable(XmlTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Abstract Xml Named Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Abstract Xml Named Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAbstractXmlNamedColumn(AbstractXmlNamedColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Abstract Xml Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Abstract Xml Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAbstractXmlColumn(AbstractXmlColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlColumn(XmlColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlJoinColumn(XmlJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IXml Column Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IXml Column Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIXmlColumnMapping(IXmlColumnMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Many To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Many To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlManyToOne(XmlManyToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml One To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml One To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlOneToOne(XmlOneToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Single Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Single Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlSingleRelationshipMapping(XmlSingleRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlRelationshipMapping(XmlRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Join Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Join Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlJoinTable(XmlJoinTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Abstract Xml Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Abstract Xml Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAbstractXmlTable(AbstractXmlTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlOverride(XmlOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Attribute Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Attribute Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlAttributeOverride(XmlAttributeOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Association Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Association Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlAssociationOverride(XmlAssociationOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Discriminator Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Discriminator Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlDiscriminatorColumn(XmlDiscriminatorColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Secondary Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Secondary Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlSecondaryTable(XmlSecondaryTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Primary Key Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Primary Key Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Generated Value'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Generated Value'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlGeneratedValue(XmlGeneratedValue object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlGenerator(XmlGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Sequence Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Sequence Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlSequenceGenerator(XmlSequenceGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Table Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Table Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlTableGenerator(XmlTableGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Abstract Xml Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Abstract Xml Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAbstractXmlQuery(AbstractXmlQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Named Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Named Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlNamedQuery(XmlNamedQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Named Native Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Named Native Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlNamedNativeQuery(XmlNamedNativeQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Query Hint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Query Hint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlQueryHint(XmlQueryHint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Unique Constraint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Unique Constraint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlUniqueConstraint(XmlUniqueConstraint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Cascade'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Cascade'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlCascade(XmlCascade object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Id Class'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Id Class'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlIdClass(XmlIdClass object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Inheritance'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Inheritance'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlInheritance(XmlInheritance object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Map Key'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Map Key'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlMapKey(XmlMapKey object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaEObject(IJpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaEObject(JpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Source Object'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Source Object'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaSourceObject(IJpaSourceObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IXml EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IXml EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIXmlEObject(IXmlEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaContentNode(IJpaContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaRootContentNode(IJpaRootContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Mapped Superclass'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Mapped Superclass'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlMappedSuperclass(XmlMappedSuperclass object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Entity Internal'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Entity Internal'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEntityInternal(XmlEntityInternal object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Entity For Xml'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Entity For Xml'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEntityForXml(XmlEntityForXml object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Entity'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Entity'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEntity(XmlEntity object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeMapping(IAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IColumn Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IColumn Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIColumnMapping(IColumnMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPersistent Attribute'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPersistent Attribute'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPersistentAttribute(IPersistentAttribute object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITable(ITable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedColumn(INamedColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAbstract Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAbstract Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAbstractColumn(IAbstractColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IColumn'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IColumn'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIColumn(IColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAbstract Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAbstract Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAbstractJoinColumn(IAbstractJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJoin Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJoin Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJoinColumn(IJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISingle Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISingle Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISingleRelationshipMapping(ISingleRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMany To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMany To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIManyToOne(IManyToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOne To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOne To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOneToOne(IOneToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJoin Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJoin Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJoinTable(IJoinTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOverride'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOverride'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOverride(IOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeOverride(IAttributeOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAssociation Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAssociation Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAssociationOverride(IAssociationOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IDiscriminator Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IDiscriminator Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIDiscriminatorColumn(IDiscriminatorColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISecondary Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISecondary Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISecondaryTable(ISecondaryTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPrimary Key Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPrimary Key Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPrimaryKeyJoinColumn(IPrimaryKeyJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IGenerated Value'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IGenerated Value'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIGeneratedValue(IGeneratedValue object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IGenerator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IGenerator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIGenerator(IGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISequence Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISequence Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISequenceGenerator(ISequenceGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITable Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITable Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITableGenerator(ITableGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IQuery'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IQuery'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIQuery(IQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedQuery(INamedQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Native Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Native Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedNativeQuery(INamedNativeQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IQuery Hint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IQuery Hint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIQueryHint(IQueryHint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IUnique Constraint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IUnique Constraint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIUniqueConstraint(IUniqueConstraint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ICascade'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ICascade'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseICascade(ICascade object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IBasic'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IBasic'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIBasic(IBasic object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IId'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IId'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIId(IId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITransient'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITransient'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITransient(ITransient object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbedded'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbedded'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbedded(IEmbedded object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbedded Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbedded Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbeddedId(IEmbeddedId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IVersion'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IVersion'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIVersion(IVersion object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IRelationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IRelationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIRelationshipMapping(IRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INon Owning Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INon Owning Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINonOwningMapping(INonOwningMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMulti Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMulti Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIMultiRelationshipMapping(IMultiRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOne To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOne To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOneToMany(IOneToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMany To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMany To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIManyToMany(IManyToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPersistent Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPersistent Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPersistentType(IPersistentType object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMapped Superclass'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMapped Superclass'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIMappedSuperclass(IMappedSuperclass object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEntity'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEntity'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEntity(IEntity object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbeddable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbeddable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbeddable(IEmbeddable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IType Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IType Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITypeMapping(ITypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } -} //JpaCoreXmlSwitch diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java deleted file mode 100644 index c99506262d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Java Class Ref'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef#getJavaClass Java Class}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getJavaClassRef() - * @model kind="class" - * @generated - */ -public class JavaClassRef extends XmlEObject -{ - /** - * The default value of the '{@link #getJavaClass() Java Class}' attribute. - * - * - * @see #getJavaClass() - * @generated - * @ordered - */ - protected static final String JAVA_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getJavaClass() Java Class}' attribute. - * - * - * @see #getJavaClass() - * @generated - * @ordered - */ - protected String javaClass = JAVA_CLASS_EDEFAULT; - - /** - * - * - * @generated - */ - protected JavaClassRef() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.JAVA_CLASS_REF; - } - - /** - * Returns the value of the 'Java Class' attribute. - * - *

    - * If the meaning of the 'Java Class' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Java Class' attribute. - * @see #setJavaClass(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getJavaClassRef_JavaClass() - * @model unique="false" ordered="false" - * @generated - */ - public String getJavaClass() { - return javaClass; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef#getJavaClass Java Class}' attribute. - * - * - * @param value the new value of the 'Java Class' attribute. - * @see #getJavaClass() - * @generated - */ - public void setJavaClass(String newJavaClass) { - String oldJavaClass = javaClass; - javaClass = newJavaClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.JAVA_CLASS_REF__JAVA_CLASS, oldJavaClass, javaClass)); - } - - public IType findJdtType() { - String fqClassName = getJavaClass(); - if (StringTools.stringIsEmpty(fqClassName)) { - return null; - } - int dotIndex = fqClassName.lastIndexOf('.'); - String packageName = (dotIndex >= 0) ? fqClassName.substring(0, dotIndex) : ""; - String className = (dotIndex >= 0) ? fqClassName.substring(dotIndex + 1, fqClassName.length()) : fqClassName; - return JDTTools.findType(packageName, className, getJpaProject().getJavaProject()); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.JAVA_CLASS_REF__JAVA_CLASS : - return getJavaClass(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.JAVA_CLASS_REF__JAVA_CLASS : - setJavaClass((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.JAVA_CLASS_REF__JAVA_CLASS : - setJavaClass(JAVA_CLASS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.JAVA_CLASS_REF__JAVA_CLASS : - return JAVA_CLASS_EDEFAULT == null ? javaClass != null : !JAVA_CLASS_EDEFAULT.equals(javaClass); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (javaClass: "); - result.append(javaClass); - result.append(')'); - return result.toString(); - } - - @Override - public ITextRange validationTextRange() { - IDOMNode textNode = (IDOMNode) DOMUtilities.getChildTextNode(node); - if (textNode != null) { - return buildTextRange(textNode); - } - else { - return buildTextRange(node); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/MappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/MappingFileRef.java deleted file mode 100644 index e6260ae408..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/MappingFileRef.java +++ /dev/null @@ -1,219 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; - -/** - * - * A representation of the model object 'Mapping File Ref'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef#getFileName File Name}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getMappingFileRef() - * @model kind="class" - * @generated - */ -public class MappingFileRef extends XmlEObject -{ - /** - * The default value of the '{@link #getFileName() File Name}' attribute. - * - * - * @see #getFileName() - * @generated - * @ordered - */ - protected static final String FILE_NAME_EDEFAULT = ""; - - /** - * The cached value of the '{@link #getFileName() File Name}' attribute. - * - * - * @see #getFileName() - * @generated - * @ordered - */ - protected String fileName = FILE_NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected MappingFileRef() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.MAPPING_FILE_REF; - } - - /** - * Returns the value of the 'File Name' attribute. - * The default value is "". - * - *

    - * If the meaning of the 'File Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'File Name' attribute. - * @see #setFileName(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getMappingFileRef_FileName() - * @model default="" unique="false" ordered="false" - * @generated - */ - public String getFileName() { - return fileName; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef#getFileName File Name}' attribute. - * - * - * @param value the new value of the 'File Name' attribute. - * @see #getFileName() - * @generated - */ - public void setFileName(String newFileName) { - String oldFileName = fileName; - fileName = newFileName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.MAPPING_FILE_REF__FILE_NAME, oldFileName, fileName)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.MAPPING_FILE_REF__FILE_NAME : - return getFileName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.MAPPING_FILE_REF__FILE_NAME : - setFileName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.MAPPING_FILE_REF__FILE_NAME : - setFileName(FILE_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.MAPPING_FILE_REF__FILE_NAME : - return FILE_NAME_EDEFAULT == null ? fileName != null : !FILE_NAME_EDEFAULT.equals(fileName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fileName: "); - result.append(fileName); - result.append(')'); - return result.toString(); - } - - @Override - public ITextRange validationTextRange() { - IDOMNode textNode = (IDOMNode) DOMUtilities.getChildTextNode(node); - return (textNode == null) ? buildTextRange(node) : buildTextRange(textNode); - } - - public IJpaFile getMappingFile() { - // check flexible project structure - IVirtualComponent component = ComponentCore.createComponent(getJpaProject().getProject()); - IVirtualFolder virtualRootFolder = component.getRootFolder(); - IVirtualFile virtualMappingFile = virtualRootFolder.getFile(new Path(getJpaProject().rootDeployLocation() + '/' + fileName)); - // keep track of whether one has been found so that we may know if multiple exist - IJpaFile mappingFile = null; - for (IFile underlyingFile : virtualMappingFile.getUnderlyingFiles()) { - IJpaFile jpaFile = JptCorePlugin.getJpaFile(underlyingFile); - if (jpaFile != null) { - if (mappingFile != null) { - return null; // multiple do exist - } - else { - mappingFile = jpaFile; - } - } - } - return mappingFile; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Persistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Persistence.java deleted file mode 100644 index 43fdf8ae5f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Persistence.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import java.util.Collection; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * An implementation of the model object 'Persistence'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getPersistenceUnits Persistence Units}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getVersion Version}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getRoot Root}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistence() - * @model kind="class" - * @generated - */ -public class Persistence extends XmlEObject -{ - /** - * The cached value of the '{@link #getPersistenceUnits() Persistence Units}' containment reference list. - * - * - * @see #getPersistenceUnits() - * @generated - * @ordered - */ - protected EList persistenceUnits; - - /** - * The default value of the '{@link #getVersion() Version}' attribute. - * - * - * @see #getVersion() - * @generated - * @ordered - */ - protected static final String VERSION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getVersion() Version}' attribute. - * - * - * @see #getVersion() - * @generated - * @ordered - */ - protected String version = VERSION_EDEFAULT; - - /** - * The cached value of the '{@link #getRoot() Root}' reference. - * - * - * @see #getRoot() - * @generated - * @ordered - */ - protected PersistenceXmlRootContentNode root; - - /** - * - * - * @generated - */ - protected Persistence() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.PERSISTENCE; - } - - /** - * Returns the value of the 'Persistence Units' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit}. - * - * - * @return the value of the 'Persistence Units' containment reference list. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistence_PersistenceUnits() - * @model type="org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit" containment="true" - * @generated - */ - public EList getPersistenceUnits() { - if (persistenceUnits == null) { - persistenceUnits = new EObjectContainmentEList(PersistenceUnit.class, this, PersistencePackage.PERSISTENCE__PERSISTENCE_UNITS); - } - return persistenceUnits; - } - - /** - * Returns the value of the 'Version' attribute. - * - * - * @return the value of the 'Version' attribute. - * @see #setVersion(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistence_Version() - * @model unique="false" dataType="org.eclipse.jpt.core.internal.content.persistence.Version" required="true" - * @generated - */ - public String getVersion() { - return version; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getVersion Version}' attribute. - * - * - * @param value the new value of the 'Version' attribute. - * @see #getVersion() - * @generated - */ - public void setVersion(String newVersion) { - String oldVersion = version; - version = newVersion; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE__VERSION, oldVersion, version)); - } - - /** - * Returns the value of the 'Root' reference. - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode#getPersistence Persistence}'. - * - *

    - * If the meaning of the 'Root' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Root' reference. - * @see #setRoot(PersistenceXmlRootContentNode) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistence_Root() - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode#getPersistence - * @model opposite="persistence" resolveProxies="false" required="true" ordered="false" - * @generated - */ - public PersistenceXmlRootContentNode getRoot() { - return root; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetRoot(PersistenceXmlRootContentNode newRoot, NotificationChain msgs) { - PersistenceXmlRootContentNode oldRoot = root; - root = newRoot; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE__ROOT, oldRoot, newRoot); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getRoot Root}' reference. - * - * - * @param value the new value of the 'Root' reference. - * @see #getRoot() - * @generated - */ - public void setRoot(PersistenceXmlRootContentNode newRoot) { - if (newRoot != root) { - NotificationChain msgs = null; - if (root != null) - msgs = ((InternalEObject) root).eInverseRemove(this, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE, PersistenceXmlRootContentNode.class, msgs); - if (newRoot != null) - msgs = ((InternalEObject) newRoot).eInverseAdd(this, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE, PersistenceXmlRootContentNode.class, msgs); - msgs = basicSetRoot(newRoot, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE__ROOT, newRoot, newRoot)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersistencePackage.PERSISTENCE__ROOT : - if (root != null) - msgs = ((InternalEObject) root).eInverseRemove(this, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE, PersistenceXmlRootContentNode.class, msgs); - return basicSetRoot((PersistenceXmlRootContentNode) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersistencePackage.PERSISTENCE__PERSISTENCE_UNITS : - return ((InternalEList) getPersistenceUnits()).basicRemove(otherEnd, msgs); - case PersistencePackage.PERSISTENCE__ROOT : - return basicSetRoot(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.PERSISTENCE__PERSISTENCE_UNITS : - return getPersistenceUnits(); - case PersistencePackage.PERSISTENCE__VERSION : - return getVersion(); - case PersistencePackage.PERSISTENCE__ROOT : - return getRoot(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.PERSISTENCE__PERSISTENCE_UNITS : - getPersistenceUnits().clear(); - getPersistenceUnits().addAll((Collection) newValue); - return; - case PersistencePackage.PERSISTENCE__VERSION : - setVersion((String) newValue); - return; - case PersistencePackage.PERSISTENCE__ROOT : - setRoot((PersistenceXmlRootContentNode) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.PERSISTENCE__PERSISTENCE_UNITS : - getPersistenceUnits().clear(); - return; - case PersistencePackage.PERSISTENCE__VERSION : - setVersion(VERSION_EDEFAULT); - return; - case PersistencePackage.PERSISTENCE__ROOT : - setRoot((PersistenceXmlRootContentNode) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.PERSISTENCE__PERSISTENCE_UNITS : - return persistenceUnits != null && !persistenceUnits.isEmpty(); - case PersistencePackage.PERSISTENCE__VERSION : - return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); - case PersistencePackage.PERSISTENCE__ROOT : - return root != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (version: "); - result.append(version); - result.append(')'); - return result.toString(); - } - - /** - * Override this because Persistence does not have an eContainer() - * This is because persistence is the "root" feature of the doc for xml Translators - * and thus cannot be "contained" - */ - @Override - public IJpaProject getJpaProject() { - IJpaFile file = getJpaFile(); - return (file == null) ? null : file.getJpaProject(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceFactory.java deleted file mode 100644 index 6fd2712ee8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceFactory.java +++ /dev/null @@ -1,278 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage - * @generated - */ -public class PersistenceFactory extends EFactoryImpl -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final PersistenceFactory eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static PersistenceFactory init() { - try { - PersistenceFactory thePersistenceFactory = (PersistenceFactory) EPackage.Registry.INSTANCE.getEFactory("persistence.xmi"); - if (thePersistenceFactory != null) { - return thePersistenceFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new PersistenceFactory(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public PersistenceFactory() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE : - return createPersistenceXmlRootContentNode(); - case PersistencePackage.PERSISTENCE : - return createPersistence(); - case PersistencePackage.PERSISTENCE_UNIT : - return createPersistenceUnit(); - case PersistencePackage.MAPPING_FILE_REF : - return createMappingFileRef(); - case PersistencePackage.JAVA_CLASS_REF : - return createJavaClassRef(); - case PersistencePackage.PROPERTIES : - return createProperties(); - case PersistencePackage.PROPERTY : - return createProperty(); - default : - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case PersistencePackage.PERSISTENCE_UNIT_TRANSACTION_TYPE : - return createPersistenceUnitTransactionTypeFromString(eDataType, initialValue); - case PersistencePackage.PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT : - return createPersistenceUnitTransactionTypeObjectFromString(eDataType, initialValue); - case PersistencePackage.VERSION : - return createVersionFromString(eDataType, initialValue); - default : - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case PersistencePackage.PERSISTENCE_UNIT_TRANSACTION_TYPE : - return convertPersistenceUnitTransactionTypeToString(eDataType, instanceValue); - case PersistencePackage.PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT : - return convertPersistenceUnitTransactionTypeObjectToString(eDataType, instanceValue); - case PersistencePackage.VERSION : - return convertVersionToString(eDataType, instanceValue); - default : - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public Persistence createPersistence() { - Persistence persistence = new Persistence(); - return persistence; - } - - /** - * - * - * @generated - */ - public PersistenceUnit createPersistenceUnit() { - PersistenceUnit persistenceUnit = new PersistenceUnit(); - return persistenceUnit; - } - - /** - * - * - * @generated - */ - public MappingFileRef createMappingFileRef() { - MappingFileRef mappingFileRef = new MappingFileRef(); - return mappingFileRef; - } - - /** - * - * - * @generated - */ - public JavaClassRef createJavaClassRef() { - JavaClassRef javaClassRef = new JavaClassRef(); - return javaClassRef; - } - - /** - * - * - * @generated - */ - public Properties createProperties() { - Properties properties = new Properties(); - return properties; - } - - /** - * - * - * @generated - */ - public Property createProperty() { - Property property = new Property(); - return property; - } - - /** - * - * - * @generated - */ - public PersistenceXmlRootContentNode createPersistenceXmlRootContentNode() { - PersistenceXmlRootContentNode persistenceXmlRootContentNode = new PersistenceXmlRootContentNode(); - return persistenceXmlRootContentNode; - } - - /** - * - * - * @generated - */ - public PersistenceUnitTransactionType createPersistenceUnitTransactionTypeFromString(EDataType eDataType, String initialValue) { - PersistenceUnitTransactionType result = PersistenceUnitTransactionType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertPersistenceUnitTransactionTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public Enumerator createPersistenceUnitTransactionTypeObjectFromString(EDataType eDataType, String initialValue) { - return (Enumerator) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * @generated - */ - public String convertPersistenceUnitTransactionTypeObjectToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * @generated - */ - public String createVersionFromString(EDataType eDataType, String initialValue) { - return (String) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * @generated - */ - public String convertVersionToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * @generated - */ - public PersistencePackage getPersistencePackage() { - return (PersistencePackage) getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static PersistencePackage getPackage() { - return PersistencePackage.eINSTANCE; - } -} //PersistenceInternalFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceInit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceInit.java deleted file mode 100644 index 462191e630..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceInit.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceXmlResourceFactory; -import org.eclipse.wst.common.componentcore.internal.impl.WTPEntityResolver; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil; - -public class PersistenceInit -{ - private static boolean initialized = false; - - public static void init() { - init(true); - } - - public static void init(boolean shouldPreregisterPackages) { - if (! initialized) { - initialized = true; - DOMUtilities.setDefaultEntityResolver(WTPEntityResolver.INSTANCE); - initResourceFactories(); - } - if (shouldPreregisterPackages) { - preregisterPackages(); - } - } - - private static void initResourceFactories() { - PersistenceXmlResourceFactory.register(); - } - - private static void preregisterPackages() { - ExtendedEcoreUtil.preRegisterPackage( - "packaging.xmi", //$NON-NLS-1$ - new EPackage.Descriptor() { - public EPackage getEPackage() { - return PersistencePackage.eINSTANCE; - } - - public EFactory getEFactory() { - return PersistenceFactory.eINSTANCE; - } - } - ); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistencePackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistencePackage.java deleted file mode 100644 index 92f9870d35..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistencePackage.java +++ /dev/null @@ -1,1378 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
      - *
    • each class,
    • - *
    • each feature of each class,
    • - *
    • each enum,
    • - *
    • and each data type
    • - *
    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceFactory - * @model kind="package" - * @generated - */ -public class PersistencePackage extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "persistence"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "persistence.xmi"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "org.eclipse.jpt.core.content.persistence"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final PersistencePackage eINSTANCE = org.eclipse.jpt.core.internal.content.persistence.PersistencePackage.init(); - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence Persistence}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistence() - * @generated - */ - public static final int PERSISTENCE = 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit Unit}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit() - * @generated - */ - public static final int PERSISTENCE_UNIT = 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.Properties Properties}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.Properties - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperties() - * @generated - */ - public static final int PROPERTIES = 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.Property Property}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.Property - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperty() - * @generated - */ - public static final int PROPERTY = 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode Xml Root Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceXmlRootContentNode() - * @generated - */ - public static final int PERSISTENCE_XML_ROOT_CONTENT_NODE = 0; - - /** - * The feature id for the 'Jpa File' container reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persistence' reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Xml Root Content Node' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_XML_ROOT_CONTENT_NODE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Persistence Units' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE__PERSISTENCE_UNITS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Version' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE__VERSION = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Root' reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE__ROOT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Persistence' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Description' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__DESCRIPTION = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Provider' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__PROVIDER = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Jta Data Source' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__JTA_DATA_SOURCE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Non Jta Data Source' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Mapping Files' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__MAPPING_FILES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Jar Files' attribute list. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__JAR_FILES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Classes' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__CLASSES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Exclude Unlisted Classes' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Properties' containment reference. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__PROPERTIES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Transaction Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT__TRANSACTION_TYPE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 10; - - /** - * The number of structural features of the 'Unit' class. - * - * - * @generated - * @ordered - */ - public static final int PERSISTENCE_UNIT_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 11; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef Mapping File Ref}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.MappingFileRef - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getMappingFileRef() - * @generated - */ - public static final int MAPPING_FILE_REF = 3; - - /** - * The feature id for the 'File Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int MAPPING_FILE_REF__FILE_NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Mapping File Ref' class. - * - * - * @generated - * @ordered - */ - public static final int MAPPING_FILE_REF_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef Java Class Ref}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.JavaClassRef - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getJavaClassRef() - * @generated - */ - public static final int JAVA_CLASS_REF = 4; - - /** - * The feature id for the 'Java Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CLASS_REF__JAVA_CLASS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Java Class Ref' class. - * - * - * @generated - * @ordered - */ - public static final int JAVA_CLASS_REF_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Properties' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int PROPERTIES__PROPERTIES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Properties' class. - * - * - * @generated - * @ordered - */ - public static final int PROPERTIES_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int PROPERTY__NAME = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int PROPERTY__VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Property' class. - * - * - * @generated - * @ordered - */ - public static final int PROPERTY_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType Unit Transaction Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnitTransactionType() - * @generated - */ - public static final int PERSISTENCE_UNIT_TRANSACTION_TYPE = 7; - - /** - * The meta object id for the 'Unit Transaction Type Object' data type. - * - * - * @see org.eclipse.emf.common.util.Enumerator - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnitTransactionTypeObject() - * @generated - */ - public static final int PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT = 8; - - /** - * The meta object id for the 'Version' data type. - * - * - * @see java.lang.String - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getVersion() - * @generated - */ - public static final int VERSION = 9; - - /** - * - * - * @generated - */ - private EClass persistenceEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceUnitEClass = null; - - /** - * - * - * @generated - */ - private EClass mappingFileRefEClass = null; - - /** - * - * - * @generated - */ - private EClass javaClassRefEClass = null; - - /** - * - * - * @generated - */ - private EClass propertiesEClass = null; - - /** - * - * - * @generated - */ - private EClass propertyEClass = null; - - /** - * - * - * @generated - */ - private EClass persistenceXmlRootContentNodeEClass = null; - - /** - * - * - * @generated - */ - private EEnum persistenceUnitTransactionTypeEEnum = null; - - /** - * - * - * @generated - */ - private EDataType persistenceUnitTransactionTypeObjectEDataType = null; - - /** - * - * - * @generated - */ - private EDataType versionEDataType = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

    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. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#eNS_URI - * @see #init() - * @generated - */ - private PersistencePackage() { - super(eNS_URI, PersistenceFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

    Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

    Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static PersistencePackage init() { - if (isInited) - return (PersistencePackage) EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI); - // Obtain or create and register package - PersistencePackage thePersistencePackage = (PersistencePackage) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PersistencePackage()); - isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - XMLTypePackage.eINSTANCE.eClass(); - // Obtain or create and register interdependencies - JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE); - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE); - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE); - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) instanceof JpaJavaMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) : JpaJavaMappingsPackage.eINSTANCE); - OrmPackage theOrmPackage = (OrmPackage) (EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE); - // Create package meta-data objects - thePersistencePackage.createPackageContents(); - theJpaCorePackage.createPackageContents(); - theJpaCoreMappingsPackage.createPackageContents(); - theJpaJavaPackage.createPackageContents(); - theJpaJavaMappingsPackage.createPackageContents(); - theOrmPackage.createPackageContents(); - // Initialize created meta-data - thePersistencePackage.initializePackageContents(); - theJpaCorePackage.initializePackageContents(); - theJpaCoreMappingsPackage.initializePackageContents(); - theJpaJavaPackage.initializePackageContents(); - theJpaJavaMappingsPackage.initializePackageContents(); - theOrmPackage.initializePackageContents(); - // Mark meta-data to indicate it can't be changed - thePersistencePackage.freeze(); - return thePersistencePackage; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence Persistence}'. - * - * - * @return the meta object for class 'Persistence'. - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence - * @generated - */ - public EClass getPersistence() { - return persistenceEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getPersistenceUnits Persistence Units}'. - * - * - * @return the meta object for the containment reference list 'Persistence Units'. - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence#getPersistenceUnits() - * @see #getPersistence() - * @generated - */ - public EReference getPersistence_PersistenceUnits() { - return (EReference) persistenceEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getVersion Version}'. - * - * - * @return the meta object for the attribute 'Version'. - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence#getVersion() - * @see #getPersistence() - * @generated - */ - public EAttribute getPersistence_Version() { - return (EAttribute) persistenceEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getRoot Root}'. - * - * - * @return the meta object for the reference 'Root'. - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence#getRoot() - * @see #getPersistence() - * @generated - */ - public EReference getPersistence_Root() { - return (EReference) persistenceEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit Unit}'. - * - * - * @return the meta object for class 'Unit'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit - * @generated - */ - public EClass getPersistenceUnit() { - return persistenceUnitEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getDescription Description}'. - * - * - * @return the meta object for the attribute 'Description'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getDescription() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_Description() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProvider Provider}'. - * - * - * @return the meta object for the attribute 'Provider'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProvider() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_Provider() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJtaDataSource Jta Data Source}'. - * - * - * @return the meta object for the attribute 'Jta Data Source'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJtaDataSource() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_JtaDataSource() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getNonJtaDataSource Non Jta Data Source}'. - * - * - * @return the meta object for the attribute 'Non Jta Data Source'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getNonJtaDataSource() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_NonJtaDataSource() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getMappingFiles Mapping Files}'. - * - * - * @return the meta object for the containment reference list 'Mapping Files'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getMappingFiles() - * @see #getPersistenceUnit() - * @generated - */ - public EReference getPersistenceUnit_MappingFiles() { - return (EReference) persistenceUnitEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJarFiles Jar Files}'. - * - * - * @return the meta object for the attribute list 'Jar Files'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJarFiles() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_JarFiles() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getClasses Classes}'. - * - * - * @return the meta object for the containment reference list 'Classes'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getClasses() - * @see #getPersistenceUnit() - * @generated - */ - public EReference getPersistenceUnit_Classes() { - return (EReference) persistenceUnitEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses Exclude Unlisted Classes}'. - * - * - * @return the meta object for the attribute 'Exclude Unlisted Classes'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_ExcludeUnlistedClasses() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProperties Properties}'. - * - * - * @return the meta object for the containment reference 'Properties'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProperties() - * @see #getPersistenceUnit() - * @generated - */ - public EReference getPersistenceUnit_Properties() { - return (EReference) persistenceUnitEClass.getEStructuralFeatures().get(8); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getName() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_Name() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(9); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType Transaction Type}'. - * - * - * @return the meta object for the attribute 'Transaction Type'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType() - * @see #getPersistenceUnit() - * @generated - */ - public EAttribute getPersistenceUnit_TransactionType() { - return (EAttribute) persistenceUnitEClass.getEStructuralFeatures().get(10); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef Mapping File Ref}'. - * - * - * @return the meta object for class 'Mapping File Ref'. - * @see org.eclipse.jpt.core.internal.content.persistence.MappingFileRef - * @generated - */ - public EClass getMappingFileRef() { - return mappingFileRefEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef#getFileName File Name}'. - * - * - * @return the meta object for the attribute 'File Name'. - * @see org.eclipse.jpt.core.internal.content.persistence.MappingFileRef#getFileName() - * @see #getMappingFileRef() - * @generated - */ - public EAttribute getMappingFileRef_FileName() { - return (EAttribute) mappingFileRefEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef Java Class Ref}'. - * - * - * @return the meta object for class 'Java Class Ref'. - * @see org.eclipse.jpt.core.internal.content.persistence.JavaClassRef - * @generated - */ - public EClass getJavaClassRef() { - return javaClassRefEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef#getJavaClass Java Class}'. - * - * - * @return the meta object for the attribute 'Java Class'. - * @see org.eclipse.jpt.core.internal.content.persistence.JavaClassRef#getJavaClass() - * @see #getJavaClassRef() - * @generated - */ - public EAttribute getJavaClassRef_JavaClass() { - return (EAttribute) javaClassRefEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.Properties Properties}'. - * - * - * @return the meta object for class 'Properties'. - * @see org.eclipse.jpt.core.internal.content.persistence.Properties - * @generated - */ - public EClass getProperties() { - return propertiesEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.persistence.Properties#getProperties Properties}'. - * - * - * @return the meta object for the containment reference list 'Properties'. - * @see org.eclipse.jpt.core.internal.content.persistence.Properties#getProperties() - * @see #getProperties() - * @generated - */ - public EReference getProperties_Properties() { - return (EReference) propertiesEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.Property Property}'. - * - * - * @return the meta object for class 'Property'. - * @see org.eclipse.jpt.core.internal.content.persistence.Property - * @generated - */ - public EClass getProperty() { - return propertyEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.Property#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.content.persistence.Property#getName() - * @see #getProperty() - * @generated - */ - public EAttribute getProperty_Name() { - return (EAttribute) propertyEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.persistence.Property#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.jpt.core.internal.content.persistence.Property#getValue() - * @see #getProperty() - * @generated - */ - public EAttribute getProperty_Value() { - return (EAttribute) propertyEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode Xml Root Content Node}'. - * - * - * @return the meta object for class 'Xml Root Content Node'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode - * @generated - */ - public EClass getPersistenceXmlRootContentNode() { - return persistenceXmlRootContentNodeEClass; - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode#getPersistence Persistence}'. - * - * - * @return the meta object for the reference 'Persistence'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode#getPersistence() - * @see #getPersistenceXmlRootContentNode() - * @generated - */ - public EReference getPersistenceXmlRootContentNode_Persistence() { - return (EReference) persistenceXmlRootContentNodeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType Unit Transaction Type}'. - * - * - * @return the meta object for enum 'Unit Transaction Type'. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType - * @generated - */ - public EEnum getPersistenceUnitTransactionType() { - return persistenceUnitTransactionTypeEEnum; - } - - /** - * Returns the meta object for data type '{@link org.eclipse.emf.common.util.Enumerator Unit Transaction Type Object}'. - * - * - * @return the meta object for data type 'Unit Transaction Type Object'. - * @see org.eclipse.emf.common.util.Enumerator - * @model instanceClass="org.eclipse.emf.common.util.Enumerator" - * @generated - */ - public EDataType getPersistenceUnitTransactionTypeObject() { - return persistenceUnitTransactionTypeObjectEDataType; - } - - /** - * Returns the meta object for data type '{@link java.lang.String Version}'. - * - * - * @return the meta object for data type 'Version'. - * @see java.lang.String - * @model instanceClass="java.lang.String" - * @generated - */ - public EDataType getVersion() { - return versionEDataType; - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public PersistenceFactory getPersistenceFactory() { - return (PersistenceFactory) getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - // Create classes and their features - persistenceXmlRootContentNodeEClass = createEClass(PERSISTENCE_XML_ROOT_CONTENT_NODE); - createEReference(persistenceXmlRootContentNodeEClass, PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE); - persistenceEClass = createEClass(PERSISTENCE); - createEReference(persistenceEClass, PERSISTENCE__PERSISTENCE_UNITS); - createEAttribute(persistenceEClass, PERSISTENCE__VERSION); - createEReference(persistenceEClass, PERSISTENCE__ROOT); - persistenceUnitEClass = createEClass(PERSISTENCE_UNIT); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__DESCRIPTION); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__PROVIDER); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__JTA_DATA_SOURCE); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE); - createEReference(persistenceUnitEClass, PERSISTENCE_UNIT__MAPPING_FILES); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__JAR_FILES); - createEReference(persistenceUnitEClass, PERSISTENCE_UNIT__CLASSES); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES); - createEReference(persistenceUnitEClass, PERSISTENCE_UNIT__PROPERTIES); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__NAME); - createEAttribute(persistenceUnitEClass, PERSISTENCE_UNIT__TRANSACTION_TYPE); - mappingFileRefEClass = createEClass(MAPPING_FILE_REF); - createEAttribute(mappingFileRefEClass, MAPPING_FILE_REF__FILE_NAME); - javaClassRefEClass = createEClass(JAVA_CLASS_REF); - createEAttribute(javaClassRefEClass, JAVA_CLASS_REF__JAVA_CLASS); - propertiesEClass = createEClass(PROPERTIES); - createEReference(propertiesEClass, PROPERTIES__PROPERTIES); - propertyEClass = createEClass(PROPERTY); - createEAttribute(propertyEClass, PROPERTY__NAME); - createEAttribute(propertyEClass, PROPERTY__VALUE); - // Create enums - persistenceUnitTransactionTypeEEnum = createEEnum(PERSISTENCE_UNIT_TRANSACTION_TYPE); - // Create data types - persistenceUnitTransactionTypeObjectEDataType = createEDataType(PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT); - versionEDataType = createEDataType(VERSION); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - // Obtain other dependent packages - JpaCorePackage theJpaCorePackage = (JpaCorePackage) EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI); - XMLTypePackage theXMLTypePackage = (XMLTypePackage) EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - // Create type parameters - // Set bounds for type parameters - // Add supertypes to classes - persistenceXmlRootContentNodeEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - persistenceXmlRootContentNodeEClass.getESuperTypes().add(theJpaCorePackage.getIJpaRootContentNode()); - persistenceEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - persistenceUnitEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - mappingFileRefEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - javaClassRefEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - propertiesEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - propertyEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - // Initialize classes and features; add operations and parameters - initEClass(persistenceXmlRootContentNodeEClass, PersistenceXmlRootContentNode.class, "PersistenceXmlRootContentNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPersistenceXmlRootContentNode_Persistence(), this.getPersistence(), this.getPersistence_Root(), "persistence", null, 0, 1, PersistenceXmlRootContentNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(persistenceEClass, Persistence.class, "Persistence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPersistence_PersistenceUnits(), this.getPersistenceUnit(), null, "persistenceUnits", null, 0, -1, Persistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistence_Version(), this.getVersion(), "version", null, 1, 1, Persistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistence_Root(), this.getPersistenceXmlRootContentNode(), this.getPersistenceXmlRootContentNode_Persistence(), "root", null, 1, 1, Persistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEClass(persistenceUnitEClass, PersistenceUnit.class, "PersistenceUnit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPersistenceUnit_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_Provider(), theXMLTypePackage.getString(), "provider", null, 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_JtaDataSource(), theXMLTypePackage.getString(), "jtaDataSource", null, 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_NonJtaDataSource(), theXMLTypePackage.getString(), "nonJtaDataSource", null, 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistenceUnit_MappingFiles(), this.getMappingFileRef(), null, "mappingFiles", null, 0, -1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_JarFiles(), theXMLTypePackage.getString(), "jarFiles", null, 0, -1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistenceUnit_Classes(), this.getJavaClassRef(), null, "classes", null, 0, -1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_ExcludeUnlistedClasses(), theXMLTypePackage.getBoolean(), "excludeUnlistedClasses", "false", 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPersistenceUnit_Properties(), this.getProperties(), null, "properties", null, 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPersistenceUnit_TransactionType(), this.getPersistenceUnitTransactionType(), "transactionType", "JTA", 0, 1, PersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(mappingFileRefEClass, MappingFileRef.class, "MappingFileRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getMappingFileRef_FileName(), theEcorePackage.getEString(), "fileName", "", 0, 1, MappingFileRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEClass(javaClassRefEClass, JavaClassRef.class, "JavaClassRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaClassRef_JavaClass(), theEcorePackage.getEString(), "javaClass", null, 0, 1, JavaClassRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEClass(propertiesEClass, Properties.class, "Properties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getProperties_Properties(), this.getProperty(), null, "properties", null, 0, -1, Properties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getProperty_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getProperty_Value(), theXMLTypePackage.getString(), "value", null, 1, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - // Initialize enums and add enum literals - initEEnum(persistenceUnitTransactionTypeEEnum, PersistenceUnitTransactionType.class, "PersistenceUnitTransactionType"); - addEEnumLiteral(persistenceUnitTransactionTypeEEnum, PersistenceUnitTransactionType.JTA); - addEEnumLiteral(persistenceUnitTransactionTypeEEnum, PersistenceUnitTransactionType.RESOURCE_LOCAL); - // Initialize data types - initEDataType(persistenceUnitTransactionTypeObjectEDataType, Enumerator.class, "PersistenceUnitTransactionTypeObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(versionEDataType, String.class, "Version", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - // Create resource - createResource(eNS_URI); - } - - - /** - * - * Defines literals for the meta objects that represent - *

      - *
    • each class,
    • - *
    • each feature of each class,
    • - *
    • each enum,
    • - *
    • and each data type
    • - *
    - * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence Persistence}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistence() - * @generated - */ - public static final EClass PERSISTENCE = eINSTANCE.getPersistence(); - - /** - * The meta object literal for the 'Persistence Units' containment reference list feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE__PERSISTENCE_UNITS = eINSTANCE.getPersistence_PersistenceUnits(); - - /** - * The meta object literal for the 'Version' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE__VERSION = eINSTANCE.getPersistence_Version(); - - /** - * The meta object literal for the 'Root' reference feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE__ROOT = eINSTANCE.getPersistence_Root(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit Unit}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit() - * @generated - */ - public static final EClass PERSISTENCE_UNIT = eINSTANCE.getPersistenceUnit(); - - /** - * The meta object literal for the 'Description' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__DESCRIPTION = eINSTANCE.getPersistenceUnit_Description(); - - /** - * The meta object literal for the 'Provider' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__PROVIDER = eINSTANCE.getPersistenceUnit_Provider(); - - /** - * The meta object literal for the 'Jta Data Source' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__JTA_DATA_SOURCE = eINSTANCE.getPersistenceUnit_JtaDataSource(); - - /** - * The meta object literal for the 'Non Jta Data Source' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE = eINSTANCE.getPersistenceUnit_NonJtaDataSource(); - - /** - * The meta object literal for the 'Mapping Files' containment reference list feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_UNIT__MAPPING_FILES = eINSTANCE.getPersistenceUnit_MappingFiles(); - - /** - * The meta object literal for the 'Jar Files' attribute list feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__JAR_FILES = eINSTANCE.getPersistenceUnit_JarFiles(); - - /** - * The meta object literal for the 'Classes' containment reference list feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_UNIT__CLASSES = eINSTANCE.getPersistenceUnit_Classes(); - - /** - * The meta object literal for the 'Exclude Unlisted Classes' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES = eINSTANCE.getPersistenceUnit_ExcludeUnlistedClasses(); - - /** - * The meta object literal for the 'Properties' containment reference feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_UNIT__PROPERTIES = eINSTANCE.getPersistenceUnit_Properties(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__NAME = eINSTANCE.getPersistenceUnit_Name(); - - /** - * The meta object literal for the 'Transaction Type' attribute feature. - * - * - * @generated - */ - public static final EAttribute PERSISTENCE_UNIT__TRANSACTION_TYPE = eINSTANCE.getPersistenceUnit_TransactionType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef Mapping File Ref}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.MappingFileRef - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getMappingFileRef() - * @generated - */ - public static final EClass MAPPING_FILE_REF = eINSTANCE.getMappingFileRef(); - - /** - * The meta object literal for the 'File Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute MAPPING_FILE_REF__FILE_NAME = eINSTANCE.getMappingFileRef_FileName(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef Java Class Ref}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.JavaClassRef - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getJavaClassRef() - * @generated - */ - public static final EClass JAVA_CLASS_REF = eINSTANCE.getJavaClassRef(); - - /** - * The meta object literal for the 'Java Class' attribute feature. - * - * - * @generated - */ - public static final EAttribute JAVA_CLASS_REF__JAVA_CLASS = eINSTANCE.getJavaClassRef_JavaClass(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.Properties Properties}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.Properties - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperties() - * @generated - */ - public static final EClass PROPERTIES = eINSTANCE.getProperties(); - - /** - * The meta object literal for the 'Properties' containment reference list feature. - * - * - * @generated - */ - public static final EReference PROPERTIES__PROPERTIES = eINSTANCE.getProperties_Properties(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.Property Property}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.Property - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperty() - * @generated - */ - public static final EClass PROPERTY = eINSTANCE.getProperty(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute PROPERTY__NAME = eINSTANCE.getProperty_Name(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute PROPERTY__VALUE = eINSTANCE.getProperty_Value(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode Xml Root Content Node}' class. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceXmlRootContentNode() - * @generated - */ - public static final EClass PERSISTENCE_XML_ROOT_CONTENT_NODE = eINSTANCE.getPersistenceXmlRootContentNode(); - - /** - * The meta object literal for the 'Persistence' reference feature. - * - * - * @generated - */ - public static final EReference PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE = eINSTANCE.getPersistenceXmlRootContentNode_Persistence(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType Unit Transaction Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnitTransactionType() - * @generated - */ - public static final EEnum PERSISTENCE_UNIT_TRANSACTION_TYPE = eINSTANCE.getPersistenceUnitTransactionType(); - - /** - * The meta object literal for the 'Unit Transaction Type Object' data type. - * - * - * @see org.eclipse.emf.common.util.Enumerator - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnitTransactionTypeObject() - * @generated - */ - public static final EDataType PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT = eINSTANCE.getPersistenceUnitTransactionTypeObject(); - - /** - * The meta object literal for the 'Version' data type. - * - * - * @see java.lang.String - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getVersion() - * @generated - */ - public static final EDataType VERSION = eINSTANCE.getVersion(); - } -} //PersistenceInternalPackage diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnit.java deleted file mode 100644 index d9e5584e19..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnit.java +++ /dev/null @@ -1,877 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import java.util.Collection; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * An implementation of the model object 'Persistence Unit'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getDescription Description}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProvider Provider}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJtaDataSource Jta Data Source}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getNonJtaDataSource Non Jta Data Source}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getMappingFiles Mapping Files}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJarFiles Jar Files}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getClasses Classes}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses Exclude Unlisted Classes}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProperties Properties}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType Transaction Type}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit() - * @model kind="class" - * @generated - */ -public class PersistenceUnit extends XmlEObject -{ - /** - * The default value of the '{@link #getDescription() Description}' attribute. - * - * - * @see #getDescription() - * @generated - * @ordered - */ - protected static final String DESCRIPTION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDescription() Description}' attribute. - * - * - * @see #getDescription() - * @generated - * @ordered - */ - protected String description = DESCRIPTION_EDEFAULT; - - /** - * The default value of the '{@link #getProvider() Provider}' attribute. - * - * - * @see #getProvider() - * @generated - * @ordered - */ - protected static final String PROVIDER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getProvider() Provider}' attribute. - * - * - * @see #getProvider() - * @generated - * @ordered - */ - protected String provider = PROVIDER_EDEFAULT; - - /** - * The default value of the '{@link #getJtaDataSource() Jta Data Source}' attribute. - * - * - * @see #getJtaDataSource() - * @generated - * @ordered - */ - protected static final String JTA_DATA_SOURCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getJtaDataSource() Jta Data Source}' attribute. - * - * - * @see #getJtaDataSource() - * @generated - * @ordered - */ - protected String jtaDataSource = JTA_DATA_SOURCE_EDEFAULT; - - /** - * The default value of the '{@link #getNonJtaDataSource() Non Jta Data Source}' attribute. - * - * - * @see #getNonJtaDataSource() - * @generated - * @ordered - */ - protected static final String NON_JTA_DATA_SOURCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getNonJtaDataSource() Non Jta Data Source}' attribute. - * - * - * @see #getNonJtaDataSource() - * @generated - * @ordered - */ - protected String nonJtaDataSource = NON_JTA_DATA_SOURCE_EDEFAULT; - - /** - * The cached value of the '{@link #getMappingFiles() Mapping Files}' containment reference list. - * - * - * @see #getMappingFiles() - * @generated - * @ordered - */ - protected EList mappingFiles; - - /** - * The cached value of the '{@link #getJarFiles() Jar Files}' attribute list. - * - * - * @see #getJarFiles() - * @generated - * @ordered - */ - protected EList jarFiles; - - /** - * The cached value of the '{@link #getClasses() Classes}' containment reference list. - * - * - * @see #getClasses() - * @generated - * @ordered - */ - protected EList classes; - - /** - * The default value of the '{@link #isExcludeUnlistedClasses() Exclude Unlisted Classes}' attribute. - * - * - * @see #isExcludeUnlistedClasses() - * @generated - * @ordered - */ - protected static final boolean EXCLUDE_UNLISTED_CLASSES_EDEFAULT = false; - - /** - * The cached value of the '{@link #isExcludeUnlistedClasses() Exclude Unlisted Classes}' attribute. - * - * - * @see #isExcludeUnlistedClasses() - * @generated - * @ordered - */ - protected boolean excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT; - - /** - * This is true if the Exclude Unlisted Classes attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean excludeUnlistedClassesESet; - - /** - * The cached value of the '{@link #getProperties() Properties}' containment reference. - * - * - * @see #getProperties() - * @generated - * @ordered - */ - protected Properties properties; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getTransactionType() Transaction Type}' attribute. - * - * - * @see #getTransactionType() - * @generated - * @ordered - */ - protected static final PersistenceUnitTransactionType TRANSACTION_TYPE_EDEFAULT = PersistenceUnitTransactionType.JTA; - - /** - * The cached value of the '{@link #getTransactionType() Transaction Type}' attribute. - * - * - * @see #getTransactionType() - * @generated - * @ordered - */ - protected PersistenceUnitTransactionType transactionType = TRANSACTION_TYPE_EDEFAULT; - - /** - * This is true if the Transaction Type attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean transactionTypeESet; - - /** - * - * - * @generated - */ - protected PersistenceUnit() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.PERSISTENCE_UNIT; - } - - /** - * Returns the value of the 'Description' attribute. - * - * - * @return the value of the 'Description' attribute. - * @see #setDescription(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Description() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" - * @generated - */ - public String getDescription() { - return description; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getDescription Description}' attribute. - * - * - * @param value the new value of the 'Description' attribute. - * @see #getDescription() - * @generated - */ - public void setDescription(String newDescription) { - String oldDescription = description; - description = newDescription; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION, oldDescription, description)); - } - - /** - * Returns the value of the 'Provider' attribute. - * - * - * @return the value of the 'Provider' attribute. - * @see #setProvider(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Provider() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" - * @generated - */ - public String getProvider() { - return provider; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProvider Provider}' attribute. - * - * - * @param value the new value of the 'Provider' attribute. - * @see #getProvider() - * @generated - */ - public void setProvider(String newProvider) { - String oldProvider = provider; - provider = newProvider; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__PROVIDER, oldProvider, provider)); - } - - /** - * Returns the value of the 'Jta Data Source' attribute. - * - * - * @return the value of the 'Jta Data Source' attribute. - * @see #setJtaDataSource(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_JtaDataSource() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" - * @generated - */ - public String getJtaDataSource() { - return jtaDataSource; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJtaDataSource Jta Data Source}' attribute. - * - * - * @param value the new value of the 'Jta Data Source' attribute. - * @see #getJtaDataSource() - * @generated - */ - public void setJtaDataSource(String newJtaDataSource) { - String oldJtaDataSource = jtaDataSource; - jtaDataSource = newJtaDataSource; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE, oldJtaDataSource, jtaDataSource)); - } - - /** - * Returns the value of the 'Non Jta Data Source' attribute. - * - * - * @return the value of the 'Non Jta Data Source' attribute. - * @see #setNonJtaDataSource(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_NonJtaDataSource() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" - * @generated - */ - public String getNonJtaDataSource() { - return nonJtaDataSource; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getNonJtaDataSource Non Jta Data Source}' attribute. - * - * - * @param value the new value of the 'Non Jta Data Source' attribute. - * @see #getNonJtaDataSource() - * @generated - */ - public void setNonJtaDataSource(String newNonJtaDataSource) { - String oldNonJtaDataSource = nonJtaDataSource; - nonJtaDataSource = newNonJtaDataSource; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE, oldNonJtaDataSource, nonJtaDataSource)); - } - - /** - * Returns the value of the 'Mapping Files' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef}. - * - * - * @return the value of the 'Mapping Files' containment reference list. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_MappingFiles() - * @model type="org.eclipse.jpt.core.internal.content.persistence.MappingFileRef" containment="true" - * @generated - */ - public EList getMappingFiles() { - if (mappingFiles == null) { - mappingFiles = new EObjectContainmentEList(MappingFileRef.class, this, PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES); - } - return mappingFiles; - } - - /** - * Returns the value of the 'Jar Files' attribute list. - * The list contents are of type {@link java.lang.String}. - * - * - * @return the value of the 'Jar Files' attribute list. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_JarFiles() - * @model type="java.lang.String" unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" - * @generated - */ - public EList getJarFiles() { - if (jarFiles == null) { - jarFiles = new EDataTypeEList(String.class, this, PersistencePackage.PERSISTENCE_UNIT__JAR_FILES); - } - return jarFiles; - } - - /** - * Returns the value of the 'Classes' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef}. - * - * - * @return the value of the 'Classes' containment reference list. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Classes() - * @model type="org.eclipse.jpt.core.internal.content.persistence.JavaClassRef" containment="true" - * @generated - */ - public EList getClasses() { - if (classes == null) { - classes = new EObjectContainmentEList(JavaClassRef.class, this, PersistencePackage.PERSISTENCE_UNIT__CLASSES); - } - return classes; - } - - /** - * Returns the value of the 'Exclude Unlisted Classes' attribute. - * The default value is "false". - * - * - * @return the value of the 'Exclude Unlisted Classes' attribute. - * @see #isSetExcludeUnlistedClasses() - * @see #unsetExcludeUnlistedClasses() - * @see #setExcludeUnlistedClasses(boolean) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_ExcludeUnlistedClasses() - * @model default="false" unique="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean" - * @generated - */ - public boolean isExcludeUnlistedClasses() { - return excludeUnlistedClasses; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses Exclude Unlisted Classes}' attribute. - * - * - * @param value the new value of the 'Exclude Unlisted Classes' attribute. - * @see #isSetExcludeUnlistedClasses() - * @see #unsetExcludeUnlistedClasses() - * @see #isExcludeUnlistedClasses() - * @generated - */ - public void setExcludeUnlistedClasses(boolean newExcludeUnlistedClasses) { - boolean oldExcludeUnlistedClasses = excludeUnlistedClasses; - excludeUnlistedClasses = newExcludeUnlistedClasses; - boolean oldExcludeUnlistedClassesESet = excludeUnlistedClassesESet; - excludeUnlistedClassesESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, excludeUnlistedClasses, !oldExcludeUnlistedClassesESet)); - } - - /** - * Unsets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses Exclude Unlisted Classes}' attribute. - * - * - * @see #isSetExcludeUnlistedClasses() - * @see #isExcludeUnlistedClasses() - * @see #setExcludeUnlistedClasses(boolean) - * @generated - */ - public void unsetExcludeUnlistedClasses() { - boolean oldExcludeUnlistedClasses = excludeUnlistedClasses; - boolean oldExcludeUnlistedClassesESet = excludeUnlistedClassesESet; - excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT; - excludeUnlistedClassesESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, EXCLUDE_UNLISTED_CLASSES_EDEFAULT, oldExcludeUnlistedClassesESet)); - } - - /** - * Returns whether the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses Exclude Unlisted Classes}' attribute is set. - * - * - * @return whether the value of the 'Exclude Unlisted Classes' attribute is set. - * @see #unsetExcludeUnlistedClasses() - * @see #isExcludeUnlistedClasses() - * @see #setExcludeUnlistedClasses(boolean) - * @generated - */ - public boolean isSetExcludeUnlistedClasses() { - return excludeUnlistedClassesESet; - } - - /** - * Returns the value of the 'Properties' containment reference. - * - * - * @return the value of the 'Properties' containment reference. - * @see #setProperties(Properties) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Properties() - * @model containment="true" - * @generated - */ - public Properties getProperties() { - return properties; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetProperties(Properties newProperties, NotificationChain msgs) { - Properties oldProperties = properties; - properties = newProperties; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, oldProperties, newProperties); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProperties Properties}' containment reference. - * - * - * @param value the new value of the 'Properties' containment reference. - * @see #getProperties() - * @generated - */ - public void setProperties(Properties newProperties) { - if (newProperties != properties) { - NotificationChain msgs = null; - if (properties != null) - msgs = ((InternalEObject) properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, null, msgs); - if (newProperties != null) - msgs = ((InternalEObject) newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, null, msgs); - msgs = basicSetProperties(newProperties, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, newProperties, newProperties)); - } - - /** - * Returns the value of the 'Name' attribute. - * - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Name() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true" - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__NAME, oldName, name)); - } - - /** - * Returns the value of the 'Transaction Type' attribute. - * The default value is "JTA". - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType}. - * - * - * @return the value of the 'Transaction Type' attribute. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType - * @see #isSetTransactionType() - * @see #unsetTransactionType() - * @see #setTransactionType(PersistenceUnitTransactionType) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_TransactionType() - * @model default="JTA" unique="false" unsettable="true" - * @generated - */ - public PersistenceUnitTransactionType getTransactionType() { - return transactionType; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType Transaction Type}' attribute. - * - * - * @param value the new value of the 'Transaction Type' attribute. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType - * @see #isSetTransactionType() - * @see #unsetTransactionType() - * @see #getTransactionType() - * @generated - */ - public void setTransactionType(PersistenceUnitTransactionType newTransactionType) { - PersistenceUnitTransactionType oldTransactionType = transactionType; - transactionType = newTransactionType == null ? TRANSACTION_TYPE_EDEFAULT : newTransactionType; - boolean oldTransactionTypeESet = transactionTypeESet; - transactionTypeESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, transactionType, !oldTransactionTypeESet)); - } - - /** - * Unsets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType Transaction Type}' attribute. - * - * - * @see #isSetTransactionType() - * @see #getTransactionType() - * @see #setTransactionType(PersistenceUnitTransactionType) - * @generated - */ - public void unsetTransactionType() { - PersistenceUnitTransactionType oldTransactionType = transactionType; - boolean oldTransactionTypeESet = transactionTypeESet; - transactionType = TRANSACTION_TYPE_EDEFAULT; - transactionTypeESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, TRANSACTION_TYPE_EDEFAULT, oldTransactionTypeESet)); - } - - /** - * Returns whether the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType Transaction Type}' attribute is set. - * - * - * @return whether the value of the 'Transaction Type' attribute is set. - * @see #unsetTransactionType() - * @see #getTransactionType() - * @see #setTransactionType(PersistenceUnitTransactionType) - * @generated - */ - public boolean isSetTransactionType() { - return transactionTypeESet; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES : - return ((InternalEList) getMappingFiles()).basicRemove(otherEnd, msgs); - case PersistencePackage.PERSISTENCE_UNIT__CLASSES : - return ((InternalEList) getClasses()).basicRemove(otherEnd, msgs); - case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES : - return basicSetProperties(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION : - return getDescription(); - case PersistencePackage.PERSISTENCE_UNIT__PROVIDER : - return getProvider(); - case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE : - return getJtaDataSource(); - case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE : - return getNonJtaDataSource(); - case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES : - return getMappingFiles(); - case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES : - return getJarFiles(); - case PersistencePackage.PERSISTENCE_UNIT__CLASSES : - return getClasses(); - case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES : - return isExcludeUnlistedClasses() ? Boolean.TRUE : Boolean.FALSE; - case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES : - return getProperties(); - case PersistencePackage.PERSISTENCE_UNIT__NAME : - return getName(); - case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE : - return getTransactionType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION : - setDescription((String) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__PROVIDER : - setProvider((String) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE : - setJtaDataSource((String) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE : - setNonJtaDataSource((String) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES : - getMappingFiles().clear(); - getMappingFiles().addAll((Collection) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES : - getJarFiles().clear(); - getJarFiles().addAll((Collection) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__CLASSES : - getClasses().clear(); - getClasses().addAll((Collection) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES : - setExcludeUnlistedClasses(((Boolean) newValue).booleanValue()); - return; - case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES : - setProperties((Properties) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__NAME : - setName((String) newValue); - return; - case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE : - setTransactionType((PersistenceUnitTransactionType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION : - setDescription(DESCRIPTION_EDEFAULT); - return; - case PersistencePackage.PERSISTENCE_UNIT__PROVIDER : - setProvider(PROVIDER_EDEFAULT); - return; - case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE : - setJtaDataSource(JTA_DATA_SOURCE_EDEFAULT); - return; - case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE : - setNonJtaDataSource(NON_JTA_DATA_SOURCE_EDEFAULT); - return; - case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES : - getMappingFiles().clear(); - return; - case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES : - getJarFiles().clear(); - return; - case PersistencePackage.PERSISTENCE_UNIT__CLASSES : - getClasses().clear(); - return; - case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES : - unsetExcludeUnlistedClasses(); - return; - case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES : - setProperties((Properties) null); - return; - case PersistencePackage.PERSISTENCE_UNIT__NAME : - setName(NAME_EDEFAULT); - return; - case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE : - unsetTransactionType(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION : - return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); - case PersistencePackage.PERSISTENCE_UNIT__PROVIDER : - return PROVIDER_EDEFAULT == null ? provider != null : !PROVIDER_EDEFAULT.equals(provider); - case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE : - return JTA_DATA_SOURCE_EDEFAULT == null ? jtaDataSource != null : !JTA_DATA_SOURCE_EDEFAULT.equals(jtaDataSource); - case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE : - return NON_JTA_DATA_SOURCE_EDEFAULT == null ? nonJtaDataSource != null : !NON_JTA_DATA_SOURCE_EDEFAULT.equals(nonJtaDataSource); - case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES : - return mappingFiles != null && !mappingFiles.isEmpty(); - case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES : - return jarFiles != null && !jarFiles.isEmpty(); - case PersistencePackage.PERSISTENCE_UNIT__CLASSES : - return classes != null && !classes.isEmpty(); - case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES : - return isSetExcludeUnlistedClasses(); - case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES : - return properties != null; - case PersistencePackage.PERSISTENCE_UNIT__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE : - return isSetTransactionType(); - } - return super.eIsSet(featureID); - } - - public Persistence getPersistence() { - return (Persistence) eContainer(); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (description: "); - result.append(description); - result.append(", provider: "); - result.append(provider); - result.append(", jtaDataSource: "); - result.append(jtaDataSource); - result.append(", nonJtaDataSource: "); - result.append(nonJtaDataSource); - result.append(", jarFiles: "); - result.append(jarFiles); - result.append(", excludeUnlistedClasses: "); - if (excludeUnlistedClassesESet) - result.append(excludeUnlistedClasses); - else - result.append(""); - result.append(", name: "); - result.append(name); - result.append(", transactionType: "); - if (transactionTypeESet) - result.append(transactionType); - else - result.append(""); - result.append(')'); - return result.toString(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnitTransactionType.java deleted file mode 100644 index cc3658a166..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnitTransactionType.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Persistence Unit Transaction Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnitTransactionType() - * @model - * @generated - */ -public enum PersistenceUnitTransactionType implements Enumerator { - /** - * The 'JTA' literal object. - * - * - * @see #JTA_VALUE - * @generated - * @ordered - */ - JTA(0, "JTA", "JTA"), - /** - * The 'RESOURCE LOCAL' literal object. - * - * - * @see #RESOURCE_LOCAL_VALUE - * @generated - * @ordered - */ - RESOURCE_LOCAL(1, "RESOURCE_LOCAL", "RESOURCE_LOCAL"); - /** - * The 'JTA' literal value. - * - *

    - * If the meaning of 'JTA' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #JTA - * @model - * @generated - * @ordered - */ - public static final int JTA_VALUE = 0; - - /** - * The 'RESOURCE LOCAL' literal value. - * - *

    - * If the meaning of 'RESOURCE LOCAL' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #RESOURCE_LOCAL - * @model - * @generated - * @ordered - */ - public static final int RESOURCE_LOCAL_VALUE = 1; - - /** - * An array of all the 'Unit Transaction Type' enumerators. - * - * - * @generated - */ - private static final PersistenceUnitTransactionType[] VALUES_ARRAY = new PersistenceUnitTransactionType[] { - JTA, RESOURCE_LOCAL, - }; - - /** - * A public read-only list of all the 'Unit Transaction Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Unit Transaction Type' literal with the specified literal value. - * - * - * @generated - */ - public static PersistenceUnitTransactionType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - PersistenceUnitTransactionType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Unit Transaction Type' literal with the specified name. - * - * - * @generated - */ - public static PersistenceUnitTransactionType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - PersistenceUnitTransactionType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Unit Transaction Type' literal with the specified integer value. - * - * - * @generated - */ - public static PersistenceUnitTransactionType get(int value) { - switch (value) { - case JTA_VALUE : - return JTA; - case RESOURCE_LOCAL_VALUE : - return RESOURCE_LOCAL; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private PersistenceUnitTransactionType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java deleted file mode 100644 index c5e5322634..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import java.io.IOException; -import java.util.Collections; -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase; -import org.eclipse.jpt.core.internal.IJpaFileContentProvider; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceResource; -import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceXmlResourceFactory; - -public class PersistenceXmlJpaFileContentProvider implements IJpaFileContentProvider -{ - public static PersistenceXmlJpaFileContentProvider INSTANCE = new PersistenceXmlJpaFileContentProvider(); - - - private IFile resourceFile; - - - /** - * Restrict access - */ - private PersistenceXmlJpaFileContentProvider() { - - } - - public IJpaRootContentNode buildRootContent(IFile resourceFile) { - PersistenceXmlResourceFactory.register(); - this.resourceFile = resourceFile; - URI fileURI = URI.createPlatformResourceURI(resourceFile.getFullPath().toString()); - PersistenceResource resource = (PersistenceResource) getResourceSet(resourceFile).getResource(fileURI, true); - PersistenceXmlRootContentNode root = PersistenceFactory.eINSTANCE.createPersistenceXmlRootContentNode(); - root.setPersistence(resource.getPersistence()); - resource.eAdapters().add(buildRootNodeListener(root)); - return root; - } - - private Adapter buildRootNodeListener(PersistenceXmlRootContentNode root) { - return new RootAdapter(root); - } - - protected ResourceSet getResourceSet(IFile file) { - return WorkbenchResourceHelperBase.getResourceSet(file.getProject()); - } - - public String contentType() { - return JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE; - } - - - private class RootAdapter extends AdapterImpl - { - PersistenceXmlRootContentNode root; - - private RootAdapter(PersistenceXmlRootContentNode rootContentNode) { - super(); - root = rootContentNode; - } - - public void notifyChanged(Notification notification) { - int featureId = notification.getFeatureID(Resource.class); - if (featureId == Resource.RESOURCE__CONTENTS) { - if (notification.getEventType() == Notification.ADD - || notification.getEventType() == Notification.REMOVE) { - PersistenceResource resource = (PersistenceResource) notification.getNotifier(); - root.setPersistence(resource.getPersistence()); - } - } - else if (featureId == Resource.RESOURCE__IS_LOADED) { - if (resourceFile.exists()) { - // dumb translator is unloading my resource, reload it - if (notification.getNewBooleanValue() == false) { - PersistenceResource resource = (PersistenceResource) notification.getNotifier(); - try { - resource.load(Collections.EMPTY_MAP); - } - catch (IOException ioe) { - // hmmm, log for now - JptCorePlugin.log(ioe); - } - } - } - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlRootContentNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlRootContentNode.java deleted file mode 100644 index 6205c4fe24..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlRootContentNode.java +++ /dev/null @@ -1,358 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.ElementChangedEvent; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.JpaFile; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.persistence.resource.IPersistenceXmlContentNodes; - -/** - * - * A representation of the model object 'Persistence Xml Root Content Node'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode#getPersistence Persistence}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceXmlRootContentNode() - * @model kind="class" - * @generated - */ -public class PersistenceXmlRootContentNode extends XmlEObject - implements IJpaRootContentNode -{ - /** - * The cached value of the '{@link #getPersistence() Persistence}' reference. - * - * - * @see #getPersistence() - * @generated - * @ordered - */ - protected Persistence persistence; - - /** - * - * - * @generated - */ - protected PersistenceXmlRootContentNode() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.PERSISTENCE_XML_ROOT_CONTENT_NODE; - } - - /** - * Returns the value of the 'Jpa File' container reference. - * The default value is "". - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.JpaFile#getContent Content}'. - * - *

    - * If the meaning of the 'Jpa File' container reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Jpa File' container reference. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getIJpaRootContentNode_JpaFile() - * @see org.eclipse.jpt.core.internal.JpaFile#getContent - * @model opposite="content" changeable="false" - * @generated - */ - public IJpaFile getJpaFile() { - if (eContainerFeatureID != PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE) - return null; - return (IJpaFile) eContainer(); - } - - public IResource getResource() { - return getJpaFile().getResource(); - } - - /** - * Returns the value of the 'Persistence' reference. - * It is bidirectional and its opposite is '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence#getRoot Root}'. - * - *

    - * If the meaning of the 'Persistence' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Persistence' reference. - * @see #setPersistence(Persistence) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceXmlRootContentNode_Persistence() - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence#getRoot - * @model opposite="root" - * @generated - */ - public Persistence getPersistence() { - if (persistence != null && persistence.eIsProxy()) { - InternalEObject oldPersistence = (InternalEObject) persistence; - persistence = (Persistence) eResolveProxy(oldPersistence); - if (persistence != oldPersistence) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE, oldPersistence, persistence)); - } - } - return persistence; - } - - /** - * - * - * @generated - */ - public Persistence basicGetPersistence() { - return persistence; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetPersistence(Persistence newPersistence, NotificationChain msgs) { - Persistence oldPersistence = persistence; - persistence = newPersistence; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE, oldPersistence, newPersistence); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode#getPersistence Persistence}' reference. - * - * - * @param value the new value of the 'Persistence' reference. - * @see #getPersistence() - * @generated - */ - public void setPersistence(Persistence newPersistence) { - if (newPersistence != persistence) { - NotificationChain msgs = null; - if (persistence != null) - msgs = ((InternalEObject) persistence).eInverseRemove(this, PersistencePackage.PERSISTENCE__ROOT, Persistence.class, msgs); - if (newPersistence != null) - msgs = ((InternalEObject) newPersistence).eInverseAdd(this, PersistencePackage.PERSISTENCE__ROOT, Persistence.class, msgs); - msgs = basicSetPersistence(newPersistence, msgs); - if (msgs != null) - msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE, newPersistence, newPersistence)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE : - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE, msgs); - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE : - if (persistence != null) - msgs = ((InternalEObject) persistence).eInverseRemove(this, PersistencePackage.PERSISTENCE__ROOT, Persistence.class, msgs); - return basicSetPersistence((Persistence) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE : - return eBasicSetContainer(null, PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE, msgs); - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE : - return basicSetPersistence(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE : - return eInternalContainer().eInverseRemove(this, JpaCorePackage.JPA_FILE__CONTENT, JpaFile.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE : - return getJpaFile(); - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE : - if (resolve) - return getPersistence(); - return basicGetPersistence(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE : - setPersistence((Persistence) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE : - setPersistence((Persistence) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE : - return getJpaFile() != null; - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__PERSISTENCE : - return persistence != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (derivedFeatureID) { - default : - return -1; - } - } - if (baseClass == IJpaRootContentNode.class) { - switch (derivedFeatureID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE : - return JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == IJpaContentNode.class) { - switch (baseFeatureID) { - default : - return -1; - } - } - if (baseClass == IJpaRootContentNode.class) { - switch (baseFeatureID) { - case JpaCorePackage.IJPA_ROOT_CONTENT_NODE__JPA_FILE : - return PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE__JPA_FILE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - public void dispose() { - // TODO Auto-generated method stub - } - - public void handleJavaElementChangedEvent(ElementChangedEvent event) { - // TODO Auto-generated method stub - } - - public IJpaContentNode getContentNode(int offset) { - // TODO Auto-generated method stub - return null; - } - - public Object getId() { - return IPersistenceXmlContentNodes.PERSISTENCEXML_ROOT_ID; - } -} // PersistenceXmlRootContentNode diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Properties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Properties.java deleted file mode 100644 index 707f9da0a2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Properties.java +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import java.util.Collection; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * An implementation of the model object 'Properties'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.Properties#getProperties Properties}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperties() - * @model kind="class" - * @generated - */ -public class Properties extends XmlEObject -{ - /** - * The cached value of the '{@link #getProperties() Properties}' containment reference list. - * - * - * @see #getProperties() - * @generated - * @ordered - */ - protected EList properties; - - /** - * - * - * @generated - */ - protected Properties() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.PROPERTIES; - } - - /** - * Returns the value of the 'Properties' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.content.persistence.Property}. - * - * - * @return the value of the 'Properties' containment reference list. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperties_Properties() - * @model type="org.eclipse.jpt.core.internal.content.persistence.Property" containment="true" - * @generated - */ - public EList getProperties() { - if (properties == null) { - properties = new EObjectContainmentEList(Property.class, this, PersistencePackage.PROPERTIES__PROPERTIES); - } - return properties; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersistencePackage.PROPERTIES__PROPERTIES : - return ((InternalEList) getProperties()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.PROPERTIES__PROPERTIES : - return getProperties(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.PROPERTIES__PROPERTIES : - getProperties().clear(); - getProperties().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.PROPERTIES__PROPERTIES : - getProperties().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.PROPERTIES__PROPERTIES : - return properties != null && !properties.isEmpty(); - } - return super.eIsSet(featureID); - } -} //PropertiesImpl diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Property.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Property.java deleted file mode 100644 index b38ec0bdd4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Property.java +++ /dev/null @@ -1,237 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * An implementation of the model object 'Property'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.Property#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.content.persistence.Property#getValue Value}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperty() - * @model kind="class" - * @generated - */ -public class Property extends XmlEObject -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * - * - * @generated - */ - protected Property() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersistencePackage.Literals.PROPERTY; - } - - /** - * Returns the value of the 'Name' attribute. - * - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperty_Name() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true" - * @generated - */ - public String getName() { - return name; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.Property#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PROPERTY__NAME, oldName, name)); - } - - /** - * Returns the value of the 'Value' attribute. - * - * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getProperty_Value() - * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true" - * @generated - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.Property#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PROPERTY__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersistencePackage.PROPERTY__NAME : - return getName(); - case PersistencePackage.PROPERTY__VALUE : - return getValue(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersistencePackage.PROPERTY__NAME : - setName((String) newValue); - return; - case PersistencePackage.PROPERTY__VALUE : - setValue((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersistencePackage.PROPERTY__NAME : - setName(NAME_EDEFAULT); - return; - case PersistencePackage.PROPERTY__VALUE : - setValue(VALUE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersistencePackage.PROPERTY__NAME : - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case PersistencePackage.PROPERTY__VALUE : - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", value: "); - result.append(value); - result.append(')'); - return result.toString(); - } -} //PropertyImpl diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/BooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/BooleanTranslator.java deleted file mode 100644 index 14d7b96c12..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/BooleanTranslator.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class BooleanTranslator extends Translator -{ - public BooleanTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE); - } - - public BooleanTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE | style); - } - - public Object convertStringToValue(String strValue, EObject owner) { - return Boolean.valueOf(strValue); - } - - public String convertValueToString(Object value, EObject owner) { - return ((Boolean) value).toString(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/IPersistenceXmlContentNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/IPersistenceXmlContentNodes.java deleted file mode 100644 index 699518b3bb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/IPersistenceXmlContentNodes.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.jpt.core.internal.JptCorePlugin; - -public interface IPersistenceXmlContentNodes -{ - String PERSISTENCEXML_ROOT_ID = JptCorePlugin.PLUGIN_ID + ".persistencexml.Root"; - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/JavaClassRefTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/JavaClassRefTranslator.java deleted file mode 100644 index 2f32b413f7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/JavaClassRefTranslator.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class JavaClassRefTranslator extends Translator -{ - private static Translator[] children; - - - public JavaClassRefTranslator(String domNameAndPath, EStructuralFeature feature, int style) { - super(domNameAndPath, feature, style); - } - - public JavaClassRefTranslator(String domNameAndPath, EStructuralFeature feature) { - super(domNameAndPath, feature); - } - - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - private static Translator[] createChildren() { - return new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, PersistencePackage.eINSTANCE.getJavaClassRef_JavaClass()) - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/MappingFileTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/MappingFileTranslator.java deleted file mode 100644 index d38858bc43..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/MappingFileTranslator.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class MappingFileTranslator extends Translator -{ - private static Translator[] children; - - - public MappingFileTranslator(String domNameAndPath, EStructuralFeature feature, int style) { - super(domNameAndPath, feature, style); - } - - public MappingFileTranslator(String domNameAndPath, EStructuralFeature feature) { - super(domNameAndPath, feature); - } - - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - private static Translator[] createChildren() { - return new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, PersistencePackage.eINSTANCE.getMappingFileRef_FileName()) - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceResource.java deleted file mode 100644 index d05495ab4d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceResource.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.wst.common.internal.emf.resource.Renderer; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResource; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl; - -public class PersistenceResource extends TranslatorResourceImpl -{ - - public PersistenceResource(Renderer aRenderer) { - super(aRenderer); - } - - public PersistenceResource(URI uri, Renderer aRenderer) { - super(uri, aRenderer); - } - - /** - * @see TranslatorResourceImpl#getDefaultPublicId() - */ - protected String getDefaultPublicId() { - return null; - // only applicable for DTD-based files - } - - /** - * @see TranslatorResourceImpl#getDefaultSystemId() - */ - protected String getDefaultSystemId() { - return null; - // only applicable for DTD-based files - } - - /** - * @see TranslatorResourceImpl#getDefaultVersionId() - */ - protected int getDefaultVersionID() { - return 10; - // this seems to be the default version of the spec for this doc - // and the id 10 maps to the version 1.0 - } - - /** - * @see TranslatorResource#getDoctype() - */ - public String getDoctype() { - return null; - // only applicable for DTD-based files - } - - /** - * @see TranslatorResource#getRootTranslator() - */ - public Translator getRootTranslator() { - return PersistenceTranslator.INSTANCE; - } - - /** - * @see PersistenceResource#getPersistence() - */ - public Persistence getPersistence() { - return (Persistence) getRootObject(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceTranslator.java deleted file mode 100644 index 123d1815e3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceTranslator.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class PersistenceTranslator extends RootTranslator - implements PersistenceXMLMapper -{ - public static PersistenceTranslator INSTANCE = new PersistenceTranslator(); - - private static Translator[] children; - - private static PersistencePackage PERSISTENCE_PKG = PersistencePackage.eINSTANCE; - - - public PersistenceTranslator() { - super(PERSISTENCE, PERSISTENCE_PKG.eINSTANCE.getPersistence()); - } - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - private static Translator[] createChildren() { - return new Translator[] { - IDTranslator.INSTANCE, - createVersionTranslator(), - new ConstantAttributeTranslator(XML_NS, PERSISTENCE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, PERSISTENCE_NS_URL + ' ' + PERSISTENCE_SCHEMA_LOC_1_0), - createPersistenceUnitTranslator() - }; - } - - private static Translator createVersionTranslator() { - return new Translator(PERSISTENCE_VERSION, PERSISTENCE_PKG.getPersistence_Version(), DOM_ATTRIBUTE); - } - - private static Translator createPersistenceUnitTranslator() { - GenericTranslator translator = new GenericTranslator(PERSISTENCE_UNIT, PERSISTENCE_PKG.getPersistence_PersistenceUnits()); - translator.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - createPersistenceUnitNameTranslator(), - createTransactionTypeTranslator(), - createPersistenceUnitDescriptionTranslator(), - createPersistenceUnitProviderTranslator(), - createJtaDataSourceTranslator(), - createNonJtaDataSourceTranslator(), - createMappingFileTranslator(), - createJarFileTranslator(), - createClassTranslator(), - createExcludeUnlistedClassesTranslator(), - createPropertiesTranslator() - } - ); - return translator; - } - - private static Translator createPersistenceUnitNameTranslator() { - return new Translator(PERSISTENCE_UNIT_NAME, PERSISTENCE_PKG.getPersistenceUnit_Name(), DOM_ATTRIBUTE); - } - - private static Translator createTransactionTypeTranslator() { - return new TransactionTypeTranslator(); - } - - private static Translator createPersistenceUnitDescriptionTranslator() { - return new Translator(PERSISTENCE_UNIT_DESCRIPTION, PERSISTENCE_PKG.getPersistenceUnit_Description()); - } - - private static Translator createPersistenceUnitProviderTranslator() { - return new Translator(PERSISTENCE_UNIT_PROVIDER, PERSISTENCE_PKG.getPersistenceUnit_Provider(), UNSET_IF_NULL); - } - - private static Translator createJtaDataSourceTranslator() { - return new Translator(JTA_DATA_SOURCE, PERSISTENCE_PKG.getPersistenceUnit_JtaDataSource()); - } - - private static Translator createNonJtaDataSourceTranslator() { - return new Translator(NON_JTA_DATA_SOURCE, PERSISTENCE_PKG.getPersistenceUnit_NonJtaDataSource()); - } - - private static Translator createMappingFileTranslator() { - return new MappingFileTranslator(MAPPING_FILE, PERSISTENCE_PKG.getPersistenceUnit_MappingFiles()); - } - - private static Translator createJarFileTranslator() { - return new Translator(JAR_FILE, PERSISTENCE_PKG.getPersistenceUnit_JarFiles()); - } - - private static Translator createClassTranslator() { - return new JavaClassRefTranslator(CLASS, PERSISTENCE_PKG.getPersistenceUnit_Classes()); - } - - private static Translator createExcludeUnlistedClassesTranslator() { - return new BooleanTranslator(EXCLUDE_UNLISTED_CLASSES, PERSISTENCE_PKG.getPersistenceUnit_ExcludeUnlistedClasses(), UNSET_IF_NULL); - } - - private static Translator createPropertiesTranslator() { - GenericTranslator translator = new GenericTranslator(PROPERTIES, PERSISTENCE_PKG.getPersistenceUnit_Properties()); - translator.setChildren( - new Translator[] { - createPropertyTranslator() - } - ); - return translator; - } - - private static Translator createPropertyTranslator() { - GenericTranslator translator = new GenericTranslator(PROPERTY, PERSISTENCE_PKG.getProperties_Properties()); - translator.setChildren( - new Translator[] { - createPropertyNameTranslator(), - createPropertyValueTranslator() - } - ); - return translator; - } - - private static Translator createPropertyNameTranslator() { - return new Translator(PROPERTY_NAME, PERSISTENCE_PKG.getProperty_Name()); - } - - private static Translator createPropertyValueTranslator() { - return new Translator(PROPERTY_VALUE, PERSISTENCE_PKG.getProperty_Value()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXMLMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXMLMapper.java deleted file mode 100644 index ffd05ea9ab..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXMLMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -public interface PersistenceXMLMapper -{ - String XML_NS = "xmlns"; //$NON-NLS-1$ - String XML_NS_XSI = "xmlns:xsi"; //$NON-NLS-1$ - String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$ - String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$ - String PERSISTENCE_NS_URL = "http://java.sun.com/xml/ns/persistence"; //$NON-NLS-1$ - String PERSISTENCE_SCHEMA_LOC_1_0 = "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"; //$NON-NLS-1$ - - - String PERSISTENCE = "persistence"; //$NON-NLS-1$ - String PERSISTENCE_VERSION = "version"; //$NON-NLS-1$ - String PERSISTENCE_UNIT = "persistence-unit"; //$NON-NLS-1$ - String PERSISTENCE_UNIT_NAME = "name"; //$NON-NLS-1$ - String PERSISTENCE_UNIT_DESCRIPTION = "description"; //$NON-NLS-1$ - String PERSISTENCE_UNIT_PROVIDER = "provider"; //$NON-NLS-1$ - String JTA_DATA_SOURCE = "jta-data-source"; //$NON-NLS-1$ - String NON_JTA_DATA_SOURCE = "non-jta-data-source"; //$NON-NLS-1$ - String MAPPING_FILE = "mapping-file"; //$NON-NLS-1$ - String JAR_FILE = "jar-file"; //$NON-NLS-1$ - String CLASS = "class"; //$NON-NLS-1$ - String EXCLUDE_UNLISTED_CLASSES = "exclude-unlisted-classes"; //$NON-NLS-1$ - String PROPERTIES = "properties"; //$NON-NLS-1$ - String PROPERTY = "property"; //$NON-NLS-1$ - String PROPERTY_NAME = "name"; //$NON-NLS-1$ - String PROPERTY_VALUE = "value"; //$NON-NLS-1$ - String TRANSACTION_TYPE = "transaction-type"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXmlResourceFactory.java deleted file mode 100644 index ee8a066f16..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXmlResourceFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry; -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; -import org.eclipse.wst.xml.core.internal.emf2xml.EMF2DOMSSERendererFactory; - -public class PersistenceXmlResourceFactory extends TranslatorResourceFactory -{ - public static final String PERSISTENCE_XML_FILE_NAME = "persistence.xml"; //$NON-NLS-1$ - public static final URI PERSISTENCE_XML_FILE_URI = URI.createURI(PERSISTENCE_XML_FILE_NAME); //$NON-NLS-1$ - - /** - * Register myself with the Resource.Factory.Registry - */ - public static void registerWith(RendererFactory rendererFactory) { - WTPResourceFactoryRegistry.INSTANCE.registerLastFileSegment(PERSISTENCE_XML_FILE_NAME, new PersistenceXmlResourceFactory(rendererFactory)); - } - - /** - * Register myself using the default renderer factory. - * @see #registerWith(RendererFactory) - */ - public static void register() { - registerWith(EMF2DOMSSERendererFactory.INSTANCE); - } - - public static Resource.Factory getRegisteredFactory() { - return WTPResourceFactoryRegistry.INSTANCE.getFactory(PERSISTENCE_XML_FILE_URI); - } - - public PersistenceXmlResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) { - super(aRendererFactory, listeningForUpdates); - } - - public PersistenceXmlResourceFactory(RendererFactory aRendererFactory) { - super(aRendererFactory); - } - - /** - * @see TranslatorResourceFactory#createResource(URI, Renderer) - */ - protected TranslatorResource createResource(URI uri, Renderer renderer) { - return new PersistenceResource(uri, renderer); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/TransactionTypeTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/TransactionTypeTranslator.java deleted file mode 100644 index acd5b18ab5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/TransactionTypeTranslator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class TransactionTypeTranslator extends Translator - implements PersistenceXMLMapper -{ - public TransactionTypeTranslator() { - super(TRANSACTION_TYPE, PersistencePackage.eINSTANCE.getPersistenceUnit_TransactionType()); - } - - public Object convertStringToValue(String strValue, EObject owner) { - String adjStrValue = strValue; - String jtaStrValue = PersistenceUnitTransactionType.JTA.getName(); - String resourceLocalStrValue = PersistenceUnitTransactionType.RESOURCE_LOCAL.getName(); - - if (jtaStrValue.equals(strValue.toUpperCase())) { //$NON-NLS-1$ - adjStrValue = jtaStrValue; - } - else if (resourceLocalStrValue.equals(strValue.toUpperCase())) { //$NON-NLS-1$ - adjStrValue = resourceLocalStrValue; - } - return super.convertStringToValue(adjStrValue, owner); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceAdapterFactory.java deleted file mode 100644 index 3c41f5b943..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceAdapterFactory.java +++ /dev/null @@ -1,384 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IXmlEObject; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.persistence.JavaClassRef; -import org.eclipse.jpt.core.internal.content.persistence.MappingFileRef; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode; -import org.eclipse.jpt.core.internal.content.persistence.Properties; -import org.eclipse.jpt.core.internal.content.persistence.Property; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage - * @generated - */ -public class PersistenceAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static PersistencePackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public PersistenceAdapterFactory() { - if (modelPackage == null) { - modelPackage = PersistencePackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the createXXX methods. - * - * - * @generated - */ - protected PersistenceSwitch modelSwitch = new PersistenceSwitch() { - @Override - public Adapter casePersistenceXmlRootContentNode(PersistenceXmlRootContentNode object) { - return createPersistenceXmlRootContentNodeAdapter(); - } - - @Override - public Adapter casePersistence(Persistence object) { - return createPersistenceAdapter(); - } - - @Override - public Adapter casePersistenceUnit(PersistenceUnit object) { - return createPersistenceUnitAdapter(); - } - - @Override - public Adapter caseMappingFileRef(MappingFileRef object) { - return createMappingFileRefAdapter(); - } - - @Override - public Adapter caseJavaClassRef(JavaClassRef object) { - return createJavaClassRefAdapter(); - } - - @Override - public Adapter caseProperties(Properties object) { - return createPropertiesAdapter(); - } - - @Override - public Adapter caseProperty(Property object) { - return createPropertyAdapter(); - } - - @Override - public Adapter caseIJpaEObject(IJpaEObject object) { - return createIJpaEObjectAdapter(); - } - - @Override - public Adapter caseJpaEObject(JpaEObject object) { - return createJpaEObjectAdapter(); - } - - @Override - public Adapter caseIJpaSourceObject(IJpaSourceObject object) { - return createIJpaSourceObjectAdapter(); - } - - @Override - public Adapter caseIXmlEObject(IXmlEObject object) { - return createIXmlEObjectAdapter(); - } - - @Override - public Adapter caseXmlEObject(XmlEObject object) { - return createXmlEObjectAdapter(); - } - - @Override - public Adapter caseIJpaContentNode(IJpaContentNode object) { - return createIJpaContentNodeAdapter(); - } - - @Override - public Adapter caseIJpaRootContentNode(IJpaRootContentNode object) { - return createIJpaRootContentNodeAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.Persistence Persistence}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.Persistence - * @generated - */ - public Adapter createPersistenceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit Unit}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit - * @generated - */ - public Adapter createPersistenceUnitAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef Mapping File Ref}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.MappingFileRef - * @generated - */ - public Adapter createMappingFileRefAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef Java Class Ref}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.JavaClassRef - * @generated - */ - public Adapter createJavaClassRefAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.Properties Properties}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.Properties - * @generated - */ - public Adapter createPropertiesAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.Property Property}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.Property - * @generated - */ - public Adapter createPropertyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public Adapter createIJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaEObject - * @generated - */ - public Adapter createJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public Adapter createIJpaSourceObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IXmlEObject IXml EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IXmlEObject - * @generated - */ - public Adapter createIXmlEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode Xml Root Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode - * @generated - */ - public Adapter createPersistenceXmlRootContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.XmlEObject Xml EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.XmlEObject - * @generated - */ - public Adapter createXmlEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @generated - */ - public Adapter createIJpaContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @generated - */ - public Adapter createIJpaRootContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } -} //PersistenceInternalAdapterFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceSwitch.java deleted file mode 100644 index 3096f60cb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceSwitch.java +++ /dev/null @@ -1,455 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.content.persistence.util; - -import java.util.List; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IXmlEObject; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.persistence.JavaClassRef; -import org.eclipse.jpt.core.internal.content.persistence.MappingFileRef; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode; -import org.eclipse.jpt.core.internal.content.persistence.Properties; -import org.eclipse.jpt.core.internal.content.persistence.Property; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage - * @generated - */ -public class PersistenceSwitch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static PersistencePackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public PersistenceSwitch() { - if (modelPackage == null) { - modelPackage = PersistencePackage.eINSTANCE; - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List eSuperTypes = theEClass.getESuperTypes(); - return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case PersistencePackage.PERSISTENCE_XML_ROOT_CONTENT_NODE : { - PersistenceXmlRootContentNode persistenceXmlRootContentNode = (PersistenceXmlRootContentNode) theEObject; - T result = casePersistenceXmlRootContentNode(persistenceXmlRootContentNode); - if (result == null) - result = caseXmlEObject(persistenceXmlRootContentNode); - if (result == null) - result = caseIJpaRootContentNode(persistenceXmlRootContentNode); - if (result == null) - result = caseJpaEObject(persistenceXmlRootContentNode); - if (result == null) - result = caseIXmlEObject(persistenceXmlRootContentNode); - if (result == null) - result = caseIJpaContentNode(persistenceXmlRootContentNode); - if (result == null) - result = caseIJpaEObject(persistenceXmlRootContentNode); - if (result == null) - result = caseIJpaSourceObject(persistenceXmlRootContentNode); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case PersistencePackage.PERSISTENCE : { - Persistence persistence = (Persistence) theEObject; - T result = casePersistence(persistence); - if (result == null) - result = caseXmlEObject(persistence); - if (result == null) - result = caseJpaEObject(persistence); - if (result == null) - result = caseIXmlEObject(persistence); - if (result == null) - result = caseIJpaEObject(persistence); - if (result == null) - result = caseIJpaSourceObject(persistence); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case PersistencePackage.PERSISTENCE_UNIT : { - PersistenceUnit persistenceUnit = (PersistenceUnit) theEObject; - T result = casePersistenceUnit(persistenceUnit); - if (result == null) - result = caseXmlEObject(persistenceUnit); - if (result == null) - result = caseJpaEObject(persistenceUnit); - if (result == null) - result = caseIXmlEObject(persistenceUnit); - if (result == null) - result = caseIJpaEObject(persistenceUnit); - if (result == null) - result = caseIJpaSourceObject(persistenceUnit); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case PersistencePackage.MAPPING_FILE_REF : { - MappingFileRef mappingFileRef = (MappingFileRef) theEObject; - T result = caseMappingFileRef(mappingFileRef); - if (result == null) - result = caseXmlEObject(mappingFileRef); - if (result == null) - result = caseJpaEObject(mappingFileRef); - if (result == null) - result = caseIXmlEObject(mappingFileRef); - if (result == null) - result = caseIJpaEObject(mappingFileRef); - if (result == null) - result = caseIJpaSourceObject(mappingFileRef); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case PersistencePackage.JAVA_CLASS_REF : { - JavaClassRef javaClassRef = (JavaClassRef) theEObject; - T result = caseJavaClassRef(javaClassRef); - if (result == null) - result = caseXmlEObject(javaClassRef); - if (result == null) - result = caseJpaEObject(javaClassRef); - if (result == null) - result = caseIXmlEObject(javaClassRef); - if (result == null) - result = caseIJpaEObject(javaClassRef); - if (result == null) - result = caseIJpaSourceObject(javaClassRef); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case PersistencePackage.PROPERTIES : { - Properties properties = (Properties) theEObject; - T result = caseProperties(properties); - if (result == null) - result = caseXmlEObject(properties); - if (result == null) - result = caseJpaEObject(properties); - if (result == null) - result = caseIXmlEObject(properties); - if (result == null) - result = caseIJpaEObject(properties); - if (result == null) - result = caseIJpaSourceObject(properties); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case PersistencePackage.PROPERTY : { - Property property = (Property) theEObject; - T result = caseProperty(property); - if (result == null) - result = caseXmlEObject(property); - if (result == null) - result = caseJpaEObject(property); - if (result == null) - result = caseIXmlEObject(property); - if (result == null) - result = caseIJpaEObject(property); - if (result == null) - result = caseIJpaSourceObject(property); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpretting the object as an instance of 'Persistence'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Persistence'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistence(Persistence object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Unit'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Unit'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceUnit(PersistenceUnit object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Mapping File Ref'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Mapping File Ref'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMappingFileRef(MappingFileRef object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Java Class Ref'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Java Class Ref'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaClassRef(JavaClassRef object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Properties'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Properties'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseProperties(Properties object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Property'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Property'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseProperty(Property object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaEObject(IJpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaEObject(JpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Source Object'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Source Object'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaSourceObject(IJpaSourceObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IXml EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IXml EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIXmlEObject(IXmlEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml Root Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml Root Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersistenceXmlRootContentNode(PersistenceXmlRootContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEObject(XmlEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaContentNode(IJpaContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaRootContentNode(IJpaRootContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } -} //PersistenceInternalSwitch diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java deleted file mode 100644 index 65e0176227..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal.emfutility; - -import org.w3c.dom.Node; - -public class DOMUtilities - extends org.eclipse.wst.common.internal.emf.utilities.DOMUtilities -{ - /** - * Get the attribute Node with the specified name - */ - static public Node getChildAttributeNode(Node node, String attributeName) { - return node.getAttributes().getNamedItem(attributeName); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/IJpaFacetDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/IJpaFacetDataModelProperties.java deleted file mode 100644 index b9d61dabb1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/IJpaFacetDataModelProperties.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.facet; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; - -public interface IJpaFacetDataModelProperties extends IDataModelProperties -{ - /** - * Required, type String, identifies Jpa Platform - */ - public static final String PLATFORM_ID = "IJpaFacetDataModelProperties.PLATFORM_ID"; - - /** - * Not required, type String, identifies database connection - */ - public static final String CONNECTION = "IJpaFacetDataModelProperties.CONNECTION"; - - /** - * Internal, type IRuntime, identifies runtime associated with project - * Used only in conjunction with validation of other properties, because this information - * is otherwise inaccessible to this data model - */ - public static final String RUNTIME = "IJpaFacetDataModelProperties.RUNTIME"; - - /** - * Required, type boolean, identifies whether server runtime provides - * JPA implementation - * If this is true, then the property JPA_LIBRARY is not used - */ - public static final String USE_SERVER_JPA_IMPLEMENTATION = "IJpaFacetDataModelProperties.USE_SERVER_JPA_IMPLEMENTATION"; - - /** - * Not required, type String, identifies JPA implementation library. - * Only used if the property USE_SERVER_JPA_IMPLEMENTATION is false. - */ - public static final String JPA_LIBRARY = "IJpaFacetDataModelProperties.JPA_LIBRARY"; - - /** - * Required, type boolean, identifies whether all annotated classes are to be automatically - * included as part of all persistence units - */ - public static final String DISCOVER_ANNOTATED_CLASSES = "IJpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES"; - - /** - * Required, type boolean, details whether orm.xml should be created - */ - public static final String CREATE_ORM_XML = "IJpaFacetDataModelProperties.CREATE_ORM_XML"; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java deleted file mode 100644 index 5703ecb580..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.facet; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.Set; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jpt.core.internal.JptCoreMessages; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.platform.generic.GenericPlatform; -import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public class JpaFacetDataModelProvider - extends FacetInstallDataModelProvider - implements IJpaFacetDataModelProperties -{ - public JpaFacetDataModelProvider() { - super(); - } - - - @Override - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(PLATFORM_ID); - propertyNames.add(CONNECTION); - propertyNames.add(RUNTIME); - propertyNames.add(USE_SERVER_JPA_IMPLEMENTATION); - propertyNames.add(JPA_LIBRARY); - propertyNames.add(DISCOVER_ANNOTATED_CLASSES); - propertyNames.add(CREATE_ORM_XML); - return propertyNames; - } - - @Override - public Object getDefaultProperty(String propertyName) { - if (FACET_ID.equals(propertyName)) { - return JptCorePlugin.FACET_ID; - } - else if (PLATFORM_ID.equals(propertyName)) { - return GenericPlatform.ID; - } - else if (CONNECTION.equals(propertyName)) { - return ""; - } - else if (RUNTIME.equals(propertyName)) { - return null; - } - else if (USE_SERVER_JPA_IMPLEMENTATION.equals(propertyName)) { - return runtimeSupportsEjb30(getRuntime()); - } - else if (JPA_LIBRARY.equals(propertyName)) { - return JptCorePlugin.getPlugin().getPluginPreferences() - .getString(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB); - } - else if (DISCOVER_ANNOTATED_CLASSES.equals(propertyName)) { - return runtimeSupportsEjb30(getRuntime()); - } - else if (CREATE_ORM_XML.equals(propertyName)) { - return true; - } - else { - return super.getDefaultProperty(propertyName); - } - } - - @Override - public boolean propertySet(String propertyName, Object propertyValue) { - boolean ok = super.propertySet(propertyName, propertyValue); - if (RUNTIME.equals(propertyName)) { - model.notifyPropertyChange(USE_SERVER_JPA_IMPLEMENTATION, IDataModel.DEFAULT_CHG); - model.notifyPropertyChange(DISCOVER_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG); - } - return ok; - } - - @Override - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - if (JPA_LIBRARY.equals(propertyName)) { - String[] libraries = JavaCore.getUserLibraryNames(); - DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[libraries.length + 1]; - - for (int i = 0; i < libraries.length ; i ++) { - descriptors[i + 1] = new DataModelPropertyDescriptor(libraries[i], libraries[i]); - } - - if(descriptors.length > 2){ - Arrays.sort(descriptors, 0, descriptors.length - 2, - new Comparator() { - public int compare(Object arg0, Object arg1) { - DataModelPropertyDescriptor d1 = (DataModelPropertyDescriptor)arg0; - DataModelPropertyDescriptor d2 = (DataModelPropertyDescriptor)arg1; - return d1.getPropertyDescription().compareTo(d2.getPropertyDescription()); - } - } - ); - } - - descriptors[0] = new DataModelPropertyDescriptor("", WTPCommonPlugin.getResourceString(WTPCommonMessages.RUNTIME_NONE, null)); - return descriptors; - } - - return super.getValidPropertyDescriptors(propertyName); - } - - @Override - public IStatus validate(String name) { - if (PLATFORM_ID.equals(name)) { - return validatePlatform(getStringProperty(name)); - } - else if (CONNECTION.equals(name)) { - return validateConnection(getStringProperty(name)); - } - else if (USE_SERVER_JPA_IMPLEMENTATION.equals(name) || JPA_LIBRARY.equals(name)) { - return validateJpaLibrary(); - } - else if (DISCOVER_ANNOTATED_CLASSES.equals(name)) { - return validatePersistentClassManagement(); - } - else { - return super.validate(name); - } - } - - private IRuntime getRuntime() { - return (IRuntime) getProperty(RUNTIME); - } - - private boolean runtimeSupportsEjb30(IRuntime runtime) { - IProjectFacetVersion ejb30 = ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EJB_MODULE).getVersion("3.0"); - return (runtime == null) ? false : runtime.supports(ejb30); - } - - private IStatus validatePlatform(String platformId) { - if (platformId == null || platformId.equals("")) { - return new Status(IStatus.ERROR, JptCorePlugin.PLUGIN_ID, JptCoreMessages.VALIDATE_PLATFORM_NOT_SPECIFIED); - } - else { - return OK_STATUS; - } - } - - private IStatus validateConnection(String connectionName) { - if (connectionName == null || connectionName.equals("") || ! ConnectionProfileRepository.instance().getConnectionWithProfileNamed(connectionName).isConnected()) { - return new Status(IStatus.INFO, JptCorePlugin.PLUGIN_ID, JptCoreMessages.VALIDATE_CONNECTION_NOT_CONNECTED); - } - else { - return OK_STATUS; - } - } - - private IStatus validateJpaLibrary() { - if (getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION)) { - IRuntime runtime = getRuntime(); - if (runtime == null) { - return new Status(IStatus.WARNING, JptCorePlugin.PLUGIN_ID, JptCoreMessages.VALIDATE_RUNTIME_NOT_SPECIFIED); - } - if (! runtimeSupportsEjb30(runtime)) { - return new Status(IStatus.WARNING, JptCorePlugin.PLUGIN_ID, JptCoreMessages.VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30); - } - } - else { - if (StringTools.stringIsEmpty(getStringProperty(JPA_LIBRARY))) { - return new Status(IStatus.WARNING, JptCorePlugin.PLUGIN_ID, JptCoreMessages.VALIDATE_LIBRARY_NOT_SPECIFIED); - } - } - return OK_STATUS; - } - - private IStatus validatePersistentClassManagement() { - // warning if "discovery" is used, but no runtime specified ?? - return OK_STATUS; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java deleted file mode 100644 index 288e9b1261..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.facet; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil; -import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public class JpaFacetInstallDelegate - implements IDelegate, IJpaFacetDataModelProperties -{ - public void execute(IProject project, IProjectFacetVersion fv, - Object config, IProgressMonitor monitor) throws CoreException { - - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - - // NB: WTP Natures (including the JavaEMFNature) - // should already be added as this facet should - // always coexist with a module facet. - - IJavaProject javaProject = JavaCore.create(project); - - boolean usesServerLibrary = ((IDataModel) config).getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION); - String jpaLibrary = ((IDataModel) config).getStringProperty(JPA_LIBRARY); - if (! usesServerLibrary && ! StringTools.stringIsEmpty(jpaLibrary)) { - IClasspathEntry[] classpath = javaProject.getRawClasspath(); - int newLength = classpath.length + 1; - boolean isWebApp = FacetedProjectFramework.hasProjectFacet(project, IModuleConstants.JST_WEB_MODULE); - IClasspathAttribute[] attributes; - if (! isWebApp && J2EEProjectUtilities.isStandaloneProject(project)) { - attributes = new IClasspathAttribute[0]; - } - else { - attributes = new IClasspathAttribute[] { - JavaCore.newClasspathAttribute( - IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY, - ClasspathDependencyUtil.getDefaultRuntimePath(isWebApp).toString() - ) - }; - } - IClasspathEntry jpaLibraryEntry = - JavaCore.newContainerEntry( - new Path(JavaCore.USER_LIBRARY_CONTAINER_ID + "/" + jpaLibrary), - null, attributes, true); - IClasspathEntry[] newClasspath = new IClasspathEntry[newLength]; - System.arraycopy(classpath, 0, newClasspath, 0, newLength - 1); - newClasspath[newLength - 1] = jpaLibraryEntry; - - javaProject.setRawClasspath(newClasspath, monitor); - } - - if (monitor != null) { - monitor.worked(1); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java deleted file mode 100644 index eea3c1457a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.facet; - -import java.io.IOException; -import java.util.Iterator; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase; -import org.eclipse.jpt.core.internal.JpaModelManager; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.OrmXmlResource; -import org.eclipse.jpt.core.internal.content.persistence.MappingFileRef; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceFactory; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceResource; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public class JpaFacetPostInstallDelegate - implements IDelegate, IJpaFacetDataModelProperties -{ - private final static String ORM_XML_FILE_PATH = "META-INF/orm.xml"; - - public void execute(IProject project, IProjectFacetVersion fv, - Object config, IProgressMonitor monitor) throws CoreException { - - if (monitor != null) { - monitor.beginTask("", 2); //$NON-NLS-1$ - } - - JpaModelManager.instance().createJpaProject(project); - IDataModel dataModel = (IDataModel) config; - JpaFacetUtils.setPlatform(project, dataModel.getStringProperty(PLATFORM_ID)); - JpaFacetUtils.setConnectionName(project, dataModel.getStringProperty(CONNECTION)); - JpaFacetUtils.setDiscoverAnnotatedClasses(project, dataModel.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES)); - - createPersistenceXml(project, dataModel); - - if (dataModel.getBooleanProperty(CREATE_ORM_XML)) { - createOrmXml(project, dataModel); - } - - if (monitor != null) { - monitor.worked(1); - } - - JpaModelManager.instance().fillJpaProject(project); - - if (monitor != null) { - monitor.worked(2); - } - } - - private void createPersistenceXml(IProject project, IDataModel dataModel) { - String sourceFolder = computeSourceFolder(project); - - URI fileURI = URI.createPlatformResourceURI(sourceFolder + "/META-INF/persistence.xml", false); - PersistenceResource resource = (PersistenceResource) getResourceSet(project).createResource(fileURI); - Persistence persistence = PersistenceFactory.eINSTANCE.createPersistence(); - persistence.setVersion("1.0"); - PersistenceUnit pUnit = PersistenceFactory.eINSTANCE.createPersistenceUnit(); - pUnit.setName(project.getName()); - - if (dataModel.getBooleanProperty(CREATE_ORM_XML)) { - MappingFileRef mappingFile = PersistenceFactory.eINSTANCE.createMappingFileRef(); - mappingFile.setFileName(ORM_XML_FILE_PATH); - pUnit.getMappingFiles().add(mappingFile); - } - - persistence.getPersistenceUnits().add(pUnit); - - try { - resource.getContents().add(persistence); - resource.save(null); - } - catch (IOException e) { - JptCorePlugin.log(e); - } - } - - private void createOrmXml(IProject project, IDataModel dataModel) { - String sourceFolder = computeSourceFolder(project); - - URI fileURI = URI.createPlatformResourceURI(sourceFolder + "/" + ORM_XML_FILE_PATH, false); - OrmXmlResource resource = (OrmXmlResource) getResourceSet(project).createResource(fileURI); - EntityMappingsInternal entityMappings = OrmFactory.eINSTANCE.createEntityMappingsInternal(); - entityMappings.setVersion("1.0"); - - try { - resource.getContents().add(entityMappings); - resource.save(null); - } - catch (IOException e) { - JptCorePlugin.log(e); - } - } - - private String computeSourceFolder(IProject project) { - IJavaProject jproject = JavaCore.create(project); - IClasspathEntry[] classpath; - - try { - classpath = jproject.getRawClasspath(); - } - catch (JavaModelException jme) { - classpath = new IClasspathEntry[0]; - } - - for (Iterator stream = CollectionTools.iterator(classpath); stream.hasNext(); ) { - IClasspathEntry next = (IClasspathEntry) stream.next(); - if (next.getEntryKind() == IClasspathEntry.CPE_SOURCE) { - return next.getPath().toString(); - } - } - - return "/" + project.getName(); - } - - private ResourceSet getResourceSet(IProject project) { - return WorkbenchResourceHelperBase.getResourceSet(project); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java deleted file mode 100644 index f887b17b26..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.facet; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JpaModelManager; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.wst.common.project.facet.core.IDelegate; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public class JpaFacetUninstallDelegate - implements IDelegate -{ - public void execute(IProject project, IProjectFacetVersion fv, - Object config, IProgressMonitor monitor) throws CoreException { - - if (monitor != null) { - monitor.beginTask("", 2); //$NON-NLS-1$ - } - - // TODO - // - remove classpath items? - // - remove persistence.xml - - IJpaProject jpaProject = JpaModelManager.instance().getJpaModel().getJpaProject(project); - if (jpaProject != null) { - JpaModelManager.instance().disposeJpaProject(jpaProject); - } - - if (monitor != null) { - monitor.worked(1); - } - - ResourcesPlugin.getWorkspace().deleteMarkers(project.findMarkers(JptCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE)); - - if (monitor != null) { - monitor.worked(1); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java deleted file mode 100644 index 9368188aa1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.facet; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ProjectScope; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.jpt.core.internal.IJpaCoreConstants; -import org.eclipse.jpt.core.internal.JpaPlatformRegistry; -import org.eclipse.jpt.core.internal.JpaProject; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.platform.generic.GenericPlatform; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.osgi.service.prefs.BackingStoreException; - -public class JpaFacetUtils -{ - private static QualifiedName CONNECTION_KEY = - new QualifiedName(JptCorePlugin.PLUGIN_ID, IJpaCoreConstants.DATA_SOURCE_CONNECTION_NAME); - - - /** - * Private constructor - static class only - */ - private JpaFacetUtils() {} - - - public static String getPlatform(final IProject project) { - final IScopeContext context = new ProjectScope(project); - final IEclipsePreferences prefs = context.getNode(JptCorePlugin.PLUGIN_ID); - - String platformId = prefs.get(IJpaCoreConstants.JPA_PLATFORM, null); - - if (platformId == null) { - try { - setPlatform(project, GenericPlatform.ID); - } - catch (CoreException ce) { - // do nothing. not sure what can be done here. - } - return GenericPlatform.ID; - } - - return platformId; - } - - public static void setPlatform(final IProject project, String jpaPlatformId) - throws CoreException - { - final IScopeContext context = new ProjectScope(project); - final IEclipsePreferences prefs = context.getNode(JptCorePlugin.PLUGIN_ID); - - JpaProject jpaProject = (JpaProject) JptCorePlugin.getJpaProject(project); - - if (jpaProject == null) { - throw new IllegalArgumentException(project.getName()); - } - - if (JpaPlatformRegistry.INSTANCE.getJpaPlatform(jpaPlatformId) == null) { - throw new IllegalArgumentException(jpaPlatformId); - } - - jpaProject.setPlatform(jpaPlatformId); - prefs.put(IJpaCoreConstants.JPA_PLATFORM, jpaPlatformId); - - try { - prefs.flush(); - } - catch( BackingStoreException e ) { - JptCorePlugin.log(e); - } - } - - public static String getConnectionName(final IProject project) { - try { - return project.getPersistentProperty(CONNECTION_KEY); - } - catch (CoreException ce) { - return null; - } - } - - public static void setConnectionName(final IProject project, String connectionName) - throws CoreException - { - JpaProject jpaProject = (JpaProject) JptCorePlugin.getJpaProject(project); - - if (jpaProject == null) { - throw new IllegalArgumentException(project.getName()); - } - - if (ConnectionProfileRepository.instance().getConnectionWithProfileNamed(connectionName) == null) { - throw new IllegalArgumentException(connectionName); - } - - jpaProject.setDataSource(connectionName); - project.setPersistentProperty(CONNECTION_KEY, connectionName); - } - - public static boolean getDiscoverAnnotatedClasses(final IProject project) { - final IScopeContext context = new ProjectScope(project); - final IEclipsePreferences prefs = context.getNode(JptCorePlugin.PLUGIN_ID); - - return prefs.getBoolean(IJpaCoreConstants.DISCOVER_ANNOTATED_CLASSES, false); - } - - public static void setDiscoverAnnotatedClasses(final IProject project, boolean discoverAnnotatedClasses) - throws CoreException - { - final IScopeContext context = new ProjectScope(project); - final IEclipsePreferences prefs = context.getNode(JptCorePlugin.PLUGIN_ID); - - JpaProject jpaProject = (JpaProject) JptCorePlugin.getJpaProject(project); - - if (jpaProject == null) { - throw new IllegalArgumentException(project.getName()); - } - - jpaProject.setDiscoverAnnotatedClasses(discoverAnnotatedClasses); - prefs.putBoolean(IJpaCoreConstants.DISCOVER_ANNOTATED_CLASSES, discoverAnnotatedClasses); - - try { - prefs.flush(); - } - catch(BackingStoreException e) { - JptCorePlugin.log(e); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java deleted file mode 100644 index 41ca85b17c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Straightforward implementation of ITextRange that adapts an ASTNode. - */ -public class ASTNodeTextRange implements ITextRange { - private final ASTNode astNode; - - public ASTNodeTextRange(ASTNode astNode) { - super(); - this.astNode = astNode; - } - - public int getOffset() { - return this.astNode.getStartPosition(); - } - - public int getLength() { - return this.astNode.getLength(); - } - - public int getLineNumber() { - return ((CompilationUnit) this.astNode.getRoot()).getLineNumber(this.getOffset()); - } - - public boolean includes(int index) { - return (this.getOffset() <= index) && (index < this.end()); - } - - public boolean touches(int index) { - return this.includes(index) || (index == this.end()); - } - - /** - * The end offset is "exclusive", i.e. the element at the end offset - * is not included in the range. - */ - private int end() { - return this.getOffset() + this.getLength(); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if ( ! (o instanceof ITextRange)) { - return false; - } - ITextRange r = (ITextRange) o; - return (r.getOffset() == this.getOffset()) - && (r.getLength() == this.getLength()); - } - - @Override - public int hashCode() { - return this.getOffset() ^ this.getLength(); - } - - @Override - public String toString() { - String start = String.valueOf(this.getOffset()); - String end = String.valueOf(this.getOffset() + this.getLength() - 1); - return StringTools.buildToStringFor(this, start + ", " + end); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java deleted file mode 100644 index f2eb31f7cd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java +++ /dev/null @@ -1,169 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Adapt a member and a declaration annotation adapter. - */ -public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { - private final Member member; - private final DeclarationAnnotationAdapter daa; - - - // ********** constructor ********** - - public AbstractAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) { - super(); - this.member = member; - this.daa = daa; - } - - - // ********** AnnotationAdapter implementation ********** - - public Annotation getAnnotation() { - return this.daa.getAnnotation(this.member.modifiedDeclaration()); - } - - public Annotation getAnnotation(CompilationUnit astRoot) { - return this.daa.getAnnotation(this.member.modifiedDeclaration(astRoot)); - } - - public void newMarkerAnnotation() { - this.edit(this.buildNewMarkerAnnotationEditor()); - } - - public void newSingleMemberAnnotation() { - this.edit(this.buildNewSingleMemberAnnotationEditor()); - } - - public void newNormalAnnotation() { - this.edit(this.buildNewNormalAnnotationEditor()); - } - - public void removeAnnotation() { - this.edit(this.buildRemoveAnnotationEditor()); - } - - public ASTNode astNode() { - return this.daa.astNode(this.member.modifiedDeclaration()); - } - - public ASTNode astNode(CompilationUnit astRoot) { - return this.daa.astNode(this.member.modifiedDeclaration(astRoot)); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.daa); - } - - - // ********** internal methods ********** - - protected void edit(Member.Editor editor) { - this.member.edit(editor); - } - - - // ********** factory methods ********** - - protected Member.Editor buildNewMarkerAnnotationEditor() { - return new NewMarkerAnnotationEditor(this.daa); - } - - protected Member.Editor buildNewSingleMemberAnnotationEditor() { - return new NewSingleMemberAnnotationEditor(this.daa); - } - - protected Member.Editor buildNewNormalAnnotationEditor() { - return new NewNormalAnnotationEditor(this.daa); - } - - protected Member.Editor buildRemoveAnnotationEditor() { - return new RemoveAnnotationEditor(this.daa); - } - - - // ********** member classes ********** - - protected static class NewMarkerAnnotationEditor implements Member.Editor { - private final DeclarationAnnotationAdapter daa; - - NewMarkerAnnotationEditor(DeclarationAnnotationAdapter daa) { - super(); - this.daa = daa; - } - public void edit(ModifiedDeclaration declaration) { - this.daa.newMarkerAnnotation(declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - - - protected static class NewSingleMemberAnnotationEditor implements Member.Editor { - private final DeclarationAnnotationAdapter daa; - - NewSingleMemberAnnotationEditor(DeclarationAnnotationAdapter daa) { - super(); - this.daa = daa; - } - public void edit(ModifiedDeclaration declaration) { - this.daa.newSingleMemberAnnotation(declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - - - protected static class NewNormalAnnotationEditor implements Member.Editor { - private final DeclarationAnnotationAdapter daa; - - NewNormalAnnotationEditor(DeclarationAnnotationAdapter daa) { - super(); - this.daa = daa; - } - public void edit(ModifiedDeclaration declaration) { - this.daa.newNormalAnnotation(declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - - - protected static class RemoveAnnotationEditor implements Member.Editor { - private final DeclarationAnnotationAdapter daa; - - RemoveAnnotationEditor(DeclarationAnnotationAdapter daa) { - super(); - this.daa = daa; - } - public void edit(ModifiedDeclaration declaration) { - this.daa.removeAnnotation(declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java deleted file mode 100644 index 9fd0f25d9e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * - */ -public abstract class AbstractDeclarationAnnotationAdapter implements DeclarationAnnotationAdapter { - private final String annotationName; - - - // ********** constructors ********** - - protected AbstractDeclarationAnnotationAdapter(String annotationName) { - super(); - this.annotationName = annotationName; - } - - - // ********** DeclarationAnnotationAdapter implementation ********** - - public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) { - MarkerAnnotation annotation = this.newMarkerAnnotation(declaration.getAST()); - this.addAnnotationAndImport(declaration, annotation); - return annotation; - } - - public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) { - SingleMemberAnnotation annotation = this.newSingleMemberAnnotation(declaration.getAST()); - this.addAnnotationAndImport(declaration, annotation); - return annotation; - } - - public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) { - NormalAnnotation annotation = this.newNormalAnnotation(declaration.getAST()); - this.addAnnotationAndImport(declaration, annotation); - return annotation; - } - - /** - * Add the appropriate import statement, then shorten the annotation's - * name before adding it to the declaration. - */ - protected void addAnnotationAndImport(ModifiedDeclaration declaration, Annotation annotation) { - declaration.addImport(this.annotationName); - annotation.setTypeName(declaration.getAST().newName(this.shortAnnotationName())); - this.addAnnotation(declaration, annotation); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.annotationName); - } - - - // ********** abstract methods ********** - - public abstract Annotation getAnnotation(ModifiedDeclaration declaration); - - public abstract void removeAnnotation(ModifiedDeclaration declaration); - - public abstract ASTNode astNode(ModifiedDeclaration declaration); - - /** - * Add the specified annotation to the specified declaration, - * replacing the original annotation if present. - */ - protected abstract void addAnnotation(ModifiedDeclaration declaration, Annotation annotation); - - - // ********** public methods ********** - - public String getAnnotationName() { - return this.annotationName; - } - - - // ********** helper methods ********** - - protected boolean nameMatches(ModifiedDeclaration declaration, Annotation annotation) { - return this.nameMatches(declaration, annotation, this.annotationName); - } - - protected boolean nameMatches(ModifiedDeclaration declaration, Annotation annotation, String name) { - return declaration.annotationIsNamed(annotation, name); - } - - protected MarkerAnnotation newMarkerAnnotation(AST ast) { - return this.newMarkerAnnotation(ast, this.annotationName); - } - - protected MarkerAnnotation newMarkerAnnotation(AST ast, String name) { - MarkerAnnotation annotation = ast.newMarkerAnnotation(); - annotation.setTypeName(ast.newName(name)); - return annotation; - } - - protected SingleMemberAnnotation newSingleMemberAnnotation(AST ast) { - return this.newSingleMemberAnnotation(ast, this.annotationName); - } - - protected SingleMemberAnnotation newSingleMemberAnnotation(AST ast, String name) { - SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation(); - annotation.setTypeName(ast.newName(name)); - return annotation; - } - - protected NormalAnnotation newNormalAnnotation(AST ast) { - return this.newNormalAnnotation(ast, this.annotationName); - } - - protected NormalAnnotation newNormalAnnotation(AST ast, String name) { - NormalAnnotation annotation = ast.newNormalAnnotation(); - annotation.setTypeName(ast.newName(name)); - return annotation; - } - - protected String shortAnnotationName() { - return this.shortName(this.annotationName); - } - - protected String shortName(String name) { - return name.substring(name.lastIndexOf('.') + 1); - } - - @SuppressWarnings("unchecked") - protected List values(NormalAnnotation na) { - return na.values(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java deleted file mode 100644 index c299099d36..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Gather together just the tiniest bit of common behavior. - * E is the expression type. - * T is the type of the object to be converted to and from an expression. - */ -public abstract class AbstractExpressionConverter - implements ExpressionConverter -{ - - protected AbstractExpressionConverter() { - super(); - } - - public E convert(T object, AST ast) { - return (object == null) ? null : this.convert_(object, ast); - } - - /** - * The specified object is not null. - * @see #convert(T, AST) - */ - protected abstract E convert_(T object, AST ast); - - public T convert(E expression) { - return (expression == null) ? null : this.convert_(expression); - } - - /** - * The specified expression is not null. - * @see #convert(Expression) - */ - protected abstract T convert_(E expression); - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java deleted file mode 100644 index b9cdce5a9f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,420 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; - -/** - * Pull together some of the behavior common to NestedDeclarationAnnotationAdapter - * and IndexedNestedDeclarationAnnotationAdapter - */ -public abstract class AbstractNestedDeclarationAnnotationAdapter extends AbstractDeclarationAnnotationAdapter { - private final DeclarationAnnotationAdapter outerAnnotationAdapter; - private final String elementName; - private final boolean removeOuterAnnotationWhenEmpty; - - - // ********** constructors ********** - - /** - * default element name is "value"; - * default behavior is to remove the outer annotation when it is empty - */ - protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) { - this(outerAnnotationAdapter, "value", annotationName); - } - - /** - * default behavior is to remove the outer annotation when it is empty - */ - protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) { - this(outerAnnotationAdapter, elementName, annotationName, true); - } - - protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName, boolean removeOuterAnnotationWhenEmpty) { - super(annotationName); - this.outerAnnotationAdapter = outerAnnotationAdapter; - this.elementName = elementName; - this.removeOuterAnnotationWhenEmpty = removeOuterAnnotationWhenEmpty; - } - - - // ********** AbstractDeclarationAnnotationAdapter implementation ********** - - @Override - public Annotation getAnnotation(ModifiedDeclaration declaration) { - Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration); - if (outer == null) { - return null; - } - Expression value = this.elementValue(outer); - if (value == null) { - return null; - } - Annotation inner = this.getAnnotation(value); - if (inner == null) { - return null; - } - // return the annotation only if it has a matching name(?) - return this.nameMatches(declaration, inner) ? inner : null; - } - - @Override - public void removeAnnotation(ModifiedDeclaration declaration) { - Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration); - if (outer == null) { - return; - } - Expression value = this.elementValue(outer); - if (value == null) { - return; - } - // hack to allow short-circuit when the value is an array initializer - if (this.removeAnnotation(declaration, outer, value)) { - return; - } - Annotation inner = this.annotationValue(value); - if (inner == null) { - return; - } - // remove the annotation only if it has a matching name(?) - if (this.nameMatches(declaration, inner)) { - this.removeElementAndNormalize(declaration, outer); - } - } - - @Override - public ASTNode astNode(ModifiedDeclaration declaration) { - // if the annotation is missing, return the outer annotation's node - Annotation annotation = this.getAnnotation(declaration); - return (annotation != null) ? annotation : this.outerAnnotationAdapter.astNode(declaration); - } - - @Override - protected void addAnnotation(ModifiedDeclaration declaration, Annotation inner) { - Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration); - if (outer == null) { - this.buildNewOuterAnnotation(declaration, inner); - } else if (outer.isMarkerAnnotation()) { - this.modifyAnnotation(declaration, (MarkerAnnotation) outer, inner); - } else if (outer.isSingleMemberAnnotation()) { - this.modifyAnnotation(declaration, (SingleMemberAnnotation) outer, inner); - } else if (outer.isNormalAnnotation()) { - this.modifyAnnotation(declaration, (NormalAnnotation) outer, inner); - } else { - throw new IllegalStateException("unknown annotation type: " + outer); - } - } - - - // ********** abstract methods ********** - - /** - * Return an annotation extracted from the specified expression, - * which is the value of the adapter's element. - */ - protected abstract Annotation getAnnotation(Expression value); - - /** - * Remove the annotation from the specified expression, - * which is the value of the adapter's element. - * Return whether the removal was successful. - */ - protected abstract boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value); - - /** - * Set the value of the specified outer annotation to the - * specified inner annotation. - */ - protected abstract void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner); - - /** - * Set the value of the specified member value pair to the - * specified inner annotation. - */ - protected abstract void modifyMemberValuePair(MemberValuePair pair, Annotation inner); - - - // ********** public methods ********** - - public DeclarationAnnotationAdapter getOuterAnnotationAdapter() { - return this.outerAnnotationAdapter; - } - - public String getElementName() { - return this.elementName; - } - - - // ********** internal methods ********** - - /** - * If the specified expression is an annotation, cast it to an annotation; - * otherwise return null. - */ - protected Annotation annotationValue(Expression expression) { - switch (expression.getNodeType()) { - case ASTNode.NORMAL_ANNOTATION: - case ASTNode.SINGLE_MEMBER_ANNOTATION: - case ASTNode.MARKER_ANNOTATION: - return (Annotation) expression; - default: - return null; - } - } - - /** - * Remove the *first* annotation element with the specified name - * from the specified annotation, converting the annotation as appropriate. - */ - protected void removeElementAndNormalize(ModifiedDeclaration declaration, Annotation outer) { - if (outer.isNormalAnnotation()) { - this.removeElementAndNormalize(declaration, (NormalAnnotation) outer); - } else if (outer.isSingleMemberAnnotation()) { - this.removeElementAndNormalize(declaration, (SingleMemberAnnotation) outer); - } else if (outer.isMarkerAnnotation()) { - this.removeElementAndNormalize(declaration, (MarkerAnnotation) outer); - } else { - throw new IllegalArgumentException("unknown annotation type: " + outer); - } - } - - /** - * Remove the *first* annotation element with the adapter's element name - * from the specified annotation. Convert the annotation to - * a marker annotation or single member annotation if appropriate. - *
    -	 * @Outer(name="Fred", foo=@Inner) => @Outer(name="Fred")
    -	 * @Outer(foo=@Inner) => @Outer
    -	 * 
    - */ - protected void removeElementAndNormalize(ModifiedDeclaration declaration, NormalAnnotation outer) { - this.removeElement(outer); - this.normalizeAnnotation(declaration, outer); - } - - /** - * Remove from the specified annotation the element with - * the adapter's element name. - */ - protected void removeElement(NormalAnnotation annotation) { - for (Iterator stream = this.values(annotation).iterator(); stream.hasNext(); ) { - MemberValuePair pair = stream.next(); - if (pair.getName().getFullyQualifiedName().equals(this.elementName)) { - stream.remove(); - break; - } - } - } - - /** - * Convert the specified normal annotation to a marker annotation or - * single member annotation if appropriate. - */ - protected void normalizeAnnotation(ModifiedDeclaration declaration, NormalAnnotation outer) { - List values = this.values(outer); - switch (values.size()) { - case 0: - // if the elements are all gone, remove the annotation or convert it to a marker annotation - if (this.removeOuterAnnotationWhenEmpty) { - this.outerAnnotationAdapter.removeAnnotation(declaration); - } else { - // convert the annotation to a marker annotation - this.outerAnnotationAdapter.newMarkerAnnotation(declaration); - } - break; - case 1: - MemberValuePair pair = values.get(0); - if (pair.getName().getFullyQualifiedName().equals("value")) { - // if the last remaining element is 'value', convert the annotation to a single member annotation - Expression vv = pair.getValue(); - vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv); - this.outerAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv); - } - break; - default: - // do nothing - break; - } - } - - /** - * Convert the specified single member annotation to a marker annotation - * if the adapter's element name is "value". - */ - protected void removeElementAndNormalize(ModifiedDeclaration declaration, SingleMemberAnnotation outer) { - if (this.elementName.equals("value")) { - if (this.removeOuterAnnotationWhenEmpty) { - this.outerAnnotationAdapter.removeAnnotation(declaration); - } else { - // convert the annotation to a marker annotation - this.outerAnnotationAdapter.newMarkerAnnotation(declaration); - } - } - } - - protected void removeElementAndNormalize(ModifiedDeclaration declaration, MarkerAnnotation outer) { - if (this.removeOuterAnnotationWhenEmpty) { - this.outerAnnotationAdapter.removeAnnotation(declaration); - } - } - - /** - * Return the value of the *first* annotation element - * with the adapter's element name. - * Return null if the annotation has no such element. - * (An element name of "value" will return the value of a single - * member annotation.) - */ - protected Expression elementValue(Annotation annotation) { - if (annotation.isNormalAnnotation()) { - return this.elementValue((NormalAnnotation) annotation); - } - if (annotation.isSingleMemberAnnotation()) { - return this.elementValue((SingleMemberAnnotation) annotation); - } - return null; - } - - protected Expression elementValue(NormalAnnotation annotation) { - MemberValuePair pair = this.memberValuePair(annotation); - return (pair == null) ? null : pair.getValue(); - } - - /** - * If the adapter's element name is "value", return the value of the - * annotation, otherwise return null. - */ - protected Expression elementValue(SingleMemberAnnotation annotation) { - return this.elementName.equals("value") ? annotation.getValue() : null; - } - - /** - * Return the *first* member value pair for the adapter's element name. - * Return null if the specified annotation has no such element. - */ - protected MemberValuePair memberValuePair(NormalAnnotation annotation) { - for (MemberValuePair pair : this.values(annotation)) { - if (pair.getName().getFullyQualifiedName().equals(this.elementName)) { - return pair; - } - } - return null; - } - - /** - * Build a new outer annotation and add the specified - * inner annotation to it: - *
    -	 *     @Outer(@Inner)
    -	 * 
    - * or - *
    -	 *     @Outer(foo=@Inner)
    -	 * 
    - */ - protected void buildNewOuterAnnotation(ModifiedDeclaration declaration, Annotation inner) { - if (this.elementName.equals("value")) { - this.outerAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(this.buildNewInnerExpression(inner)); - } else { - List values = this.values(this.outerAnnotationAdapter.newNormalAnnotation(declaration)); - values.add(this.newMemberValuePair(this.buildNewInnerExpression(inner))); - } - } - - /** - * Build an expression to be added to a new outer annotation - * for the specified inner annotation. - */ - protected abstract Expression buildNewInnerExpression(Annotation inner); - - /** - * Build a new member value pair with the specified name and value. - */ - protected MemberValuePair newMemberValuePair(String name, Expression value) { - AST ast = value.getAST(); - MemberValuePair pair = ast.newMemberValuePair(); - pair.setName(ast.newSimpleName(name)); - pair.setValue(value); - return pair; - } - - /** - * Build a new member value pair with the adapter's element name - * and the specified inner annotation. - */ - protected MemberValuePair newMemberValuePair(Expression value) { - return this.newMemberValuePair(this.elementName, value); - } - - /** - * Add the specified inner annotation to the marker annotation. - */ - protected void modifyAnnotation(ModifiedDeclaration declaration, MarkerAnnotation outer, Annotation inner) { - this.buildNewOuterAnnotation(declaration, inner); - } - - /** - * Add the specified inner annotation to the single member annotation. - */ - protected void modifyAnnotation(ModifiedDeclaration declaration, SingleMemberAnnotation outer, Annotation inner) { - if (this.elementName.equals("value")) { - this.modifyAnnotationValue(outer, inner); - } else { - this.modifyAnnotationNonValue(declaration, outer, inner); - } - } - - /** - * Add the specified inner annotation to the single member annotation, - * converting it to a normal annotation: - *
    -	 *     @Outer("lorem ipsum") => @Outer(value="lorem ipsum", foo=@Inner)
    -	 * 
    - */ - protected void modifyAnnotationNonValue(ModifiedDeclaration declaration, SingleMemberAnnotation outer, Annotation inner) { - Expression vv = outer.getValue(); - vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv); - NormalAnnotation newOuter = this.outerAnnotationAdapter.newNormalAnnotation(declaration); - List values = this.values(newOuter); - values.add(this.newMemberValuePair("value", vv)); - values.add(this.newMemberValuePair(this.buildNewInnerExpression(inner))); - } - - /** - * Add the specified inner annotation to the normal annotation: - *
    -	 *     @Outer(bar="lorem ipsum") => @Outer(bar="lorem ipsum", foo=@Inner)
    -	 * 
    - * or - *
    -	 *     @Outer(foo=@Inner("lorem ipsum")) => @Outer(foo=@Inner)
    -	 * 
    - */ - protected void modifyAnnotation(ModifiedDeclaration declaration, NormalAnnotation outer, Annotation inner) { - MemberValuePair pair = this.memberValuePair(outer); - if (pair == null) { - List values = this.values(outer); - values.add(this.newMemberValuePair(inner)); - } else { - this.modifyMemberValuePair(pair, inner); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java deleted file mode 100644 index 8190d36122..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Adapt a Java annotation with a simple-to-use interface. - */ -public interface AnnotationAdapter { - - /** - * Return the value of the adapter's annotation. - * If the compilation unit is available, #getAnnotation(CompilationUnit) - * might be more performant. - * @see #getAnnotation(org.eclipse.jdt.core.dom.CompilationUnit) - */ - Annotation getAnnotation(); - - /** - * Given the specified compilation unit, return the value of the - * adapter's annotation. - * @see #getAnnotation() - */ - Annotation getAnnotation(CompilationUnit astRoot); - - /** - * Build a new marker annotation, replacing the original annotation if present. - */ - void newMarkerAnnotation(); - - /** - * Build a new single member annotation, replacing the original annotation if present. - */ - void newSingleMemberAnnotation(); - - /** - * Build a new normal annotation, replacing the original annotation if present. - */ - void newNormalAnnotation(); - - /** - * Remove the annotation. - */ - void removeAnnotation(); - - /** - * Return the AST node corresponding to the annotation. - * If the annotation is missing, return the annotation's parent's node. - * If the compilation unit is available, #astNode(CompilationUnit) - * might be more performant. - * @see #astNode(org.eclipse.jdt.core.dom.CompilationUnit) - */ - ASTNode astNode(); - - /** - * Return the AST node corresponding to the annotation. - * If the annotation is missing, return the annotation's parent node. - * @see #astNode() - */ - ASTNode astNode(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java deleted file mode 100644 index 8819d0186d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.text.edits.InsertEdit; -import org.eclipse.text.edits.MalformedTreeException; -import org.eclipse.text.edits.MultiTextEdit; -import org.eclipse.text.edits.ReplaceEdit; -import org.eclipse.text.edits.TextEdit; - -/** - * This will apply TextEdit's to a doc and do some extra work to cleanup some - * of the nasty Eclipse annotation formatting (e.g. arrays of annotations). - */ -public class AnnotationEditFormatter { - - protected IDocument doc; - - public AnnotationEditFormatter(IDocument doc) { - this.doc = doc; - } - - /** - * Apply the edits to our doc doing extra formatting as needed. - */ - public void apply(TextEdit edits) throws MalformedTreeException, - BadLocationException { - edits.apply(doc, TextEdit.UPDATE_REGIONS); - MultiTextEdit extra = new MultiTextEdit(); - TextEdit[] all = edits.getChildren(); - for (int i = 0; i < all.length; i++) { - if (all[i] instanceof InsertEdit) { - InsertEdit a = (InsertEdit)all[i]; - if (i + 1 < all.length && all[i + 1] instanceof InsertEdit) { - InsertEdit b = (InsertEdit)all[i + 1]; - if (" ".equals(b.getText()) && isAnnotation(a)) { - // Annotation being inserted before something on the same line. - // Insert a newline and indent after the annotation. - ReplaceEdit re = new ReplaceEdit(b.getOffset(), 1, - getNewlineAndIdent(b.getOffset())); - extra.addChild(re); - i++; - continue; - } - if (", ".equals(a.getText()) && isAnnotation(b)) { - // Annotation being inserted in an array initializer on the - // same line as the previous array element. - // Insert a newline and indent before the annotation. - ReplaceEdit re = new ReplaceEdit(a.getOffset() + 1, 1, - getNewlineAndIdent(a.getOffset())); - extra.addChild(re); - i++; - continue; - } - } - if (formatArrayInit(a, extra)) { - continue; - } - } - } - extra.apply(doc, 0); - } - - /** - * Create a String containing a line delimeter and indenting characters - * matching the indent level of the line containing character offset. - */ - protected String getNewlineAndIdent(int offset) throws BadLocationException { - int line = doc.getLineOfOffset(offset); - offset = doc.getLineOffset(line); - StringBuffer s = new StringBuffer(); - s.append(doc.getLineDelimiter(line)); - for (;;) { - char c = doc.getChar(offset++); - if (c == ' ' || c == '\t') { - s.append(c); - } else { - break; - } - } - return s.toString(); - } - - /** - * Is e inserting an annotation? - */ - protected boolean isAnnotation(InsertEdit e) { - String s = e.getText(); - return s.length() > 1 && s.charAt(0) == '@'; - } - - /** - * If a is inserting an annotation containing an array of annotations as - * its value then format them nicely and return true. - */ - protected boolean formatArrayInit(InsertEdit a, MultiTextEdit extra) - throws BadLocationException { - String s = a.getText(); - int n = s.length(); - if (n < 6 || s.charAt(0) != '@') { - return false; - } - int pos; - for (pos = 1; pos < n && s.charAt(pos++) != '('; ) {/* just move 'pos' */} - if (pos == n) { - return false; - } - for (; pos < n; ) { - char c = s.charAt(pos++); - if (c == '{') { - break; - } - if (c != ' ') { - return false; - } - } - if (pos == n) { - return false; - } - // now look for @ not inside parenthesis and put in - // line delimeter and indent string before each - int offset = a.getOffset(); - String indent = null; - int parenCount = 0; - for (; pos < n; pos++) { - char c = s.charAt(pos); - switch (c) { - case '(': - ++parenCount; - break; - case ')': - --parenCount; - break; - case '@': - if (parenCount == 0) { - if (indent == null) { - indent = getNewlineAndIdent(offset) + "\t"; - } - InsertEdit ie = new InsertEdit(offset + pos, indent); - extra.addChild(ie); - } - } - } - return indent != null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java deleted file mode 100644 index 5e25607ab3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Expression; - -/** - * Adapt a Java annotation element with a simple-to-use interface. - */ -public interface AnnotationElementAdapter { - - /** - * Return the value of the adapter's annotation element. - * Return null if the element is not present. - * If the compilation unit is available, #getValue(CompilationUnit) - * might be more performant. - * @see #getValue(org.eclipse.jdt.core.dom.CompilationUnit) - */ - T getValue(); - - /** - * Given the specified compilation unit, return the value of the - * adapter's annotation element. - * Return null if the element is not present. - * @see #getValue() - */ - T getValue(CompilationUnit astRoot); - - /** - * Set the value of the adapter's annotation element. - * Setting the value of the element to null will cause - * the element to be removed from its annotation. - */ - void setValue(T value); - - /** - * Return the expression value of the adapter's annotation element. - * Return null if the element is not present. - * If the compilation unit is available, #expression(CompilationUnit) - * might be more performant. - * @see #expression(org.eclipse.jdt.core.dom.CompilationUnit) - */ - Expression expression(); - - /** - * Given the specified compilation unit, return the expression value of the - * adapter's annotation element. - * Return null if the element is not present. - * @see #expression() - */ - Expression expression(CompilationUnit astRoot); - - /** - * Return the AST node corresponding to the element. - * If the element is missing, return the annotation's node. - * If the compilation unit is available, #astNode(CompilationUnit) - * might be more performant. - * @see #astNode(org.eclipse.jdt.core.dom.CompilationUnit) - */ - ASTNode astNode(); - - /** - * Return the AST node corresponding to the element. - * If the element is missing, return the annotation's node. - * @see #astNode() - */ - ASTNode astNode(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java deleted file mode 100644 index bb46008f8e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.IMember; - -/** - * Combine behavior common to FieldAttribute and MethodAttribute. - */ -public abstract class Attribute extends Member { - - Attribute(IMember jdtMember) { - super(jdtMember); - } - - public boolean isField() { - return false; - } - - public boolean isMethod() { - return false; - } - - public abstract String attributeName(); - - public abstract String typeSignature(); - - public boolean isPrimitiveType() { - return JDTTools.signatureIsPrimitive(this.typeSignature()); - } - - public boolean typeIs(String fullyQualifiedTypeName) { - return fullyQualifiedTypeName.equals(this.resolvedTypeName()); - } - - /** - * Resolve the attribute. - * Return the fully-qualified type name or return null if it cannot be - * resolved unambiguously. - */ - public String resolvedTypeName() { - return JDTTools.resolveSignature(this.typeSignature(), this.getJdtMember().getDeclaringType()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AttributeAnnotationTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AttributeAnnotationTools.java deleted file mode 100644 index 31fa4cec12..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AttributeAnnotationTools.java +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.ArrayList; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IField; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; - -public class AttributeAnnotationTools { - - /** - * Return the fields in the specified type that may be "persisted". - */ - public static IField[] persistableFields(IType type) { - try { - return persistableFields_(type); - } catch(JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private static IField[] persistableFields_(IType type) throws JavaModelException { - ArrayList persistableFields = new ArrayList(); - for (IField field : type.getFields()) { - if (fieldIsPersistable(field)) { - persistableFields.add(field); - } - } - return persistableFields.toArray(new IField[persistableFields.size()]); - } - - /** - * Return whether the specified field may be "persisted". - */ - public static boolean fieldIsPersistable(IField field) { - try { - return fieldIsPersistable_(field); - } catch(JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * According to the spec, "All non-transient instance variables that are not - * annotated with the Transient annotation are persistent." - */ - private static boolean fieldIsPersistable_(IField field) throws JavaModelException { - int flags = field.getFlags(); - if (Flags.isStatic(flags)) { - return false; - } - if (Flags.isTransient(flags)) { - return false; - } - return true; - } - - /** - * Return the "getter" methods in the specified type that - * represent properties that may be "persisted". - */ - public static IMethod[] persistablePropertyGetters(IType type) { - try { - return persistablePropertyGetters_(type); - } catch(JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private static IMethod[] persistablePropertyGetters_(IType type) throws JavaModelException { - ArrayList persistableMethods = new ArrayList(); - for (IMethod method : type.getMethods()) { - if (methodIsPersistablePropertyGetter(method)) { - persistableMethods.add(method); - } - } - return persistableMethods.toArray(new IMethod[persistableMethods.size()]); - } - - /** - * Return whether the specified method is a "getter" method that - * represents a property that may be "persisted". - */ - public static boolean methodIsPersistablePropertyGetter(IMethod method) { - try { - return methodIsPersistablePropertyGetter_(method); - } catch(JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private static boolean methodIsPersistablePropertyGetter_(IMethod method) throws JavaModelException { - if (methodHasBadModifiers(method)) { - return false; - } - - // TODO need to "resolve" return type - String returnType = method.getReturnType(); - if (returnType.equals("V")) { // 'void' - return false; - } - if (method.getNumberOfParameters() != 0) { - return false; - } - - String methodName = method.getElementName(); - int beginIndex = 0; - boolean booleanGetter = false; - if (methodName.startsWith("is")) { - if (returnType.equals("Z")) { // 'boolean' - beginIndex = 2; - } else { - return false; - } - } else { - if (methodName.startsWith("get")) { - beginIndex = 3; - if (returnType.equals("Z")) { // 'boolean' - booleanGetter = true; - } - } else { - return false; - } - } - - String capitalizedAttributeName = method.getElementName().substring(beginIndex); - // if the type has both methods: - // boolean isProperty() - // boolean getProperty() - // then #isProperty() takes precedence and we ignore #getProperty() - // (see the JavaBeans spec 1.01) - if (booleanGetter) { - IMethod isMethod = method.getDeclaringType().getMethod("is" + capitalizedAttributeName, new String[0]); - if (isMethod.exists() && isMethod.getReturnType().equals("Z")) { // 'boolean' - return false; - } - } - IMethod setMethod = method.getDeclaringType().getMethod("set" + capitalizedAttributeName, new String[] {returnType}); - if ( ! setMethod.exists()) { - return false; - } - if (methodHasBadModifiers(setMethod)) { - return false; - } - if ( ! setMethod.getReturnType().equals("V")) { // 'void' - return false; - } - return true; - } - - /** - * Return whether the specified method's modifiers prevent it - * from being a getter or setter for a "persistent" property. - */ - private static boolean methodHasBadModifiers(IMethod method) throws JavaModelException { - if (method.isConstructor()) { - return true; - } - int flags = method.getFlags(); - if (Flags.isStatic(flags)) { - return true; - } - if (Flags.isFinal(flags)) { - return true; - } - if ( ! (Flags.isPublic(flags) || Flags.isProtected(flags))) { - return true; - } - return false; - } - - /** - * Return whether the type may be "persisted", ie marked as Entity, MappedSuperclass, Embeddable - */ - public static boolean typeIsPersistable(IType type) { - try { - return typeIsPersistable_(type); - } catch(JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private static boolean typeIsPersistable_(IType type) throws JavaModelException { - if (type.isInterface()) { - return false; - } - if (type.isAnnotation()) { - return false; - } - if (type.isEnum()) { - return false; - } - if (type.isLocal()) { - return false; - } - if (type.isAnonymous()) { - return false; - } - int flags = type.getFlags(); - if (Flags.isFinal(flags)) { - return false; - } - return true; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java deleted file mode 100644 index 6a1eb8894b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Adapt a "boolean" Java annotation with a simple-to-use interface. - */ -public interface BooleanAnnotationAdapter { - - /** - * Return the "boolean" value of the adapter's annotation. - * Return true if the annotation is present; otherwise return false. - * If the compilation unit is available, #getValue(CompilationUnit) - * might be more performant. - * @see #getValue(org.eclipse.jdt.core.dom.CompilationUnit) - */ - boolean getValue(); - - /** - * Given the specified compilation unit, return the "boolean" value of the - * adapter's annotation. - * Return true if the annotation is present; otherwise return false. - * @see #getValue() - */ - boolean getValue(CompilationUnit astRoot); - - /** - * Set the "boolean" value of the adapter's annotation. - * Setting the value to true will cause the annotation to be added - * to its declaration; setting it to false will cause the annotation - * to be removed. - */ - void setValue(boolean value); - - /** - * Return the value of the adapter's annotation. - * If the compilation unit is available, #getAnnotation(CompilationUnit) - * might be more performant. - * @see #getAnnotation(org.eclipse.jdt.core.dom.CompilationUnit) - */ - Annotation getAnnotation(); - - /** - * Given the specified compilation unit, return the value of the - * adapter's annotation. - * @see #getAnnotation() - */ - Annotation getAnnotation(CompilationUnit astRoot); - - /** - * Return the AST node corresponding to the annotation. - * If the annotation is missing, return the annotation's parent's node. - * If the compilation unit is available, #astNode(CompilationUnit) - * might be more performant. - * @see #astNode(org.eclipse.jdt.core.dom.CompilationUnit) - */ - ASTNode astNode(); - - /** - * Return the AST node corresponding to the annotation. - * If the annotation is missing, return the annotation's parent node. - * @see #astNode() - */ - ASTNode astNode(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanStringExpressionConverter.java deleted file mode 100644 index 0f5854e5d6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanStringExpressionConverter.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.BooleanLiteral; - -/** - * Convert a boolean literal to/from a string representation of a boolean - * (e.g. "true"). - */ -public final class BooleanStringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new BooleanStringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private BooleanStringExpressionConverter() { - super(); - } - - @Override - protected BooleanLiteral convert_(String string, AST ast) { - return ast.newBooleanLiteral(Boolean.valueOf(string).booleanValue()); - } - - @Override - protected String convert_(BooleanLiteral booleanLiteral) { - return (booleanLiteral.getNodeType() == ASTNode.BOOLEAN_LITERAL) ? - Boolean.toString(booleanLiteral.booleanValue()) - : - null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java deleted file mode 100644 index 1fa055d707..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.CharacterLiteral; - -/** - * Convert a character literal to/from a string representation of a character - * (e.g. "A"). - */ -public final class CharacterStringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new CharacterStringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private CharacterStringExpressionConverter() { - super(); - } - - @Override - protected CharacterLiteral convert_(String string, AST ast) { - CharacterLiteral characterLiteral = ast.newCharacterLiteral(); - characterLiteral.setCharValue(string.charAt(0)); - return characterLiteral; - } - - @Override - protected String convert_(CharacterLiteral characterLiteral) { - return (characterLiteral.getNodeType() == ASTNode.CHARACTER_LITERAL) ? - Character.toString(characterLiteral.charValue()) - : - null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java deleted file mode 100644 index 21b1bce7bb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,490 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Manipulate an annotation that either occurs stand-alone, e.g. - *
    - *     @Inner("zero")
    - *     private int id;
    - * 
    - * - * or is embedded in an element array within another annotation, e.g. - *
    - *     @Outer(foo={@Inner("zero"), @Inner("one"), @Inner("two")})
    - *     private int id;
    - *     
    - *         annotationName = "Inner"
    - *         containerAnnotationName = "Outer"
    - *         elementName = "foo"
    - *         index = 0-2
    - * 
    - * - * This is a useful pattern because a declaration cannot have more - * than one annotation of the same type, and allowing the stand-alone - * configuration reduces clutter. - *
    - * NB: This configuration only makes sense for "top-level" annotations, as - * opposed to "nested" annotations. This is because annotation elements - * can only be declared with a type of a single annotation and annotations - * cannot be part of an inheritance hierarchy. - * For example, the following configurations cannot *both* be supported: - *
    - *     @Foo(bar=@Outer(...))
    - *     private int id;
    - * 
    - *     @Foo(bar=@Inner(...))  // not allowed
    - *     private int id;
    - * 
    - * - * NB: Behavior is undefined when both the stand-alone and the nested - * configurations annotate the same declaration, e.g. - *
    - *     // undefined behavior
    - *     @Inner("zero")
    - *     @Outer(foo={@Inner("zero"), @Inner("one"), @Inner("two")})
    - *     private int id;
    - * 
    - */ -public class CombinationIndexedDeclarationAnnotationAdapter - implements IndexedDeclarationAnnotationAdapter -{ - - /** - * this adapter is used when the annotation is "stand-alone": - *
    -	 *     @Inner("zero")
    -	 * 
    - * and is only used when the index is 0 or 1 - */ - private final SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter; - - /** - * this adapter is used when the annotation is "nested": - *
    -	 *     @Outer(foo={@Inner("zero"), @Inner("one")})
    -	 * 
    - */ - private final NestedIndexedDeclarationAnnotationAdapter nestedAnnotationAdapter; - - /** - * this adapter is for the "nested" annotation at the zero index; - * and is only used when the index is 1 - */ - private final NestedIndexedDeclarationAnnotationAdapter zeroNestedAnnotationAdapter; - - - // ********** constructors ********** - - /** - * default element name is "value" - *
    -	 *     @Inner("zero")
    -	 *     @Outer({@Inner("zero"), @Inner("one")})
    -	 * 
    - */ - public CombinationIndexedDeclarationAnnotationAdapter(String annotationName, String containerAnnotationName, int index) { - this(annotationName, containerAnnotationName, "value", index); - } - - public CombinationIndexedDeclarationAnnotationAdapter(String annotationName, String containerAnnotationName, String elementName, int index) { - this(new SimpleDeclarationAnnotationAdapter(annotationName), new SimpleDeclarationAnnotationAdapter(containerAnnotationName), elementName, index, annotationName); - } - - /** - * default element name is "value" - */ - public CombinationIndexedDeclarationAnnotationAdapter( - SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter, - SimpleDeclarationAnnotationAdapter containerAnnotationAdapter, - int index, - String nestedAnnotationName - ) { - this(standAloneAnnotationAdapter, containerAnnotationAdapter, "value", index, nestedAnnotationName); - } - - public CombinationIndexedDeclarationAnnotationAdapter( - SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter, - SimpleDeclarationAnnotationAdapter containerAnnotationAdapter, - String elementName, - int index, - String nestedAnnotationName - ) { - super(); - this.standAloneAnnotationAdapter = standAloneAnnotationAdapter; - this.nestedAnnotationAdapter = new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, elementName, index, nestedAnnotationName); - this.zeroNestedAnnotationAdapter = new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, elementName, 0, nestedAnnotationName); - } - - - // ********** DeclarationAnnotationAdapter implementation ********** - - public Annotation getAnnotation(ModifiedDeclaration declaration) { - if (this.getIndex() == 0) { - // check for the stand-alone annotation - Annotation standAloneAnnotation = this.standAloneAnnotation(declaration); - if (standAloneAnnotation != null) { - return standAloneAnnotation; - } - } - return this.nestedAnnotation(declaration); - } - - /** - *
    -	 * [none] => @Inner
    -	 *     or
    -	 * @Inner("lorem ipsum") => @Inner
    -	 *     or
    -	 * @Inner(text="lorem ipsum") => @Inner
    -	 *     or
    -	 * @Outer(foo={@Inner, @Inner}) => @Outer(foo={@Inner, @Inner, @Inner})
    -	 *     or
    -	 * @Outer(foo=@Inner) => @Outer(foo={@Inner, @Inner})
    -	 *     or
    -	 * @Inner => @Outer(foo={@Inner, @Inner})
    -	 *     etc.
    -	 * 
    - */ - public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) { - return (MarkerAnnotation) this.newAnnotation(MARKER_ANNOTATION_FACTORY, declaration); - } - - public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) { - return (SingleMemberAnnotation) this.newAnnotation(SINGLE_MEMBER_ANNOTATION_FACTORY, declaration); - } - - public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) { - return (NormalAnnotation) this.newAnnotation(NORMAL_ANNOTATION_FACTORY, declaration); - } - - public void removeAnnotation(ModifiedDeclaration declaration) { - if (this.getIndex() == 0) { - // check for the stand-alone annotation - if (this.standAloneAnnotationIsPresent(declaration)) { - this.removeStandAloneAnnotation(declaration); - return; - } - } - this.removeNestedAnnotation(declaration); - if (this.nestedElementCanBeConvertedToStandAlone(declaration)) { - this.convertLastElementAnnotationToStandAloneAnnotation(declaration); - } - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - // if the annotation is missing, delegate to the nested annotation adapter - Annotation annotation = this.getAnnotation(declaration); - return (annotation != null) ? annotation : this.nestedAnnotationAdapter.astNode(declaration); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.annotationName()); - } - - - // ********** IndexedDeclarationAnnotationAdapter implementation ********** - - public int getIndex() { - return this.nestedAnnotationAdapter.getIndex(); - } - - public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) { - int oldIndex = this.getIndex(); - if (newIndex == oldIndex) { - return; - } - - Annotation standAloneAnnotation = this.standAloneAnnotation(declaration); - if (standAloneAnnotation == null) { - this.moveNestedAnnotation(newIndex, declaration); - if (this.nestedElementCanBeConvertedToStandAlone(declaration)) { - this.convertLastElementAnnotationToStandAloneAnnotation(declaration); - } - } else { - if ((oldIndex == 0) && (newIndex == 1)) { - // this is one of two situations where we transition from standalone to container - this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration); - this.moveNestedAnnotation(newIndex, declaration); - } else if (newIndex == 0) { - // we are moving a 'null' entry on top of the standalone, so remove it - this.removeStandAloneAnnotation(declaration); - } else { - throw new IllegalStateException("old index = " + oldIndex + "; new index = " + newIndex); - } - } - } - - - // ********** internal methods ********** - - /** - * build the appropriate new annotation, - * which may require moving the 0th annotation from "stand-alone" to "nested" - */ - private Annotation newAnnotation(AnnotationFactory annotationFactory, ModifiedDeclaration declaration) { - if (this.getIndex() == 0) { - return this.newZeroAnnotation(annotationFactory, declaration); - } - if (this.zeroNestedAnnotationIsPresent(declaration)) { - // manipulate the container annotation - ignore the stand-alone annotation(?) - // @Outer(foo=@Inner("zero")) => @Outer(foo={@Inner("zero"), @Inner}) - // or - // @Outer(foo={@Inner("zero"), @Inner("one")}) => @Outer(foo={@Inner("zero"), @Inner}) - return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration); - } - - // this is one of two situations where we transition from standalone to container - this.moveStandAloneAnnotationToContainerAnnotation(declaration); - // once the stand-alone annotation is moved to index=0, build the new annotation at index=1 - return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration); - } - - /** - * the index is 0 - build the appropriate new annotation, - * which may be either "stand-alone" or "nested" - */ - private Annotation newZeroAnnotation(AnnotationFactory annotationFactory, ModifiedDeclaration declaration) { - if (this.standAloneAnnotationIsPresent(declaration)) { - // replace the stand-alone annotation - ignore the container annotation(?) - // @Inner(text="lorem ipsum") => @Inner - return annotationFactory.newAnnotation(this.standAloneAnnotationAdapter, declaration); - } - if (this.containerAnnotationIsPresent(declaration)) { - // manipulate the container annotation - // @Outer(foo=@Inner(text="lorem ipsum")) => @Outer(foo=@Inner) - return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration); - } - // neither annotation is present - add a new stand-alone annotation - return annotationFactory.newAnnotation(this.standAloneAnnotationAdapter, declaration); - } - - /** - * move the stand-alone annotation to the container annotation at index=0 - */ - private void moveStandAloneAnnotationToContainerAnnotation(ModifiedDeclaration declaration) { - Annotation standAloneAnnotation = this.standAloneAnnotation(declaration); - if (standAloneAnnotation == null) { - throw new IllegalStateException("the stand-alone annotation is missing"); - } - this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration); - } - - /** - * move the specified, non-null, stand-alone annotation to - * the container annotation at index=0 - */ - private void moveStandAloneAnnotationToContainerAnnotation(Annotation standAloneAnnotation, ModifiedDeclaration declaration) { - if (standAloneAnnotation.isMarkerAnnotation()) { - this.zeroNestedAnnotationAdapter.newMarkerAnnotation(declaration); - } else if (standAloneAnnotation.isSingleMemberAnnotation()) { - Expression vv = ((SingleMemberAnnotation) standAloneAnnotation).getValue(); - vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv); - this.zeroNestedAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv); - } else if (standAloneAnnotation.isNormalAnnotation()) { - NormalAnnotation newNA = this.zeroNestedAnnotationAdapter.newNormalAnnotation(declaration); - List values = this.values(newNA); - for (MemberValuePair pair : this.values((NormalAnnotation) standAloneAnnotation)) { - values.add((MemberValuePair) ASTNode.copySubtree(pair.getAST(), pair)); - } - } else { - throw new IllegalStateException("unknown annotation type: " + standAloneAnnotation); - } - this.removeStandAloneAnnotation(declaration); - } - - /** - * return whether the "nested" annotation container has been reduced to - * a single element (and the array initializer is converted to just - * the single remaining element) and can be further converted to the - * "stand-alone" annotation: - *
    -	 *     @Outer(foo={@Inner("zero"), @Inner("one")}) =>
    -	 *     @Outer(foo=@Inner("zero")) =>
    -	 *     @Inner("zero")
    -	 * 
    - */ - private boolean nestedElementCanBeConvertedToStandAlone(ModifiedDeclaration declaration) { - Annotation containerAnnotation = this.containerAnnotation(declaration); - if (containerAnnotation == null) { - return false; - } - if (containerAnnotation.isMarkerAnnotation()) { - return false; - } - if (containerAnnotation.isSingleMemberAnnotation()) { - if (this.elementName().equals("value")) { - return (((SingleMemberAnnotation) containerAnnotation).getValue().getNodeType() != ASTNode.ARRAY_INITIALIZER) - && (this.zeroNestedAnnotationAdapter.getAnnotation(declaration) != null); - } - return false; - } - if (containerAnnotation.isNormalAnnotation()) { - NormalAnnotation na = (NormalAnnotation) containerAnnotation; - if (na.values().size() == 0) { - return false; // there are no elements present - } - if (na.values().size() != 1) { - return false; // there are other elements present - leave them all alone - } - MemberValuePair pair = (MemberValuePair) na.values().get(0); - if (this.elementName().equals(pair.getName().getFullyQualifiedName())) { - return (pair.getValue().getNodeType() != ASTNode.ARRAY_INITIALIZER) - && (this.zeroNestedAnnotationAdapter.getAnnotation(declaration) != null); - } - return false; - } - throw new IllegalStateException("unknown annotation type: " + containerAnnotation); - } - - /** - * move the annotation in the container annotation at index=0 - * to the stand-alone annotation - */ - private void convertLastElementAnnotationToStandAloneAnnotation(ModifiedDeclaration declaration) { - Annotation last = this.zeroNestedAnnotationAdapter.getAnnotation(declaration); - if (last == null) { - throw new IllegalStateException("the last nested annotation is missing"); - } else if (last.isMarkerAnnotation()) { - this.newStandAloneMarkerAnnotation(declaration); - } else if (last.isSingleMemberAnnotation()) { - Expression vv = ((SingleMemberAnnotation) last).getValue(); - vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv); - this.newStandAloneSingleMemberAnnotation(declaration).setValue(vv); - } else if (last.isNormalAnnotation()) { - NormalAnnotation newNA = this.newStandAloneNormalAnnotation(declaration); - List values = this.values(newNA); - for (MemberValuePair pair : this.values((NormalAnnotation) last)) { - values.add((MemberValuePair) ASTNode.copySubtree(pair.getAST(), pair)); - } - } else { - throw new IllegalStateException("unknown annotation type: " + last); - } - this.zeroNestedAnnotationAdapter.removeAnnotation(declaration); - } - - private boolean standAloneAnnotationIsPresent(ModifiedDeclaration declaration) { - return this.standAloneAnnotation(declaration) != null; - } - - private Annotation standAloneAnnotation(ModifiedDeclaration declaration) { - return this.standAloneAnnotationAdapter.getAnnotation(declaration); - } - - private MarkerAnnotation newStandAloneMarkerAnnotation(ModifiedDeclaration declaration) { - return this.standAloneAnnotationAdapter.newMarkerAnnotation(declaration); - } - - private SingleMemberAnnotation newStandAloneSingleMemberAnnotation(ModifiedDeclaration declaration) { - return this.standAloneAnnotationAdapter.newSingleMemberAnnotation(declaration); - } - - private NormalAnnotation newStandAloneNormalAnnotation(ModifiedDeclaration declaration) { - return this.standAloneAnnotationAdapter.newNormalAnnotation(declaration); - } - - private void removeStandAloneAnnotation(ModifiedDeclaration declaration) { - this.standAloneAnnotationAdapter.removeAnnotation(declaration); - } - - private Annotation nestedAnnotation(ModifiedDeclaration declaration) { - return this.nestedAnnotationAdapter.getAnnotation(declaration); - } - - private void moveNestedAnnotation(int newIndex, ModifiedDeclaration declaration) { - this.nestedAnnotationAdapter.moveAnnotation(newIndex, declaration); - } - - private void removeNestedAnnotation(ModifiedDeclaration declaration) { - this.nestedAnnotationAdapter.removeAnnotation(declaration); - } - - private boolean containerAnnotationIsPresent(ModifiedDeclaration declaration) { - return this.containerAnnotation(declaration) != null; - } - - private Annotation containerAnnotation(ModifiedDeclaration declaration) { - return this.nestedAnnotationAdapter.getOuterAnnotationAdapter().getAnnotation(declaration); - } - - private boolean zeroNestedAnnotationIsPresent(ModifiedDeclaration declaration) { - return this.zeroNestedAnnotation(declaration) != null; - } - - private Annotation zeroNestedAnnotation(ModifiedDeclaration declaration) { - return this.zeroNestedAnnotationAdapter.getAnnotation(declaration); - } - - private String annotationName() { - return this.nestedAnnotationAdapter.getAnnotationName(); - } - - private String elementName() { - return this.nestedAnnotationAdapter.getElementName(); - } - - @SuppressWarnings("unchecked") - protected List values(NormalAnnotation na) { - return na.values(); - } - - - // ********** annotation factories ********** - - /** - * define interface that allows us to "re-use" the nasty code in - * #newAnnotation(AnnotationFactory, ModifiedDeclaration) - */ - private interface AnnotationFactory { - Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration); - } - - private static final AnnotationFactory MARKER_ANNOTATION_FACTORY = new AnnotationFactory() { - public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) { - return adapter.newMarkerAnnotation(declaration); - } - @Override - public String toString() { - return "MarkerAnnotationFactory"; - } - }; - - private static final AnnotationFactory SINGLE_MEMBER_ANNOTATION_FACTORY = new AnnotationFactory() { - public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) { - return adapter.newSingleMemberAnnotation(declaration); - } - @Override - public String toString() { - return "SingleMemberAnnotationFactory"; - } - }; - - private static final AnnotationFactory NORMAL_ANNOTATION_FACTORY = new AnnotationFactory() { - public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) { - return adapter.newNormalAnnotation(declaration); - } - @Override - public String toString() { - return "NormalAnnotationFactory"; - } - }; - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java deleted file mode 100644 index 11ead9d281..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.StringLiteral; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Wrap a declaration annotation element adapter that deals with AST - * expressions, converting them to/from various other objects. - * T is the type of the object to be passed to and returned by the adapter. - * E is the type of the expression to be converted by the converter. - */ -public class ConversionDeclarationAnnotationElementAdapter - implements DeclarationAnnotationElementAdapter -{ - /** - * The wrapped adapter that returns and takes AST expressions. - */ - private final DeclarationAnnotationElementAdapter adapter; - - /** - * The converter that converts AST expressions to other objects - * (e.g. Strings). - */ - private final ExpressionConverter converter; - - - // ********** constructors ********** - - /** - * The default element name is "value"; the default behavior is to - * remove the annotation when the last element is removed; - * the default expression converter expects string literals. - */ - public static ConversionDeclarationAnnotationElementAdapter forStrings(DeclarationAnnotationAdapter annotationAdapter) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, StringExpressionConverter.instance()); - } - - /** - * The default element name is "value"; the default behavior is to - * remove the annotation when the last element is removed. - */ - public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, ExpressionConverter converter) { - this(new ExpressionDeclarationAnnotationElementAdapter(annotationAdapter), converter); - } - - /** - * The default behavior is to remove the annotation when the last - * element is removed; the default expression converter expects - * string literals. - */ - public static ConversionDeclarationAnnotationElementAdapter forStrings(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, StringExpressionConverter.instance()); - } - - /** - * The default behavior is to remove the annotation when the last - * element is removed. - */ - public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter converter) { - this(new ExpressionDeclarationAnnotationElementAdapter(annotationAdapter, elementName), converter); - } - - /** - * The default expression converter expects string literals. - */ - public static ConversionDeclarationAnnotationElementAdapter forStrings(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) { - return new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, removeAnnotationWhenEmpty, StringExpressionConverter.instance()); - } - - public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty, ExpressionConverter converter) { - this(new ExpressionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, removeAnnotationWhenEmpty), converter); - } - - public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationElementAdapter adapter, ExpressionConverter converter) { - super(); - this.adapter = adapter; - this.converter = converter; - } - - - // ********** DeclarationAnnotationElementAdapter implementation ********** - - public T getValue(ModifiedDeclaration declaration) { - return this.converter.convert(this.adapter.getValue(declaration)); - } - - public void setValue(T value, ModifiedDeclaration declaration) { - this.adapter.setValue(this.converter.convert(value, this.adapter.astNode(declaration).getAST()), declaration); - } - - public Expression expression(ModifiedDeclaration declaration) { - return this.adapter.expression(declaration); - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - return this.adapter.astNode(declaration); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.adapter); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java deleted file mode 100644 index b8c551bc83..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; - -/** - * Provide clients with a pluggable way to manipulate an - * annotation modifying a "declaration". - * - * TODO specify how multiple annotations with the same name are to be handled - */ -public interface DeclarationAnnotationAdapter { - - /** - * Given the specified declaration, return the annotation. - */ - Annotation getAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, modify it with - * a new marker annotation, replacing the original annotation if present. - * Return the new annotation. - */ - MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, modify it with - * a new single member annotation, replacing the original annotation if present. - * Return the new annotation. - */ - SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, modify it with - * a new normal annotation, replacing the original annotation if present. - * Return the new annotation. - */ - NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration); - - /** - * Remove the annotation from the specified declaration. - */ - void removeAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, return the AST node - * corresponding to the annotation. - * If the annotation is missing, return its parent node. - */ - ASTNode astNode(ModifiedDeclaration declaration); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java deleted file mode 100644 index 3d08445111..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Expression; - -/** - * Provide clients with a pluggable way to manipulate an - * annotation element modifying a "declaration". - * T is the type of the object to be passed to and returned by the adapter. - */ -public interface DeclarationAnnotationElementAdapter { - - /** - * Given the specified declaration, return the value of the - * annotation element. Return null if the element is not present. - */ - T getValue(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, set the value of the - * annotation element. Setting the value of the element - * to null will cause the element to be removed from its - * annotation. - */ - void setValue(T value, ModifiedDeclaration declaration); - - /** - * Given the specified declaration, return the element's value expression. - * Return null if the element is not present. - */ - Expression expression(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, return the AST node - * corresponding to the element's value. - * If the element is missing, return the annotation's node. - */ - ASTNode astNode(ModifiedDeclaration declaration); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java deleted file mode 100644 index 7d153b9b21..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.ArrayInitializer; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.Name; - -/** - * Wrap a declaration annotation element adapter and simply - * add an import for the enums when necessary. - */ -public class EnumArrayDeclarationAnnotationElementAdapter - implements DeclarationAnnotationElementAdapter -{ - /** - * The wrapped adapter that returns and takes name strings (enums). - */ - private final ConversionDeclarationAnnotationElementAdapter adapter; - - - // ********** constructors ********** - - /** - * The default element name is "value"; the default behavior is to - * remove the annotation when the last element is removed. - */ - public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) { - this(annotationAdapter, "value"); - } - - /** - * The default behavior is to remove the annotation when the last - * element is removed. - */ - public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - this(annotationAdapter, elementName, true); - } - - public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) { - this(new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, removeAnnotationWhenEmpty, buildExpressionConverter())); - } - - private static ExpressionConverter buildExpressionConverter() { - return new StringArrayExpressionConverter(NameStringExpressionConverter.instance()); - } - - protected EnumArrayDeclarationAnnotationElementAdapter(ConversionDeclarationAnnotationElementAdapter adapter) { - super(); - this.adapter = adapter; - } - - - // ********** DeclarationAnnotationElementAdapter implementation ********** - - public String[] getValue(ModifiedDeclaration declaration) { - return this.resolve(this.adapter.expression(declaration), declaration); - } - - public void setValue(String[] value, ModifiedDeclaration declaration) { - this.adapter.setValue(this.convertToShortNames(value, declaration), declaration); - } - - public Expression expression(ModifiedDeclaration declaration) { - return this.adapter.expression(declaration); - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - return this.adapter.astNode(declaration); - } - - - // ********** internal methods ********** - - /** - * resolve the enums - */ - protected String[] resolve(Expression enumsExpression, ModifiedDeclaration declaration) { - if (enumsExpression == null) { - return null; - } - ArrayInitializer ai = (ArrayInitializer) enumsExpression; - List expressions = this.expressions(ai); - int len = expressions.size(); - String[] enums = new String[len]; - for (int i = len; i-- > 0; ) { - enums[i] = JDTTools.resolveEnum(declaration.iCompilationUnit(), expressions.get(i)); - } - return enums; - } - - @SuppressWarnings("unchecked") - private List expressions(ArrayInitializer arrayInitializer) { - return arrayInitializer.expressions(); - } - - /** - * convert the fully-qualified enums to static imports and short names - */ - protected String[] convertToShortNames(String[] enums, ModifiedDeclaration declaration) { - if (enums == null) { - return null; - } - int len = enums.length; - String[] shortNames = new String[len]; - for (int i = len; i-- > 0; ) { - declaration.addStaticImport(enums[i]); // e.g. "javax.persistence.CascadeType.REFRESH" - shortNames[i] = this.shortName(enums[i]); // e.g. "EAGER" - } - return shortNames; - } - - protected String shortTypeName(String name) { - return name.substring(0, name.lastIndexOf('.')); - } - - protected String shortName(String name) { - return name.substring(name.lastIndexOf('.') + 1); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java deleted file mode 100644 index 838860f486..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.Name; - -/** - * Wrap a declaration annotation element adapter and simply - * add an import for the enum when necessary. - */ -public class EnumDeclarationAnnotationElementAdapter - implements DeclarationAnnotationElementAdapter -{ - /** - * The wrapped adapter that returns and takes name strings (enums). - */ - private final ConversionDeclarationAnnotationElementAdapter adapter; - - - // ********** constructors ********** - - /** - * The default element name is "value"; the default behavior is to - * remove the annotation when the last element is removed. - */ - public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) { - this(annotationAdapter, "value"); - } - - /** - * The default behavior is to remove the annotation when the last - * element is removed. - */ - public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - this(annotationAdapter, elementName, true); - } - - public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) { - this(new ConversionDeclarationAnnotationElementAdapter(annotationAdapter, elementName, removeAnnotationWhenEmpty, NameStringExpressionConverter.instance())); - } - - protected EnumDeclarationAnnotationElementAdapter(ConversionDeclarationAnnotationElementAdapter adapter) { - super(); - this.adapter = adapter; - } - - - // ********** DeclarationAnnotationElementAdapter implementation ********** - - public String getValue(ModifiedDeclaration declaration) { - return this.resolve(this.adapter.expression(declaration), declaration); - } - - public void setValue(String value, ModifiedDeclaration declaration) { - this.adapter.setValue(this.convertToShortName(value, declaration), declaration); - } - - public Expression expression(ModifiedDeclaration declaration) { - return this.adapter.expression(declaration); - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - return this.adapter.astNode(declaration); - } - - - // ********** internal methods ********** - - /** - * resolve the enum - */ - protected String resolve(Expression enumExpression, ModifiedDeclaration declaration) { - return (enumExpression == null) ? null : JDTTools.resolveEnum(declaration.iCompilationUnit(), enumExpression); - } - - /** - * convert the fully-qualified enum to a static import and its short name - */ - protected String convertToShortName(String string, ModifiedDeclaration declaration) { - if (string == null) { - return null; - } - declaration.addStaticImport(string); // e.g. "javax.persistence.FetchType.EAGER" - return this.shortName(string); // e.g. "EAGER" - } - - protected String shortTypeName(String name) { - return name.substring(0, name.lastIndexOf('.')); - } - - protected String shortName(String name) { - return name.substring(name.lastIndexOf('.') + 1); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java deleted file mode 100644 index 4bce4344d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.Expression; - -/** - * Define the protocol for converting an AST expression back and forth - * from an arbitrary type (e.g. StringLiteral <=> String). - * E is the expression type. - * T is the type of the object to be converted to and from an expression. - */ -public interface ExpressionConverter { - - /** - * Convert the specified object to an - * expression that is owned by the specified AST. - * The type of the object is determined by the - * contract specified by the client. - */ - E convert(T object, AST ast); - - /** - * Convert the specified expression to an object of some - * pre-determined type. - */ - T convert(E expression); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java deleted file mode 100644 index 9f7cd03a5f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,359 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Most obvious implementation of the interface. - * Assume the element's value is an Expression. - */ -public class ExpressionDeclarationAnnotationElementAdapter - implements DeclarationAnnotationElementAdapter -{ - /** - * Adapter used to manipulate the element's annotation. - */ - private final DeclarationAnnotationAdapter annotationAdapter; - - /** - * The name of the relevant annotation element. - */ - private final String elementName; - - /** - * Flag to indicate whether the element's annotation is to be - * completely removed if, when the element itself is removed, - * the annotation has no remaining elements. - */ - private final boolean removeAnnotationWhenEmpty; - - - // ********** constructors ********** - - /** - * The default element name is "value"; the default behavior is to - * remove the annotation when the last element is removed. - */ - public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) { - this(annotationAdapter, "value"); - } - - /** - * The default element name is "value". - */ - public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, boolean removeAnnotationWhenEmpty) { - this(annotationAdapter, "value", removeAnnotationWhenEmpty); - } - - /** - * The default behavior is to remove the annotation when the last - * element is removed. - */ - public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { - this(annotationAdapter, elementName, true); - } - - public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) { - super(); - this.annotationAdapter = annotationAdapter; - this.elementName = elementName; - this.removeAnnotationWhenEmpty = removeAnnotationWhenEmpty; - } - - - // ********** DeclarationAnnotationElementAdapter implementation ********** - - public E getValue(ModifiedDeclaration declaration) { - // return the expression unmodified - return this.expression(declaration); - } - - public void setValue(E value, ModifiedDeclaration declaration) { - this.setValue(value, this.annotationAdapter.getAnnotation(declaration), declaration); - } - - public E expression(ModifiedDeclaration declaration) { - return this.expression(this.annotationAdapter.getAnnotation(declaration)); - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - Expression exp = this.expression(declaration); - return (exp != null) ? exp : this.annotationAdapter.astNode(declaration); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.elementName); - } - - - // ********** expression ********** - - /** - * Return the expression value of the *first* annotation element - * with the adapter's element name. - * Return null if the annotation has no such element. - * (An element name of "value" will return the value of a single - * member annotation.) - */ - protected E expression(Annotation annotation) { - if (annotation == null) { - return this.expressionNoAnnotation(); - } - if (annotation.isMarkerAnnotation()) { - return this.expressionMarkerAnnotation((MarkerAnnotation) annotation); - } - if (annotation.isSingleMemberAnnotation()) { - return this.expressionSingleMemberAnnotation((SingleMemberAnnotation) annotation); - } - if (annotation.isNormalAnnotation()) { - return this.expressionNormalAnnotation((NormalAnnotation) annotation); - } - throw new IllegalArgumentException("unknown annotation type: " + annotation); - } - - protected E expressionNoAnnotation() { - return null; - } - - /** - * Return the expression value of the *first* annotation element - * with the adapter's element name. - * Return null if the annotation has no such element. - */ - protected E expressionMarkerAnnotation(MarkerAnnotation annotation) { - return null; - } - - /** - * Return the expression value of the *first* annotation element - * with the adapter's element name. - * Return null if the annotation has no such element. - */ - protected E expressionSingleMemberAnnotation(SingleMemberAnnotation annotation) { - return this.downcast(this.elementName.equals("value") ? annotation.getValue() : null); - } - - @SuppressWarnings("unchecked") - private E downcast(Expression e) { - return (E) e; - } - - /** - * Return the expression value of the *first* annotation element - * with the adapter's element name. - * Return null if the annotation has no such element. - */ - protected E expressionNormalAnnotation(NormalAnnotation annotation) { - MemberValuePair pair = this.memberValuePair(annotation); - return this.downcast((pair == null) ? null : pair.getValue()); - } - - - // ********** set value ********** - - /** - * set non-null, non-empty value - */ - protected void setValue(Expression value, Annotation annotation, ModifiedDeclaration declaration) { - if (value == null) { - this.removeElement(annotation, declaration); - } - else if (annotation == null) { - this.setValueNoAnnotation(value, declaration); - } - else if (annotation.isMarkerAnnotation()) { - this.setValueMarkerAnnotation(value, (MarkerAnnotation) annotation, declaration); - } - else if (annotation.isSingleMemberAnnotation()) { - this.setValueSingleMemberAnnotation(value, (SingleMemberAnnotation) annotation, declaration); - } - else if (annotation.isNormalAnnotation()) { - this.setValueNormalAnnotation(value, (NormalAnnotation) annotation, declaration); - } - else { - throw new IllegalArgumentException("unknown annotation type: " + annotation); - } - } - - /** - * add non-null, non-empty value - */ - protected void setValueNoAnnotation(Expression value, ModifiedDeclaration declaration) { - if (this.elementName.equals("value")) { - // @Foo("xxx") - this.annotationAdapter.newSingleMemberAnnotation(declaration).setValue(value); - } else { - // @Foo(bar="xxx") - this.addValue(value, this.annotationAdapter.newNormalAnnotation(declaration)); - } - } - - protected void addValue(Expression value, NormalAnnotation annotation) { - this.addValue(value, annotation, this.elementName); - } - - protected void addValue(Expression value, NormalAnnotation annotation, String annotationElementName) { - AST ast = annotation.getAST(); - MemberValuePair pair = ast.newMemberValuePair(); - pair.setName(ast.newSimpleName(annotationElementName)); - pair.setValue(value); - List values = this.values(annotation); - values.add(pair); - } - - protected void setValueMarkerAnnotation(Expression value, MarkerAnnotation annotation, ModifiedDeclaration declaration) { - // @Foo => @Foo("xxx") - // or - // @Foo => @Foo(bar="xxx") - this.setValueNoAnnotation(value, declaration); - } - - protected void setValueSingleMemberAnnotation(Expression value, SingleMemberAnnotation annotation, ModifiedDeclaration declaration) { - if (this.elementName.equals("value")) { - // @Foo("yyy") => @Foo("xxx") - annotation.setValue(value); - } else { - // @Foo("yyy") => @Foo(value="yyy", bar="xxx") - Expression vv = annotation.getValue(); - vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv); - NormalAnnotation normalAnnotation = this.annotationAdapter.newNormalAnnotation(declaration); - this.addValue(vv, normalAnnotation, "value"); - this.addValue(value, normalAnnotation); - } - } - - protected void setValueNormalAnnotation(Expression value, NormalAnnotation annotation, ModifiedDeclaration declaration) { - MemberValuePair pair = this.memberValuePair(annotation); - if (pair == null) { - this.addValue(value, annotation); - } else { - pair.setValue(value); - } - } - - - // ********** remove element ********** - - protected void removeElement(Annotation annotation, ModifiedDeclaration declaration) { - if (annotation == null) { - this.removeElementNoAnnotation(declaration); - } - else if (annotation.isMarkerAnnotation()) { - this.removeElementMarkerAnnotation((MarkerAnnotation) annotation, declaration); - } - else if (annotation.isSingleMemberAnnotation()) { - this.removeElementSingleMemberAnnotation((SingleMemberAnnotation) annotation, declaration); - } - else if (annotation.isNormalAnnotation()) { - this.removeElementNormalAnnotation((NormalAnnotation) annotation, declaration); - } - else { - throw new IllegalArgumentException("unknown annotation type: " + annotation); - } - } - - protected void removeElementNoAnnotation(ModifiedDeclaration declaration) { - // the element is already gone (?) - } - - protected void removeElementMarkerAnnotation(MarkerAnnotation annotation, ModifiedDeclaration declaration) { - // the element is already gone (?) - } - - protected void removeElementSingleMemberAnnotation(SingleMemberAnnotation annotation, ModifiedDeclaration declaration) { - if (this.elementName.equals("value")) { - if (this.removeAnnotationWhenEmpty) { - // @Foo("xxx") => - this.annotationAdapter.removeAnnotation(declaration); - } else { - // @Foo("xxx") => @Foo - this.annotationAdapter.newMarkerAnnotation(declaration); - } - } else { - // the [non-'value'] element is already gone (?) - } - } - - protected void removeElementNormalAnnotation(NormalAnnotation annotation, ModifiedDeclaration declaration) { - List values = this.values(annotation); - if ((values.size() == 1) && values.get(0).getName().getFullyQualifiedName().equals(this.elementName)) { - if (this.removeAnnotationWhenEmpty) { - // @Foo(bar="xxx") => - this.annotationAdapter.removeAnnotation(declaration); - } else { - // @Foo(bar="xxx") => @Foo - this.annotationAdapter.newMarkerAnnotation(declaration); - } - } else { - this.removeElement(annotation); - if (values.size() == 1) { - MemberValuePair pair = values.get(0); - if (pair.getName().getFullyQualifiedName().equals("value")) { - // @Foo(bar="xxx", value="yyy") => @Foo("yyy") - Expression vv = pair.getValue(); - vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv); - this.annotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv); - } else { - // @Foo(bar="xxx", baz="yyy") => @Foo(baz="yyy") - } - } else { - // @Foo(bar="xxx", baz="yyy", joo="xxx") => @Foo(baz="yyy", joo="xxx") - } - } - } - - /** - * Remove the *first* member value pair from the specified annotation element - * with the adapter's element name. - */ - protected void removeElement(NormalAnnotation annotation) { - for (Iterator stream = this.values(annotation).iterator(); stream.hasNext(); ) { - MemberValuePair pair = stream.next(); - if (pair.getName().getFullyQualifiedName().equals(this.elementName)) { - stream.remove(); - } - } - } - - - // ********** convenience methods ********** - - /** - * Return the *first* member value pair for the specified annotation element - * with the adapter's element name. - * Return null if the annotation has no such element. - */ - protected MemberValuePair memberValuePair(NormalAnnotation annotation) { - for (MemberValuePair pair : this.values(annotation)) { - if (pair.getName().getFullyQualifiedName().equals(this.elementName)) { - return pair; - } - } - return null; - } - - @SuppressWarnings("unchecked") - protected List values(NormalAnnotation na) { - return na.values(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java deleted file mode 100644 index fe343b4b73..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.IField; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.FieldDeclaration; -import org.eclipse.jdt.core.dom.VariableDeclarationFragment; - -/** - * Adapt and extend a jdt field. - * Attribute based on a Java field, e.g. - * private int foo; - */ -public class FieldAttribute extends Attribute { - - public FieldAttribute(IField field) { - super(field); - } - - @Override - public IField getJdtMember() { - return (IField) super.getJdtMember(); - } - - @Override - public FieldDeclaration bodyDeclaration() { - return (FieldDeclaration) super.bodyDeclaration(); - } - - - // ********** Member implementation ********** - - @Override - public FieldDeclaration bodyDeclaration(CompilationUnit astRoot) { - String fieldName = this.getName(); - for (FieldDeclaration fieldDeclaration : this.declaringTypeDeclaration(astRoot).getFields()) { - // handle multiple fields declared in a single statement: - // private int foo, bar; - for (VariableDeclarationFragment fragment : this.fragments(fieldDeclaration)) { - if (fragment.getName().getFullyQualifiedName().equals(fieldName)) { - return fieldDeclaration; - } - } - } - return null; - } - - - // ********** Attribute implementation ********** - - @Override - public boolean isField() { - return true; - } - - @Override - public String attributeName() { - return this.getName(); - } - - @Override - public String typeSignature() { - try { - return this.getJdtMember().getTypeSignature(); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - - // ********** miscellaneous ********** - - @SuppressWarnings("unchecked") - protected List fragments(FieldDeclaration fd) { - return fd.fragments(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java deleted file mode 100644 index 47ba35c993..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -/** - * Adapt an indexed Java annotation with a simple-to-use interface. - */ -public interface IndexedAnnotationAdapter extends AnnotationAdapter { - - /** - * Return the the index at which the annotation is situated. - */ - int index(); - - /** - * Move the annotation to the specified index, leaving its original - * position cleared out. - */ - void moveAnnotation(int newIndex); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java deleted file mode 100644 index e3add1b167..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -/** - * Allow clients to manipulate an annotation within an array of annotations. - */ -public interface IndexedDeclarationAnnotationAdapter extends DeclarationAnnotationAdapter { - - /** - * Return the the index at which the annotation is situated. - */ - int getIndex(); - - /** - * Move the annotation to the specified index, leaving its original - * position cleared out. - */ - void moveAnnotation(int newIndex, ModifiedDeclaration declaration); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java deleted file mode 100644 index 203c17a9e8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IClassFile; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IImportDeclaration; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IMember; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.core.compiler.CategorizedProblem; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTParser; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.internal.codeassist.ISelectionRequestor; -import org.eclipse.jdt.internal.codeassist.SelectionEngine; -import org.eclipse.jdt.internal.core.DefaultWorkingCopyOwner; -import org.eclipse.jdt.internal.core.JavaProject; -import org.eclipse.jdt.internal.core.SearchableEnvironment; -import org.eclipse.jpt.core.internal.JptCorePlugin; - -public class JDTTools { - - /** - * add a "normal" import, as opposed to a "static" import - */ - public static IImportDeclaration addImport(ICompilationUnit compilationUnit, String importElement) { - return addImport(compilationUnit, importElement, Flags.AccDefault); - } - - /** - * this doesn't work yet... see eclipse bugzilla 143684 - */ - public static IImportDeclaration addStaticImport(ICompilationUnit compilationUnit, String importElement) { - return addImport(compilationUnit, importElement, Flags.AccStatic); - } - - public static IImportDeclaration addImport(ICompilationUnit compilationUnit, String importElement, int flags) { - try { - return compilationUnit.createImport(importElement, null, flags, null); // null = place at end of import list; null = no progress monitor - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Build an AST for the specified member's compilation unit or class file. - */ - public static CompilationUnit createASTRoot(IMember member) { - return (member.isBinary()) ? - createASTRoot(member.getClassFile()) // the class file must have a source attachment - : - createASTRoot(member.getCompilationUnit()); - } - - public static CompilationUnit createASTRoot(IClassFile classFile) { - ASTParser parser = ASTParser.newParser(AST.JLS3); - parser.setSource(classFile); - return (CompilationUnit) parser.createAST(null); - - } - - public static CompilationUnit createASTRoot(ICompilationUnit compilationUnit) { - ASTParser parser = ASTParser.newParser(AST.JLS3); - parser.setSource(compilationUnit); - return (CompilationUnit) parser.createAST(null); - } - - public static IType findType(String packageName, String qualifiedTypeName, IJavaProject javaProject) { - try { - if (javaProject != null) { - return javaProject.findType(packageName, qualifiedTypeName.replace('$', '.')); - } - } - catch (JavaModelException jme) { - JptCorePlugin.log(jme); - } - return null; - } - - /** - * Resolve the specified signature in the scope of the specified jdt type. - * Return the fully-qualified type name or return null if it cannot be - * resolved unambiguously. - */ - public static String resolveSignature(String signature, IType type) { - String elementSignature = Signature.getElementType(signature); - if (signatureIsPrimitive(elementSignature)) { - return Signature.toString(signature); // no need to resolve primitives - } - String elementTypeName = Signature.toString(elementSignature); - elementTypeName = resolve(elementTypeName, type); - if (elementTypeName == null) { - return null; // unable to resolve type - } - int arrayCount = Signature.getArrayCount(signature); - if (arrayCount == 0) { - return elementTypeName; - } - StringBuffer sb = new StringBuffer(elementTypeName.length() + 2*arrayCount); - sb.append(elementTypeName); - for (int i = arrayCount; i-- > 0; ) { - sb.append('[').append(']'); - } - return sb.toString(); - } - - /** - * Resolve the specified type name in the scope of the specified jdt type. - * Return the fully-qualified type name or return null if it cannot be - * resolved unambiguously. - */ - public static String resolve(String typeName, IType type) { - try { - return resolve_(typeName, type); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private static String resolve_(String typeName, IType type) throws JavaModelException { - String[][] resolvedTypes = type.resolveType(typeName); - // if more than one resolved type is returned, the type name is ambiguous - if (resolvedTypes == null) { - return null; - } - if (resolvedTypes.length > 1) { - return null; - } - return resolvedTypes[0][0] + "." + resolvedTypes[0][1]; - } - - public static boolean signatureIsPrimitive(String signature) { - return Signature.getTypeSignatureKind(signature) == Signature.BASE_TYPE_SIGNATURE; - } - - public static String resolveEnum(ICompilationUnit sourceUnit, Expression enumExpression) { - return resolveEnum(sourceUnit, enumExpression.getStartPosition(), enumExpression.getStartPosition() + enumExpression.getLength() - 1); - } - - public static String resolveEnum(ICompilationUnit sourceUnit, int enumSourceStart, int enumSourceEnd) { - try { - return resolveEnum_(sourceUnit, enumSourceStart, enumSourceEnd); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private static String resolveEnum_(ICompilationUnit sourceUnit, int enumSourceStart, int enumSourceEnd) throws JavaModelException { - String[][] resolvedEnums = resolveField_((org.eclipse.jdt.internal.core.CompilationUnit) sourceUnit, enumSourceStart, enumSourceEnd); - // if more than one resolved enum is returned, the enum name is ambiguous - if (resolvedEnums == null) { - return null; - } - if (resolvedEnums.length > 1) { - return null; - } - return resolvedEnums[0][0] + "." + resolvedEnums[0][1] + "." + resolvedEnums[0][2]; - } - - // code lifted from SourceType.resolveType(String, WorkingCopyOwner) - private static String[][] resolveField_(org.eclipse.jdt.internal.core.CompilationUnit sourceUnit, int selectionSourceStart, int selectionSourceEnd) throws JavaModelException { - class TypeResolveRequestor implements ISelectionRequestor { - String[][] answers = null; - public void acceptType(char[] packageName, char[] tName, int modifiers, boolean isDeclaration, char[] uniqueKey, int start, int end) { - // ignore - } - public void acceptError(CategorizedProblem error) { - // ignore - } - public void acceptField(char[] declaringTypePackageName, char[] declaringTypeName, char[] fieldName, boolean isDeclaration, char[] uniqueKey, int start, int end) { - String[] answer = new String[] {new String(declaringTypePackageName), new String(declaringTypeName), new String(fieldName) }; - if (this.answers == null) { - this.answers = new String[][]{ answer }; - } else { - int len = this.answers.length; - System.arraycopy(this.answers, 0, this.answers = new String[len+1][], 0, len); - this.answers[len] = answer; - } - } - public void acceptMethod(char[] declaringTypePackageName, char[] declaringTypeName, String enclosingDeclaringTypeSignature, char[] selector, char[][] parameterPackageNames, char[][] parameterTypeNames, String[] parameterSignatures, char[][] typeParameterNames, char[][][] typeParameterBoundNames, boolean isConstructor, boolean isDeclaration, char[] uniqueKey, int start, int end) { - // ignore - } - public void acceptPackage(char[] packageName){ - // ignore - } - public void acceptTypeParameter(char[] declaringTypePackageName, char[] declaringTypeName, char[] typeParameterName, boolean isDeclaration, int start, int end) { - // ignore - } - public void acceptMethodTypeParameter(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, int selectorStart, int selcetorEnd, char[] typeParameterName, boolean isDeclaration, int start, int end) { - // ignore - } - - } - TypeResolveRequestor requestor = new TypeResolveRequestor(); - JavaProject project = (JavaProject) sourceUnit.getJavaProject(); - SearchableEnvironment environment = project.newSearchableNameEnvironment(DefaultWorkingCopyOwner.PRIMARY); - - SelectionEngine engine = new SelectionEngine(environment, requestor, project.getOptions(true)); - - engine.select(sourceUnit, selectionSourceStart, selectionSourceEnd); - return requestor.answers; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java deleted file mode 100644 index e76927bb9a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java +++ /dev/null @@ -1,416 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.core.filebuffers.FileBuffers; -import org.eclipse.core.filebuffers.ITextFileBuffer; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IMember; -import org.eclipse.jdt.core.ISourceRange; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.SimpleTextRange; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.text.edits.TextEdit; - -/** - * Adapt and extend a JDT member with simplified annotation handling. - */ -public abstract class Member { - - private final IMember jdtMember; - - /** this will be null for a top-level type */ - private final Type declaringType; - - - // ********** constructor ********** - - Member(IMember jdtMember) { - super(); - this.jdtMember = jdtMember; - IType jdtDeclaringType = jdtMember.getDeclaringType(); - this.declaringType = (jdtDeclaringType == null) ? null : new Type(jdtDeclaringType); - } - - - // ********** accessors ********** - - public IMember getJdtMember() { - return this.jdtMember; - } - - public boolean wraps(IMember member) { - return this.jdtMember.exists() - && this.jdtMember.equals(member); - } - - /** - * this will return null for a top-level type - */ - public Type getDeclaringType() { - return this.declaringType; - } - - - // ********** miscellaneous ********** - - public ICompilationUnit compilationUnit() { - return this.jdtMember.getCompilationUnit(); - } - - public String getName() { - return this.jdtMember.getElementName(); - } - - public Type topLevelDeclaringType() { - return this.declaringType.topLevelDeclaringType(); - } - - /** - * note: this creates a *new* AST - */ - public CompilationUnit astRoot() { - return JDTTools.createASTRoot(this.jdtMember); - } - - public ModifiedDeclaration modifiedDeclaration() { - return this.modifiedDeclaration(this.astRoot()); - } - - public ModifiedDeclaration modifiedDeclaration(CompilationUnit astRoot) { - return new ModifiedDeclaration(this.bodyDeclaration(astRoot)); - } - - public BodyDeclaration bodyDeclaration() { - return this.bodyDeclaration(this.astRoot()); - } - - public ITextRange textRange() { - return this.textRange(this.astRoot()); - } - - public ITextRange textRange(CompilationUnit astRoot) { - return this.textRange(this.bodyDeclaration(astRoot)); - } - - ITextRange textRange(ASTNode astNode) { - return (astNode == null) ? null : new ASTNodeTextRange(astNode); - } - - public ITextRange nameTextRange() { - return this.nameTextRange(this.astRoot()); - } - - public ITextRange nameTextRange(CompilationUnit astRoot) { - ISourceRange sourceRange = this.nameSourceRange(); - return - new SimpleTextRange( - sourceRange.getOffset(), - sourceRange.getLength(), - astRoot.getLineNumber(sourceRange.getOffset())); - } - - private ISourceRange nameSourceRange() { - try { - return getJdtMember().getNameRange(); - } - catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - /** - * this will throw a NPE for a top-level type - */ - TypeDeclaration declaringTypeDeclaration(CompilationUnit astRoot) { - return this.declaringType.bodyDeclaration(astRoot); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.getName()); - } - - - // ********** abstract methods ********** - - /** - * Return the member's body declaration. - */ - public abstract BodyDeclaration bodyDeclaration(CompilationUnit astRoot); - - - // ********** annotations ********** - - public Annotation annotation(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) { - return adapter.getAnnotation(this.modifiedDeclaration(astRoot)); - } - - public Annotation annotation(DeclarationAnnotationAdapter adapter) { - return this.annotation(adapter, this.astRoot()); - } - - public boolean containsAnnotation(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) { - return this.annotation(adapter, astRoot) != null; - } - - public boolean containsAnnotation(DeclarationAnnotationAdapter adapter) { - return this.containsAnnotation(adapter, this.astRoot()); - } - - /** - * Return whether the member contains any one of the specified annotations. - */ - public boolean containsAnyAnnotation(DeclarationAnnotationAdapter[] adapters) { - return this.containsAnyAnnotation(adapters, this.astRoot()); - } - - /** - * Return whether the member contains any one of the specified annotations. - */ - public boolean containsAnyAnnotation(DeclarationAnnotationAdapter[] adapters, CompilationUnit astRoot) { - for (DeclarationAnnotationAdapter adapter : adapters) { - if (this.containsAnnotation(adapter, astRoot)) { - return true; - } - } - return false; - } - - /** - * Return the text range corresponding to the specified annotation. - * If the annotation is missing, return null. - */ - public ITextRange annotationTextRange(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) { - return this.textRange(this.annotation(adapter, astRoot)); - } - - /** - * Return the text range corresponding to the specified annotation. - * If the annotation is missing, return null. - */ - public ITextRange annotationTextRange(DeclarationAnnotationAdapter adapter) { - return this.annotationTextRange(adapter, this.astRoot()); - } - - /** - * Return the AST node corresponding to the specified annotation. - * If the annotation is missing, return its parent node. - */ - public ASTNode annotationASTNode(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) { - return adapter.astNode(this.modifiedDeclaration(astRoot)); - } - - /** - * Return the AST node corresponding to the specified annotation. - * If the annotation is missing, return its parent node. - */ - public ASTNode annotationASTNode(DeclarationAnnotationAdapter adapter) { - return this.annotationASTNode(adapter, this.astRoot()); - } - - /** - * Add the specified marker annotation to the member. - */ - public void newMarkerAnnotation(final DeclarationAnnotationAdapter adapter) { - this.edit(new Editor() { - public void edit(ModifiedDeclaration declaration) { - adapter.newMarkerAnnotation(declaration); - } - }); - } - - /** - * Add the specified single member annotation to the member. - */ - public void newSingleMemberAnnotation(final DeclarationAnnotationAdapter adapter) { - this.edit(new Editor() { - public void edit(ModifiedDeclaration declaration) { - adapter.newSingleMemberAnnotation(declaration); - } - }); - } - - /** - * Add the specified normal annotation to the member. - */ - public void newNormalAnnotation(final DeclarationAnnotationAdapter adapter) { - this.edit(new Editor() { - public void edit(ModifiedDeclaration declaration) { - adapter.newNormalAnnotation(declaration); - } - }); - } - - /** - * Remove the specified annotation from the member. - */ - public void removeAnnotation(final DeclarationAnnotationAdapter adapter) { - this.edit(new Editor() { - public void edit(ModifiedDeclaration declaration) { - adapter.removeAnnotation(declaration); - } - }); - } - - - // ********** annotation elements ********** - - public T annotationElementValue(DeclarationAnnotationElementAdapter adapter, CompilationUnit astRoot) { - return adapter.getValue(this.modifiedDeclaration(astRoot)); - } - - public T annotationElementValue(DeclarationAnnotationElementAdapter adapter) { - return this.annotationElementValue(adapter, this.astRoot()); - } - - public Expression annotationElementExpression(DeclarationAnnotationElementAdapter adapter, CompilationUnit astRoot) { - return adapter.expression(this.modifiedDeclaration(astRoot)); - } - - public Expression annotationElementExpression(DeclarationAnnotationElementAdapter adapter) { - return this.annotationElementExpression(adapter, this.astRoot()); - } - - public boolean containsAnnotationElement(DeclarationAnnotationElementAdapter adapter, CompilationUnit astRoot) { - return this.annotationElementExpression(adapter, astRoot) != null; - } - - public boolean containsAnnotationElement(DeclarationAnnotationElementAdapter adapter) { - return this.containsAnnotationElement(adapter, this.astRoot()); - } - - /** - * Return the text range corresponding to the specified element. - * If the element is missing, return null. - */ - public ITextRange annotationElementTextRange(DeclarationAnnotationElementAdapter adapter, CompilationUnit astRoot) { - return this.textRange(this.annotationElementExpression(adapter, astRoot)); - } - - /** - * Return the text range corresponding to the specified element. - * If the element is missing, return null. - */ - public ITextRange annotationElementTextRange(DeclarationAnnotationElementAdapter adapter) { - return this.annotationElementTextRange(adapter, this.astRoot()); - } - - /** - * Return the AST node corresponding to the specified element. - * If the element is missing, return its parent node. - */ - public ASTNode annotationElementASTNode(DeclarationAnnotationElementAdapter adapter, CompilationUnit astRoot) { - return adapter.astNode(this.modifiedDeclaration(astRoot)); - } - - /** - * Return the AST node corresponding to the specified element. - * If the element is missing, return its parent node. - */ - public ASTNode annotationElementASTNode(DeclarationAnnotationElementAdapter adapter) { - return this.annotationElementASTNode(adapter, this.astRoot()); - } - - /** - * Set the value of the specified element. - */ - public void setAnnotationElementValue(final DeclarationAnnotationElementAdapter adapter, final T value) { - this.edit(new Editor() { - public void edit(ModifiedDeclaration declaration) { - adapter.setValue(value, declaration); - } - }); - } - - - // ********** editing ********** - - /** - * Edit the member with the specified editor. - * The editor will be invoked once the member's compilation unit - * is in an editable state. - */ - public void edit(Editor editor) { - try { - this.edit_(editor); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } catch (BadLocationException ex) { - throw new RuntimeException(ex); - } - } - - /** - * NB: Be careful changing this method. - * Things to look out for: - * - when editing via the JavaEditor there is no need to create a working copy - * - when editing headlessly, a "working copy" must be created - * (at least as far as I can tell ~kfm) - * - when editing via a plain text editor, make a working copy or else things are screwed - * up the second time you edit through the Persistence Properties View - */ - private void edit_(Editor editor) throws JavaModelException, BadLocationException { - ICompilationUnit compilationUnit = this.compilationUnit(); - if ( ! compilationUnit.isWorkingCopy()) { - compilationUnit.becomeWorkingCopy(null); - } - - ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(compilationUnit.getResource().getFullPath()); - boolean textEditorPresent = (buffer != null); - IDocument doc = textEditorPresent ? - buffer.getDocument() - : - new Document(compilationUnit.getBuffer().getContents()); - - CompilationUnit astRoot = this.astRoot(); - astRoot.recordModifications(); - - editor.edit(this.modifiedDeclaration(astRoot)); - - TextEdit edits = astRoot.rewrite(doc, compilationUnit.getJavaProject().getOptions(true)); - AnnotationEditFormatter formatter = new AnnotationEditFormatter(doc); - formatter.apply(edits); - - if ( ! textEditorPresent) { - compilationUnit.getBuffer().setContents(doc.get()); - compilationUnit.commitWorkingCopy(true, null); - compilationUnit.discardWorkingCopy(); - } - } - - - // ********** "editor" interface ********** - - /** - * This interface defines a callback that is invoked when the member's - * compilation unit is in a state to be manipulated. - */ - public interface Editor { - - /** - * Edit the specified declaration. - */ - void edit(ModifiedDeclaration declaration); - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java deleted file mode 100644 index 2ab8e28a5c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -/** - * Adapt a member and a declaration annotation adapter. - */ -public class MemberAnnotationAdapter extends AbstractAnnotationAdapter { - - - // ********** constructor ********** - - public MemberAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) { - super(member, daa); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java deleted file mode 100644 index 7c4d725480..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jpt.utility.internal.StringTools; - - /** - * Adapt a member and a declaration annotation element adapter. - */ -public class MemberAnnotationElementAdapter - implements AnnotationElementAdapter -{ - private final Member member; - private final DeclarationAnnotationElementAdapter daea; - - - // ********** constructor ********** - - public MemberAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter daea) { - super(); - this.member = member; - this.daea = daea; - } - - - // ********** AnnotationElementAdapter implementation ********** - - public T getValue() { - return this.daea.getValue(this.member.modifiedDeclaration()); - } - - public T getValue(CompilationUnit astRoot) { - return this.daea.getValue(this.member.modifiedDeclaration(astRoot)); - } - - public void setValue(T value) { - this.edit(this.buildSetValueEditor(value)); - } - - public Expression expression() { - return this.daea.expression(this.member.modifiedDeclaration()); - } - - public Expression expression(CompilationUnit astRoot) { - return this.daea.expression(this.member.modifiedDeclaration(astRoot)); - } - - public ASTNode astNode() { - return this.daea.astNode(this.member.modifiedDeclaration()); - } - - public ASTNode astNode(CompilationUnit astRoot) { - return this.daea.astNode(this.member.modifiedDeclaration(astRoot)); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.daea); - } - - - // ********** internal methods ********** - - protected void edit(Member.Editor editor) { - this.member.edit(editor); - } - - protected Member.Editor buildSetValueEditor(T value) { - return new SetValueEditor(value, this.daea); - } - - - // ********** member classes ********** - - protected static class SetValueEditor implements Member.Editor { - private final DeclarationAnnotationElementAdapter daea; - private final T value; - - SetValueEditor(T value, DeclarationAnnotationElementAdapter daea) { - super(); - this.value = value; - this.daea = daea; - } - public void edit(ModifiedDeclaration declaration) { - this.daea.setValue(this.value, declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java deleted file mode 100644 index 2358e4ec39..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Adapt a member and an indexed declaration annotation adapter. - */ -public class MemberIndexedAnnotationAdapter - extends AbstractAnnotationAdapter - implements IndexedAnnotationAdapter -{ - private final IndexedDeclarationAnnotationAdapter idaa; - - - // ********** constructor ********** - - public MemberIndexedAnnotationAdapter(Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(member, idaa); - this.idaa = idaa; - } - - - // ********** IndexedAnnotationAdapter implementation ********** - - public int index() { - return this.idaa.getIndex(); - } - - public void moveAnnotation(int newIndex) { - this.edit(this.buildMoveAnnotationEditor(newIndex)); - } - - - // ********** factory methods ********** - - protected Member.Editor buildMoveAnnotationEditor(int newIndex) { - return new MoveAnnotationEditor(this.idaa, newIndex); - } - - - // ********** member classes ********** - - protected static class MoveAnnotationEditor implements Member.Editor { - private final IndexedDeclarationAnnotationAdapter idaa; - private int index; - - MoveAnnotationEditor(IndexedDeclarationAnnotationAdapter idaa, int index) { - super(); - this.idaa = idaa; - this.index = index; - } - public void edit(ModifiedDeclaration declaration) { - this.idaa.moveAnnotation(this.index, declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java deleted file mode 100644 index b32979892d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.beans.Introspector; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.MethodDeclaration; - -/** - * Adapt and extend a jdt method. - * Attribute based on a Java property, e.g. - * private int getFoo() { - * return foo; - * } - * private void setFoo(int foo) { - * this.foo = foo; - * } - * - * For now we only hold the getter method, since that's where the - * annotations are put. - */ -public class MethodAttribute extends Attribute { - - public MethodAttribute(IMethod getMethod) { - super(getMethod); - } - - @Override - public IMethod getJdtMember() { - return (IMethod) super.getJdtMember(); - } - - @Override - public MethodDeclaration bodyDeclaration() { - return (MethodDeclaration) super.bodyDeclaration(); - } - - - // ********** Member implementation ********** - - @Override - public MethodDeclaration bodyDeclaration(CompilationUnit astRoot) { - String methodName = this.getName(); - for (MethodDeclaration methodDeclaration : this.declaringTypeDeclaration(astRoot).getMethods()) { - if (methodDeclaration.getName().getFullyQualifiedName().equals(methodName) - && (methodDeclaration.parameters().size() == 0)) { - return methodDeclaration; - } - } - return null; - } - - - // ********** Attribute implementation ********** - - @Override - public boolean isMethod() { - return true; - } - - /** - * "foo" returned for a method named "getFoo" or "isFoo" - */ - @Override - public String attributeName() { - String methodName = super.getName(); - int beginIndex = 0; - if (methodName.startsWith("get")) { - beginIndex = 3; - } else if (methodName.startsWith("is")) { - beginIndex = 2; - } - return Introspector.decapitalize(methodName.substring(beginIndex)); - } - - @Override - public String typeSignature() { - try { - return this.getJdtMember().getReturnType(); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java deleted file mode 100644 index 18c85208fe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java +++ /dev/null @@ -1,442 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.IExtendedModifier; -import org.eclipse.jdt.core.dom.ImportDeclaration; -import org.eclipse.jdt.core.dom.SingleVariableDeclaration; -import org.eclipse.jdt.core.dom.VariableDeclarationExpression; -import org.eclipse.jdt.core.dom.VariableDeclarationStatement; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * Define a wrapper that provides a common protocol for all the various AST - * declarations that have modifiers (i.e. there are a number of AST node - * classes that implement the method #modifiers(), but they do not implement - * a common interface): - * BodyDeclaration - * SingleVariableDeclaration - * VariableDeclarationExpression - * VariableDeclarationStatement - */ -public class ModifiedDeclaration { - private final Adapter adapter; - - - // ********** constructors ********** - - public ModifiedDeclaration(Adapter adapter) { - super(); - this.adapter = adapter; - } - - public ModifiedDeclaration(BodyDeclaration declaration) { - this(new BodyDeclarationAdapter(declaration)); - } - - public ModifiedDeclaration(SingleVariableDeclaration declaration) { - this(new SingleVariableDeclarationAdapter(declaration)); - } - - public ModifiedDeclaration(VariableDeclarationExpression declaration) { - this(new VariableDeclarationExpressionAdapter(declaration)); - } - - public ModifiedDeclaration(VariableDeclarationStatement declaration) { - this(new VariableDeclarationStatementAdapter(declaration)); - } - - - // ********** public methods ********** - - /** - * Return the "declaration" AST node. - */ - public ASTNode getDeclaration() { - return this.adapter.getDeclaration(); - } - - /** - * Return the declaration's list of modifiers. - * Element type: org.eclipse.jdt.core.dom.IExtendedModifier - */ - public List modifiers() { - return this.adapter.modifiers(); - } - - /** - * Return the "declaration" AST. - */ - public AST getAST() { - return this.getDeclaration().getAST(); - } - - public CompilationUnit compilationUnit() { - return (CompilationUnit) this.getDeclaration().getRoot(); - } - - public ICompilationUnit iCompilationUnit() { - return (ICompilationUnit) this.compilationUnit().getJavaElement(); - } - - public IType type() { - return this.compilationUnit().getTypeRoot().findPrimaryType(); - } - - /** - * Return the declaration's annotations. - */ - public Iterator annotations() { - return new FilteringIterator(this.modifiers().iterator()) { - @Override - protected boolean accept(Object next) { - return ((IExtendedModifier) next).isAnnotation(); - } - }; - } - - /** - * Return the *first* annotation with the specified name. - * Return null if the declaration has no such annotation. - */ - public Annotation getAnnotationNamed(String annotationName) { - for (Iterator stream = this.annotations(); stream.hasNext(); ) { - Annotation annotation = stream.next(); - if (this.annotationIsNamed(annotation, annotationName)) { - return annotation; - } - } - return null; - } - - /** - * Return whether the declaration has an annotation with the specified name. - */ - public boolean containsAnnotationNamed(String annotationName) { - return this.getAnnotationNamed(annotationName) != null; - } - - /** - * Add the specified annotation to the declaration. - * By convention annotations precede the "standard" (JLS2) modifiers; - * though, technically, they can be interspersed. - */ - public void addAnnotation(Annotation annotation) { - List modifiers = this.modifiers(); - for (ListIterator stream = modifiers.listIterator(); stream.hasNext(); ) { - if (stream.next().isModifier()) { - stream.previous(); // put the annotation *before* the first "standard" (JLS2) modifier - stream.add(annotation); - return; - } - } - modifiers.add(annotation); // just tack it on to the end - } - - /** - * Remove the *first* annotation with the specified name from the declaration. - */ - public void removeAnnotationNamed(String annotationName) { - for (Iterator stream = this.modifiers().iterator(); stream.hasNext(); ) { - IExtendedModifier modifier = stream.next(); - if (modifier.isAnnotation()) { - if (this.annotationIsNamed((Annotation) modifier, annotationName)) { - stream.remove(); - break; - } - } - } - } - - /** - * Remove the specified annotation from the declaration. - */ - public void removeAnnotation(Annotation annotation) { - if ( ! this.modifiers().remove(annotation)) { - throw new IllegalArgumentException("invalid annotation: " + annotation); - } - } - - /** - * Replace the specified old annotation with the specified new annotation. - */ - public void replaceAnnotation(Annotation oldAnnotation, Annotation newAnnotation) { - for (ListIterator stream = this.modifiers().listIterator(); stream.hasNext(); ) { - if (stream.next().equals(oldAnnotation)) { - stream.set(newAnnotation); - return; - } - } - throw new IllegalArgumentException("invalid old annotation: " + oldAnnotation); - } - - /** - * Replace the specified old annotation with the specified new annotation. - * If there is no annotation with the specified name, simply add the new - * annotation to the declaration's modifiers. - */ - public void replaceAnnotationNamed(String oldAnnotationName, Annotation newAnnotation) { - List modifiers = this.modifiers(); - for (ListIterator stream = modifiers.listIterator(); stream.hasNext(); ) { - IExtendedModifier modifier = stream.next(); - if (modifier.isAnnotation()) { - if (this.annotationIsNamed((Annotation) modifier, oldAnnotationName)) { - stream.set(newAnnotation); - return; - } - } - } - this.addAnnotation(newAnnotation); - } - - /** - * Add the specified import to the declaration's compilation unit. - */ - public void addImport(String importName) { - this.addImport(importName, false); - } - - /** - * Add the specified static import to the declaration's compilation unit. - */ - public void addStaticImport(String importName) { - this.addImport(importName, true); - } - - /** - * Add the specified import to the declaration's compilation unit. - */ - public void addImport(String importName, boolean static_) { - if (importName.indexOf('.') != -1) { - this.addImportTo(this.compilationUnit(), importName, static_); - } - } - - public String importFor(String shortName) { - return this.importFor(shortName, false); - } - - public String staticImportFor(String shortName) { - return this.importFor(shortName, true); - } - - // TODO handle wildcards - public String importFor(String shortName, boolean static_) { - if (shortName.indexOf('.') != -1) { - return shortName; - } - List imports = this.imports(this.compilationUnit()); - for (ImportDeclaration importDeclaration : imports) { - if (this.importIsFor(importDeclaration, shortName, static_)) { - return importDeclaration.getName().getFullyQualifiedName(); - } - } - return null; - } - - protected boolean importIsFor(ImportDeclaration importDeclaration, String shortName, boolean static_) { - if (importDeclaration.isStatic() != static_) { - return false; - } - String importDeclarationName = importDeclaration.getName().getFullyQualifiedName(); - return importDeclarationName.endsWith(shortName); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.adapter.toString()); - } - - - // ********** internal methods ********** - - /** - * Return whether the specified annotation has the specified name. - */ - boolean annotationIsNamed(Annotation annotation, String name) { - String qualifiedName = this.qualifiedName(annotation); - return (qualifiedName != null) && qualifiedName.equals(name); - } - - private String qualifiedName(Annotation annotation) { - String name = annotation.getTypeName().getFullyQualifiedName(); - if (name.indexOf('.') != -1) { - return name; // name is already qualified - } - String resolvedName = JDTTools.resolve(name, this.type()); - if (resolvedName != null) { - return resolvedName; - } - // hack(?): check for a matching import because when moving a stand-alone - // annotation to its container in CombinationIndexedDeclarationAnnotationAdapter - // the container's import is added but then it won't "resolve" upon - // subsequent lookups... :-( - return this.importFor(name); // look for a matching import - } - - /** - * Return whether the specified import was added without a collision. - */ - // TODO handle collisions (e.g. java.util.Date vs. java.sql.Date) - protected void addImportTo(CompilationUnit astRoot, String importName, boolean static_) { - List imports = this.imports(astRoot); - if (this.importsInclude(imports, importName, static_)) { - return; - } - AST ast = astRoot.getAST(); - ImportDeclaration import_ = ast.newImportDeclaration(); - import_.setName(ast.newName(importName)); - import_.setStatic(static_); - imports.add(import_); - } - - @SuppressWarnings("unchecked") - protected List imports(CompilationUnit astRoot) { - return astRoot.imports(); - } - - protected boolean importsInclude(List imports, String importName, boolean static_) { - for (ImportDeclaration importDeclaration : imports) { - if (this.importIncludes(importDeclaration, importName, static_)) { - return true; - } - } - return false; - } - - protected boolean importIncludes(ImportDeclaration importDeclaration, String importName, boolean static_) { - if (importDeclaration.isStatic() != static_) { - return false; - } - String importDeclarationName = importDeclaration.getName().getFullyQualifiedName(); - if (importName.equals(importDeclarationName)) { - return true; - } - if (importDeclaration.isOnDemand() - && this.onDemandNameFor(importName).equals(importDeclarationName)) { - return true; - } - return false; - } - - protected String onDemandNameFor(String importName) { - int lastPeriod = importName.lastIndexOf('.'); - return (lastPeriod == -1) ? "" : importName.substring(0, lastPeriod); - } - - - // ********** declaration adapter interface and implementations ********** - - /** - * Define common protocol among the various "declarations". - */ - public interface Adapter { - - /** - * Return the adapted "declaration". - */ - ASTNode getDeclaration(); - - /** - * Return the "declaration"'s list of modifiers. - * Element type: org.eclipse.jdt.core.dom.IExtendedModifier - */ - List modifiers(); - - } - - public static class BodyDeclarationAdapter implements Adapter { - private final BodyDeclaration declaration; - public BodyDeclarationAdapter(BodyDeclaration declaration) { - super(); - this.declaration = declaration; - } - public ASTNode getDeclaration() { - return this.declaration; - } - @SuppressWarnings("unchecked") - public List modifiers() { - return this.declaration.modifiers(); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.declaration.toString()); - } - } - - public static class SingleVariableDeclarationAdapter implements Adapter { - private final SingleVariableDeclaration declaration; - public SingleVariableDeclarationAdapter(SingleVariableDeclaration declaration) { - super(); - this.declaration = declaration; - } - public ASTNode getDeclaration() { - return this.declaration; - } - @SuppressWarnings("unchecked") - public List modifiers() { - return this.declaration.modifiers(); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.declaration.toString()); - } - } - - public static class VariableDeclarationExpressionAdapter implements Adapter { - private final VariableDeclarationExpression declaration; - public VariableDeclarationExpressionAdapter(VariableDeclarationExpression declaration) { - super(); - this.declaration = declaration; - } - public ASTNode getDeclaration() { - return this.declaration; - } - @SuppressWarnings("unchecked") - public List modifiers() { - return this.declaration.modifiers(); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.declaration.toString()); - } - } - - public static class VariableDeclarationStatementAdapter implements Adapter { - private final VariableDeclarationStatement declaration; - public VariableDeclarationStatementAdapter(VariableDeclarationStatement declaration) { - super(); - this.declaration = declaration; - } - public ASTNode getDeclaration() { - return this.declaration; - } - @SuppressWarnings("unchecked") - public List modifiers() { - return this.declaration.modifiers(); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.declaration.toString()); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java deleted file mode 100644 index 078835e845..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Name; - -/** - * Convert a name to/from a string representation of a name/identifier - * (e.g. "com.xxx.Foo.VALUE1" or "value"). - */ -public final class NameStringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new NameStringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private NameStringExpressionConverter() { - super(); - } - - @Override - protected Name convert_(String string, AST ast) { - return ast.newName(string); - } - - @Override - protected String convert_(Name name) { - switch (name.getNodeType()) { - case ASTNode.QUALIFIED_NAME: - case ASTNode.SIMPLE_NAME: - return name.getFullyQualifiedName(); - default: - return null; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java deleted file mode 100644 index b373a16599..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; - -/** - * Manipulate an annotation that is embedded as an element within - * another annotation, e.g. - *
    - *     @Outer(foo=@Inner)
    - *     private int id;
    - *         outerAnnotationAdapter = AnnotationAdapter<@Outer>
    - *         elementName = "foo"
    - *         annotationName = "Inner"
    - * 
    - */ -public class NestedDeclarationAnnotationAdapter extends AbstractNestedDeclarationAnnotationAdapter { - - - // ********** constructors ********** - - /** - * default element name is "value"; - * default behavior is to remove the outer annotation when it is empty - */ - public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) { - super(outerAnnotationAdapter, annotationName); - } - - /** - * default behavior is to remove the outer annotation when it is empty - */ - public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) { - super(outerAnnotationAdapter, elementName, annotationName); - } - - public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName, boolean removeOuterAnnotationWhenEmpty) { - super(outerAnnotationAdapter, elementName, annotationName, removeOuterAnnotationWhenEmpty); - } - - - // ********** AbstractNestedDeclarationAnnotationAdapter implementation ********** - - @Override - protected Annotation getAnnotation(Expression value) { - return this.annotationValue(value); - } - - @Override - protected Expression buildNewInnerExpression(Annotation inner) { - return inner; - } - - /** - * the annotation is the expression itself, so the annotation cannot be - * "removed" from itself - return 'false' - */ - @Override - protected boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value) { - return false; - } - - /** - *
    -	 * @Outer("lorem ipsum") => @Outer(@Inner)
    -	 * 
    - */ - @Override - protected void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner) { - // replace(?) the current element value - outer.setValue(inner); - } - - /** - * Simply set the pair's value. - */ - @Override - protected void modifyMemberValuePair(MemberValuePair pair, Annotation inner) { - pair.setValue(inner); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java deleted file mode 100644 index 78a9988d76..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,331 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.ArrayInitializer; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; - -/** - * Manipulate an annotation that is embedded in an element array within - * another annotation, e.g. - *
    - *     @Outer(foo={@Inner("zero"), @Inner("one"), @Inner("two")})
    - *     private int id;
    - *         outerAnnotationAdapter = AnnotationAdapter<@Outer>
    - *         elementName = "foo"
    - *         index = 0-2
    - *         annotationName = "Inner"
    - * 
    - */ -public class NestedIndexedDeclarationAnnotationAdapter - extends AbstractNestedDeclarationAnnotationAdapter - implements IndexedDeclarationAnnotationAdapter -{ - private int index; - - - // ********** constructors ********** - - /** - * default element name is "value"; - * default behavior is to remove the outer annotation when it is empty - */ - public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, int index, String annotationName) { - super(annotationAdapter, annotationName); - this.index = index; - } - - /** - * default behavior is to remove the outer annotation when it is empty - */ - public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName) { - super(annotationAdapter, elementName, annotationName); - this.index = index; - } - - public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName, boolean removeOuterAnnotationWhenEmpty) { - super(annotationAdapter, elementName, annotationName, removeOuterAnnotationWhenEmpty); - this.index = index; - } - - - // ********** AbstractNestedDeclarationAnnotationAdapter implementation ********** - - @Override - protected Annotation getAnnotation(Expression value) { - if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) { - return this.getAnnotation((ArrayInitializer) value); - } - return (this.index == 0) ? this.annotationValue(value) : null; - } - - @Override - protected Expression buildNewInnerExpression(Annotation inner) { - return (this.index == 0) ? inner : (Expression) this.buildNewInnerArrayInitializer(inner); - } - - @Override - protected boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value) { - if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) { - this.removeAnnotation(declaration, outer, (ArrayInitializer) value); - return true; - } - // if our index is greater than zero, but we don't have an array, - // then the annotation must already be gone - return (this.index != 0); - } - - /** - *
    -	 * @Outer({@Inner(0), @Inner(1)}) => @Outer({@Inner(0), @Inner(1), @Inner(2)})
    -	 *     or
    -	 * @Outer("lorem ipsum") => @Outer(@Inner(0))
    -	 *     or
    -	 * @Outer(@Inner(0)) => @Outer({@Inner(0), @Inner(1)})
    -	 * 
    - */ - @Override - protected void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner) { - this.modifyExpression(outer, SINGLE_MEMBER_ANNOTATION_EXPRESSION_PROVIDER, inner); - } - - /** - *
    -	 * @Outer(text="lorem ipsum") => @Outer(text="lorem ipsum", foo=@Inner(0))
    -	 *     or
    -	 * @Outer(foo={@Inner(0), @Inner(1)}) => @Outer(foo={@Inner(0), @Inner(1), @Inner(2)})
    -	 *     or
    -	 * @Outer(foo="lorem ipsum") => @Outer(foo=@Inner(0))
    -	 *     or
    -	 * @Outer(foo=@NotInner) => @Outer(foo=@Inner(0))
    -	 *     or
    -	 * @Outer(foo=@Inner(0)) => @Outer(foo={@Inner(0), @Inner(1)})
    -	 * 
    - */ - @Override - protected void modifyMemberValuePair(MemberValuePair pair, Annotation inner) { - this.modifyExpression(pair, MEMBER_VALUE_PAIR_EXPRESSION_PROVIDER, inner); - } - - - // ********** IndexedDeclarationAnnotationAdapter implementation ********** - - public int getIndex() { - return this.index; - } - - /** - * Move the annotation to the specified index, leaving its original - * position cleared out. - */ - public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) { - int oldIndex = this.index; - if (newIndex == oldIndex) { - return; - } - - Annotation original = this.getAnnotation(declaration); - if (original == null) { - this.index = newIndex; - this.removeAnnotation(declaration); // clear out the new location (?) - } else { - Annotation copy = (Annotation) ASTNode.copySubtree(original.getAST(), original); - this.index = newIndex; - this.addAnnotation(declaration, copy); // install the copy in the new location - this.index = oldIndex; - this.removeAnnotation(declaration); // go back and clear out the original location (AFTER the move) - this.index = newIndex; - } - } - - - // ********** internal methods ********** - - /** - * Return the adapter's annotation from the specified array initializer. - */ - private Annotation getAnnotation(ArrayInitializer value) { - List expressions = this.expressions(value); - return (this.index >= expressions.size()) ? null : this.annotationValue(expressions.get(this.index)); - } - - /** - * Build a new array initializer to hold the specified annotation, - * padding it with 'null' literals as necessary - */ - private ArrayInitializer buildNewInnerArrayInitializer(Annotation inner) { - ArrayInitializer ai = inner.getAST().newArrayInitializer(); - this.addInnerToExpressions(inner, this.expressions(ai)); - return ai; - } - - /** - * Add the specified annotation to the specified array initializer, - * padding it with 'null' literals as necessary - */ - private void addInnerToExpressions(Annotation inner, List expressions) { - if (expressions.size() > this.index) { - throw new IllegalStateException("expressions size is greater than index - size: " + expressions.size() + " - index: " + this.index); - } - while (expressions.size() < this.index) { - expressions.add(inner.getAST().newNullLiteral()); - } - expressions.add(inner); - } - - /** - * Remove the adapter's annotation from the specified array initializer. - */ - private void removeAnnotation(ModifiedDeclaration declaration, Annotation outer, ArrayInitializer value) { - List expressions = this.expressions(value); - if (this.index >= expressions.size()) { - return; // avoid IndexOutOfBoundsException(?) - } - Annotation inner = this.annotationValue(expressions.get(this.index)); - if (inner == null) { - return; - } - if ( ! this.nameMatches(declaration, inner)) { - return; - } - if (this.index == (expressions.size() - 1)) { - expressions.remove(this.index); - } else { - expressions.set(this.index, value.getAST().newNullLiteral()); - } - this.trimExpressions(declaration, outer, expressions); - } - - /** - * Strip all the null literals off the end of the specified list of expressions - * and normalize the specified outer annotation. - */ - private void trimExpressions(ModifiedDeclaration declaration, Annotation outer, List expressions) { - // start at the end of the list - for (int i = expressions.size(); i-- > 0; ) { - if (expressions.get(i).getNodeType() == ASTNode.NULL_LITERAL) { - expressions.remove(i); - } else { - break; // stop with the first non-null literal encountered - } - } - switch (expressions.size()) { - case 0: - this.removeElementAndNormalize(declaration, outer); - break; - case 1: - this.convertArrayToLastRemainingExpression(outer, expressions.get(0)); - break; - default: - break; - } - } - - /** - * When there is only a single element in an array initializer, convert the - * expression to be just the single element; e.g. - *
    -	 *     @Foo(xxx={"abc"}) => @Foo(xxx="abc")
    -	 * or
    -	 *     @Foo({"abc"}) => @Foo("abc")
    -	 * 
    - */ - private void convertArrayToLastRemainingExpression(Annotation outer, Expression lastValue) { - lastValue = (Expression) ASTNode.copySubtree(lastValue.getAST(), lastValue); - if (outer.isNormalAnnotation()) { - this.memberValuePair((NormalAnnotation) outer).setValue(lastValue); - } else if (outer.isSingleMemberAnnotation()) { - ((SingleMemberAnnotation) outer).setValue(lastValue); - } else { - throw new IllegalArgumentException("unexpected annotation type: " + outer); - } - } - - /** - * Manipulate the specified expression appropriately. - * If it is an array initializer, add the specified annotation to it. - * If it is not, replace the expression or convert it into an array - * initializer. - */ - private void modifyExpression(ASTNode node, ExpressionProvider expProvider, Annotation inner) { - Expression value = expProvider.getExpression(node); - if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) { - // ignore the other entries in the array initializer(?) - they may not be matching Annotations... - List expressions = this.expressions((ArrayInitializer) value); - if (this.index >= expressions.size()) { - this.addInnerToExpressions(inner, expressions); - } else { - expressions.set(this.index, inner); - } - } else { - if (this.index == 0) { - // replace whatever was there before - expProvider.setExpression(node, inner); - } else { - // convert to an array - ArrayInitializer ai = inner.getAST().newArrayInitializer(); - List expressions = this.expressions(ai); - expressions.add((Expression) ASTNode.copySubtree(value.getAST(), value)); - this.addInnerToExpressions(inner, expressions); - expProvider.setExpression(node, ai); - } - } - } - - @SuppressWarnings("unchecked") - protected List expressions(ArrayInitializer ai) { - return ai.expressions(); - } - - - // ********** expression providers ********** - - /** - * define interface that allows us to "re-use" the code in - * #modifyExpression(ASTNode, ExpressionProvider, Annotation) - */ - private interface ExpressionProvider { - Expression getExpression(ASTNode node); - void setExpression(ASTNode node, Expression expression); - } - - private static final ExpressionProvider MEMBER_VALUE_PAIR_EXPRESSION_PROVIDER = new ExpressionProvider() { - public Expression getExpression(ASTNode node) { - return ((MemberValuePair) node).getValue(); - } - public void setExpression(ASTNode node, Expression expression) { - ((MemberValuePair) node).setValue(expression); - } - @Override - public String toString() { - return "MemberValuePairExpressionProvider"; - } - }; - - private static final ExpressionProvider SINGLE_MEMBER_ANNOTATION_EXPRESSION_PROVIDER = new ExpressionProvider() { - public Expression getExpression(ASTNode node) { - return ((SingleMemberAnnotation) node).getValue(); - } - public void setExpression(ASTNode node, Expression expression) { - ((SingleMemberAnnotation) node).setValue(expression); - } - @Override - public String toString() { - return "SingleMemberAnnotationExpressionProvider"; - } - }; - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java deleted file mode 100644 index 9dc042ea6e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; - -/** - * Behaviorless implementation. - */ -public final class NullDeclarationAnnotationAdapter - implements IndexedDeclarationAnnotationAdapter -{ - - // singleton - private static final NullDeclarationAnnotationAdapter INSTANCE = new NullDeclarationAnnotationAdapter(); - - /** - * Return the singleton. - */ - public static IndexedDeclarationAnnotationAdapter instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private NullDeclarationAnnotationAdapter() { - super(); - } - - - // ********** DeclarationAnnotationAdapter implementation ********** - - public Annotation getAnnotation(ModifiedDeclaration declaration) { - return null; - } - - public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) { - return null; - } - - public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) { - return null; - } - - public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) { - return null; - } - - public void removeAnnotation(ModifiedDeclaration declaration) { - // do nothing - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - return declaration.getDeclaration(); - } - - - // ********** IndexedDeclarationAnnotationAdapter implementation ********** - - public int getIndex() { - return -1; - } - - public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) { - // do nothing - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java deleted file mode 100644 index e0853b9faa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Expression; - -/** - * Behaviorless implementation. - */ -public class NullDeclarationAnnotationElementAdapter - implements DeclarationAnnotationElementAdapter -{ - - // singleton - @SuppressWarnings("unchecked") - private static final DeclarationAnnotationElementAdapter INSTANCE - = new NullDeclarationAnnotationElementAdapter(); - - /** - * Return the singleton. - */ - @SuppressWarnings("unchecked") - public static DeclarationAnnotationElementAdapter instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private NullDeclarationAnnotationElementAdapter() { - super(); - } - - public T getValue(ModifiedDeclaration declaration) { - return null; - } - - public void setValue(T value, ModifiedDeclaration declaration) { - // do nothing - } - - public ASTNode astNode(ModifiedDeclaration declaration) { - return declaration.getDeclaration(); - } - - public Expression expression(ModifiedDeclaration declaration) { - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java deleted file mode 100644 index e58f3af09b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * No conversion. - */ -public final class NullExpressionConverter - implements ExpressionConverter -{ - - // singleton - private static ExpressionConverter INSTANCE = new NullExpressionConverter(); - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new NullExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private NullExpressionConverter() { - super(); - } - - public Expression convert(Expression expression, AST ast) { - return expression; - } - - public Expression convert(Expression expression) { - return expression; - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberStringExpressionConverter.java deleted file mode 100644 index 0b312fb720..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberStringExpressionConverter.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.NumberLiteral; - -/** - * Convert a number literal to/from a string representation of a number - * (e.g. "48"). - */ -public final class NumberStringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new NumberStringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private NumberStringExpressionConverter() { - super(); - } - - @Override - protected NumberLiteral convert_(String string, AST ast) { - return ast.newNumberLiteral(string); - } - - @Override - protected String convert_(NumberLiteral numberLiteral) { - return (numberLiteral.getNodeType() == ASTNode.NUMBER_LITERAL) ? - numberLiteral.getToken() - : - null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java deleted file mode 100644 index 49f6d99166..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.PrimitiveType; -import org.eclipse.jdt.core.dom.TypeLiteral; - -/** - * Convert a type literal to/from a string representation of a primitive type - * (e.g. "int"). - */ -public final class PrimitiveTypeStringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new PrimitiveTypeStringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private PrimitiveTypeStringExpressionConverter() { - super(); - } - - @Override - protected TypeLiteral convert_(String string, AST ast) { - org.eclipse.jdt.core.dom.Type type = ast.newPrimitiveType(PrimitiveType.toCode(string)); - TypeLiteral typeLiteral = ast.newTypeLiteral(); - typeLiteral.setType(type); - return typeLiteral; - } - - @Override - protected String convert_(TypeLiteral typeLiteral) { - if (typeLiteral.getNodeType() == ASTNode.TYPE_LITERAL) { - org.eclipse.jdt.core.dom.Type type = typeLiteral.getType(); - if (type.getNodeType() == ASTNode.PRIMITIVE_TYPE) { - return ((PrimitiveType) type).getPrimitiveTypeCode().toString(); - } - } - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java deleted file mode 100644 index 2ffcb36d71..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Wrap another annotation element adapter and short-circuit the - * #setValue method if the value has not changed. - */ -public class ShortCircuitAnnotationElementAdapter - implements AnnotationElementAdapter -{ - /** the wrapped adapter */ - private final AnnotationElementAdapter adapter; - - - // ********** constructor ********** - - public ShortCircuitAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter daea) { - this(new MemberAnnotationElementAdapter(member, daea)); - } - - public ShortCircuitAnnotationElementAdapter(AnnotationElementAdapter adapter) { - super(); - this.adapter = adapter; - } - - - // ********** AnnotationElementAdapter implementation ********** - - public T getValue() { - return this.adapter.getValue(); - } - - public T getValue(CompilationUnit astRoot) { - return this.adapter.getValue(astRoot); - } - - public void setValue(T value) { - this.setValue(this.adapter.getValue(), value); - } - - public Expression expression() { - return this.adapter.expression(); - } - - public Expression expression(CompilationUnit astRoot) { - return this.adapter.expression(astRoot); - } - - public ASTNode astNode() { - return this.adapter.astNode(); - } - - public ASTNode astNode(CompilationUnit astRoot) { - return this.adapter.astNode(astRoot); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.adapter); - } - - - // ********** internal methods ********** - - /** - * set the adapter's value to the specified new value if it - * is different from the specified old value - */ - protected void setValue(T oldValue, T newValue) { - if (oldValue == null) { - if (newValue == null) { // null => null - // do nothing - } else { // null => object - this.adapter.setValue(newValue); - } - } else { - if (newValue == null) { // object => null - this.adapter.setValue(newValue); - } else { // object => object - if (this.valuesAreEqual(oldValue, newValue)) { - // do nothing - } else { - this.adapter.setValue(newValue); - } - } - } - } - - /** - * both values are non-null when this method is called - */ - protected boolean valuesAreEqual(T oldValue, T newValue) { - return newValue.equals(oldValue); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java deleted file mode 100644 index 9bead7a287..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.Arrays; - -/** - * Wrap another annotation element adapter and short-circuit the - * #setValue method if the value has not changed. Overrides #valuesAreEqual() - * to check equality on arrays - */ -public class ShortCircuitArrayAnnotationElementAdapter - extends ShortCircuitAnnotationElementAdapter -{ - // ********** constructor ********** - - public ShortCircuitArrayAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter daea) { - super(member, daea); - } - - public ShortCircuitArrayAnnotationElementAdapter(AnnotationElementAdapter adapter) { - super(adapter); - } - - - // ********** AnnotationElementAdapter implementation ********** - - @Override - protected boolean valuesAreEqual(T[] oldValue, T[] newValue) { - return Arrays.equals(newValue, oldValue); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java deleted file mode 100644 index 23311e47ae..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Wrap an annotation adapter and return true if the annotation is simply - * present; return false if it is missing. The annotation can be of any type - * (marker, single member, or normal). - */ -public class SimpleBooleanAnnotationAdapter implements BooleanAnnotationAdapter { - private final AnnotationAdapter adapter; - - public SimpleBooleanAnnotationAdapter(AnnotationAdapter adapter) { - super(); - this.adapter = adapter; - } - - - // ********** BooleanAnnotationAdapter implementation ********** - - public ASTNode astNode() { - return this.adapter.astNode(); - } - - public ASTNode astNode(CompilationUnit astRoot) { - return this.adapter.astNode(astRoot); - } - - public Annotation getAnnotation() { - return this.adapter.getAnnotation(); - } - - public Annotation getAnnotation(CompilationUnit astRoot) { - return this.adapter.getAnnotation(astRoot); - } - - public boolean getValue() { - return this.getValue(this.getAnnotation()); - } - - public boolean getValue(CompilationUnit astRoot) { - return this.getValue(this.getAnnotation(astRoot)); - } - - public void setValue(boolean value) { - this.setValue(this.getValue(), value); - } - - - // ********** internal methods ********** - - protected boolean getValue(Annotation annotation) { - return annotation != null; - } - - /** - * set the adapter's value to the specified new value if it - * is different from the specified old value - */ - protected void setValue(boolean oldValue, boolean newValue) { - if (newValue != oldValue) { - this.setNewValue(newValue); - } - } - - protected void setNewValue(boolean value) { - if (value) { - this.adapter.newMarkerAnnotation(); - } else { - this.adapter.removeAnnotation(); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java deleted file mode 100644 index 77d3352d06..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; - -/** - * Manipulate an annotation with a specific name, e.g. - *
    - *     @Foo
    - *     private int id;
    - * 
    - * - * NB: - * If the declaration contains more than one annotation with the same - * name, the adapter will correspond to the first annotation with the specified - * name. (Also note that the compiler will not allow a declaration to be - * modified by multiple annotations with the same name, i.e. of the same type; - * so if there *are* multiple annotations of the same type, there are bigger - * problems to worry about than which annotation the adapter manipulates.) - */ -public class SimpleDeclarationAnnotationAdapter extends AbstractDeclarationAnnotationAdapter { - - - // ********** constructors ********** - - public SimpleDeclarationAnnotationAdapter(String annotationName) { - super(annotationName); - } - - - // ********** AbstractAnnotationAdapter implementation ********** - - @Override - public Annotation getAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(this.getAnnotationName()); - } - - @Override - public void removeAnnotation(ModifiedDeclaration declaration) { - declaration.removeAnnotationNamed(this.getAnnotationName()); - } - - @Override - protected void addAnnotation(ModifiedDeclaration declaration, Annotation annotation) { - declaration.replaceAnnotationNamed(this.getAnnotationName(), annotation); - } - - @Override - public ASTNode astNode(ModifiedDeclaration declaration) { - // if the annotation is missing, return the declaration - Annotation annotation = this.getAnnotation(declaration); - return (annotation != null) ? annotation : declaration.getDeclaration(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java deleted file mode 100644 index 43566cb864..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Name; -import org.eclipse.jdt.core.dom.SimpleType; -import org.eclipse.jdt.core.dom.TypeLiteral; - -/** - * Convert a type literal to/from a string representation of a simple type - * (e.g. "java.lang.Object"). - */ -public final class SimpleTypeStringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new SimpleTypeStringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private SimpleTypeStringExpressionConverter() { - super(); - } - - @Override - protected TypeLiteral convert_(String string, AST ast) { - Name name = ast.newName(string); - org.eclipse.jdt.core.dom.Type type = ast.newSimpleType(name); - TypeLiteral typeLiteral = ast.newTypeLiteral(); - typeLiteral.setType(type); - return typeLiteral; - } - - @Override - protected String convert_(TypeLiteral typeLiteral) { - if (typeLiteral.getNodeType() == ASTNode.TYPE_LITERAL) { - org.eclipse.jdt.core.dom.Type type = typeLiteral.getType(); - if (type.getNodeType() == ASTNode.SIMPLE_TYPE) { - return ((SimpleType) type).getName().getFullyQualifiedName(); - } - } - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java deleted file mode 100644 index 08f9fe1b08..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ArrayInitializer; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.StringLiteral; - -/** - * Convert an array initializer to/from an array of strings (e.g. {"text0", "text1"}). - * E is the type of the expressions to be found in the array initializer. - */ -public class StringArrayExpressionConverter - extends AbstractExpressionConverter -{ - private final ExpressionConverter elementConverter; - - public StringArrayExpressionConverter(ExpressionConverter elementConverter) { - super(); - this.elementConverter = elementConverter; - } - - @Override - protected ArrayInitializer convert_(String[] strings, AST ast) { - ArrayInitializer arrayInitializer = ast.newArrayInitializer(); - List expressions = this.expressions(arrayInitializer); - for (String string : strings) { - expressions.add(this.elementConverter.convert(string, ast)); - } - return arrayInitializer; - } - - @SuppressWarnings("unchecked") - private List expressions(ArrayInitializer arrayInitializer) { - return arrayInitializer.expressions(); - } - - @Override - protected String[] convert_(ArrayInitializer arrayInitializer) { - List expressions = this.downcastExpressions(arrayInitializer); - int len = expressions.size(); - String[] strings = new String[len]; - for (int i = len; i-- > 0; ) { - strings[i] = this.elementConverter.convert(expressions.get(i)); - } - return strings; - } - - @SuppressWarnings("unchecked") - private List downcastExpressions(ArrayInitializer arrayInitializer) { - return arrayInitializer.expressions(); - } - - /** - * Build an expression converter for an annotation element of type String[]. - * @Foo(bar={"text0", "text1"}) - */ - public static StringArrayExpressionConverter forStringLiterals() { - return new StringArrayExpressionConverter(StringExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java deleted file mode 100644 index 444650f53e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.StringLiteral; - -/** - * Convert a string literal to/from a string (e.g. "text"). - */ -public final class StringExpressionConverter - extends AbstractExpressionConverter -{ - private static ExpressionConverter INSTANCE; - - /** - * Return the singleton. - */ - public static ExpressionConverter instance() { - if (INSTANCE == null) { - INSTANCE = new StringExpressionConverter(); - } - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private StringExpressionConverter() { - super(); - } - - @Override - protected StringLiteral convert_(String string, AST ast) { - StringLiteral stringLiteral = ast.newStringLiteral(); - stringLiteral.setLiteralValue(string); - return stringLiteral; - } - - @Override - protected String convert_(StringLiteral stringLiteral) { - return (stringLiteral.getNodeType() == ASTNode.STRING_LITERAL) ? - stringLiteral.getLiteralValue() - : - null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java deleted file mode 100644 index 65f018e644..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.jdtutility; - -import java.util.List; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.TypeDeclaration; - -public class Type extends Member { - - public Type(IType type) { - super(type); - } - - @Override - public IType getJdtMember() { - return (IType) super.getJdtMember(); - } - - @Override - public TypeDeclaration bodyDeclaration() { - return (TypeDeclaration) super.bodyDeclaration(); - } - - public boolean isAbstract() { - try { - return Flags.isAbstract(this.getJdtMember().getFlags()); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - @Override - public Type topLevelDeclaringType() { - return (this.getDeclaringType() == null) ? this : super.topLevelDeclaringType(); - } - - public String getFullyQualifiedName() { - return this.getJdtMember().getFullyQualifiedName(); - } - - - // ********** Member implementation ********** - - @Override - public TypeDeclaration bodyDeclaration(CompilationUnit astRoot) { - String name = this.getName(); - for (AbstractTypeDeclaration typeDeclaration : this.types(astRoot)) { - if (typeDeclaration.getName().getFullyQualifiedName().equals(name)) { - return (TypeDeclaration) typeDeclaration; // assume no enum or annotation declarations - } - } - return null; - } - - - // ********** miscellaneous ********** - - @SuppressWarnings("unchecked") - protected List types(CompilationUnit astRoot) { - return astRoot.types(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java deleted file mode 100644 index 5514bda74e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java +++ /dev/null @@ -1,343 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.CascadeType.ALL_VALUE; -import static org.eclipse.jpt.core.internal.mappings.CascadeType.MERGE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.CascadeType.PERSIST_VALUE; -import static org.eclipse.jpt.core.internal.mappings.CascadeType.REFRESH_VALUE; -import static org.eclipse.jpt.core.internal.mappings.CascadeType.REMOVE_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Cascade Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType() - * @model - * @generated - */ -public enum CascadeType implements Enumerator { - /** - * The 'ALL' literal object. - * - * - * @see #ALL_VALUE - * @generated - * @ordered - */ - ALL(0, "ALL", "All"), - /** - * The 'PERSIST' literal object. - * - * - * @see #PERSIST_VALUE - * @generated - * @ordered - */ - PERSIST(1, "PERSIST", "Persist"), - /** - * The 'MERGE' literal object. - * - * - * @see #MERGE_VALUE - * @generated - * @ordered - */ - MERGE(2, "MERGE", "Merge"), - /** - * The 'REMOVE' literal object. - * - * - * @see #REMOVE_VALUE - * @generated - * @ordered - */ - REMOVE(3, "REMOVE", "Remove"), - /** - * The 'REFRESH' literal object. - * - * - * @see #REFRESH_VALUE - * @generated - * @ordered - */ - REFRESH(4, "REFRESH", "Refresh"); - /** - * The 'ALL' literal value. - * - *

    - * If the meaning of 'ALL' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #ALL - * @model literal="All" - * @generated - * @ordered - */ - public static final int ALL_VALUE = 0; - - /** - * The 'PERSIST' literal value. - * - *

    - * If the meaning of 'PERSIST' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #PERSIST - * @model literal="Persist" - * @generated - * @ordered - */ - public static final int PERSIST_VALUE = 1; - - /** - * The 'MERGE' literal value. - * - *

    - * If the meaning of 'MERGE' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #MERGE - * @model literal="Merge" - * @generated - * @ordered - */ - public static final int MERGE_VALUE = 2; - - /** - * The 'REMOVE' literal value. - * - *

    - * If the meaning of 'REMOVE' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #REMOVE - * @model literal="Remove" - * @generated - * @ordered - */ - public static final int REMOVE_VALUE = 3; - - /** - * The 'REFRESH' literal value. - * - *

    - * If the meaning of 'REFRESH' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #REFRESH - * @model literal="Refresh" - * @generated - * @ordered - */ - public static final int REFRESH_VALUE = 4; - - /** - * An array of all the 'Cascade Type' enumerators. - * - * - * @generated - */ - private static final CascadeType[] VALUES_ARRAY = new CascadeType[] { - ALL, PERSIST, MERGE, REMOVE, REFRESH, - }; - - /** - * A public read-only list of all the 'Cascade Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Cascade Type' literal with the specified literal value. - * - * - * @generated - */ - public static CascadeType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - CascadeType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Cascade Type' literal with the specified name. - * - * - * @generated - */ - public static CascadeType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - CascadeType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Cascade Type' literal with the specified integer value. - * - * - * @generated - */ - public static CascadeType get(int value) { - switch (value) { - case ALL_VALUE : - return ALL; - case PERSIST_VALUE : - return PERSIST; - case MERGE_VALUE : - return MERGE; - case REMOVE_VALUE : - return REMOVE; - case REFRESH_VALUE : - return REFRESH; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private CascadeType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static CascadeType[] fromJavaAnnotationValue(String[] javaAnnotationValues) { - if (javaAnnotationValues == null) { - return new CascadeType[0]; - } - CascadeType[] cascadeTypes = new CascadeType[javaAnnotationValues.length]; - for (int i = 0; i < javaAnnotationValues.length; i++) { - String javaAnnotationValue = javaAnnotationValues[i]; - if (javaAnnotationValue != null) { - if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__ALL)) { - cascadeTypes[i] = ALL; - } - else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__PERSIST)) { - cascadeTypes[i] = PERSIST; - } - else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__MERGE)) { - cascadeTypes[i] = MERGE; - } - else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__REMOVE)) { - cascadeTypes[i] = REMOVE; - } - else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__REFRESH)) { - cascadeTypes[i] = REFRESH; - } - } - } - return cascadeTypes; - } - - public static String[] toJavaAnnotationValue(CascadeType[] cascadeTypes) { - String[] javaAnnotationValues = new String[cascadeTypes.length]; - for (int i = 0; i < cascadeTypes.length; i++) { - CascadeType cascadeType = cascadeTypes[i]; - if (cascadeType == ALL) { - javaAnnotationValues[i] = JPA.CASCADE_TYPE__ALL; - } - else if (cascadeType == PERSIST) { - javaAnnotationValues[i] = JPA.CASCADE_TYPE__PERSIST; - } - else if (cascadeType == MERGE) { - javaAnnotationValues[i] = JPA.CASCADE_TYPE__MERGE; - } - else if (cascadeType == REMOVE) { - javaAnnotationValues[i] = JPA.CASCADE_TYPE__REMOVE; - } - else if (cascadeType == REFRESH) { - javaAnnotationValues[i] = JPA.CASCADE_TYPE__REFRESH; - } - } - return javaAnnotationValues; - } -} //CascadeType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultEagerFetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultEagerFetchType.java deleted file mode 100644 index f76d0d78eb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultEagerFetchType.java +++ /dev/null @@ -1,265 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType.EAGER_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType.LAZY_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Default Eager Fetch Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultEagerFetchType() - * @model - * @generated - */ -public enum DefaultEagerFetchType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (Eager)"), /** - * The 'EAGER' literal object. - * - * - * @see #EAGER_VALUE - * @generated - * @ordered - */ - EAGER(1, "EAGER", "Eager"), /** - * The 'LAZY' literal object. - * - * - * @see #LAZY_VALUE - * @generated - * @ordered - */ - LAZY(2, "LAZY", "Lazy"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (Eager)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'EAGER' literal value. - * - *

    - * If the meaning of 'EAGER' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #EAGER - * @model literal="Eager" - * @generated - * @ordered - */ - public static final int EAGER_VALUE = 1; - - /** - * The 'LAZY' literal value. - * - *

    - * If the meaning of 'LAZY' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #LAZY - * @model literal="Lazy" - * @generated - * @ordered - */ - public static final int LAZY_VALUE = 2; - - /** - * An array of all the 'Default Eager Fetch Type' enumerators. - * - * - * @generated - */ - private static final DefaultEagerFetchType[] VALUES_ARRAY = new DefaultEagerFetchType[] { - DEFAULT, EAGER, LAZY, - }; - - /** - * A public read-only list of all the 'Default Eager Fetch Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Default Eager Fetch Type' literal with the specified literal value. - * - * - * @generated - */ - public static DefaultEagerFetchType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultEagerFetchType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default Eager Fetch Type' literal with the specified name. - * - * - * @generated - */ - public static DefaultEagerFetchType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultEagerFetchType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default Eager Fetch Type' literal with the specified integer value. - * - * - * @generated - */ - public static DefaultEagerFetchType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case EAGER_VALUE : - return EAGER; - case LAZY_VALUE : - return LAZY; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private DefaultEagerFetchType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static DefaultEagerFetchType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals(JPA.FETCH_TYPE__EAGER)) { - return EAGER; - } - if (javaAnnotationValue.equals(JPA.FETCH_TYPE__LAZY)) { - return LAZY; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case EAGER_VALUE : - return JPA.FETCH_TYPE__EAGER; - case LAZY_VALUE : - return JPA.FETCH_TYPE__LAZY; - default : - throw new IllegalArgumentException("unknown fetch type: " + this); - } - } -} //DefaultEagerFetchType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultFalseBoolean.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultFalseBoolean.java deleted file mode 100644 index 2bc9fcdb87..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultFalseBoolean.java +++ /dev/null @@ -1,264 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean.FALSE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean.TRUE_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Default False Boolean', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultFalseBoolean() - * @model - * @generated - */ -public enum DefaultFalseBoolean implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (False)"), /** - * The 'False' literal object. - * - * - * @see #FALSE_VALUE - * @generated - * @ordered - */ - FALSE(1, "false", "False"), /** - * The 'True' literal object. - * - * - * @see #TRUE_VALUE - * @generated - * @ordered - */ - TRUE(2, "true", "True"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (False)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'False' literal value. - * - *

    - * If the meaning of 'False' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #FALSE - * @model name="false" literal="False" - * @generated - * @ordered - */ - public static final int FALSE_VALUE = 1; - - /** - * The 'True' literal value. - * - *

    - * If the meaning of 'True' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #TRUE - * @model name="true" literal="True" - * @generated - * @ordered - */ - public static final int TRUE_VALUE = 2; - - /** - * An array of all the 'Default False Boolean' enumerators. - * - * - * @generated - */ - private static final DefaultFalseBoolean[] VALUES_ARRAY = new DefaultFalseBoolean[] { - DEFAULT, FALSE, TRUE, - }; - - /** - * A public read-only list of all the 'Default False Boolean' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Default False Boolean' literal with the specified literal value. - * - * - * @generated - */ - public static DefaultFalseBoolean get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultFalseBoolean result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default False Boolean' literal with the specified name. - * - * - * @generated - */ - public static DefaultFalseBoolean getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultFalseBoolean result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default False Boolean' literal with the specified integer value. - * - * - * @generated - */ - public static DefaultFalseBoolean get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case FALSE_VALUE : - return FALSE; - case TRUE_VALUE : - return TRUE; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private DefaultFalseBoolean(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static DefaultFalseBoolean fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals("true")) { - return TRUE; - } - if (javaAnnotationValue.equals("false")) { - return FALSE; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case TRUE_VALUE : - return "true"; - case FALSE_VALUE : - return "false"; - default : - throw new IllegalArgumentException("unknown boolean type: " + this); - } - } -} //DefaultFalseBoolean diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultLazyFetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultLazyFetchType.java deleted file mode 100644 index 63b44ea65f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultLazyFetchType.java +++ /dev/null @@ -1,265 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType.EAGER_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType.LAZY_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Default Lazy Fetch Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultLazyFetchType() - * @model - * @generated - */ -public enum DefaultLazyFetchType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (Lazy)"), /** - * The 'LAZY' literal object. - * - * - * @see #LAZY_VALUE - * @generated - * @ordered - */ - LAZY(1, "LAZY", "Lazy"), /** - * The 'EAGER' literal object. - * - * - * @see #EAGER_VALUE - * @generated - * @ordered - */ - EAGER(2, "EAGER", "Eager"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (Lazy)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'LAZY' literal value. - * - *

    - * If the meaning of 'LAZY' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #LAZY - * @model literal="Lazy" - * @generated - * @ordered - */ - public static final int LAZY_VALUE = 1; - - /** - * The 'EAGER' literal value. - * - *

    - * If the meaning of 'EAGER' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #EAGER - * @model literal="Eager" - * @generated - * @ordered - */ - public static final int EAGER_VALUE = 2; - - /** - * An array of all the 'Default Lazy Fetch Type' enumerators. - * - * - * @generated - */ - private static final DefaultLazyFetchType[] VALUES_ARRAY = new DefaultLazyFetchType[] { - DEFAULT, LAZY, EAGER, - }; - - /** - * A public read-only list of all the 'Default Lazy Fetch Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Default Lazy Fetch Type' literal with the specified literal value. - * - * - * @generated - */ - public static DefaultLazyFetchType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultLazyFetchType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default Lazy Fetch Type' literal with the specified name. - * - * - * @generated - */ - public static DefaultLazyFetchType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultLazyFetchType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default Lazy Fetch Type' literal with the specified integer value. - * - * - * @generated - */ - public static DefaultLazyFetchType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case LAZY_VALUE : - return LAZY; - case EAGER_VALUE : - return EAGER; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private DefaultLazyFetchType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static DefaultLazyFetchType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals(JPA.FETCH_TYPE__EAGER)) { - return EAGER; - } - if (javaAnnotationValue.equals(JPA.FETCH_TYPE__LAZY)) { - return LAZY; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case EAGER_VALUE : - return JPA.FETCH_TYPE__EAGER; - case LAZY_VALUE : - return JPA.FETCH_TYPE__LAZY; - default : - throw new IllegalArgumentException("unknown fetch type: " + this); - } - } -} //DefaultLazyFetchType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultTrueBoolean.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultTrueBoolean.java deleted file mode 100644 index ad70d8debf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultTrueBoolean.java +++ /dev/null @@ -1,264 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean.FALSE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean.TRUE_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Default True Boolean', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultTrueBoolean() - * @model - * @generated - */ -public enum DefaultTrueBoolean implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (True)"), /** - * The 'True' literal object. - * - * - * @see #TRUE_VALUE - * @generated - * @ordered - */ - TRUE(1, "true", "True"), /** - * The 'False' literal object. - * - * - * @see #FALSE_VALUE - * @generated - * @ordered - */ - FALSE(2, "false", "False"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (False)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'True' literal value. - * - *

    - * If the meaning of 'True' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #TRUE - * @model name="true" literal="True" - * @generated - * @ordered - */ - public static final int TRUE_VALUE = 1; - - /** - * The 'False' literal value. - * - *

    - * If the meaning of 'False' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #FALSE - * @model name="false" literal="False" - * @generated - * @ordered - */ - public static final int FALSE_VALUE = 2; - - /** - * An array of all the 'Default True Boolean' enumerators. - * - * - * @generated - */ - private static final DefaultTrueBoolean[] VALUES_ARRAY = new DefaultTrueBoolean[] { - DEFAULT, TRUE, FALSE, - }; - - /** - * A public read-only list of all the 'Default True Boolean' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Default True Boolean' literal with the specified literal value. - * - * - * @generated - */ - public static DefaultTrueBoolean get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultTrueBoolean result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default True Boolean' literal with the specified name. - * - * - * @generated - */ - public static DefaultTrueBoolean getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DefaultTrueBoolean result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Default True Boolean' literal with the specified integer value. - * - * - * @generated - */ - public static DefaultTrueBoolean get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case TRUE_VALUE : - return TRUE; - case FALSE_VALUE : - return FALSE; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private DefaultTrueBoolean(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static DefaultTrueBoolean fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals("true")) { - return TRUE; - } - if (javaAnnotationValue.equals("false")) { - return FALSE; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case TRUE_VALUE : - return "true"; - case FALSE_VALUE : - return "false"; - default : - throw new IllegalArgumentException("unknown boolean type: " + this); - } - } -} //DefaultTrueBoolean diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DiscriminatorType.java deleted file mode 100644 index ef1b54227b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DiscriminatorType.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.DiscriminatorType.CHAR_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DiscriminatorType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DiscriminatorType.INTEGER_VALUE; -import static org.eclipse.jpt.core.internal.mappings.DiscriminatorType.STRING_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Discriminator Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDiscriminatorType() - * @model - * @generated - */ -public enum DiscriminatorType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (String)"), - /** - * The 'STRING' literal object. - * - * - * @see #STRING_VALUE - * @generated - * @ordered - */ - STRING(1, "STRING", "String"), - /** - * The 'CHAR' literal object. - * - * - * @see #CHAR_VALUE - * @generated - * @ordered - */ - CHAR(2, "CHAR", "Char"), - /** - * The 'INTEGER' literal object. - * - * - * @see #INTEGER_VALUE - * @generated - * @ordered - */ - INTEGER(3, "INTEGER", "Integer"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (String)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'STRING' literal value. - * - *

    - * If the meaning of 'String' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #STRING - * @model literal="String" - * @generated - * @ordered - */ - public static final int STRING_VALUE = 1; - - /** - * The 'CHAR' literal value. - * - *

    - * If the meaning of 'Char' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #CHAR - * @model literal="Char" - * @generated - * @ordered - */ - public static final int CHAR_VALUE = 2; - - /** - * The 'INTEGER' literal value. - * - *

    - * If the meaning of 'Integer' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #INTEGER - * @model literal="Integer" - * @generated - * @ordered - */ - public static final int INTEGER_VALUE = 3; - - /** - * An array of all the 'Discriminator Type' enumerators. - * - * - * @generated - */ - private static final DiscriminatorType[] VALUES_ARRAY = new DiscriminatorType[] { - DEFAULT, STRING, CHAR, INTEGER, - }; - - /** - * A public read-only list of all the 'Discriminator Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Discriminator Type' literal with the specified literal value. - * - * - * @generated - */ - public static DiscriminatorType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DiscriminatorType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Discriminator Type' literal with the specified name. - * - * - * @generated - */ - public static DiscriminatorType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - DiscriminatorType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Discriminator Type' literal with the specified integer value. - * - * - * @generated - */ - public static DiscriminatorType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case STRING_VALUE : - return STRING; - case CHAR_VALUE : - return CHAR; - case INTEGER_VALUE : - return INTEGER; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private DiscriminatorType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static DiscriminatorType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__CHAR)) { - return CHAR; - } - if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__INTEGER)) { - return INTEGER; - } - if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__STRING)) { - return STRING; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DiscriminatorType.DEFAULT_VALUE : - return null; - case CHAR_VALUE : - return JPA.DISCRIMINATOR_TYPE__CHAR; - case INTEGER_VALUE : - return JPA.DISCRIMINATOR_TYPE__INTEGER; - case STRING_VALUE : - return JPA.DISCRIMINATOR_TYPE__STRING; - default : - throw new IllegalArgumentException("unknown discriminator type: " + this); - } - } - - public boolean isString() { - return (this.getValue() == DEFAULT_VALUE) || (this.getValue() == STRING_VALUE); - } -} //DiscriminatorType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/EnumType.java deleted file mode 100644 index fd7b48c8ff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/EnumType.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.EnumType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.EnumType.ORDINAL_VALUE; -import static org.eclipse.jpt.core.internal.mappings.EnumType.STRING_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Enum Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getEnumType() - * @model - * @generated - */ -public enum EnumType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (Ordinal)"), /** - * The 'ORDINAL' literal object. - * - * - * @see #ORDINAL_VALUE - * @generated - * @ordered - */ - ORDINAL(1, "ORDINAL", "Ordinal"), - /** - * The 'STRING' literal object. - * - * - * @see #STRING_VALUE - * @generated - * @ordered - */ - STRING(2, "STRING", "String"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (Ordinal)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'ORDINAL' literal value. - * - *

    - * If the meaning of 'ORDINAL' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #ORDINAL - * @model literal="Ordinal" - * @generated - * @ordered - */ - public static final int ORDINAL_VALUE = 1; - - /** - * The 'STRING' literal value. - * - *

    - * If the meaning of 'STRING' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #STRING - * @model literal="String" - * @generated - * @ordered - */ - public static final int STRING_VALUE = 2; - - /** - * An array of all the 'Enum Type' enumerators. - * - * - * @generated - */ - private static final EnumType[] VALUES_ARRAY = new EnumType[] { - DEFAULT, ORDINAL, STRING, - }; - - /** - * A public read-only list of all the 'Enum Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Enum Type' literal with the specified literal value. - * - * - * @generated - */ - public static EnumType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - EnumType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Enum Type' literal with the specified name. - * - * - * @generated - */ - public static EnumType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - EnumType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Enum Type' literal with the specified integer value. - * - * - * @generated - */ - public static EnumType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case ORDINAL_VALUE : - return ORDINAL; - case STRING_VALUE : - return STRING; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private EnumType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static EnumType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals(JPA.ENUM_TYPE__ORDINAL)) { - return ORDINAL; - } - if (javaAnnotationValue.equals(JPA.ENUM_TYPE__STRING)) { - return STRING; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case ORDINAL_VALUE : - return JPA.ENUM_TYPE__ORDINAL; - case STRING_VALUE : - return JPA.ENUM_TYPE__STRING; - default : - throw new IllegalArgumentException("unknown enum type: " + this); - } - } -} //EnumType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/GenerationType.java deleted file mode 100644 index d767fcc20f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/GenerationType.java +++ /dev/null @@ -1,331 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.GenerationType.AUTO_VALUE; -import static org.eclipse.jpt.core.internal.mappings.GenerationType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.GenerationType.IDENTITY_VALUE; -import static org.eclipse.jpt.core.internal.mappings.GenerationType.SEQUENCE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.GenerationType.TABLE_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Generation Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getGenerationType() - * @model - * @generated - */ -public enum GenerationType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (Auto)"), - /** - * The 'AUTO' literal object. - * - * - * @see #AUTO_VALUE - * @generated - * @ordered - */ - AUTO(1, "AUTO", "Auto"), - /** - * The 'IDENTITY' literal object. - * - * - * @see #IDENTITY_VALUE - * @generated - * @ordered - */ - IDENTITY(2, "IDENTITY", "Identity"), - /** - * The 'SEQUENCE' literal object. - * - * - * @see #SEQUENCE_VALUE - * @generated - * @ordered - */ - SEQUENCE(3, "SEQUENCE", "Sequence"), - /** - * The 'TABLE' literal object. - * - * - * @see #TABLE_VALUE - * @generated - * @ordered - */ - TABLE(4, "TABLE", "Table"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (Auto)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'AUTO' literal value. - * - *

    - * If the meaning of 'Auto' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #AUTO - * @model literal="Auto" - * @generated - * @ordered - */ - public static final int AUTO_VALUE = 1; - - /** - * The 'IDENTITY' literal value. - * - *

    - * If the meaning of 'Identity' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #IDENTITY - * @model literal="Identity" - * @generated - * @ordered - */ - public static final int IDENTITY_VALUE = 2; - - /** - * The 'SEQUENCE' literal value. - * - *

    - * If the meaning of 'Sequence' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #SEQUENCE - * @model literal="Sequence" - * @generated - * @ordered - */ - public static final int SEQUENCE_VALUE = 3; - - /** - * The 'TABLE' literal value. - * - *

    - * If the meaning of 'Table' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #TABLE - * @model literal="Table" - * @generated - * @ordered - */ - public static final int TABLE_VALUE = 4; - - /** - * An array of all the 'Generation Type' enumerators. - * - * - * @generated - */ - private static final GenerationType[] VALUES_ARRAY = new GenerationType[] { - DEFAULT, AUTO, IDENTITY, SEQUENCE, TABLE, - }; - - /** - * A public read-only list of all the 'Generation Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Generation Type' literal with the specified literal value. - * - * - * @generated - */ - public static GenerationType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - GenerationType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Generation Type' literal with the specified name. - * - * - * @generated - */ - public static GenerationType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - GenerationType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Generation Type' literal with the specified integer value. - * - * - * @generated - */ - public static GenerationType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case AUTO_VALUE : - return AUTO; - case IDENTITY_VALUE : - return IDENTITY; - case SEQUENCE_VALUE : - return SEQUENCE; - case TABLE_VALUE : - return TABLE; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private GenerationType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static GenerationType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__AUTO)) { - return AUTO; - } - if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__IDENTITY)) { - return IDENTITY; - } - if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__SEQUENCE)) { - return SEQUENCE; - } - if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__TABLE)) { - return TABLE; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case AUTO_VALUE : - return JPA.GENERATION_TYPE__AUTO; - case IDENTITY_VALUE : - return JPA.GENERATION_TYPE__IDENTITY; - case SEQUENCE_VALUE : - return JPA.GENERATION_TYPE__SEQUENCE; - case TABLE_VALUE : - return JPA.GENERATION_TYPE__TABLE; - default : - throw new IllegalArgumentException("unknown generation type: " + this); - } - } -} //GenerationType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractColumn.java deleted file mode 100644 index 12b37d5301..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractColumn.java +++ /dev/null @@ -1,211 +0,0 @@ -/** - * - * - * - * $Id: IAbstractColumn.java,v 1.4 2007/05/11 19:33:48 kmoore Exp $ - */ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.ITextRange; - -/** - * - * A representation of the model object 'IAbstract Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUnique Unique}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getNullable Nullable}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getInsertable Insertable}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUpdatable Updatable}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getTable Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getSpecifiedTable Specified Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getDefaultTable Default Table}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IAbstractColumn extends INamedColumn -{ - /** - * Returns the value of the 'Unique' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean}. - * - *

    - * If the meaning of the 'Unique' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Unique' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #setUnique(DefaultFalseBoolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_Unique() - * @model - * @generated - */ - DefaultFalseBoolean getUnique(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUnique Unique}' attribute. - * - * - * @param value the new value of the 'Unique' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see #getUnique() - * @generated - */ - void setUnique(DefaultFalseBoolean value); - - /** - * Returns the value of the 'Nullable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Nullable' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Nullable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setNullable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_Nullable() - * @model - * @generated - */ - DefaultTrueBoolean getNullable(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getNullable Nullable}' attribute. - * - * - * @param value the new value of the 'Nullable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getNullable() - * @generated - */ - void setNullable(DefaultTrueBoolean value); - - /** - * Returns the value of the 'Insertable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Insertable' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Insertable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setInsertable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_Insertable() - * @model - * @generated - */ - DefaultTrueBoolean getInsertable(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getInsertable Insertable}' attribute. - * - * - * @param value the new value of the 'Insertable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getInsertable() - * @generated - */ - void setInsertable(DefaultTrueBoolean value); - - /** - * Returns the value of the 'Updatable' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Updatable' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Updatable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setUpdatable(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_Updatable() - * @model - * @generated - */ - DefaultTrueBoolean getUpdatable(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUpdatable Updatable}' attribute. - * - * - * @param value the new value of the 'Updatable' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getUpdatable() - * @generated - */ - void setUpdatable(DefaultTrueBoolean value); - - /** - * Returns the value of the 'Table' attribute. - * - *

    - * If the meaning of the 'Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_Table() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getTable(); - - /** - * Returns the value of the 'Specified Table' attribute. - * - *

    - * If the meaning of the 'Specified Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Table' attribute. - * @see #setSpecifiedTable(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_SpecifiedTable() - * @model - * @generated - */ - String getSpecifiedTable(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getSpecifiedTable Specified Table}' attribute. - * - * - * @param value the new value of the 'Specified Table' attribute. - * @see #getSpecifiedTable() - * @generated - */ - void setSpecifiedTable(String value); - - /** - * Returns the value of the 'Default Table' attribute. - * - *

    - * If the meaning of the 'Default Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Table' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn_DefaultTable() - * @model changeable="false" - * @generated - */ - String getDefaultTable(); - - /** - * Return the (best guess) text location of the column's table. - */ - ITextRange tableTextRange(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java deleted file mode 100644 index 8cdd52ff5d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * - * - * - * $Id: IAbstractJoinColumn.java,v 1.9 2007/05/30 20:39:02 pfullbright Exp $ - */ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.List; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'IAbstract Join Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getReferencedColumnName Referenced Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getDefaultReferencedColumnName Default Referenced Column Name}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IAbstractJoinColumn extends INamedColumn -{ - /** - * Returns the value of the 'Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn_ReferencedColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getReferencedColumnName(); - - /** - * Returns the value of the 'Specified Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Referenced Column Name' attribute. - * @see #setSpecifiedReferencedColumnName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn_SpecifiedReferencedColumnName() - * @model - * @generated - */ - String getSpecifiedReferencedColumnName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Referenced Column Name' attribute. - * @see #getSpecifiedReferencedColumnName() - * @generated - */ - void setSpecifiedReferencedColumnName(String value); - - /** - * Returns the value of the 'Default Referenced Column Name' attribute. - * - *

    - * If the meaning of the 'Default Referenced Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Referenced Column Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn_DefaultReferencedColumnName() - * @model changeable="false" - * @generated - */ - String getDefaultReferencedColumnName(); - - void refreshDefaults(DefaultsContext defaultsContext); - - /** - * Return the wrapper for the datasource referenced column - */ - Column dbReferencedColumn(); - - /** - * Return whether the reference column is found on the datasource - */ - boolean isReferencedColumnResolved(); - - /** - * Return the (best guess) text location of the referenced column name - */ - ITextRange referencedColumnNameTextRange(); - - /** - * Re-declared to return IAbstractJoinColumn.Owner. - */ - IAbstractJoinColumn.Owner getOwner(); - - - interface Owner extends INamedColumn.Owner - { - /** - * Return the wrapper for the datasource table for the referenced column - */ - Table dbReferencedColumnTable(); - - /** - * return the list of join columns containing the join column - */ - List joinColumns(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAssociationOverride.java deleted file mode 100644 index 03aebfe7b3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAssociationOverride.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.List; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'IAssociation Override'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getJoinColumns Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getSpecifiedJoinColumns Specified Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getDefaultJoinColumns Default Join Columns}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IAssociationOverride extends IOverride -{ - /** - * Returns the value of the 'Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride_JoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getJoinColumns(); - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getSpecifiedJoinColumns(); - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getDefaultJoinColumns(); - - IJoinColumn createJoinColumn(int index); - - boolean containsSpecifiedJoinColumns(); - - ITypeMapping typeMapping(); - - - public class JoinColumnOwner implements IJoinColumn.Owner - { - private IAssociationOverride associationOverride; - - public JoinColumnOwner(IAssociationOverride associationOverride) { - super(); - this.associationOverride = associationOverride; - } - - /** - * by default, the join column is in the type mapping's primary table - */ - public String defaultTableName() { - return this.associationOverride.getOwner().getTypeMapping().getTableName(); - } - - public List joinColumns() { - return this.associationOverride.getJoinColumns(); - } - - public IEntity targetEntity() { - return getRelationshipMapping().getResolvedTargetEntity(); - } - - public String attributeName() { - return this.associationOverride.getName(); - } - - public IRelationshipMapping getRelationshipMapping() { - //TODO cast or check instanceof first?? - return (IRelationshipMapping) this.associationOverride.getOwner().attributeMapping(this.associationOverride.getName()); - } - - public boolean tableNameIsInvalid(String tableName) { - return getTypeMapping().tableNameIsInvalid(tableName); - } - - /** - * the join column can be on a secondary table - */ - public boolean tableIsAllowed() { - return true; - } - - public ITextRange validationTextRange() { - return this.associationOverride.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return this.associationOverride.getOwner().getTypeMapping(); - } - - public Table dbTable(String tableName) { - return getTypeMapping().dbTable(tableName); - } - - public Table dbReferencedColumnTable() { - IEntity targetEntity = targetEntity(); - return (targetEntity == null) ? null : targetEntity().primaryDbTable(); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAttributeOverride.java deleted file mode 100644 index 97e19b51a1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAttributeOverride.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IAttribute Override'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride#getColumn Column}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAttributeOverride() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IAttributeOverride extends IOverride, IColumnMapping -{ - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAttributeOverride_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - IColumn getColumn(); -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IBasic.java deleted file mode 100644 index 434bb7de51..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IBasic.java +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; - -/** - * - * A representation of the model object 'Basic'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IBasic#getFetch Fetch}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IBasic#getOptional Optional}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IBasic#getColumn Column}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IBasic#isLob Lob}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IBasic#getTemporal Temporal}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IBasic#getEnumerated Enumerated}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IBasic extends IAttributeMapping, IColumnMapping -{ - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType}. - * - *

    - * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #setFetch(DefaultEagerFetchType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic_Fetch() - * @model - * @generated - */ - DefaultEagerFetchType getFetch(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #getFetch() - * @generated - */ - void setFetch(DefaultEagerFetchType value); - - /** - * Returns the value of the 'Optional' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Optional' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setOptional(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic_Optional() - * @model - * @generated - */ - DefaultTrueBoolean getOptional(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getOptional Optional}' attribute. - * - * - * @param value the new value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getOptional() - * @generated - */ - void setOptional(DefaultTrueBoolean value); - - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - IColumn getColumn(); - - /** - * Returns the value of the 'Lob' attribute. - * - *

    - * If the meaning of the 'Lob' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Lob' attribute. - * @see #setLob(boolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic_Lob() - * @model - * @generated - */ - boolean isLob(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IBasic#isLob Lob}' attribute. - * - * - * @param value the new value of the 'Lob' attribute. - * @see #isLob() - * @generated - */ - void setLob(boolean value); - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

    - * If the meaning of the 'Temporal' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic_Temporal() - * @model - * @generated - */ - TemporalType getTemporal(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - void setTemporal(TemporalType value); - - /** - * Returns the value of the 'Enumerated' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.EnumType}. - * - *

    - * If the meaning of the 'Enumerated' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Enumerated' attribute. - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see #setEnumerated(EnumType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic_Enumerated() - * @model - * @generated - */ - EnumType getEnumerated(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getEnumerated Enumerated}' attribute. - * - * - * @param value the new value of the 'Enumerated' attribute. - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see #getEnumerated() - * @generated - */ - void setEnumerated(EnumType value); -} // Basic diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java deleted file mode 100644 index a4437823dc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'ICascade'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.ICascade#isAll All}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ICascade#isPersist Persist}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ICascade#isMerge Merge}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ICascade#isRemove Remove}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh Refresh}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ICascade extends IJpaSourceObject -{ - /** - * Returns the value of the 'All' attribute. - * - *

    - * If the meaning of the 'All' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'All' attribute. - * @see #setAll(boolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_All() - * @model - * @generated - */ - boolean isAll(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isAll All}' attribute. - * - * - * @param value the new value of the 'All' attribute. - * @see #isAll() - * @generated - */ - void setAll(boolean value); - - /** - * Returns the value of the 'Persist' attribute. - * - *

    - * If the meaning of the 'Persist' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Persist' attribute. - * @see #setPersist(boolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Persist() - * @model - * @generated - */ - boolean isPersist(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isPersist Persist}' attribute. - * - * - * @param value the new value of the 'Persist' attribute. - * @see #isPersist() - * @generated - */ - void setPersist(boolean value); - - /** - * Returns the value of the 'Merge' attribute. - * - *

    - * If the meaning of the 'Merge' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Merge' attribute. - * @see #setMerge(boolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Merge() - * @model - * @generated - */ - boolean isMerge(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isMerge Merge}' attribute. - * - * - * @param value the new value of the 'Merge' attribute. - * @see #isMerge() - * @generated - */ - void setMerge(boolean value); - - /** - * Returns the value of the 'Remove' attribute. - * - *

    - * If the meaning of the 'Remove' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Remove' attribute. - * @see #setRemove(boolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Remove() - * @model - * @generated - */ - boolean isRemove(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRemove Remove}' attribute. - * - * - * @param value the new value of the 'Remove' attribute. - * @see #isRemove() - * @generated - */ - void setRemove(boolean value); - - /** - * Returns the value of the 'Refresh' attribute. - * - *

    - * If the meaning of the 'Refresh' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Refresh' attribute. - * @see #setRefresh(boolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Refresh() - * @model - * @generated - */ - boolean isRefresh(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh Refresh}' attribute. - * - * - * @param value the new value of the 'Refresh' attribute. - * @see #isRefresh() - * @generated - */ - void setRefresh(boolean value); -} // ICascade diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java deleted file mode 100644 index aaf84672e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * - * A representation of the model object 'IColumn'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IColumn#getLength Length}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision Precision}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IColumn#getScale Scale}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IColumn extends IAbstractColumn -{ - /** - * Returns the value of the 'Length' attribute. - * The default value is "255". - * - *

    - * If the meaning of the 'Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Length' attribute. - * @see #setLength(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_Length() - * @model default="255" - * @generated - */ - int getLength(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getLength Length}' attribute. - * - * - * @param value the new value of the 'Length' attribute. - * @see #getLength() - * @generated - */ - void setLength(int value); - - /** - * Returns the value of the 'Precision' attribute. - * - *

    - * If the meaning of the 'Precision' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Precision' attribute. - * @see #setPrecision(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_Precision() - * @model - * @generated - */ - int getPrecision(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision Precision}' attribute. - * - * - * @param value the new value of the 'Precision' attribute. - * @see #getPrecision() - * @generated - */ - void setPrecision(int value); - - /** - * Returns the value of the 'Scale' attribute. - * - *

    - * If the meaning of the 'Scale' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Scale' attribute. - * @see #setScale(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_Scale() - * @model - * @generated - */ - int getScale(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getScale Scale}' attribute. - * - * - * @param value the new value of the 'Scale' attribute. - * @see #getScale() - * @generated - */ - void setScale(int value); - - void refreshDefaults(DefaultsContext defaultsContext); - - /** - * Return whether the column is found on the datasource - */ - boolean isResolved(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumnMapping.java deleted file mode 100644 index 2ac84a01b3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumnMapping.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'IColumn Mapping'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumnMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IColumnMapping extends EObject -{ - /** - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @model kind="operation" - * @generated - */ - IColumn getColumn(); -} // IColumnMapping diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IDiscriminatorColumn.java deleted file mode 100644 index ceef08d4f0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IDiscriminatorColumn.java +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'IDiscriminator Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDiscriminatorType Discriminator Type}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDefaultLength Default Length}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getSpecifiedLength Specified Length}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getLength Length}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IDiscriminatorColumn extends INamedColumn -{ - /** - * Returns the value of the 'Discriminator Type' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType}. - * - *

    - * If the meaning of the 'Discriminator Type' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Type' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see #setDiscriminatorType(DiscriminatorType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn_DiscriminatorType() - * @model - * @generated - */ - DiscriminatorType getDiscriminatorType(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDiscriminatorType Discriminator Type}' attribute. - * - * - * @param value the new value of the 'Discriminator Type' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see #getDiscriminatorType() - * @generated - */ - void setDiscriminatorType(DiscriminatorType value); - - /** - * Returns the value of the 'Default Length' attribute. - * The default value is "31". - * - *

    - * If the meaning of the 'Default Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Length' attribute. - * @see #setDefaultLength(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn_DefaultLength() - * @model default="31" - * @generated - */ - int getDefaultLength(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDefaultLength Default Length}' attribute. - * - * - * @param value the new value of the 'Default Length' attribute. - * @see #getDefaultLength() - * @generated - */ - void setDefaultLength(int value); - - /** - * Returns the value of the 'Specified Length' attribute. - * The default value is "-1". - * - *

    - * If the meaning of the 'Specified Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Length' attribute. - * @see #setSpecifiedLength(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn_SpecifiedLength() - * @model default="-1" - * @generated - */ - int getSpecifiedLength(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getSpecifiedLength Specified Length}' attribute. - * - * - * @param value the new value of the 'Specified Length' attribute. - * @see #getSpecifiedLength() - * @generated - */ - void setSpecifiedLength(int value); - - /** - * Returns the value of the 'Length' attribute. - * - *

    - * If the meaning of the 'Length' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Length' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn_Length() - * @model transient="true" changeable="false" volatile="true" derived="true" - * @generated - */ - int getLength(); - - - class Owner implements INamedColumn.Owner - { - private IEntity entity; - - public Owner(IEntity entity) { - super(); - this.entity = entity; - } - - public Table dbTable(String tableName) { - return this.entity.dbTable(tableName); - } - - public ITextRange validationTextRange() { - return this.entity.getDiscriminatorColumn().validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return this.entity; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddable.java deleted file mode 100644 index dad0ff9044..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddable.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.ITypeMapping; - -/** - * - * A representation of the model object 'Embeddable'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddable() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IEmbeddable extends ITypeMapping -{} // Embeddable diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbedded.java deleted file mode 100644 index 91f43f92f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbedded.java +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IOverride.Owner; - -/** - * - * A representation of the model object 'IEmbedded'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEmbedded#getAttributeOverrides Attribute Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEmbedded#getSpecifiedAttributeOverrides Specified Attribute Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEmbedded#getDefaultAttributeOverrides Default Attribute Overrides}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IEmbedded extends IAttributeMapping -{ - /** - * Returns the value of the 'Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded_AttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getAttributeOverrides(); - - /** - * Returns the value of the 'Specified Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Specified Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded_SpecifiedAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - EList getSpecifiedAttributeOverrides(); - - /** - * Returns the value of the 'Default Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Default Attribute Overrides' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded_DefaultAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - EList getDefaultAttributeOverrides(); - - /** - * - * - * @model - * @generated - */ - IEmbeddable embeddable(); - - IAttributeOverride createAttributeOverride(int index); - - Iterator allOverridableAttributeNames(); - - IAttributeOverride attributeOverrideNamed(String name); - - boolean containsAttributeOverride(String name); - - boolean containsSpecifiedAttributeOverride(String name); - - - class AttributeOverrideOwner implements Owner - { - private IEmbedded embedded; - - public AttributeOverrideOwner(IEmbedded embedded) { - this.embedded = embedded; - } - - public ITypeMapping getTypeMapping() { - return this.embedded.typeMapping(); - } - - public IAttributeMapping attributeMapping(String attributeName) { - return (IAttributeMapping) columnMapping(attributeName); - } - - private IColumnMapping columnMapping(String name) { - IEmbeddable embeddable = this.embedded.embeddable(); - if (embeddable != null) { - for (Iterator stream = embeddable.getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute persAttribute = stream.next(); - if (persAttribute.getName().equals(name)) { - if (persAttribute.getMapping() instanceof IColumnMapping) { - return (IColumnMapping) persAttribute.getMapping(); - } - } - } - } - return null; - } - - public boolean isVirtual(IOverride override) { - return embedded.getDefaultAttributeOverrides().contains(override); - } - - public ITextRange validationTextRange() { - return embedded.validationTextRange(); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddedId.java deleted file mode 100644 index d2e1f082db..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddedId.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; - -/** - * - * A representation of the model object 'IEmbedded Id'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddedId() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IEmbeddedId extends IAttributeMapping -{} // IEmbeddedId diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEntity.java deleted file mode 100644 index 40ebb4c086..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEntity.java +++ /dev/null @@ -1,686 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'Entity'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedName Specified Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultName Default Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getTable Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedSecondaryTables Specified Secondary Tables}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getPrimaryKeyJoinColumns Primary Key Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedPrimaryKeyJoinColumns Specified Primary Key Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultPrimaryKeyJoinColumns Default Primary Key Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getInheritanceStrategy Inheritance Strategy}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultDiscriminatorValue Default Discriminator Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedDiscriminatorValue Specified Discriminator Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDiscriminatorValue Discriminator Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDiscriminatorColumn Discriminator Column}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSequenceGenerator Sequence Generator}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getTableGenerator Table Generator}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getAttributeOverrides Attribute Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedAttributeOverrides Specified Attribute Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultAttributeOverrides Default Attribute Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getAssociationOverrides Association Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedAssociationOverrides Specified Association Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultAssociationOverrides Default Association Overrides}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getNamedQueries Named Queries}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getNamedNativeQueries Named Native Queries}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IEntity#getIdClass Id Class}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IEntity extends ITypeMapping -{ - /** - * Returns the value of the 'Specified Name' attribute. - * - *

    - * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SpecifiedName() - * @model - * @generated - */ - String getSpecifiedName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - void setSpecifiedName(String value); - - /** - * Returns the value of the 'Default Name' attribute. - * - *

    - * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DefaultName() - * @model changeable="false" - * @generated - */ - String getDefaultName(); - - /** - * Returns the value of the 'Table' containment reference. - * - *

    - * If the meaning of the 'Table' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_Table() - * @model containment="true" required="true" changeable="false" - * @generated - */ - ITable getTable(); - - /** - * Returns the value of the 'Specified Secondary Tables' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable}. - * - *

    - * If the meaning of the 'Specified Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Secondary Tables' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SpecifiedSecondaryTables() - * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" - * @generated - */ - EList getSpecifiedSecondaryTables(); - - /** - * - *

    - * If the meaning of the 'Secondary Tables' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @model kind="operation" type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" - * @generated - */ - EList getSecondaryTables(); - - /** - * Returns the value of the 'Inheritance Strategy' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.InheritanceType}. - * - *

    - * If the meaning of the 'Inheritance Strategy' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Inheritance Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #setInheritanceStrategy(InheritanceType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_InheritanceStrategy() - * @model - * @generated - */ - InheritanceType getInheritanceStrategy(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getInheritanceStrategy Inheritance Strategy}' attribute. - * - * - * @param value the new value of the 'Inheritance Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see #getInheritanceStrategy() - * @generated - */ - void setInheritanceStrategy(InheritanceType value); - - /** - * Returns the value of the 'Discriminator Column' containment reference. - * - *

    - * If the meaning of the 'Discriminator Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Column' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DiscriminatorColumn() - * @model containment="true" changeable="false" - * @generated - */ - IDiscriminatorColumn getDiscriminatorColumn(); - - /** - * Returns the value of the 'Sequence Generator' containment reference. - * - *

    - * If the meaning of the 'Sequence Generator' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Sequence Generator' containment reference. - * @see #setSequenceGenerator(ISequenceGenerator) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SequenceGenerator() - * @model containment="true" - * @generated - */ - ISequenceGenerator getSequenceGenerator(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSequenceGenerator Sequence Generator}' containment reference. - * - * - * @param value the new value of the 'Sequence Generator' containment reference. - * @see #getSequenceGenerator() - * @generated - */ - void setSequenceGenerator(ISequenceGenerator value); - - /** - * Returns the value of the 'Table Generator' containment reference. - * - *

    - * If the meaning of the 'Table Generator' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table Generator' containment reference. - * @see #setTableGenerator(ITableGenerator) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_TableGenerator() - * @model containment="true" - * @generated - */ - ITableGenerator getTableGenerator(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getTableGenerator Table Generator}' containment reference. - * - * - * @param value the new value of the 'Table Generator' containment reference. - * @see #getTableGenerator() - * @generated - */ - void setTableGenerator(ITableGenerator value); - - /** - * Returns the value of the 'Default Discriminator Value' attribute. - * - *

    - * If the meaning of the 'Default Discriminator Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Discriminator Value' attribute. - * @see #setDefaultDiscriminatorValue(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DefaultDiscriminatorValue() - * @model - * @generated - */ - String getDefaultDiscriminatorValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultDiscriminatorValue Default Discriminator Value}' attribute. - * - * - * @param value the new value of the 'Default Discriminator Value' attribute. - * @see #getDefaultDiscriminatorValue() - * @generated - */ - void setDefaultDiscriminatorValue(String value); - - /** - * Returns the value of the 'Specified Discriminator Value' attribute. - * - *

    - * If the meaning of the 'Specified Discriminator Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Discriminator Value' attribute. - * @see #setSpecifiedDiscriminatorValue(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SpecifiedDiscriminatorValue() - * @model - * @generated - */ - String getSpecifiedDiscriminatorValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedDiscriminatorValue Specified Discriminator Value}' attribute. - * - * - * @param value the new value of the 'Specified Discriminator Value' attribute. - * @see #getSpecifiedDiscriminatorValue() - * @generated - */ - void setSpecifiedDiscriminatorValue(String value); - - /** - * Returns the value of the 'Discriminator Value' attribute. - * - *

    - * If the meaning of the 'Discriminator Value' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Discriminator Value' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DiscriminatorValue() - * @model transient="true" changeable="false" volatile="true" derived="true" - * @generated - */ - String getDiscriminatorValue(); - - /** - * Returns the value of the 'Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_PrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getPrimaryKeyJoinColumns(); - - /** - * Returns the value of the 'Specified Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Specified Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SpecifiedPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - EList getSpecifiedPrimaryKeyJoinColumns(); - - /** - * Returns the value of the 'Default Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Default Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DefaultPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - EList getDefaultPrimaryKeyJoinColumns(); - - /** - * Returns the value of the 'Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_AttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getAttributeOverrides(); - - /** - * Returns the value of the 'Specified Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Specified Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SpecifiedAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - EList getSpecifiedAttributeOverrides(); - - /** - * Returns the value of the 'Default Attribute Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride}. - * - *

    - * If the meaning of the 'Default Attribute Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Attribute Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DefaultAttributeOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAttributeOverride" containment="true" - * @generated - */ - EList getDefaultAttributeOverrides(); - - /** - * Returns the value of the 'Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

    - * If the meaning of the 'Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_AssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getAssociationOverrides(); - - /** - * Returns the value of the 'Specified Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

    - * If the meaning of the 'Specified Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_SpecifiedAssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" - * @generated - */ - EList getSpecifiedAssociationOverrides(); - - /** - * Returns the value of the 'Default Association Overrides' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride}. - * - *

    - * If the meaning of the 'Default Association Overrides' reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Association Overrides' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_DefaultAssociationOverrides() - * @model type="org.eclipse.jpt.core.internal.mappings.IAssociationOverride" containment="true" - * @generated - */ - EList getDefaultAssociationOverrides(); - - /** - * Returns the value of the 'Named Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.INamedQuery}. - * - *

    - * If the meaning of the 'Named Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Named Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_NamedQueries() - * @model type="org.eclipse.jpt.core.internal.mappings.INamedQuery" containment="true" - * @generated - */ - EList getNamedQueries(); - - /** - * Returns the value of the 'Named Native Queries' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery}. - * - *

    - * If the meaning of the 'Named Native Queries' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Named Native Queries' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_NamedNativeQueries() - * @model type="org.eclipse.jpt.core.internal.mappings.INamedNativeQuery" containment="true" - * @generated - */ - EList getNamedNativeQueries(); - - /** - * Returns the value of the 'Id Class' attribute. - * - *

    - * If the meaning of the 'Id Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class' attribute. - * @see #setIdClass(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity_IdClass() - * @model - * @generated - */ - String getIdClass(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getIdClass Id Class}' attribute. - * - * - * @param value the new value of the 'Id Class' attribute. - * @see #getIdClass() - * @generated - */ - void setIdClass(String value); - - /** - * - * - * @model - * @generated - */ - boolean discriminatorValueIsAllowed(); - - /** - * Return the ultimate top of the inheritance hierarchy - * This method should never return null. The root - * is defined as the persistent type in the inheritance hierarchy - * that has no parent. The root should be an entity - * - * Non-entities in the hierarchy should be ignored, ie skip - * over them in the search for the root. - * - * @model - * @generated - */ - IEntity rootEntity(); - - /** - * - * The first parent in the class hierarchy that is an entity. - * This is the parent in the entity (persistent) inheritance hierarchy - * (vs class inheritance hierarchy) - * - * @model - * @generated - */ - IEntity parentEntity(); - - /** - * Return the name of the entity's primary key column. - * Return null if the entity's primary key is "compound" - * (i.e. the primary key is composed of multiple columns). - */ - String primaryKeyColumnName(); - - /** - * Return the name of the entity's primary key attribute. - * Return null if the entity's primary key is "compound" - * (i.e. the primary key is composed of multiple columns). - */ - String primaryKeyAttributeName(); - - IAttributeOverride createAttributeOverride(int index); - - IAssociationOverride createAssociationOverride(int index); - - IAttributeOverride attributeOverrideNamed(String name); - - boolean containsAttributeOverride(String name); - - boolean containsSpecifiedAttributeOverride(String name); - - boolean containsAssociationOverride(String name); - - boolean containsSpecifiedAssociationOverride(String name); - - boolean containsSecondaryTable(String name); - - boolean containsSpecifiedSecondaryTable(String name); - - ISecondaryTable createSecondaryTable(int index); - - boolean containsSpecifiedPrimaryKeyJoinColumns(); - - IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index); - - INamedQuery createNamedQuery(int index); - - INamedNativeQuery createNamedNativeQuery(int index); - - - abstract class OverrideOwner implements IOverride.Owner - { - protected IEntity entity; - - public OverrideOwner(IEntity entity) { - this.entity = entity; - } - - public ITypeMapping getTypeMapping() { - return this.entity; - } - - public ITextRange validationTextRange() { - return entity.validationTextRange(); - } - } - - - class AttributeOverrideOwner extends OverrideOwner - { - public AttributeOverrideOwner(IEntity entity) { - super(entity); - } - - public IAttributeMapping attributeMapping(String attributeName) { - return (IAttributeMapping) columnMapping(attributeName); - } - - private IColumnMapping columnMapping(String attributeName) { - if (attributeName == null) { - return null; - } - for (Iterator stream = this.entity.getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute persAttribute = stream.next(); - if (attributeName.equals(persAttribute.getName())) { - if (persAttribute.getMapping() instanceof IColumnMapping) { - return (IColumnMapping) persAttribute.getMapping(); - } - } - } - return null; - } - - public boolean isVirtual(IOverride override) { - return entity.getDefaultAttributeOverrides().contains(override); - } - } - - - class AssociationOverrideOwner extends OverrideOwner - { - public AssociationOverrideOwner(IEntity entity) { - super(entity); - } - - public IAttributeMapping attributeMapping(String attributeName) { - for (Iterator stream = this.entity.getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute persAttribute = stream.next(); - if (attributeName.equals(persAttribute.getName())) { - return persAttribute.getMapping(); - } - } - return null; - } - - public boolean isVirtual(IOverride override) { - return entity.getDefaultAssociationOverrides().contains(override); - } - } - - - class PrimaryKeyJoinColumnOwner implements IAbstractJoinColumn.Owner - { - private IEntity entity; - - public PrimaryKeyJoinColumnOwner(IEntity entity) { - this.entity = entity; - } - - public ITextRange validationTextRange() { - return this.entity.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return this.entity; - } - - public Table dbTable(String tableName) { - return this.entity.dbTable(tableName); - } - - public Table dbReferencedColumnTable() { - IEntity parentEntity = this.entity.parentEntity(); - return (parentEntity == null) ? null : parentEntity.primaryDbTable(); - } - - public List joinColumns() { - return this.entity.getPrimaryKeyJoinColumns(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGeneratedValue.java deleted file mode 100644 index 48627ea1d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGeneratedValue.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITextRange; - -/** - * - * A representation of the model object 'IGenerated Value'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getStrategy Strategy}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getGenerator Generator}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGeneratedValue() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IGeneratedValue extends IJpaSourceObject -{ - /** - * Returns the value of the 'Strategy' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.GenerationType}. - * - *

    - * If the meaning of the 'Strategy' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see #setStrategy(GenerationType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGeneratedValue_Strategy() - * @model - * @generated - */ - GenerationType getStrategy(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getStrategy Strategy}' attribute. - * - * - * @param value the new value of the 'Strategy' attribute. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see #getStrategy() - * @generated - */ - void setStrategy(GenerationType value); - - /** - * Returns the value of the 'Generator' attribute. - * - *

    - * If the meaning of the 'Generator' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Generator' attribute. - * @see #setGenerator(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGeneratedValue_Generator() - * @model - * @generated - */ - String getGenerator(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getGenerator Generator}' attribute. - * - * - * @param value the new value of the 'Generator' attribute. - * @see #getGenerator() - * @generated - */ - void setGenerator(String value); - - /** - * Return the (best guess) text location of the generator. - */ - ITextRange generatorTextRange(); -} // IGeneratedValue diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGenerator.java deleted file mode 100644 index 07c74de367..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGenerator.java +++ /dev/null @@ -1,177 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'IGenerator'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getInitialValue Initial Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedInitialValue Specified Initial Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getDefaultInitialValue Default Initial Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getAllocationSize Allocation Size}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedAllocationSize Specified Allocation Size}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IGenerator#getDefaultAllocationSize Default Allocation Size}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IGenerator extends IJpaSourceObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Initial Value' attribute. - * - *

    - * If the meaning of the 'Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Initial Value' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_InitialValue() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - int getInitialValue(); - - /** - * Returns the value of the 'Specified Initial Value' attribute. - * The default value is "-1". - * - *

    - * If the meaning of the 'Specified Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Initial Value' attribute. - * @see #setSpecifiedInitialValue(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_SpecifiedInitialValue() - * @model default="-1" - * @generated - */ - int getSpecifiedInitialValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedInitialValue Specified Initial Value}' attribute. - * - * - * @param value the new value of the 'Specified Initial Value' attribute. - * @see #getSpecifiedInitialValue() - * @generated - */ - void setSpecifiedInitialValue(int value); - - /** - * Returns the value of the 'Default Initial Value' attribute. - * - *

    - * If the meaning of the 'Default Initial Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Initial Value' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_DefaultInitialValue() - * @model changeable="false" - * @generated - */ - int getDefaultInitialValue(); - - /** - * Returns the value of the 'Allocation Size' attribute. - * - *

    - * If the meaning of the 'Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Allocation Size' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_AllocationSize() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - int getAllocationSize(); - - /** - * Returns the value of the 'Specified Allocation Size' attribute. - * The default value is "-1". - * - *

    - * If the meaning of the 'Specified Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Allocation Size' attribute. - * @see #setSpecifiedAllocationSize(int) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_SpecifiedAllocationSize() - * @model default="-1" - * @generated - */ - int getSpecifiedAllocationSize(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedAllocationSize Specified Allocation Size}' attribute. - * - * - * @param value the new value of the 'Specified Allocation Size' attribute. - * @see #getSpecifiedAllocationSize() - * @generated - */ - void setSpecifiedAllocationSize(int value); - - /** - * Returns the value of the 'Default Allocation Size' attribute. - * - *

    - * If the meaning of the 'Default Allocation Size' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Allocation Size' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator_DefaultAllocationSize() - * @model changeable="false" - * @generated - */ - int getDefaultAllocationSize(); -} // IGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IId.java deleted file mode 100644 index cae3c2baa8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IId.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; - -/** - * - * A representation of the model object 'Id'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IId#getColumn Column}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IId#getGeneratedValue Generated Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IId#getTemporal Temporal}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IId#getTableGenerator Table Generator}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IId#getSequenceGenerator Sequence Generator}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IId extends IAttributeMapping, IColumnMapping -{ - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - IColumn getColumn(); - - /** - * Returns the value of the 'Generated Value' containment reference. - * - *

    - * If the meaning of the 'Generated Value' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Generated Value' containment reference. - * @see #setGeneratedValue(IGeneratedValue) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId_GeneratedValue() - * @model containment="true" - * @generated - */ - IGeneratedValue getGeneratedValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IId#getGeneratedValue Generated Value}' containment reference. - * - * - * @param value the new value of the 'Generated Value' containment reference. - * @see #getGeneratedValue() - * @generated - */ - void setGeneratedValue(IGeneratedValue value); - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

    - * If the meaning of the 'Temporal' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId_Temporal() - * @model - * @generated - */ - TemporalType getTemporal(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IId#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - void setTemporal(TemporalType value); - - /** - * Returns the value of the 'Table Generator' containment reference. - * - *

    - * If the meaning of the 'Table Generator' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table Generator' containment reference. - * @see #setTableGenerator(ITableGenerator) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId_TableGenerator() - * @model containment="true" - * @generated - */ - ITableGenerator getTableGenerator(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IId#getTableGenerator Table Generator}' containment reference. - * - * - * @param value the new value of the 'Table Generator' containment reference. - * @see #getTableGenerator() - * @generated - */ - void setTableGenerator(ITableGenerator value); - - /** - * Returns the value of the 'Sequence Generator' containment reference. - * - *

    - * If the meaning of the 'Sequence Generator' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Sequence Generator' containment reference. - * @see #setSequenceGenerator(ISequenceGenerator) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId_SequenceGenerator() - * @model containment="true" - * @generated - */ - ISequenceGenerator getSequenceGenerator(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IId#getSequenceGenerator Sequence Generator}' containment reference. - * - * - * @param value the new value of the 'Sequence Generator' containment reference. - * @see #getSequenceGenerator() - * @generated - */ - void setSequenceGenerator(ISequenceGenerator value); - - IGeneratedValue createGeneratedValue(); - - ITableGenerator createTableGenerator(); - - ISequenceGenerator createSequenceGenerator(); -} // Id diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java deleted file mode 100644 index fe077636f4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IJoin Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJoinColumn extends IAbstractColumn, IAbstractJoinColumn -{ - IJoinColumn.Owner getOwner(); - - - /** - * interface allowing join columns to be used in multiple places - * (e.g. 1:1 mappings and join tables) - */ - interface Owner extends IAbstractJoinColumn.Owner - { - /** - * return whether the specified table cannot be explicitly specified - * in the join column's 'table' element - */ - boolean tableNameIsInvalid(String tableName); - - /** - * return whether the join column's table can be specified explicitly - */ - boolean tableIsAllowed(); - - /** - * return the entity referenced by the join column - */ - IEntity targetEntity(); - - /** - * return the join column's attribute name - */ - String attributeName(); - - /** - * return the relationship mapping for this join column - */ - IRelationshipMapping getRelationshipMapping(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinTable.java deleted file mode 100644 index 52da107d73..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinTable.java +++ /dev/null @@ -1,292 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'IJoin Table'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getJoinColumns Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getSpecifiedJoinColumns Specified Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getDefaultJoinColumns Default Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getInverseJoinColumns Inverse Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getSpecifiedInverseJoinColumns Specified Inverse Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getDefaultInverseJoinColumns Default Inverse Join Columns}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IJoinTable extends ITable -{ - /** - * Returns the value of the 'Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable_JoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getJoinColumns(); - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getSpecifiedJoinColumns(); - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getDefaultJoinColumns(); - - /** - * Returns the value of the 'Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable_InverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getInverseJoinColumns(); - - /** - * Returns the value of the 'Specified Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable_SpecifiedInverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getSpecifiedInverseJoinColumns(); - - /** - * Returns the value of the 'Default Inverse Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Inverse Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Inverse Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable_DefaultInverseJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getDefaultInverseJoinColumns(); - - IJoinColumn createJoinColumn(int index); - - IJoinColumn createInverseJoinColumn(int index); - - boolean containsSpecifiedJoinColumns(); - - boolean containsSpecifiedInverseJoinColumns(); - - IRelationshipMapping relationshipMapping(); - - - /** - * just a little common behavior - */ - abstract class AbstractJoinColumnOwner implements IJoinColumn.Owner - { - private final IJoinTable joinTable; - - AbstractJoinColumnOwner(IJoinTable joinTable) { - super(); - this.joinTable = joinTable; - } - - protected IJoinTable getJoinTable() { - return this.joinTable; - } - - public IRelationshipMapping getRelationshipMapping() { - return this.joinTable.relationshipMapping(); - } - - /** - * the default table name is always valid and a specified table name - * is prohibited (which will be handled elsewhere) - */ - public boolean tableNameIsInvalid(String tableName) { - return false; - } - - /** - * the join column can only be on the join table itself - */ - public boolean tableIsAllowed() { - return false; - } - - public ITextRange validationTextRange() { - return this.joinTable.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return this.joinTable.getOwner().getTypeMapping(); - } - - public Table dbTable(String tableName) { - if (this.joinTable.getName() == null) { - return null; - } - return (this.joinTable.getName().equals(tableName)) ? this.joinTable.dbTable() : null; - } - } - - - /** - * owner for "forward-pointer" JoinColumns; - * these point at the target/inverse entity - */ - class InverseJoinColumnOwner extends AbstractJoinColumnOwner - { - public InverseJoinColumnOwner(IJoinTable joinTable) { - super(joinTable); - } - - public List joinColumns() { - return getJoinTable().getInverseJoinColumns(); - } - - public IEntity targetEntity() { - return getJoinTable().relationshipMapping().getResolvedTargetEntity(); - } - - public String attributeName() { - return getJoinTable().relationshipMapping().getPersistentAttribute().getName(); - } - - @Override - public Table dbTable(String tableName) { - Table dbTable = super.dbTable(tableName); - if (dbTable != null) { - return dbTable; - } - IEntity targetEntity = targetEntity(); - return (targetEntity == null) ? null : targetEntity.dbTable(tableName); - } - - public Table dbReferencedColumnTable() { - IEntity targetEntity = targetEntity(); - return (targetEntity == null) ? null : targetEntity.primaryDbTable(); - } - } - - - /** - * owner for "back-pointer" JoinColumns; - * these point at the source/owning entity - */ - class JoinColumnOwner extends AbstractJoinColumnOwner - { - public JoinColumnOwner(IJoinTable joinTable) { - super(joinTable); - } - - public List joinColumns() { - return getJoinTable().getJoinColumns(); - } - - public IEntity targetEntity() { - return getJoinTable().relationshipMapping().getEntity(); - } - - public String attributeName() { - IEntity targetEntity = getJoinTable().relationshipMapping().getResolvedTargetEntity(); - if (targetEntity == null) { - return null; - } - String attributeName = getJoinTable().relationshipMapping().getPersistentAttribute().getName(); - for (Iterator stream = targetEntity.getPersistentType().allAttributes(); stream.hasNext();) { - IPersistentAttribute attribute = stream.next(); - IAttributeMapping mapping = attribute.getMapping(); - if (mapping instanceof INonOwningMapping) { - String mappedBy = ((INonOwningMapping) mapping).getMappedBy(); - if ((mappedBy != null) && mappedBy.equals(attributeName)) { - return attribute.getName(); - } - } - } - return null; - } - - @Override - public Table dbTable(String tableName) { - Table dbTable = super.dbTable(tableName); - if (dbTable != null) { - return dbTable; - } - return getTypeMapping().dbTable(tableName); - } - - public Table dbReferencedColumnTable() { - return getTypeMapping().primaryDbTable(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToMany.java deleted file mode 100644 index 1cc4f946d3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToMany.java +++ /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 - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IMany To Many'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToMany() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IManyToMany extends IMultiRelationshipMapping -{} // IManyToMany diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToOne.java deleted file mode 100644 index 033d6afb1c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToOne.java +++ /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 - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IMany To One'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToOne() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IManyToOne extends ISingleRelationshipMapping -{} // IManyToOne diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMappedSuperclass.java deleted file mode 100644 index fa513d0f45..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMappedSuperclass.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.ITypeMapping; - -/** - * - * A representation of the model object 'Mapped Superclass'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass#getIdClass Id Class}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMappedSuperclass() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IMappedSuperclass extends ITypeMapping -{ - /** - * Returns the value of the 'Id Class' attribute. - * - *

    - * If the meaning of the 'Id Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Id Class' attribute. - * @see #setIdClass(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMappedSuperclass_IdClass() - * @model - * @generated - */ - String getIdClass(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass#getIdClass Id Class}' attribute. - * - * - * @param value the new value of the 'Id Class' attribute. - * @see #getIdClass() - * @generated - */ - void setIdClass(String value); -} // MappedSuperclass diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java deleted file mode 100644 index 85db84e718..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; - -/** - * - * A representation of the model object 'IMulti Relationship Mapping'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy Order By}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch Fetch}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable Join Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getMapKey Map Key}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IMultiRelationshipMapping extends INonOwningMapping -{ - /** - * Returns the value of the 'Order By' attribute. - * - *

    - * If the meaning of the 'Order By' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Order By' attribute. - * @see #setOrderBy(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping_OrderBy() - * @model unique="false" ordered="false" - * @generated - */ - String getOrderBy(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy Order By}' attribute. - * - * - * @param value the new value of the 'Order By' attribute. - * @see #getOrderBy() - * @generated - */ - void setOrderBy(String value); - - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType}. - * - *

    - * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see #setFetch(DefaultLazyFetchType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping_Fetch() - * @model - * @generated - */ - DefaultLazyFetchType getFetch(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see #getFetch() - * @generated - */ - void setFetch(DefaultLazyFetchType value); - - /** - * Returns the value of the 'Join Table' containment reference. - * - *

    - * If the meaning of the 'Join Table' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Table' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping_JoinTable() - * @model containment="true" required="true" changeable="false" - * @generated - */ - IJoinTable getJoinTable(); - - /** - * All multi-relationship mappings have a join table, even if it has to be - * calculated from default settings. However, it is important to note - * whether the table *is* default or whether it is specified. - */ - boolean isJoinTableSpecified(); - - /** - * Returns the value of the 'Map Key' attribute. - * - *

    - * If the meaning of the 'Map Key' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Map Key' attribute. - * @see #setMapKey(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping_MapKey() - * @model - * @generated - */ - String getMapKey(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getMapKey Map Key}' attribute. - * - * - * @param value the new value of the 'Map Key' attribute. - * @see #getMapKey() - * @generated - */ - void setMapKey(String value); - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated - */ - boolean isNoOrdering(); - - /** - * - * - * @model - * @generated - */ - void setNoOrdering(); - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated - */ - boolean isOrderByPk(); - - /** - * - * - * @model - * @generated - */ - void setOrderByPk(); - - /** - * - * - * @model kind="operation" unique="false" required="true" ordered="false" - * @generated - */ - boolean isCustomOrdering(); - - Iterator candidateMapKeyNames(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedColumn.java deleted file mode 100644 index 87210b191f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedColumn.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'INamed Column'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getSpecifiedName Specified Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getDefaultName Default Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getColumnDefinition Column Definition}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface INamedColumn extends IJpaSourceObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getName(); - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

    - * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn_SpecifiedName() - * @model - * @generated - */ - String getSpecifiedName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - void setSpecifiedName(String value); - - /** - * Returns the value of the 'Default Name' attribute. - * - *

    - * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn_DefaultName() - * @model changeable="false" - * @generated - */ - String getDefaultName(); - - /** - * Returns the value of the 'Column Definition' attribute. - * - *

    - * If the meaning of the 'Column Definition' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column Definition' attribute. - * @see #setColumnDefinition(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn_ColumnDefinition() - * @model - * @generated - */ - String getColumnDefinition(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getColumnDefinition Column Definition}' attribute. - * - * - * @param value the new value of the 'Column Definition' attribute. - * @see #getColumnDefinition() - * @generated - */ - void setColumnDefinition(String value); - - /** - * Return the wrapper for the datasource column - */ - Column dbColumn(); - - /** - * Return the wrapper for the datasource table - */ - Table dbTable(); - - /** - * Return whether the column is found on the datasource. - */ - boolean isResolved(); - - /** - * Return the (best guess) text location of the column's name. - */ - ITextRange nameTextRange(); - - /** - * Return whether the column's datasource is connected - */ - boolean isConnected(); - - /** - * Return the column's "owner" - the object that contains the column - * and provides its context. - */ - Owner getOwner(); - - - /** - * interface allowing columns to be used in multiple places - * (e.g. basic mappings and attribute overrides) - */ - interface Owner - { - /** - * Return the type mapping that contains the column. - */ - ITypeMapping getTypeMapping(); - - /** - * Return the column owner's text range. This can be returned by the - * column when its annotation is not present. - */ - ITextRange validationTextRange(); - - /** - * Return the wrapper for the datasource table for the given table name - */ - Table dbTable(String tableName); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedNativeQuery.java deleted file mode 100644 index ba382a05e3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedNativeQuery.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'INamed Native Query'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultClass Result Class}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultSetMapping Result Set Mapping}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface INamedNativeQuery extends IJpaSourceObject, IQuery -{ - /** - * Returns the value of the 'Result Class' attribute. - * - *

    - * If the meaning of the 'Result Class' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Result Class' attribute. - * @see #setResultClass(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery_ResultClass() - * @model - * @generated - */ - String getResultClass(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultClass Result Class}' attribute. - * - * - * @param value the new value of the 'Result Class' attribute. - * @see #getResultClass() - * @generated - */ - void setResultClass(String value); - - /** - * Returns the value of the 'Result Set Mapping' attribute. - * - *

    - * If the meaning of the 'Result Set Mapping' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Result Set Mapping' attribute. - * @see #setResultSetMapping(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery_ResultSetMapping() - * @model - * @generated - */ - String getResultSetMapping(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultSetMapping Result Set Mapping}' attribute. - * - * - * @param value the new value of the 'Result Set Mapping' attribute. - * @see #getResultSetMapping() - * @generated - */ - void setResultSetMapping(String value); -} // INamedNativeQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedQuery.java deleted file mode 100644 index fc6c348e9c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedQuery.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'INamed Query'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedQuery() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface INamedQuery extends IJpaSourceObject, IQuery -{} // INamedQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java deleted file mode 100644 index 3f15be3430..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.ITextRange; - -/** - * - * A representation of the model object 'INon Owning Mapping'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping#getMappedBy Mapped By}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINonOwningMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface INonOwningMapping extends IRelationshipMapping -{ - /** - * Returns the value of the 'Mapped By' attribute. - * - *

    - * If the meaning of the 'Mapped By' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Mapped By' attribute. - * @see #setMappedBy(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINonOwningMapping_MappedBy() - * @model - * @generated - */ - String getMappedBy(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping#getMappedBy Mapped By}' attribute. - * - * - * @param value the new value of the 'Mapped By' attribute. - * @see #getMappedBy() - * @generated - */ - void setMappedBy(String value); - - Iterator candidateMappedByAttributeNames(); - - boolean mappedByIsValid(IAttributeMapping mappedByMapping); - - ITextRange mappedByTextRange(); -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToMany.java deleted file mode 100644 index d0b03eed27..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToMany.java +++ /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 - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IOne To Many'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToMany() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IOneToMany extends IMultiRelationshipMapping -{} // IOneToMany diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToOne.java deleted file mode 100644 index c44b7b5ba1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToOne.java +++ /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 - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IOne To One'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToOne() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IOneToOne - extends ISingleRelationshipMapping, INonOwningMapping -{} // IOneToOne diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOverride.java deleted file mode 100644 index 224e003d3b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOverride.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; - -/** - * - * A representation of the model object 'IOverride'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IOverride#getName Name}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOverride() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IOverride extends IJpaSourceObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOverride_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IOverride#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Return true if override exists as specified on the owning object, or false - * if the override is "gotten for free" as a result of defaults calculation - */ - boolean isVirtual(); - - Owner getOwner(); - - - interface Owner - { - ITypeMapping getTypeMapping(); - - IAttributeMapping attributeMapping(String attributeName); - - boolean isVirtual(IOverride override); - - ITextRange validationTextRange(); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IPrimaryKeyJoinColumn.java deleted file mode 100644 index 79235c8643..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IPrimaryKeyJoinColumn.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'IPrimary Key Join Column'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIPrimaryKeyJoinColumn() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IPrimaryKeyJoinColumn extends IAbstractJoinColumn -{} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQuery.java deleted file mode 100644 index de11b6f43b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQuery.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'IQuery'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IQuery#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IQuery#getQuery Query}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IQuery#getHints Hints}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IQuery extends IJpaSourceObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IQuery#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Query' attribute. - * - *

    - * If the meaning of the 'Query' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Query' attribute. - * @see #setQuery(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery_Query() - * @model - * @generated - */ - String getQuery(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IQuery#getQuery Query}' attribute. - * - * - * @param value the new value of the 'Query' attribute. - * @see #getQuery() - * @generated - */ - void setQuery(String value); - - /** - * Returns the value of the 'Hints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IQueryHint}. - * - *

    - * If the meaning of the 'Hints' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Hints' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery_Hints() - * @model type="org.eclipse.jpt.core.internal.mappings.IQueryHint" containment="true" - * @generated - */ - EList getHints(); - - IQueryHint createQueryHint(int index); -} // IQuery diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQueryHint.java deleted file mode 100644 index 3d092622f5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQueryHint.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'IQuery Hint'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IQueryHint#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IQueryHint#getValue Value}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IQueryHint extends IJpaSourceObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Value' attribute. - * - *

    - * If the meaning of the 'Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint_Value() - * @model - * @generated - */ - String getValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - void setValue(String value); -} // IQueryHint diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java deleted file mode 100644 index 3b757972f7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; - -/** - * - * A representation of the model object 'IRelationship Mapping'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getTargetEntity Target Entity}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getSpecifiedTargetEntity Specified Target Entity}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getDefaultTargetEntity Default Target Entity}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getResolvedTargetEntity Resolved Target Entity}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade Cascade}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IRelationshipMapping extends IAttributeMapping -{ - /** - * Returns the value of the 'Target Entity' attribute. - * - *

    - * If the meaning of the 'Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Target Entity' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping_TargetEntity() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getTargetEntity(); - - /** - * Returns the value of the 'Specified Target Entity' attribute. - * - *

    - * If the meaning of the 'Specified Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Target Entity' attribute. - * @see #setSpecifiedTargetEntity(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping_SpecifiedTargetEntity() - * @model - * @generated - */ - String getSpecifiedTargetEntity(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getSpecifiedTargetEntity Specified Target Entity}' attribute. - * - * - * @param value the new value of the 'Specified Target Entity' attribute. - * @see #getSpecifiedTargetEntity() - * @generated - */ - void setSpecifiedTargetEntity(String value); - - /** - * Returns the value of the 'Default Target Entity' attribute. - * - *

    - * If the meaning of the 'Default Target Entity' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Target Entity' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping_DefaultTargetEntity() - * @model changeable="false" - * @generated - */ - String getDefaultTargetEntity(); - - /** - * Returns the value of the 'Resolved Target Entity' reference. - * - *

    - * If the meaning of the 'Resolved Target Entity' reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Resolved Target Entity' reference. - * @see #setResolvedTargetEntity(IEntity) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping_ResolvedTargetEntity() - * @model - * @generated - */ - IEntity getResolvedTargetEntity(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getResolvedTargetEntity Resolved Target Entity}' reference. - * - * - * @param value the new value of the 'Resolved Target Entity' reference. - * @see #getResolvedTargetEntity() - * @generated - */ - void setResolvedTargetEntity(IEntity value); - - /** - * Returns the value of the 'Cascade' containment reference. - * - *

    - * If the meaning of the 'Cascade' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Cascade' containment reference. - * @see #setCascade(ICascade) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping_Cascade() - * @model containment="true" - * @generated - */ - ICascade getCascade(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade Cascade}' containment reference. - * - * - * @param value the new value of the 'Cascade' containment reference. - * @see #getCascade() - * @generated - */ - void setCascade(ICascade value); - - /** - * Return whether the specified 'targetEntity' is valid. - */ - boolean targetEntityIsValid(String targetEntity); - - /** - * Return the fully qualified target entity. If it is already specified - * as fully qualified then just return that. - * @return - */ - String fullyQualifiedTargetEntity(); - - /** - * Return the Entity that owns this relationship mapping - * @return - */ - IEntity getEntity(); - - ICascade createCascade(); -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java deleted file mode 100644 index 9e64992251..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.List; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'ISecondary Table'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getPrimaryKeyJoinColumns Primary Key Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getSpecifiedPrimaryKeyJoinColumns Specified Primary Key Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getDefaultPrimaryKeyJoinColumns Default Primary Key Join Columns}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ISecondaryTable extends ITable -{ - /** - * Returns the value of the 'Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable_PrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getPrimaryKeyJoinColumns(); - - /** - * Returns the value of the 'Specified Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Specified Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable_SpecifiedPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - EList getSpecifiedPrimaryKeyJoinColumns(); - - /** - * Returns the value of the 'Default Primary Key Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn}. - * - *

    - * If the meaning of the 'Default Primary Key Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Primary Key Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable_DefaultPrimaryKeyJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn" containment="true" - * @generated - */ - EList getDefaultPrimaryKeyJoinColumns(); - - /** - * - * - * @model - * @generated - */ - ITypeMapping typeMapping(); - - /** - * Create a primary key join column with the given index - */ - IPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index); - - boolean containsSpecifiedPrimaryKeyJoinColumns(); - - - class PrimaryKeyJoinColumnOwner implements IAbstractJoinColumn.Owner - { - private ISecondaryTable secondaryTable; - - public PrimaryKeyJoinColumnOwner(ISecondaryTable secondaryTable) { - this.secondaryTable = secondaryTable; - } - - public ITextRange validationTextRange() { - return this.secondaryTable.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return this.secondaryTable.typeMapping(); - } - - public Table dbTable(String tableName) { - return this.secondaryTable.dbTable(); - } - - public Table dbReferencedColumnTable() { - return getTypeMapping().primaryDbTable(); - } - - public List joinColumns() { - return this.secondaryTable.getPrimaryKeyJoinColumns(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISequenceGenerator.java deleted file mode 100644 index ca2e191675..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISequenceGenerator.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -/** - * - * A representation of the model object 'ISequence Generator'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSequenceName Sequence Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSpecifiedSequenceName Specified Sequence Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getDefaultSequenceName Default Sequence Name}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ISequenceGenerator extends IGenerator -{ - /** - * Returns the value of the 'Sequence Name' attribute. - * - *

    - * If the meaning of the 'Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Sequence Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator_SequenceName() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getSequenceName(); - - /** - * Returns the value of the 'Specified Sequence Name' attribute. - * - *

    - * If the meaning of the 'Specified Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Sequence Name' attribute. - * @see #setSpecifiedSequenceName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator_SpecifiedSequenceName() - * @model - * @generated - */ - String getSpecifiedSequenceName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSpecifiedSequenceName Specified Sequence Name}' attribute. - * - * - * @param value the new value of the 'Specified Sequence Name' attribute. - * @see #getSpecifiedSequenceName() - * @generated - */ - void setSpecifiedSequenceName(String value); - - /** - * Returns the value of the 'Default Sequence Name' attribute. - * - *

    - * If the meaning of the 'Default Sequence Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Sequence Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator_DefaultSequenceName() - * @model changeable="false" - * @generated - */ - String getDefaultSequenceName(); -} // ISequenceGenerator diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISingleRelationshipMapping.java deleted file mode 100644 index 16359ae1e7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISingleRelationshipMapping.java +++ /dev/null @@ -1,211 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.List; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'ISingle Relationship Mapping'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getFetch Fetch}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getJoinColumns Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getSpecifiedJoinColumns Specified Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getDefaultJoinColumns Default Join Columns}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getOptional Optional}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ISingleRelationshipMapping extends IRelationshipMapping -{ - /** - * Returns the value of the 'Fetch' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType}. - * - *

    - * If the meaning of the 'Fetch' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #setFetch(DefaultEagerFetchType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping_Fetch() - * @model - * @generated - */ - DefaultEagerFetchType getFetch(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getFetch Fetch}' attribute. - * - * - * @param value the new value of the 'Fetch' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see #getFetch() - * @generated - */ - void setFetch(DefaultEagerFetchType value); - - /** - * Returns the value of the 'Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping_JoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" transient="true" changeable="false" volatile="true" - * @generated - */ - EList getJoinColumns(); - - /** - * Returns the value of the 'Specified Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Specified Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping_SpecifiedJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getSpecifiedJoinColumns(); - - /** - * Returns the value of the 'Default Join Columns' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IJoinColumn}. - * - *

    - * If the meaning of the 'Default Join Columns' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Join Columns' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping_DefaultJoinColumns() - * @model type="org.eclipse.jpt.core.internal.mappings.IJoinColumn" containment="true" - * @generated - */ - EList getDefaultJoinColumns(); - - /** - * Returns the value of the 'Optional' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean}. - * - *

    - * If the meaning of the 'Optional' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #setOptional(DefaultTrueBoolean) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping_Optional() - * @model - * @generated - */ - DefaultTrueBoolean getOptional(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getOptional Optional}' attribute. - * - * - * @param value the new value of the 'Optional' attribute. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see #getOptional() - * @generated - */ - void setOptional(DefaultTrueBoolean value); - - boolean containsSpecifiedJoinColumns(); - - IJoinColumn createJoinColumn(int index); - - - public class JoinColumnOwner implements IJoinColumn.Owner - { - private ISingleRelationshipMapping singleRelationshipMapping; - - public JoinColumnOwner(ISingleRelationshipMapping singleRelationshipMapping) { - super(); - this.singleRelationshipMapping = singleRelationshipMapping; - } - - /** - * by default, the join column is in the type mapping's primary table - */ - public String defaultTableName() { - return this.singleRelationshipMapping.getPersistentAttribute().typeMapping().getTableName(); - } - - public List joinColumns() { - return this.singleRelationshipMapping.getJoinColumns(); - } - - public IEntity targetEntity() { - return this.singleRelationshipMapping.getResolvedTargetEntity(); - } - - public String attributeName() { - return this.singleRelationshipMapping.getPersistentAttribute().getName(); - } - - public IRelationshipMapping getRelationshipMapping() { - return this.singleRelationshipMapping; - } - - public boolean tableNameIsInvalid(String tableName) { - return this.singleRelationshipMapping.getPersistentAttribute().typeMapping().tableNameIsInvalid(tableName); - } - - /** - * the join column can be on a secondary table - */ - public boolean tableIsAllowed() { - return true; - } - - public ITextRange validationTextRange() { - return this.singleRelationshipMapping.validationTextRange(); - } - - public ITypeMapping getTypeMapping() { - return this.singleRelationshipMapping.typeMapping(); - } - - public Table dbTable(String tableName) { - return getTypeMapping().dbTable(tableName); - } - - public Table dbReferencedColumnTable() { - IEntity targetEntity = targetEntity(); - return (targetEntity == null) ? null : targetEntity().primaryDbTable(); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java deleted file mode 100644 index 77763ff27a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java +++ /dev/null @@ -1,286 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'ITable'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getName Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedName Specified Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultName Default Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getCatalog Catalog}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedCatalog Specified Catalog}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultCatalog Default Catalog}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getSchema Schema}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedSchema Specified Schema}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultSchema Default Schema}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITable#getUniqueConstraints Unique Constraints}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ITable extends IJpaSourceObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

    - * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_Name() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getName(); - - /** - * Returns the value of the 'Default Name' attribute. - * - *

    - * If the meaning of the 'Default Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_DefaultName() - * @model changeable="false" - * @generated - */ - String getDefaultName(); - - /** - * Returns the value of the 'Catalog' attribute. - * - *

    - * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Catalog' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_Catalog() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getCatalog(); - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

    - * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_SpecifiedCatalog() - * @model - * @generated - */ - String getSpecifiedCatalog(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - void setSpecifiedCatalog(String value); - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

    - * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Catalog' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_DefaultCatalog() - * @model changeable="false" - * @generated - */ - String getDefaultCatalog(); - - /** - * Returns the value of the 'Schema' attribute. - * - *

    - * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Schema' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_Schema() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getSchema(); - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

    - * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_SpecifiedSchema() - * @model - * @generated - */ - String getSpecifiedSchema(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - void setSpecifiedSchema(String value); - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

    - * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Schema' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_DefaultSchema() - * @model changeable="false" - * @generated - */ - String getDefaultSchema(); - - /** - * Returns the value of the 'Unique Constraints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}. - * - *

    - * If the meaning of the 'Unique Constraints' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Unique Constraints' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_UniqueConstraints() - * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true" - * @generated - */ - EList getUniqueConstraints(); - - /** - * Returns the value of the 'Specified Name' attribute. - * - *

    - * If the meaning of the 'Specified Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Name' attribute. - * @see #setSpecifiedName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_SpecifiedName() - * @model - * @generated - */ - String getSpecifiedName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedName Specified Name}' attribute. - * - * - * @param value the new value of the 'Specified Name' attribute. - * @see #getSpecifiedName() - * @generated - */ - void setSpecifiedName(String value); - - void refreshDefaults(DefaultsContext defaultsContext); - - Table dbTable(); - - Schema dbSchema(); - - /** - * Return true if this table is connected to a datasource - */ - boolean isConnected(); - - /** - * Return true if this table's schema can be resolved to a schema on the active connection - */ - boolean hasResolvedSchema(); - - /** - * Return true if this can be resolved to a table on the active connection - */ - boolean isResolved(); - - ITextRange nameTextRange(); - - ITextRange schemaTextRange(); - - Owner getOwner(); - - IUniqueConstraint createUniqueConstraint(int index); - - - /** - * interface allowing tables to be owned by various objects - */ - interface Owner - { - ITextRange validationTextRange(); - - ITypeMapping getTypeMapping(); - } - - - class UniqueConstraintOwner implements IUniqueConstraint.Owner - { - private final ITable table; - - public UniqueConstraintOwner(ITable table) { - super(); - this.table = table; - } - - public Iterator candidateUniqueConstraintColumnNames() { - return this.table.dbTable().columnNames(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java deleted file mode 100644 index 3b7aaf92e4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java +++ /dev/null @@ -1,428 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; - -/** - * - * A representation of the model object 'ITable Generator'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getTable Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedTable Specified Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultTable Default Table}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getCatalog Catalog}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedCatalog Specified Catalog}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultCatalog Default Catalog}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSchema Schema}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedSchema Specified Schema}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultSchema Default Schema}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnName Pk Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnName Specified Pk Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnName Default Pk Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getValueColumnName Value Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedValueColumnName Specified Value Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultValueColumnName Default Value Column Name}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnValue Pk Column Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnValue Specified Pk Column Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnValue Default Pk Column Value}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getUniqueConstraints Unique Constraints}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ITableGenerator extends IGenerator -{ - /** - * Returns the value of the 'Table' attribute. - * - *

    - * If the meaning of the 'Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Table' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_Table() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getTable(); - - /** - * Returns the value of the 'Specified Table' attribute. - * - *

    - * If the meaning of the 'Specified Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Table' attribute. - * @see #setSpecifiedTable(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_SpecifiedTable() - * @model - * @generated - */ - String getSpecifiedTable(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedTable Specified Table}' attribute. - * - * - * @param value the new value of the 'Specified Table' attribute. - * @see #getSpecifiedTable() - * @generated - */ - void setSpecifiedTable(String value); - - /** - * Returns the value of the 'Default Table' attribute. - * - *

    - * If the meaning of the 'Default Table' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Table' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_DefaultTable() - * @model changeable="false" - * @generated - */ - String getDefaultTable(); - - /** - * Returns the value of the 'Catalog' attribute. - * - *

    - * If the meaning of the 'Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Catalog' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_Catalog() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getCatalog(); - - /** - * Returns the value of the 'Specified Catalog' attribute. - * - *

    - * If the meaning of the 'Specified Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Catalog' attribute. - * @see #setSpecifiedCatalog(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_SpecifiedCatalog() - * @model - * @generated - */ - String getSpecifiedCatalog(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedCatalog Specified Catalog}' attribute. - * - * - * @param value the new value of the 'Specified Catalog' attribute. - * @see #getSpecifiedCatalog() - * @generated - */ - void setSpecifiedCatalog(String value); - - /** - * Returns the value of the 'Default Catalog' attribute. - * - *

    - * If the meaning of the 'Default Catalog' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Catalog' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_DefaultCatalog() - * @model changeable="false" - * @generated - */ - String getDefaultCatalog(); - - /** - * Returns the value of the 'Schema' attribute. - * - *

    - * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Schema' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_Schema() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getSchema(); - - /** - * Returns the value of the 'Specified Schema' attribute. - * - *

    - * If the meaning of the 'Specified Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Schema' attribute. - * @see #setSpecifiedSchema(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_SpecifiedSchema() - * @model - * @generated - */ - String getSpecifiedSchema(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedSchema Specified Schema}' attribute. - * - * - * @param value the new value of the 'Specified Schema' attribute. - * @see #getSpecifiedSchema() - * @generated - */ - void setSpecifiedSchema(String value); - - /** - * Returns the value of the 'Default Schema' attribute. - * - *

    - * If the meaning of the 'Default Schema' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Schema' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_DefaultSchema() - * @model changeable="false" - * @generated - */ - String getDefaultSchema(); - - /** - * Returns the value of the 'Pk Column Name' attribute. - * - *

    - * If the meaning of the 'Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Pk Column Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_PkColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getPkColumnName(); - - /** - * Returns the value of the 'Specified Pk Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Pk Column Name' attribute. - * @see #setSpecifiedPkColumnName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_SpecifiedPkColumnName() - * @model - * @generated - */ - String getSpecifiedPkColumnName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnName Specified Pk Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Pk Column Name' attribute. - * @see #getSpecifiedPkColumnName() - * @generated - */ - void setSpecifiedPkColumnName(String value); - - /** - * Returns the value of the 'Default Pk Column Name' attribute. - * - *

    - * If the meaning of the 'Default Pk Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Pk Column Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_DefaultPkColumnName() - * @model changeable="false" - * @generated - */ - String getDefaultPkColumnName(); - - /** - * Returns the value of the 'Value Column Name' attribute. - * - *

    - * If the meaning of the 'Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Value Column Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_ValueColumnName() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getValueColumnName(); - - /** - * Returns the value of the 'Specified Value Column Name' attribute. - * - *

    - * If the meaning of the 'Specified Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Value Column Name' attribute. - * @see #setSpecifiedValueColumnName(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_SpecifiedValueColumnName() - * @model - * @generated - */ - String getSpecifiedValueColumnName(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedValueColumnName Specified Value Column Name}' attribute. - * - * - * @param value the new value of the 'Specified Value Column Name' attribute. - * @see #getSpecifiedValueColumnName() - * @generated - */ - void setSpecifiedValueColumnName(String value); - - /** - * Returns the value of the 'Default Value Column Name' attribute. - * - *

    - * If the meaning of the 'Default Value Column Name' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Value Column Name' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_DefaultValueColumnName() - * @model changeable="false" - * @generated - */ - String getDefaultValueColumnName(); - - /** - * Returns the value of the 'Pk Column Value' attribute. - * - *

    - * If the meaning of the 'Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Pk Column Value' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_PkColumnValue() - * @model changeable="false" volatile="true" derived="true" - * @generated - */ - String getPkColumnValue(); - - /** - * Returns the value of the 'Specified Pk Column Value' attribute. - * - *

    - * If the meaning of the 'Specified Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Specified Pk Column Value' attribute. - * @see #setSpecifiedPkColumnValue(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_SpecifiedPkColumnValue() - * @model - * @generated - */ - String getSpecifiedPkColumnValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnValue Specified Pk Column Value}' attribute. - * - * - * @param value the new value of the 'Specified Pk Column Value' attribute. - * @see #getSpecifiedPkColumnValue() - * @generated - */ - void setSpecifiedPkColumnValue(String value); - - /** - * Returns the value of the 'Default Pk Column Value' attribute. - * - *

    - * If the meaning of the 'Default Pk Column Value' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Default Pk Column Value' attribute. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_DefaultPkColumnValue() - * @model changeable="false" - * @generated - */ - String getDefaultPkColumnValue(); - - /** - * Returns the value of the 'Unique Constraints' containment reference list. - * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}. - * - *

    - * If the meaning of the 'Unique Constraints' containment reference list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Unique Constraints' containment reference list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_UniqueConstraints() - * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true" - * @generated - */ - EList getUniqueConstraints(); - - void refreshDefaults(DefaultsContext defaultsContext); - - IUniqueConstraint createUniqueConstraint(int index); - - Schema dbSchema(); - - Table dbTable(); - - - class UniqueConstraintOwner implements IUniqueConstraint.Owner - { - private final ITableGenerator tableGenerator; - - public UniqueConstraintOwner(ITableGenerator tableGenerator) { - super(); - this.tableGenerator = tableGenerator; - } - - public Iterator candidateUniqueConstraintColumnNames() { - return this.tableGenerator.dbTable().columnNames(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITransient.java deleted file mode 100644 index 8024da8f27..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITransient.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; - -/** - * - * A representation of the model object 'ITransient'. - * - * - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITransient() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface ITransient extends IAttributeMapping -{} // ITransient diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java deleted file mode 100644 index ca1984e9f0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.Iterator; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.core.internal.IJpaSourceObject; - -/** - * - * A representation of the model object 'IUnique Constraint'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint#getColumnNames Column Names}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IUniqueConstraint extends IJpaSourceObject -{ - /** - * Returns the value of the 'Column Names' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

    - * If the meaning of the 'Column Names' attribute list isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column Names' attribute list. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint_ColumnNames() - * @model type="java.lang.String" - * @generated - */ - EList getColumnNames(); - - - /** - * All containers must implement this interface. - */ - interface Owner - { - Iterator candidateUniqueConstraintColumnNames(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IVersion.java deleted file mode 100644 index 1f3ed18483..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IVersion.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IAttributeMapping; - -/** - * - * A representation of the model object 'IVersion'. - * - * - *

    - * The following features are supported: - *

      - *
    • {@link org.eclipse.jpt.core.internal.mappings.IVersion#getColumn Column}
    • - *
    • {@link org.eclipse.jpt.core.internal.mappings.IVersion#getTemporal Temporal}
    • - *
    - *

    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIVersion() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IVersion extends IAttributeMapping, IColumnMapping -{ - /** - * Returns the value of the 'Column' containment reference. - * - *

    - * If the meaning of the 'Column' containment reference isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Column' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIVersion_Column() - * @model containment="true" required="true" changeable="false" - * @generated - */ - IColumn getColumn(); - - /** - * Returns the value of the 'Temporal' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.TemporalType}. - * - *

    - * If the meaning of the 'Temporal' attribute isn't clear, - * there really should be more of a description here... - *

    - * - * @return the value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #setTemporal(TemporalType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIVersion_Temporal() - * @model - * @generated - */ - TemporalType getTemporal(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IVersion#getTemporal Temporal}' attribute. - * - * - * @param value the new value of the 'Temporal' attribute. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see #getTemporal() - * @generated - */ - void setTemporal(TemporalType value); -} // IVersion diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/InheritanceType.java deleted file mode 100644 index ccd4ef21ed..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/InheritanceType.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.InheritanceType.DEFAULT_VALUE; -import static org.eclipse.jpt.core.internal.mappings.InheritanceType.JOINED_VALUE; -import static org.eclipse.jpt.core.internal.mappings.InheritanceType.SINGLE_TABLE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.InheritanceType.TABLE_PER_CLASS_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Inheritance Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getInheritanceType() - * @model - * @generated - */ -public enum InheritanceType implements Enumerator { - /** - * The 'Default' literal object. - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(0, "Default", "Default (Single Table)"), - /** - * The 'SINGLE TABLE' literal object. - * - * - * @see #SINGLE_TABLE_VALUE - * @generated - * @ordered - */ - SINGLE_TABLE(1, "SINGLE_TABLE", "Single Table"), - /** - * The 'JOINED' literal object. - * - * - * @see #JOINED_VALUE - * @generated - * @ordered - */ - JOINED(2, "JOINED", "Joined"), - /** - * The 'TABLE PER CLASS' literal object. - * - * - * @see #TABLE_PER_CLASS_VALUE - * @generated - * @ordered - */ - TABLE_PER_CLASS(3, "TABLE_PER_CLASS", "Table per Class"); - /** - * The 'Default' literal value. - * - *

    - * If the meaning of 'Default' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DEFAULT - * @model name="Default" literal="Default (Single Table)" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 0; - - /** - * The 'SINGLE TABLE' literal value. - * - *

    - * If the meaning of 'Single Table' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #SINGLE_TABLE - * @model literal="Single Table" - * @generated - * @ordered - */ - public static final int SINGLE_TABLE_VALUE = 1; - - /** - * The 'JOINED' literal value. - * - *

    - * If the meaning of 'Joined' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #JOINED - * @model literal="Joined" - * @generated - * @ordered - */ - public static final int JOINED_VALUE = 2; - - /** - * The 'TABLE PER CLASS' literal value. - * - *

    - * If the meaning of 'Table Per Class' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #TABLE_PER_CLASS - * @model literal="Table per Class" - * @generated - * @ordered - */ - public static final int TABLE_PER_CLASS_VALUE = 3; - - /** - * An array of all the 'Inheritance Type' enumerators. - * - * - * @generated - */ - private static final InheritanceType[] VALUES_ARRAY = new InheritanceType[] { - DEFAULT, SINGLE_TABLE, JOINED, TABLE_PER_CLASS, - }; - - /** - * A public read-only list of all the 'Inheritance Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Inheritance Type' literal with the specified literal value. - * - * - * @generated - */ - public static InheritanceType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - InheritanceType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Inheritance Type' literal with the specified name. - * - * - * @generated - */ - public static InheritanceType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - InheritanceType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Inheritance Type' literal with the specified integer value. - * - * - * @generated - */ - public static InheritanceType get(int value) { - switch (value) { - case DEFAULT_VALUE : - return DEFAULT; - case SINGLE_TABLE_VALUE : - return SINGLE_TABLE; - case JOINED_VALUE : - return JOINED; - case TABLE_PER_CLASS_VALUE : - return TABLE_PER_CLASS; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private InheritanceType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static InheritanceType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return DEFAULT; - } - if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__JOINED)) { - return JOINED; - } - if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__SINGLE_TABLE)) { - return SINGLE_TABLE; - } - if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__TABLE_PER_CLASS)) { - return TABLE_PER_CLASS; - } - return DEFAULT; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case DEFAULT_VALUE : - return null; - case JOINED_VALUE : - return JPA.INHERITANCE_TYPE__JOINED; - case SINGLE_TABLE_VALUE : - return JPA.INHERITANCE_TYPE__SINGLE_TABLE; - case TABLE_PER_CLASS_VALUE : - return JPA.INHERITANCE_TYPE__TABLE_PER_CLASS; - default : - throw new IllegalArgumentException("unknown inheritance type: " + this); - } - } - - public boolean isSingleTable() { - return (this.getValue() == DEFAULT_VALUE) || (this.getValue() == SINGLE_TABLE_VALUE); - } -} //InheritanceType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java deleted file mode 100644 index 71e1442228..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java +++ /dev/null @@ -1,373 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -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; - -/** - * - * An implementation of the model Factory. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage - * @generated - */ -public class JpaCoreMappingsFactory extends EFactoryImpl -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final JpaCoreMappingsFactory eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static JpaCoreMappingsFactory init() { - try { - JpaCoreMappingsFactory theJpaCoreMappingsFactory = (JpaCoreMappingsFactory) EPackage.Registry.INSTANCE.getEFactory("jpt.core.mappings.xmi"); - if (theJpaCoreMappingsFactory != null) { - return theJpaCoreMappingsFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new JpaCoreMappingsFactory(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public JpaCoreMappingsFactory() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - default : - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case JpaCoreMappingsPackage.DEFAULT_EAGER_FETCH_TYPE : - return createDefaultEagerFetchTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.DEFAULT_LAZY_FETCH_TYPE : - return createDefaultLazyFetchTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.DEFAULT_FALSE_BOOLEAN : - return createDefaultFalseBooleanFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.DEFAULT_TRUE_BOOLEAN : - return createDefaultTrueBooleanFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.TEMPORAL_TYPE : - return createTemporalTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.INHERITANCE_TYPE : - return createInheritanceTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.DISCRIMINATOR_TYPE : - return createDiscriminatorTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.GENERATION_TYPE : - return createGenerationTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.ENUM_TYPE : - return createEnumTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.CASCADE_TYPE : - return createCascadeTypeFromString(eDataType, initialValue); - default : - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case JpaCoreMappingsPackage.DEFAULT_EAGER_FETCH_TYPE : - return convertDefaultEagerFetchTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.DEFAULT_LAZY_FETCH_TYPE : - return convertDefaultLazyFetchTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.DEFAULT_FALSE_BOOLEAN : - return convertDefaultFalseBooleanToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.DEFAULT_TRUE_BOOLEAN : - return convertDefaultTrueBooleanToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.TEMPORAL_TYPE : - return convertTemporalTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.INHERITANCE_TYPE : - return convertInheritanceTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.DISCRIMINATOR_TYPE : - return convertDiscriminatorTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.GENERATION_TYPE : - return convertGenerationTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.ENUM_TYPE : - return convertEnumTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.CASCADE_TYPE : - return convertCascadeTypeToString(eDataType, instanceValue); - default : - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public DefaultEagerFetchType createDefaultEagerFetchTypeFromString(EDataType eDataType, String initialValue) { - DefaultEagerFetchType result = DefaultEagerFetchType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertDefaultEagerFetchTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public DefaultLazyFetchType createDefaultLazyFetchTypeFromString(EDataType eDataType, String initialValue) { - DefaultLazyFetchType result = DefaultLazyFetchType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertDefaultLazyFetchTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public DefaultFalseBoolean createDefaultFalseBooleanFromString(EDataType eDataType, String initialValue) { - DefaultFalseBoolean result = DefaultFalseBoolean.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertDefaultFalseBooleanToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public DefaultTrueBoolean createDefaultTrueBooleanFromString(EDataType eDataType, String initialValue) { - DefaultTrueBoolean result = DefaultTrueBoolean.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertDefaultTrueBooleanToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public TemporalType createTemporalTypeFromString(EDataType eDataType, String initialValue) { - TemporalType result = TemporalType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertTemporalTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public InheritanceType createInheritanceTypeFromString(EDataType eDataType, String initialValue) { - InheritanceType result = InheritanceType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertInheritanceTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public DiscriminatorType createDiscriminatorTypeFromString(EDataType eDataType, String initialValue) { - DiscriminatorType result = DiscriminatorType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertDiscriminatorTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public GenerationType createGenerationTypeFromString(EDataType eDataType, String initialValue) { - GenerationType result = GenerationType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertGenerationTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public EnumType createEnumTypeFromString(EDataType eDataType, String initialValue) { - EnumType result = EnumType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertEnumTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public CascadeType createCascadeTypeFromString(EDataType eDataType, String initialValue) { - CascadeType result = CascadeType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertCascadeTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public JpaCoreMappingsPackage getJpaCoreMappingsPackage() { - return (JpaCoreMappingsPackage) getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static JpaCoreMappingsPackage getPackage() { - return JpaCoreMappingsPackage.eINSTANCE; - } -} //MappingsFactoryImpl diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java deleted file mode 100644 index b5399b7eed..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java +++ /dev/null @@ -1,8741 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.persistence.PersistencePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
      - *
    • each class,
    • - *
    • each feature of each class,
    • - *
    • each enum,
    • - *
    • and each data type
    • - *
    - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsFactory - * @model kind="package" - * @generated - */ -public class JpaCoreMappingsPackage extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "mappings"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "jpt.core.mappings.xmi"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "jpt.core.mappings"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final JpaCoreMappingsPackage eINSTANCE = org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage.init(); - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass IMapped Superclass}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMappedSuperclass() - * @generated - */ - public static final int IMAPPED_SUPERCLASS = 0; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMAPPED_SUPERCLASS__NAME = JpaCorePackage.ITYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMAPPED_SUPERCLASS__TABLE_NAME = JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMAPPED_SUPERCLASS__ID_CLASS = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IMapped Superclass' class. - * - * - * @generated - * @ordered - */ - public static final int IMAPPED_SUPERCLASS_FEATURE_COUNT = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IEntity IEntity}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEntity - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity() - * @generated - */ - public static final int IENTITY = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__NAME = JpaCorePackage.ITYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__TABLE_NAME = JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SPECIFIED_NAME = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DEFAULT_NAME = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__TABLE = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Specified Secondary Tables' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SPECIFIED_SECONDARY_TABLES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__PRIMARY_KEY_JOIN_COLUMNS = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Inheritance Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__INHERITANCE_STRATEGY = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DEFAULT_DISCRIMINATOR_VALUE = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Specified Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SPECIFIED_DISCRIMINATOR_VALUE = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Discriminator Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DISCRIMINATOR_VALUE = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Discriminator Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DISCRIMINATOR_COLUMN = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SEQUENCE_GENERATOR = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__TABLE_GENERATOR = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__ATTRIBUTE_OVERRIDES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__ASSOCIATION_OVERRIDES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Specified Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 18; - - /** - * The feature id for the 'Default Association Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__DEFAULT_ASSOCIATION_OVERRIDES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 19; - - /** - * The feature id for the 'Named Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__NAMED_QUERIES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 20; - - /** - * The feature id for the 'Named Native Queries' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__NAMED_NATIVE_QUERIES = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 21; - - /** - * The feature id for the 'Id Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int IENTITY__ID_CLASS = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 22; - - /** - * The number of structural features of the 'IEntity' class. - * - * - * @generated - * @ordered - */ - public static final int IENTITY_FEATURE_COUNT = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 23; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddable IEmbeddable}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddable() - * @generated - */ - public static final int IEMBEDDABLE = 2; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDABLE__NAME = JpaCorePackage.ITYPE_MAPPING__NAME; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDABLE__TABLE_NAME = JpaCorePackage.ITYPE_MAPPING__TABLE_NAME; - - /** - * The number of structural features of the 'IEmbeddable' class. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDABLE_FEATURE_COUNT = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ITable ITable}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ITable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable() - * @generated - */ - public static final int ITABLE = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__SPECIFIED_NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__DEFAULT_NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__CATALOG = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__SPECIFIED_CATALOG = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__DEFAULT_CATALOG = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__SCHEMA = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__SPECIFIED_SCHEMA = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__DEFAULT_SCHEMA = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ITABLE__UNIQUE_CONSTRAINTS = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 9; - - /** - * The number of structural features of the 'ITable' class. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 10; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint IUnique Constraint}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint() - * @generated - */ - public static final int IUNIQUE_CONSTRAINT = 4; - - /** - * The feature id for the 'Column Names' attribute list. - * - * - * @generated - * @ordered - */ - public static final int IUNIQUE_CONSTRAINT__COLUMN_NAMES = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IUnique Constraint' class. - * - * - * @generated - * @ordered - */ - public static final int IUNIQUE_CONSTRAINT_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn INamed Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn() - * @generated - */ - public static final int INAMED_COLUMN = 5; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_COLUMN__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_COLUMN__SPECIFIED_NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_COLUMN__DEFAULT_NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_COLUMN__COLUMN_DEFINITION = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'INamed Column' class. - * - * - * @generated - * @ordered - */ - public static final int INAMED_COLUMN_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn IAbstract Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn() - * @generated - */ - public static final int IABSTRACT_COLUMN = 6; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__NAME = INAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__SPECIFIED_NAME = INAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__DEFAULT_NAME = INAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__COLUMN_DEFINITION = INAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__UNIQUE = INAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__NULLABLE = INAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__INSERTABLE = INAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__UPDATABLE = INAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__TABLE = INAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__SPECIFIED_TABLE = INAMED_COLUMN_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN__DEFAULT_TABLE = INAMED_COLUMN_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'IAbstract Column' class. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_COLUMN_FEATURE_COUNT = INAMED_COLUMN_FEATURE_COUNT + 7; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IColumn IColumn}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn() - * @generated - */ - public static final int ICOLUMN = 7; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__NAME = IABSTRACT_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__SPECIFIED_NAME = IABSTRACT_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__DEFAULT_NAME = IABSTRACT_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__COLUMN_DEFINITION = IABSTRACT_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__UNIQUE = IABSTRACT_COLUMN__UNIQUE; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__NULLABLE = IABSTRACT_COLUMN__NULLABLE; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__INSERTABLE = IABSTRACT_COLUMN__INSERTABLE; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__UPDATABLE = IABSTRACT_COLUMN__UPDATABLE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__TABLE = IABSTRACT_COLUMN__TABLE; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__SPECIFIED_TABLE = IABSTRACT_COLUMN__SPECIFIED_TABLE; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__DEFAULT_TABLE = IABSTRACT_COLUMN__DEFAULT_TABLE; - - /** - * The feature id for the 'Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__LENGTH = IABSTRACT_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Precision' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__PRECISION = IABSTRACT_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Scale' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN__SCALE = IABSTRACT_COLUMN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'IColumn' class. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN_FEATURE_COUNT = IABSTRACT_COLUMN_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping IColumn Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IColumnMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumnMapping() - * @generated - */ - public static final int ICOLUMN_MAPPING = 8; - - /** - * The number of structural features of the 'IColumn Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int ICOLUMN_MAPPING_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IBasic IBasic}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IBasic - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic() - * @generated - */ - public static final int IBASIC = 9; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int IBASIC__FETCH = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int IBASIC__OPTIONAL = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IBASIC__COLUMN = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Lob' attribute. - * - * - * @generated - * @ordered - */ - public static final int IBASIC__LOB = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int IBASIC__TEMPORAL = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Enumerated' attribute. - * - * - * @generated - * @ordered - */ - public static final int IBASIC__ENUMERATED = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'IBasic' class. - * - * - * @generated - * @ordered - */ - public static final int IBASIC_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IId IId}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IId - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId() - * @generated - */ - public static final int IID = 10; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IID__COLUMN = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Generated Value' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IID__GENERATED_VALUE = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int IID__TEMPORAL = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Table Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IID__TABLE_GENERATOR = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Sequence Generator' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IID__SEQUENCE_GENERATOR = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'IId' class. - * - * - * @generated - * @ordered - */ - public static final int IID_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ITransient ITransient}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ITransient - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITransient() - * @generated - */ - public static final int ITRANSIENT = 11; - - /** - * The number of structural features of the 'ITransient' class. - * - * - * @generated - * @ordered - */ - public static final int ITRANSIENT_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IVersion IVersion}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IVersion - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIVersion() - * @generated - */ - public static final int IVERSION = 12; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IVERSION__COLUMN = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Temporal' attribute. - * - * - * @generated - * @ordered - */ - public static final int IVERSION__TEMPORAL = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'IVersion' class. - * - * - * @generated - * @ordered - */ - public static final int IVERSION_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddedId IEmbedded Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddedId - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddedId() - * @generated - */ - public static final int IEMBEDDED_ID = 13; - - /** - * The number of structural features of the 'IEmbedded Id' class. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDED_ID_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded IEmbedded}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded() - * @generated - */ - public static final int IEMBEDDED = 14; - - /** - * The feature id for the 'Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDED__ATTRIBUTE_OVERRIDES = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Attribute Overrides' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'IEmbedded' class. - * - * - * @generated - * @ordered - */ - public static final int IEMBEDDED_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping IRelationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping() - * @generated - */ - public static final int IRELATIONSHIP_MAPPING = 15; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IRELATIONSHIP_MAPPING__TARGET_ENTITY = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IRELATIONSHIP_MAPPING__CASCADE = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'IRelationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int IRELATIONSHIP_MAPPING_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping INon Owning Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINonOwningMapping() - * @generated - */ - public static final int INON_OWNING_MAPPING = 16; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING__TARGET_ENTITY = IRELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING__SPECIFIED_TARGET_ENTITY = IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING__DEFAULT_TARGET_ENTITY = IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING__RESOLVED_TARGET_ENTITY = IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING__CASCADE = IRELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING__MAPPED_BY = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'INon Owning Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int INON_OWNING_MAPPING_FEATURE_COUNT = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping IMulti Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping() - * @generated - */ - public static final int IMULTI_RELATIONSHIP_MAPPING = 17; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY = INON_OWNING_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = INON_OWNING_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = INON_OWNING_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = INON_OWNING_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__CASCADE = INON_OWNING_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY = INON_OWNING_MAPPING__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__ORDER_BY = INON_OWNING_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__FETCH = INON_OWNING_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = INON_OWNING_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING__MAP_KEY = INON_OWNING_MAPPING_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'IMulti Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int IMULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = INON_OWNING_MAPPING_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IOneToMany IOne To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IOneToMany - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToMany() - * @generated - */ - public static final int IONE_TO_MANY = 18; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__SPECIFIED_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__DEFAULT_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__RESOLVED_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__CASCADE = IMULTI_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__MAPPED_BY = IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__ORDER_BY = IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__FETCH = IMULTI_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__JOIN_TABLE = IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY__MAP_KEY = IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; - - /** - * The number of structural features of the 'IOne To Many' class. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_MANY_FEATURE_COUNT = IMULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IManyToMany IMany To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IManyToMany - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToMany() - * @generated - */ - public static final int IMANY_TO_MANY = 19; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__SPECIFIED_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__DEFAULT_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__RESOLVED_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__CASCADE = IMULTI_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__MAPPED_BY = IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY; - - /** - * The feature id for the 'Order By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__ORDER_BY = IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__FETCH = IMULTI_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Table' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__JOIN_TABLE = IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - - /** - * The feature id for the 'Map Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY__MAP_KEY = IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; - - /** - * The number of structural features of the 'IMany To Many' class. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_MANY_FEATURE_COUNT = IMULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping ISingle Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping() - * @generated - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING = 20; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY = IRELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__CASCADE = IRELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__FETCH = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'ISingle Relationship Mapping' class. - * - * - * @generated - * @ordered - */ - public static final int ISINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT = IRELATIONSHIP_MAPPING_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IManyToOne IMany To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IManyToOne - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToOne() - * @generated - */ - public static final int IMANY_TO_ONE = 21; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__SPECIFIED_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__DEFAULT_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__RESOLVED_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__CASCADE = ISINGLE_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__FETCH = ISINGLE_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__JOIN_COLUMNS = ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__SPECIFIED_JOIN_COLUMNS = ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__DEFAULT_JOIN_COLUMNS = ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE__OPTIONAL = ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - - /** - * The number of structural features of the 'IMany To One' class. - * - * - * @generated - * @ordered - */ - public static final int IMANY_TO_ONE_FEATURE_COUNT = ISINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IOneToOne IOne To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IOneToOne - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToOne() - * @generated - */ - public static final int IONE_TO_ONE = 22; - - /** - * The feature id for the 'Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY; - - /** - * The feature id for the 'Specified Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__SPECIFIED_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY; - - /** - * The feature id for the 'Default Target Entity' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__DEFAULT_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY; - - /** - * The feature id for the 'Resolved Target Entity' reference. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__RESOLVED_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY; - - /** - * The feature id for the 'Cascade' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__CASCADE = ISINGLE_RELATIONSHIP_MAPPING__CASCADE; - - /** - * The feature id for the 'Fetch' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__FETCH = ISINGLE_RELATIONSHIP_MAPPING__FETCH; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__JOIN_COLUMNS = ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__SPECIFIED_JOIN_COLUMNS = ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__DEFAULT_JOIN_COLUMNS = ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS; - - /** - * The feature id for the 'Optional' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__OPTIONAL = ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL; - - /** - * The feature id for the 'Mapped By' attribute. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE__MAPPED_BY = ISINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IOne To One' class. - * - * - * @generated - * @ordered - */ - public static final int IONE_TO_ONE_FEATURE_COUNT = ISINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable IJoin Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable() - * @generated - */ - public static final int IJOIN_TABLE = 23; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__NAME = ITABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__SPECIFIED_NAME = ITABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__DEFAULT_NAME = ITABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__CATALOG = ITABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__SPECIFIED_CATALOG = ITABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__DEFAULT_CATALOG = ITABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__SCHEMA = ITABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__SPECIFIED_SCHEMA = ITABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__DEFAULT_SCHEMA = ITABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__UNIQUE_CONSTRAINTS = ITABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__DEFAULT_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__INVERSE_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Inverse Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'IJoin Table' class. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_TABLE_FEATURE_COUNT = ITABLE_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn IAbstract Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn() - * @generated - */ - public static final int IABSTRACT_JOIN_COLUMN = 24; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__NAME = INAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__SPECIFIED_NAME = INAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__DEFAULT_NAME = INAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__COLUMN_DEFINITION = INAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME = INAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = INAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = INAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'IAbstract Join Column' class. - * - * - * @generated - * @ordered - */ - public static final int IABSTRACT_JOIN_COLUMN_FEATURE_COUNT = INAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IJoinColumn IJoin Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IJoinColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinColumn() - * @generated - */ - public static final int IJOIN_COLUMN = 25; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__NAME = IABSTRACT_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__SPECIFIED_NAME = IABSTRACT_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__DEFAULT_NAME = IABSTRACT_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__COLUMN_DEFINITION = IABSTRACT_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__UNIQUE = IABSTRACT_COLUMN__UNIQUE; - - /** - * The feature id for the 'Nullable' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__NULLABLE = IABSTRACT_COLUMN__NULLABLE; - - /** - * The feature id for the 'Insertable' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__INSERTABLE = IABSTRACT_COLUMN__INSERTABLE; - - /** - * The feature id for the 'Updatable' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__UPDATABLE = IABSTRACT_COLUMN__UPDATABLE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__TABLE = IABSTRACT_COLUMN__TABLE; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__SPECIFIED_TABLE = IABSTRACT_COLUMN__SPECIFIED_TABLE; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__DEFAULT_TABLE = IABSTRACT_COLUMN__DEFAULT_TABLE; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__REFERENCED_COLUMN_NAME = IABSTRACT_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = IABSTRACT_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = IABSTRACT_COLUMN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'IJoin Column' class. - * - * - * @generated - * @ordered - */ - public static final int IJOIN_COLUMN_FEATURE_COUNT = IABSTRACT_COLUMN_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IOverride IOverride}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IOverride - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOverride() - * @generated - */ - public static final int IOVERRIDE = 26; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IOVERRIDE__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IOverride' class. - * - * - * @generated - * @ordered - */ - public static final int IOVERRIDE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride IAttribute Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAttributeOverride() - * @generated - */ - public static final int IATTRIBUTE_OVERRIDE = 27; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IATTRIBUTE_OVERRIDE__NAME = IOVERRIDE__NAME; - - /** - * The feature id for the 'Column' containment reference. - * - * - * @generated - * @ordered - */ - public static final int IATTRIBUTE_OVERRIDE__COLUMN = IOVERRIDE_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'IAttribute Override' class. - * - * - * @generated - * @ordered - */ - public static final int IATTRIBUTE_OVERRIDE_FEATURE_COUNT = IOVERRIDE_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride IAssociation Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride() - * @generated - */ - public static final int IASSOCIATION_OVERRIDE = 28; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IASSOCIATION_OVERRIDE__NAME = IOVERRIDE__NAME; - - /** - * The feature id for the 'Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IASSOCIATION_OVERRIDE__JOIN_COLUMNS = IOVERRIDE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS = IOVERRIDE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS = IOVERRIDE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'IAssociation Override' class. - * - * - * @generated - * @ordered - */ - public static final int IASSOCIATION_OVERRIDE_FEATURE_COUNT = IOVERRIDE_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn IDiscriminator Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn() - * @generated - */ - public static final int IDISCRIMINATOR_COLUMN = 29; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__NAME = INAMED_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__SPECIFIED_NAME = INAMED_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__DEFAULT_NAME = INAMED_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__COLUMN_DEFINITION = INAMED_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Discriminator Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = INAMED_COLUMN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Default Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH = INAMED_COLUMN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH = INAMED_COLUMN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Length' attribute. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN__LENGTH = INAMED_COLUMN_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'IDiscriminator Column' class. - * - * - * @generated - * @ordered - */ - public static final int IDISCRIMINATOR_COLUMN_FEATURE_COUNT = INAMED_COLUMN_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable ISecondary Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable() - * @generated - */ - public static final int ISECONDARY_TABLE = 30; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__NAME = ITABLE__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__SPECIFIED_NAME = ITABLE__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__DEFAULT_NAME = ITABLE__DEFAULT_NAME; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__CATALOG = ITABLE__CATALOG; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__SPECIFIED_CATALOG = ITABLE__SPECIFIED_CATALOG; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__DEFAULT_CATALOG = ITABLE__DEFAULT_CATALOG; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__SCHEMA = ITABLE__SCHEMA; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__SPECIFIED_SCHEMA = ITABLE__SPECIFIED_SCHEMA; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__DEFAULT_SCHEMA = ITABLE__DEFAULT_SCHEMA; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__UNIQUE_CONSTRAINTS = ITABLE__UNIQUE_CONSTRAINTS; - - /** - * The feature id for the 'Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Primary Key Join Columns' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = ITABLE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'ISecondary Table' class. - * - * - * @generated - * @ordered - */ - public static final int ISECONDARY_TABLE_FEATURE_COUNT = ITABLE_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn IPrimary Key Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIPrimaryKeyJoinColumn() - * @generated - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN = 31; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__NAME = IABSTRACT_JOIN_COLUMN__NAME; - - /** - * The feature id for the 'Specified Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__SPECIFIED_NAME = IABSTRACT_JOIN_COLUMN__SPECIFIED_NAME; - - /** - * The feature id for the 'Default Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__DEFAULT_NAME = IABSTRACT_JOIN_COLUMN__DEFAULT_NAME; - - /** - * The feature id for the 'Column Definition' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = IABSTRACT_JOIN_COLUMN__COLUMN_DEFINITION; - - /** - * The feature id for the 'Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME; - - /** - * The feature id for the 'Specified Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME; - - /** - * The feature id for the 'Default Referenced Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME; - - /** - * The number of structural features of the 'IPrimary Key Join Column' class. - * - * - * @generated - * @ordered - */ - public static final int IPRIMARY_KEY_JOIN_COLUMN_FEATURE_COUNT = IABSTRACT_JOIN_COLUMN_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IGenerator IGenerator}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IGenerator - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator() - * @generated - */ - public static final int IGENERATOR = 32; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__INITIAL_VALUE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__SPECIFIED_INITIAL_VALUE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__DEFAULT_INITIAL_VALUE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__ALLOCATION_SIZE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__SPECIFIED_ALLOCATION_SIZE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR__DEFAULT_ALLOCATION_SIZE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 6; - - /** - * The number of structural features of the 'IGenerator' class. - * - * - * @generated - * @ordered - */ - public static final int IGENERATOR_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 7; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator ITable Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator() - * @generated - */ - public static final int ITABLE_GENERATOR = 33; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__NAME = IGENERATOR__NAME; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__INITIAL_VALUE = IGENERATOR__INITIAL_VALUE; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_INITIAL_VALUE = IGENERATOR__SPECIFIED_INITIAL_VALUE; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_INITIAL_VALUE = IGENERATOR__DEFAULT_INITIAL_VALUE; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__ALLOCATION_SIZE = IGENERATOR__ALLOCATION_SIZE; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_ALLOCATION_SIZE = IGENERATOR__SPECIFIED_ALLOCATION_SIZE; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_ALLOCATION_SIZE = IGENERATOR__DEFAULT_ALLOCATION_SIZE; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__TABLE = IGENERATOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_TABLE = IGENERATOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_TABLE = IGENERATOR_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__CATALOG = IGENERATOR_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Specified Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_CATALOG = IGENERATOR_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Default Catalog' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_CATALOG = IGENERATOR_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SCHEMA = IGENERATOR_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Specified Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_SCHEMA = IGENERATOR_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Default Schema' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_SCHEMA = IGENERATOR_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__PK_COLUMN_NAME = IGENERATOR_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Specified Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME = IGENERATOR_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Default Pk Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME = IGENERATOR_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__VALUE_COLUMN_NAME = IGENERATOR_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Specified Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME = IGENERATOR_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Default Value Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME = IGENERATOR_FEATURE_COUNT + 14; - - /** - * The feature id for the 'Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__PK_COLUMN_VALUE = IGENERATOR_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Specified Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE = IGENERATOR_FEATURE_COUNT + 16; - - /** - * The feature id for the 'Default Pk Column Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = IGENERATOR_FEATURE_COUNT + 17; - - /** - * The feature id for the 'Unique Constraints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR__UNIQUE_CONSTRAINTS = IGENERATOR_FEATURE_COUNT + 18; - - /** - * The number of structural features of the 'ITable Generator' class. - * - * - * @generated - * @ordered - */ - public static final int ITABLE_GENERATOR_FEATURE_COUNT = IGENERATOR_FEATURE_COUNT + 19; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator ISequence Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator() - * @generated - */ - public static final int ISEQUENCE_GENERATOR = 34; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__NAME = IGENERATOR__NAME; - - /** - * The feature id for the 'Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__INITIAL_VALUE = IGENERATOR__INITIAL_VALUE; - - /** - * The feature id for the 'Specified Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__SPECIFIED_INITIAL_VALUE = IGENERATOR__SPECIFIED_INITIAL_VALUE; - - /** - * The feature id for the 'Default Initial Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__DEFAULT_INITIAL_VALUE = IGENERATOR__DEFAULT_INITIAL_VALUE; - - /** - * The feature id for the 'Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__ALLOCATION_SIZE = IGENERATOR__ALLOCATION_SIZE; - - /** - * The feature id for the 'Specified Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__SPECIFIED_ALLOCATION_SIZE = IGENERATOR__SPECIFIED_ALLOCATION_SIZE; - - /** - * The feature id for the 'Default Allocation Size' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__DEFAULT_ALLOCATION_SIZE = IGENERATOR__DEFAULT_ALLOCATION_SIZE; - - /** - * The feature id for the 'Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__SEQUENCE_NAME = IGENERATOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Specified Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME = IGENERATOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Default Sequence Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME = IGENERATOR_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'ISequence Generator' class. - * - * - * @generated - * @ordered - */ - public static final int ISEQUENCE_GENERATOR_FEATURE_COUNT = IGENERATOR_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue IGenerated Value}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGeneratedValue() - * @generated - */ - public static final int IGENERATED_VALUE = 35; - - /** - * The feature id for the 'Strategy' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATED_VALUE__STRATEGY = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Generator' attribute. - * - * - * @generated - * @ordered - */ - public static final int IGENERATED_VALUE__GENERATOR = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'IGenerated Value' class. - * - * - * @generated - * @ordered - */ - public static final int IGENERATED_VALUE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IQuery IQuery}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IQuery - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery() - * @generated - */ - public static final int IQUERY = 36; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IQUERY__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int IQUERY__QUERY = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int IQUERY__HINTS = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'IQuery' class. - * - * - * @generated - * @ordered - */ - public static final int IQUERY_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.INamedQuery INamed Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INamedQuery - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedQuery() - * @generated - */ - public static final int INAMED_QUERY = 37; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_QUERY__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_QUERY__QUERY = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int INAMED_QUERY__HINTS = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'INamed Query' class. - * - * - * @generated - * @ordered - */ - public static final int INAMED_QUERY_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery INamed Native Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery() - * @generated - */ - public static final int INAMED_NATIVE_QUERY = 38; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_NATIVE_QUERY__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Query' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_NATIVE_QUERY__QUERY = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Hints' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int INAMED_NATIVE_QUERY__HINTS = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Result Class' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_NATIVE_QUERY__RESULT_CLASS = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Result Set Mapping' attribute. - * - * - * @generated - * @ordered - */ - public static final int INAMED_NATIVE_QUERY__RESULT_SET_MAPPING = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'INamed Native Query' class. - * - * - * @generated - * @ordered - */ - public static final int INAMED_NATIVE_QUERY_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint IQuery Hint}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint() - * @generated - */ - public static final int IQUERY_HINT = 39; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int IQUERY_HINT__NAME = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - public static final int IQUERY_HINT__VALUE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'IQuery Hint' class. - * - * - * @generated - * @ordered - */ - public static final int IQUERY_HINT_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ICascade ICascade}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ICascade - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade() - * @generated - */ - public static final int ICASCADE = 40; - - /** - * The feature id for the 'All' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICASCADE__ALL = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Persist' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICASCADE__PERSIST = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Merge' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICASCADE__MERGE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Remove' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICASCADE__REMOVE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Refresh' attribute. - * - * - * @generated - * @ordered - */ - public static final int ICASCADE__REFRESH = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'ICascade' class. - * - * - * @generated - * @ordered - */ - public static final int ICASCADE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 5; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType Default Eager Fetch Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultEagerFetchType() - * @generated - */ - public static final int DEFAULT_EAGER_FETCH_TYPE = 41; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType Default Lazy Fetch Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultLazyFetchType() - * @generated - */ - public static final int DEFAULT_LAZY_FETCH_TYPE = 42; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean Default False Boolean}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultFalseBoolean() - * @generated - */ - public static final int DEFAULT_FALSE_BOOLEAN = 43; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean Default True Boolean}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultTrueBoolean() - * @generated - */ - public static final int DEFAULT_TRUE_BOOLEAN = 44; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.TemporalType Temporal Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getTemporalType() - * @generated - */ - public static final int TEMPORAL_TYPE = 45; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.InheritanceType Inheritance Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getInheritanceType() - * @generated - */ - public static final int INHERITANCE_TYPE = 46; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType Discriminator Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDiscriminatorType() - * @generated - */ - public static final int DISCRIMINATOR_TYPE = 47; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.GenerationType Generation Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getGenerationType() - * @generated - */ - public static final int GENERATION_TYPE = 48; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.EnumType Enum Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getEnumType() - * @generated - */ - public static final int ENUM_TYPE = 49; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.CascadeType Cascade Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.CascadeType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType() - * @generated - */ - public static final int CASCADE_TYPE = 50; - - /** - * - * - * @generated - */ - private EClass iMappedSuperclassEClass = null; - - /** - * - * - * @generated - */ - private EClass iEntityEClass = null; - - /** - * - * - * @generated - */ - private EClass iEmbeddableEClass = null; - - /** - * - * - * @generated - */ - private EClass iTableEClass = null; - - /** - * - * - * @generated - */ - private EClass iUniqueConstraintEClass = null; - - /** - * - * - * @generated - */ - private EClass iNamedColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iAbstractColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iColumnMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iBasicEClass = null; - - /** - * - * - * @generated - */ - private EClass iIdEClass = null; - - /** - * - * - * @generated - */ - private EClass iTransientEClass = null; - - /** - * - * - * @generated - */ - private EClass iVersionEClass = null; - - /** - * - * - * @generated - */ - private EClass iEmbeddedIdEClass = null; - - /** - * - * - * @generated - */ - private EClass iEmbeddedEClass = null; - - /** - * - * - * @generated - */ - private EClass iRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iNonOwningMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iMultiRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iOneToManyEClass = null; - - /** - * - * - * @generated - */ - private EClass iManyToManyEClass = null; - - /** - * - * - * @generated - */ - private EClass iSingleRelationshipMappingEClass = null; - - /** - * - * - * @generated - */ - private EClass iManyToOneEClass = null; - - /** - * - * - * @generated - */ - private EClass iOneToOneEClass = null; - - /** - * - * - * @generated - */ - private EClass iJoinTableEClass = null; - - /** - * - * - * @generated - */ - private EClass iAbstractJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass iAttributeOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass iAssociationOverrideEClass = null; - - /** - * - * - * @generated - */ - private EClass iDiscriminatorColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iSecondaryTableEClass = null; - - /** - * - * - * @generated - */ - private EClass iPrimaryKeyJoinColumnEClass = null; - - /** - * - * - * @generated - */ - private EClass iGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass iTableGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass iSequenceGeneratorEClass = null; - - /** - * - * - * @generated - */ - private EClass iGeneratedValueEClass = null; - - /** - * - * - * @generated - */ - private EClass iQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass iNamedQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass iNamedNativeQueryEClass = null; - - /** - * - * - * @generated - */ - private EClass iQueryHintEClass = null; - - /** - * - * - * @generated - */ - private EClass iCascadeEClass = null; - - /** - * - * - * @generated - */ - private EEnum defaultEagerFetchTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum defaultLazyFetchTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum defaultFalseBooleanEEnum = null; - - /** - * - * - * @generated - */ - private EEnum defaultTrueBooleanEEnum = null; - - /** - * - * - * @generated - */ - private EEnum temporalTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum inheritanceTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum discriminatorTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum generationTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum enumTypeEEnum = null; - - /** - * - * - * @generated - */ - private EEnum cascadeTypeEEnum = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

    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. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#eNS_URI - * @see #init() - * @generated - */ - private JpaCoreMappingsPackage() { - super(eNS_URI, JpaCoreMappingsFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

    Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

    Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static JpaCoreMappingsPackage init() { - if (isInited) - return (JpaCoreMappingsPackage) EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI); - // Obtain or create and register package - JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new JpaCoreMappingsPackage()); - isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - // Obtain or create and register interdependencies - JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE); - JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE); - JpaJavaMappingsPackage theJpaJavaMappingsPackage = (JpaJavaMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) instanceof JpaJavaMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaMappingsPackage.eNS_URI) : JpaJavaMappingsPackage.eINSTANCE); - OrmPackage theOrmPackage = (OrmPackage) (EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE); - PersistencePackage thePersistencePackage = (PersistencePackage) (EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE); - // Create package meta-data objects - theJpaCoreMappingsPackage.createPackageContents(); - theJpaCorePackage.createPackageContents(); - theJpaJavaPackage.createPackageContents(); - theJpaJavaMappingsPackage.createPackageContents(); - theOrmPackage.createPackageContents(); - thePersistencePackage.createPackageContents(); - // Initialize created meta-data - theJpaCoreMappingsPackage.initializePackageContents(); - theJpaCorePackage.initializePackageContents(); - theJpaJavaPackage.initializePackageContents(); - theJpaJavaMappingsPackage.initializePackageContents(); - theOrmPackage.initializePackageContents(); - thePersistencePackage.initializePackageContents(); - // Mark meta-data to indicate it can't be changed - theJpaCoreMappingsPackage.freeze(); - return theJpaCoreMappingsPackage; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass IMapped Superclass}'. - * - * - * @return the meta object for class 'IMapped Superclass'. - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass - * @generated - */ - public EClass getIMappedSuperclass() { - return iMappedSuperclassEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass#getIdClass Id Class}'. - * - * - * @return the meta object for the attribute 'Id Class'. - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass#getIdClass() - * @see #getIMappedSuperclass() - * @generated - */ - public EAttribute getIMappedSuperclass_IdClass() { - return (EAttribute) iMappedSuperclassEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IEntity IEntity}'. - * - * - * @return the meta object for class 'IEntity'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity - * @generated - */ - public EClass getIEntity() { - return iEntityEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedName Specified Name}'. - * - * - * @return the meta object for the attribute 'Specified Name'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedName() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_SpecifiedName() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultName Default Name}'. - * - * - * @return the meta object for the attribute 'Default Name'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultName() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_DefaultName() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getTable Table}'. - * - * - * @return the meta object for the containment reference 'Table'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getTable() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_Table() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedSecondaryTables Specified Secondary Tables}'. - * - * - * @return the meta object for the containment reference list 'Specified Secondary Tables'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedSecondaryTables() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_SpecifiedSecondaryTables() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getInheritanceStrategy Inheritance Strategy}'. - * - * - * @return the meta object for the attribute 'Inheritance Strategy'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getInheritanceStrategy() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_InheritanceStrategy() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDiscriminatorColumn Discriminator Column}'. - * - * - * @return the meta object for the containment reference 'Discriminator Column'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDiscriminatorColumn() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_DiscriminatorColumn() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(11); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSequenceGenerator Sequence Generator}'. - * - * - * @return the meta object for the containment reference 'Sequence Generator'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSequenceGenerator() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_SequenceGenerator() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(12); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getTableGenerator Table Generator}'. - * - * - * @return the meta object for the containment reference 'Table Generator'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getTableGenerator() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_TableGenerator() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(13); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultDiscriminatorValue Default Discriminator Value}'. - * - * - * @return the meta object for the attribute 'Default Discriminator Value'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultDiscriminatorValue() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_DefaultDiscriminatorValue() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(8); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedDiscriminatorValue Specified Discriminator Value}'. - * - * - * @return the meta object for the attribute 'Specified Discriminator Value'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedDiscriminatorValue() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_SpecifiedDiscriminatorValue() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(9); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDiscriminatorValue Discriminator Value}'. - * - * - * @return the meta object for the attribute 'Discriminator Value'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDiscriminatorValue() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_DiscriminatorValue() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(10); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getPrimaryKeyJoinColumns Primary Key Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Primary Key Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getPrimaryKeyJoinColumns() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_PrimaryKeyJoinColumns() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedPrimaryKeyJoinColumns Specified Primary Key Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Specified Primary Key Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedPrimaryKeyJoinColumns() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_SpecifiedPrimaryKeyJoinColumns() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultPrimaryKeyJoinColumns Default Primary Key Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Default Primary Key Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultPrimaryKeyJoinColumns() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_DefaultPrimaryKeyJoinColumns() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getAttributeOverrides Attribute Overrides}'. - * - * - * @return the meta object for the containment reference list 'Attribute Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getAttributeOverrides() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_AttributeOverrides() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(14); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedAttributeOverrides Specified Attribute Overrides}'. - * - * - * @return the meta object for the containment reference list 'Specified Attribute Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedAttributeOverrides() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_SpecifiedAttributeOverrides() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(15); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultAttributeOverrides Default Attribute Overrides}'. - * - * - * @return the meta object for the containment reference list 'Default Attribute Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultAttributeOverrides() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_DefaultAttributeOverrides() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(16); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getAssociationOverrides Association Overrides}'. - * - * - * @return the meta object for the containment reference list 'Association Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getAssociationOverrides() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_AssociationOverrides() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(17); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedAssociationOverrides Specified Association Overrides}'. - * - * - * @return the meta object for the containment reference list 'Specified Association Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getSpecifiedAssociationOverrides() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_SpecifiedAssociationOverrides() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(18); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultAssociationOverrides Default Association Overrides}'. - * - * - * @return the meta object for the containment reference list 'Default Association Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getDefaultAssociationOverrides() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_DefaultAssociationOverrides() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(19); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getNamedQueries Named Queries}'. - * - * - * @return the meta object for the containment reference list 'Named Queries'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getNamedQueries() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_NamedQueries() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(20); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getNamedNativeQueries Named Native Queries}'. - * - * - * @return the meta object for the containment reference list 'Named Native Queries'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getNamedNativeQueries() - * @see #getIEntity() - * @generated - */ - public EReference getIEntity_NamedNativeQueries() { - return (EReference) iEntityEClass.getEStructuralFeatures().get(21); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IEntity#getIdClass Id Class}'. - * - * - * @return the meta object for the attribute 'Id Class'. - * @see org.eclipse.jpt.core.internal.mappings.IEntity#getIdClass() - * @see #getIEntity() - * @generated - */ - public EAttribute getIEntity_IdClass() { - return (EAttribute) iEntityEClass.getEStructuralFeatures().get(22); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddable IEmbeddable}'. - * - * - * @return the meta object for class 'IEmbeddable'. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddable - * @generated - */ - public EClass getIEmbeddable() { - return iEmbeddableEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ITable ITable}'. - * - * - * @return the meta object for class 'ITable'. - * @see org.eclipse.jpt.core.internal.mappings.ITable - * @generated - */ - public EClass getITable() { - return iTableEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getName() - * @see #getITable() - * @generated - */ - public EAttribute getITable_Name() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedName Specified Name}'. - * - * - * @return the meta object for the attribute 'Specified Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedName() - * @see #getITable() - * @generated - */ - public EAttribute getITable_SpecifiedName() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultName Default Name}'. - * - * - * @return the meta object for the attribute 'Default Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getDefaultName() - * @see #getITable() - * @generated - */ - public EAttribute getITable_DefaultName() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getCatalog Catalog}'. - * - * - * @return the meta object for the attribute 'Catalog'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getCatalog() - * @see #getITable() - * @generated - */ - public EAttribute getITable_Catalog() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedCatalog Specified Catalog}'. - * - * - * @return the meta object for the attribute 'Specified Catalog'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedCatalog() - * @see #getITable() - * @generated - */ - public EAttribute getITable_SpecifiedCatalog() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultCatalog Default Catalog}'. - * - * - * @return the meta object for the attribute 'Default Catalog'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getDefaultCatalog() - * @see #getITable() - * @generated - */ - public EAttribute getITable_DefaultCatalog() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSchema Schema}'. - * - * - * @return the meta object for the attribute 'Schema'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getSchema() - * @see #getITable() - * @generated - */ - public EAttribute getITable_Schema() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedSchema Specified Schema}'. - * - * - * @return the meta object for the attribute 'Specified Schema'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedSchema() - * @see #getITable() - * @generated - */ - public EAttribute getITable_SpecifiedSchema() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultSchema Default Schema}'. - * - * - * @return the meta object for the attribute 'Default Schema'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getDefaultSchema() - * @see #getITable() - * @generated - */ - public EAttribute getITable_DefaultSchema() { - return (EAttribute) iTableEClass.getEStructuralFeatures().get(8); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ITable#getUniqueConstraints Unique Constraints}'. - * - * - * @return the meta object for the containment reference list 'Unique Constraints'. - * @see org.eclipse.jpt.core.internal.mappings.ITable#getUniqueConstraints() - * @see #getITable() - * @generated - */ - public EReference getITable_UniqueConstraints() { - return (EReference) iTableEClass.getEStructuralFeatures().get(9); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint IUnique Constraint}'. - * - * - * @return the meta object for class 'IUnique Constraint'. - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint - * @generated - */ - public EClass getIUniqueConstraint() { - return iUniqueConstraintEClass; - } - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint#getColumnNames Column Names}'. - * - * - * @return the meta object for the attribute list 'Column Names'. - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint#getColumnNames() - * @see #getIUniqueConstraint() - * @generated - */ - public EAttribute getIUniqueConstraint_ColumnNames() { - return (EAttribute) iUniqueConstraintEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn INamed Column}'. - * - * - * @return the meta object for class 'INamed Column'. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn - * @generated - */ - public EClass getINamedColumn() { - return iNamedColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn#getName() - * @see #getINamedColumn() - * @generated - */ - public EAttribute getINamedColumn_Name() { - return (EAttribute) iNamedColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getSpecifiedName Specified Name}'. - * - * - * @return the meta object for the attribute 'Specified Name'. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn#getSpecifiedName() - * @see #getINamedColumn() - * @generated - */ - public EAttribute getINamedColumn_SpecifiedName() { - return (EAttribute) iNamedColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getDefaultName Default Name}'. - * - * - * @return the meta object for the attribute 'Default Name'. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn#getDefaultName() - * @see #getINamedColumn() - * @generated - */ - public EAttribute getINamedColumn_DefaultName() { - return (EAttribute) iNamedColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn#getColumnDefinition Column Definition}'. - * - * - * @return the meta object for the attribute 'Column Definition'. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn#getColumnDefinition() - * @see #getINamedColumn() - * @generated - */ - public EAttribute getINamedColumn_ColumnDefinition() { - return (EAttribute) iNamedColumnEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn IAbstract Column}'. - * - * - * @return the meta object for class 'IAbstract Column'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn - * @generated - */ - public EClass getIAbstractColumn() { - return iAbstractColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUnique Unique}'. - * - * - * @return the meta object for the attribute 'Unique'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUnique() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_Unique() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getNullable Nullable}'. - * - * - * @return the meta object for the attribute 'Nullable'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getNullable() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_Nullable() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getInsertable Insertable}'. - * - * - * @return the meta object for the attribute 'Insertable'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getInsertable() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_Insertable() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUpdatable Updatable}'. - * - * - * @return the meta object for the attribute 'Updatable'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getUpdatable() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_Updatable() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getTable Table}'. - * - * - * @return the meta object for the attribute 'Table'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getTable() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_Table() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getSpecifiedTable Specified Table}'. - * - * - * @return the meta object for the attribute 'Specified Table'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getSpecifiedTable() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_SpecifiedTable() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getDefaultTable Default Table}'. - * - * - * @return the meta object for the attribute 'Default Table'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn#getDefaultTable() - * @see #getIAbstractColumn() - * @generated - */ - public EAttribute getIAbstractColumn_DefaultTable() { - return (EAttribute) iAbstractColumnEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IColumn IColumn}'. - * - * - * @return the meta object for class 'IColumn'. - * @see org.eclipse.jpt.core.internal.mappings.IColumn - * @generated - */ - public EClass getIColumn() { - return iColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getLength Length}'. - * - * - * @return the meta object for the attribute 'Length'. - * @see org.eclipse.jpt.core.internal.mappings.IColumn#getLength() - * @see #getIColumn() - * @generated - */ - public EAttribute getIColumn_Length() { - return (EAttribute) iColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision Precision}'. - * - * - * @return the meta object for the attribute 'Precision'. - * @see org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision() - * @see #getIColumn() - * @generated - */ - public EAttribute getIColumn_Precision() { - return (EAttribute) iColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getScale Scale}'. - * - * - * @return the meta object for the attribute 'Scale'. - * @see org.eclipse.jpt.core.internal.mappings.IColumn#getScale() - * @see #getIColumn() - * @generated - */ - public EAttribute getIColumn_Scale() { - return (EAttribute) iColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping IColumn Mapping}'. - * - * - * @return the meta object for class 'IColumn Mapping'. - * @see org.eclipse.jpt.core.internal.mappings.IColumnMapping - * @generated - */ - public EClass getIColumnMapping() { - return iColumnMappingEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IBasic IBasic}'. - * - * - * @return the meta object for class 'IBasic'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic - * @generated - */ - public EClass getIBasic() { - return iBasicEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getFetch Fetch}'. - * - * - * @return the meta object for the attribute 'Fetch'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic#getFetch() - * @see #getIBasic() - * @generated - */ - public EAttribute getIBasic_Fetch() { - return (EAttribute) iBasicEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getOptional Optional}'. - * - * - * @return the meta object for the attribute 'Optional'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic#getOptional() - * @see #getIBasic() - * @generated - */ - public EAttribute getIBasic_Optional() { - return (EAttribute) iBasicEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getColumn Column}'. - * - * - * @return the meta object for the containment reference 'Column'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic#getColumn() - * @see #getIBasic() - * @generated - */ - public EReference getIBasic_Column() { - return (EReference) iBasicEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IBasic#isLob Lob}'. - * - * - * @return the meta object for the attribute 'Lob'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic#isLob() - * @see #getIBasic() - * @generated - */ - public EAttribute getIBasic_Lob() { - return (EAttribute) iBasicEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getTemporal Temporal}'. - * - * - * @return the meta object for the attribute 'Temporal'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic#getTemporal() - * @see #getIBasic() - * @generated - */ - public EAttribute getIBasic_Temporal() { - return (EAttribute) iBasicEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IBasic#getEnumerated Enumerated}'. - * - * - * @return the meta object for the attribute 'Enumerated'. - * @see org.eclipse.jpt.core.internal.mappings.IBasic#getEnumerated() - * @see #getIBasic() - * @generated - */ - public EAttribute getIBasic_Enumerated() { - return (EAttribute) iBasicEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IId IId}'. - * - * - * @return the meta object for class 'IId'. - * @see org.eclipse.jpt.core.internal.mappings.IId - * @generated - */ - public EClass getIId() { - return iIdEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IId#getColumn Column}'. - * - * - * @return the meta object for the containment reference 'Column'. - * @see org.eclipse.jpt.core.internal.mappings.IId#getColumn() - * @see #getIId() - * @generated - */ - public EReference getIId_Column() { - return (EReference) iIdEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IId#getGeneratedValue Generated Value}'. - * - * - * @return the meta object for the containment reference 'Generated Value'. - * @see org.eclipse.jpt.core.internal.mappings.IId#getGeneratedValue() - * @see #getIId() - * @generated - */ - public EReference getIId_GeneratedValue() { - return (EReference) iIdEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IId#getTemporal Temporal}'. - * - * - * @return the meta object for the attribute 'Temporal'. - * @see org.eclipse.jpt.core.internal.mappings.IId#getTemporal() - * @see #getIId() - * @generated - */ - public EAttribute getIId_Temporal() { - return (EAttribute) iIdEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IId#getTableGenerator Table Generator}'. - * - * - * @return the meta object for the containment reference 'Table Generator'. - * @see org.eclipse.jpt.core.internal.mappings.IId#getTableGenerator() - * @see #getIId() - * @generated - */ - public EReference getIId_TableGenerator() { - return (EReference) iIdEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IId#getSequenceGenerator Sequence Generator}'. - * - * - * @return the meta object for the containment reference 'Sequence Generator'. - * @see org.eclipse.jpt.core.internal.mappings.IId#getSequenceGenerator() - * @see #getIId() - * @generated - */ - public EReference getIId_SequenceGenerator() { - return (EReference) iIdEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ITransient ITransient}'. - * - * - * @return the meta object for class 'ITransient'. - * @see org.eclipse.jpt.core.internal.mappings.ITransient - * @generated - */ - public EClass getITransient() { - return iTransientEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IVersion IVersion}'. - * - * - * @return the meta object for class 'IVersion'. - * @see org.eclipse.jpt.core.internal.mappings.IVersion - * @generated - */ - public EClass getIVersion() { - return iVersionEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IVersion#getColumn Column}'. - * - * - * @return the meta object for the containment reference 'Column'. - * @see org.eclipse.jpt.core.internal.mappings.IVersion#getColumn() - * @see #getIVersion() - * @generated - */ - public EReference getIVersion_Column() { - return (EReference) iVersionEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IVersion#getTemporal Temporal}'. - * - * - * @return the meta object for the attribute 'Temporal'. - * @see org.eclipse.jpt.core.internal.mappings.IVersion#getTemporal() - * @see #getIVersion() - * @generated - */ - public EAttribute getIVersion_Temporal() { - return (EAttribute) iVersionEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddedId IEmbedded Id}'. - * - * - * @return the meta object for class 'IEmbedded Id'. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddedId - * @generated - */ - public EClass getIEmbeddedId() { - return iEmbeddedIdEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded IEmbedded}'. - * - * - * @return the meta object for class 'IEmbedded'. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded - * @generated - */ - public EClass getIEmbedded() { - return iEmbeddedEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded#getAttributeOverrides Attribute Overrides}'. - * - * - * @return the meta object for the containment reference list 'Attribute Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded#getAttributeOverrides() - * @see #getIEmbedded() - * @generated - */ - public EReference getIEmbedded_AttributeOverrides() { - return (EReference) iEmbeddedEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded#getSpecifiedAttributeOverrides Specified Attribute Overrides}'. - * - * - * @return the meta object for the containment reference list 'Specified Attribute Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded#getSpecifiedAttributeOverrides() - * @see #getIEmbedded() - * @generated - */ - public EReference getIEmbedded_SpecifiedAttributeOverrides() { - return (EReference) iEmbeddedEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded#getDefaultAttributeOverrides Default Attribute Overrides}'. - * - * - * @return the meta object for the containment reference list 'Default Attribute Overrides'. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded#getDefaultAttributeOverrides() - * @see #getIEmbedded() - * @generated - */ - public EReference getIEmbedded_DefaultAttributeOverrides() { - return (EReference) iEmbeddedEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping IRelationship Mapping}'. - * - * - * @return the meta object for class 'IRelationship Mapping'. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping - * @generated - */ - public EClass getIRelationshipMapping() { - return iRelationshipMappingEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getTargetEntity Target Entity}'. - * - * - * @return the meta object for the attribute 'Target Entity'. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getTargetEntity() - * @see #getIRelationshipMapping() - * @generated - */ - public EAttribute getIRelationshipMapping_TargetEntity() { - return (EAttribute) iRelationshipMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getSpecifiedTargetEntity Specified Target Entity}'. - * - * - * @return the meta object for the attribute 'Specified Target Entity'. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getSpecifiedTargetEntity() - * @see #getIRelationshipMapping() - * @generated - */ - public EAttribute getIRelationshipMapping_SpecifiedTargetEntity() { - return (EAttribute) iRelationshipMappingEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getDefaultTargetEntity Default Target Entity}'. - * - * - * @return the meta object for the attribute 'Default Target Entity'. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getDefaultTargetEntity() - * @see #getIRelationshipMapping() - * @generated - */ - public EAttribute getIRelationshipMapping_DefaultTargetEntity() { - return (EAttribute) iRelationshipMappingEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getResolvedTargetEntity Resolved Target Entity}'. - * - * - * @return the meta object for the reference 'Resolved Target Entity'. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getResolvedTargetEntity() - * @see #getIRelationshipMapping() - * @generated - */ - public EReference getIRelationshipMapping_ResolvedTargetEntity() { - return (EReference) iRelationshipMappingEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade Cascade}'. - * - * - * @return the meta object for the containment reference 'Cascade'. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade() - * @see #getIRelationshipMapping() - * @generated - */ - public EReference getIRelationshipMapping_Cascade() { - return (EReference) iRelationshipMappingEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping INon Owning Mapping}'. - * - * - * @return the meta object for class 'INon Owning Mapping'. - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping - * @generated - */ - public EClass getINonOwningMapping() { - return iNonOwningMappingEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping#getMappedBy Mapped By}'. - * - * - * @return the meta object for the attribute 'Mapped By'. - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping#getMappedBy() - * @see #getINonOwningMapping() - * @generated - */ - public EAttribute getINonOwningMapping_MappedBy() { - return (EAttribute) iNonOwningMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping IMulti Relationship Mapping}'. - * - * - * @return the meta object for class 'IMulti Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping - * @generated - */ - public EClass getIMultiRelationshipMapping() { - return iMultiRelationshipMappingEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy Order By}'. - * - * - * @return the meta object for the attribute 'Order By'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy() - * @see #getIMultiRelationshipMapping() - * @generated - */ - public EAttribute getIMultiRelationshipMapping_OrderBy() { - return (EAttribute) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch Fetch}'. - * - * - * @return the meta object for the attribute 'Fetch'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch() - * @see #getIMultiRelationshipMapping() - * @generated - */ - public EAttribute getIMultiRelationshipMapping_Fetch() { - return (EAttribute) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable Join Table}'. - * - * - * @return the meta object for the containment reference 'Join Table'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable() - * @see #getIMultiRelationshipMapping() - * @generated - */ - public EReference getIMultiRelationshipMapping_JoinTable() { - return (EReference) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getMapKey Map Key}'. - * - * - * @return the meta object for the attribute 'Map Key'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getMapKey() - * @see #getIMultiRelationshipMapping() - * @generated - */ - public EAttribute getIMultiRelationshipMapping_MapKey() { - return (EAttribute) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IOneToMany IOne To Many}'. - * - * - * @return the meta object for class 'IOne To Many'. - * @see org.eclipse.jpt.core.internal.mappings.IOneToMany - * @generated - */ - public EClass getIOneToMany() { - return iOneToManyEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IManyToMany IMany To Many}'. - * - * - * @return the meta object for class 'IMany To Many'. - * @see org.eclipse.jpt.core.internal.mappings.IManyToMany - * @generated - */ - public EClass getIManyToMany() { - return iManyToManyEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping ISingle Relationship Mapping}'. - * - * - * @return the meta object for class 'ISingle Relationship Mapping'. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping - * @generated - */ - public EClass getISingleRelationshipMapping() { - return iSingleRelationshipMappingEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getFetch Fetch}'. - * - * - * @return the meta object for the attribute 'Fetch'. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getFetch() - * @see #getISingleRelationshipMapping() - * @generated - */ - public EAttribute getISingleRelationshipMapping_Fetch() { - return (EAttribute) iSingleRelationshipMappingEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getJoinColumns Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getJoinColumns() - * @see #getISingleRelationshipMapping() - * @generated - */ - public EReference getISingleRelationshipMapping_JoinColumns() { - return (EReference) iSingleRelationshipMappingEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getSpecifiedJoinColumns Specified Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Specified Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getSpecifiedJoinColumns() - * @see #getISingleRelationshipMapping() - * @generated - */ - public EReference getISingleRelationshipMapping_SpecifiedJoinColumns() { - return (EReference) iSingleRelationshipMappingEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getDefaultJoinColumns Default Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Default Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getDefaultJoinColumns() - * @see #getISingleRelationshipMapping() - * @generated - */ - public EReference getISingleRelationshipMapping_DefaultJoinColumns() { - return (EReference) iSingleRelationshipMappingEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getOptional Optional}'. - * - * - * @return the meta object for the attribute 'Optional'. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping#getOptional() - * @see #getISingleRelationshipMapping() - * @generated - */ - public EAttribute getISingleRelationshipMapping_Optional() { - return (EAttribute) iSingleRelationshipMappingEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IManyToOne IMany To One}'. - * - * - * @return the meta object for class 'IMany To One'. - * @see org.eclipse.jpt.core.internal.mappings.IManyToOne - * @generated - */ - public EClass getIManyToOne() { - return iManyToOneEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IOneToOne IOne To One}'. - * - * - * @return the meta object for class 'IOne To One'. - * @see org.eclipse.jpt.core.internal.mappings.IOneToOne - * @generated - */ - public EClass getIOneToOne() { - return iOneToOneEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable IJoin Table}'. - * - * - * @return the meta object for class 'IJoin Table'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable - * @generated - */ - public EClass getIJoinTable() { - return iJoinTableEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getJoinColumns Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable#getJoinColumns() - * @see #getIJoinTable() - * @generated - */ - public EReference getIJoinTable_JoinColumns() { - return (EReference) iJoinTableEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getSpecifiedJoinColumns Specified Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Specified Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable#getSpecifiedJoinColumns() - * @see #getIJoinTable() - * @generated - */ - public EReference getIJoinTable_SpecifiedJoinColumns() { - return (EReference) iJoinTableEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getDefaultJoinColumns Default Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Default Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable#getDefaultJoinColumns() - * @see #getIJoinTable() - * @generated - */ - public EReference getIJoinTable_DefaultJoinColumns() { - return (EReference) iJoinTableEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getInverseJoinColumns Inverse Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Inverse Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable#getInverseJoinColumns() - * @see #getIJoinTable() - * @generated - */ - public EReference getIJoinTable_InverseJoinColumns() { - return (EReference) iJoinTableEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getSpecifiedInverseJoinColumns Specified Inverse Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Specified Inverse Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable#getSpecifiedInverseJoinColumns() - * @see #getIJoinTable() - * @generated - */ - public EReference getIJoinTable_SpecifiedInverseJoinColumns() { - return (EReference) iJoinTableEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable#getDefaultInverseJoinColumns Default Inverse Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Default Inverse Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable#getDefaultInverseJoinColumns() - * @see #getIJoinTable() - * @generated - */ - public EReference getIJoinTable_DefaultInverseJoinColumns() { - return (EReference) iJoinTableEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn IAbstract Join Column}'. - * - * - * @return the meta object for class 'IAbstract Join Column'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn - * @generated - */ - public EClass getIAbstractJoinColumn() { - return iAbstractJoinColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getReferencedColumnName Referenced Column Name}'. - * - * - * @return the meta object for the attribute 'Referenced Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getReferencedColumnName() - * @see #getIAbstractJoinColumn() - * @generated - */ - public EAttribute getIAbstractJoinColumn_ReferencedColumnName() { - return (EAttribute) iAbstractJoinColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getSpecifiedReferencedColumnName Specified Referenced Column Name}'. - * - * - * @return the meta object for the attribute 'Specified Referenced Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getSpecifiedReferencedColumnName() - * @see #getIAbstractJoinColumn() - * @generated - */ - public EAttribute getIAbstractJoinColumn_SpecifiedReferencedColumnName() { - return (EAttribute) iAbstractJoinColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getDefaultReferencedColumnName Default Referenced Column Name}'. - * - * - * @return the meta object for the attribute 'Default Referenced Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn#getDefaultReferencedColumnName() - * @see #getIAbstractJoinColumn() - * @generated - */ - public EAttribute getIAbstractJoinColumn_DefaultReferencedColumnName() { - return (EAttribute) iAbstractJoinColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IJoinColumn IJoin Column}'. - * - * - * @return the meta object for class 'IJoin Column'. - * @see org.eclipse.jpt.core.internal.mappings.IJoinColumn - * @generated - */ - public EClass getIJoinColumn() { - return iJoinColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IOverride IOverride}'. - * - * - * @return the meta object for class 'IOverride'. - * @see org.eclipse.jpt.core.internal.mappings.IOverride - * @generated - */ - public EClass getIOverride() { - return iOverrideEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IOverride#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.mappings.IOverride#getName() - * @see #getIOverride() - * @generated - */ - public EAttribute getIOverride_Name() { - return (EAttribute) iOverrideEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride IAttribute Override}'. - * - * - * @return the meta object for class 'IAttribute Override'. - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride - * @generated - */ - public EClass getIAttributeOverride() { - return iAttributeOverrideEClass; - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride#getColumn Column}'. - * - * - * @return the meta object for the containment reference 'Column'. - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride#getColumn() - * @see #getIAttributeOverride() - * @generated - */ - public EReference getIAttributeOverride_Column() { - return (EReference) iAttributeOverrideEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride IAssociation Override}'. - * - * - * @return the meta object for class 'IAssociation Override'. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride - * @generated - */ - public EClass getIAssociationOverride() { - return iAssociationOverrideEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getJoinColumns Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getJoinColumns() - * @see #getIAssociationOverride() - * @generated - */ - public EReference getIAssociationOverride_JoinColumns() { - return (EReference) iAssociationOverrideEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getSpecifiedJoinColumns Specified Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Specified Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getSpecifiedJoinColumns() - * @see #getIAssociationOverride() - * @generated - */ - public EReference getIAssociationOverride_SpecifiedJoinColumns() { - return (EReference) iAssociationOverrideEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getDefaultJoinColumns Default Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Default Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride#getDefaultJoinColumns() - * @see #getIAssociationOverride() - * @generated - */ - public EReference getIAssociationOverride_DefaultJoinColumns() { - return (EReference) iAssociationOverrideEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn IDiscriminator Column}'. - * - * - * @return the meta object for class 'IDiscriminator Column'. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn - * @generated - */ - public EClass getIDiscriminatorColumn() { - return iDiscriminatorColumnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDiscriminatorType Discriminator Type}'. - * - * - * @return the meta object for the attribute 'Discriminator Type'. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDiscriminatorType() - * @see #getIDiscriminatorColumn() - * @generated - */ - public EAttribute getIDiscriminatorColumn_DiscriminatorType() { - return (EAttribute) iDiscriminatorColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDefaultLength Default Length}'. - * - * - * @return the meta object for the attribute 'Default Length'. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getDefaultLength() - * @see #getIDiscriminatorColumn() - * @generated - */ - public EAttribute getIDiscriminatorColumn_DefaultLength() { - return (EAttribute) iDiscriminatorColumnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getSpecifiedLength Specified Length}'. - * - * - * @return the meta object for the attribute 'Specified Length'. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getSpecifiedLength() - * @see #getIDiscriminatorColumn() - * @generated - */ - public EAttribute getIDiscriminatorColumn_SpecifiedLength() { - return (EAttribute) iDiscriminatorColumnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getLength Length}'. - * - * - * @return the meta object for the attribute 'Length'. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn#getLength() - * @see #getIDiscriminatorColumn() - * @generated - */ - public EAttribute getIDiscriminatorColumn_Length() { - return (EAttribute) iDiscriminatorColumnEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable ISecondary Table}'. - * - * - * @return the meta object for class 'ISecondary Table'. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable - * @generated - */ - public EClass getISecondaryTable() { - return iSecondaryTableEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getPrimaryKeyJoinColumns Primary Key Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Primary Key Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getPrimaryKeyJoinColumns() - * @see #getISecondaryTable() - * @generated - */ - public EReference getISecondaryTable_PrimaryKeyJoinColumns() { - return (EReference) iSecondaryTableEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getSpecifiedPrimaryKeyJoinColumns Specified Primary Key Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Specified Primary Key Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getSpecifiedPrimaryKeyJoinColumns() - * @see #getISecondaryTable() - * @generated - */ - public EReference getISecondaryTable_SpecifiedPrimaryKeyJoinColumns() { - return (EReference) iSecondaryTableEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getDefaultPrimaryKeyJoinColumns Default Primary Key Join Columns}'. - * - * - * @return the meta object for the containment reference list 'Default Primary Key Join Columns'. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable#getDefaultPrimaryKeyJoinColumns() - * @see #getISecondaryTable() - * @generated - */ - public EReference getISecondaryTable_DefaultPrimaryKeyJoinColumns() { - return (EReference) iSecondaryTableEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn IPrimary Key Join Column}'. - * - * - * @return the meta object for class 'IPrimary Key Join Column'. - * @see org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn - * @generated - */ - public EClass getIPrimaryKeyJoinColumn() { - return iPrimaryKeyJoinColumnEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IGenerator IGenerator}'. - * - * - * @return the meta object for class 'IGenerator'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator - * @generated - */ - public EClass getIGenerator() { - return iGeneratorEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getName() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_Name() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getInitialValue Initial Value}'. - * - * - * @return the meta object for the attribute 'Initial Value'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getInitialValue() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_InitialValue() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedInitialValue Specified Initial Value}'. - * - * - * @return the meta object for the attribute 'Specified Initial Value'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedInitialValue() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_SpecifiedInitialValue() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getDefaultInitialValue Default Initial Value}'. - * - * - * @return the meta object for the attribute 'Default Initial Value'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getDefaultInitialValue() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_DefaultInitialValue() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getAllocationSize Allocation Size}'. - * - * - * @return the meta object for the attribute 'Allocation Size'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getAllocationSize() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_AllocationSize() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedAllocationSize Specified Allocation Size}'. - * - * - * @return the meta object for the attribute 'Specified Allocation Size'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getSpecifiedAllocationSize() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_SpecifiedAllocationSize() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGenerator#getDefaultAllocationSize Default Allocation Size}'. - * - * - * @return the meta object for the attribute 'Default Allocation Size'. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator#getDefaultAllocationSize() - * @see #getIGenerator() - * @generated - */ - public EAttribute getIGenerator_DefaultAllocationSize() { - return (EAttribute) iGeneratorEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator ITable Generator}'. - * - * - * @return the meta object for class 'ITable Generator'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator - * @generated - */ - public EClass getITableGenerator() { - return iTableGeneratorEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getTable Table}'. - * - * - * @return the meta object for the attribute 'Table'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getTable() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_Table() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedTable Specified Table}'. - * - * - * @return the meta object for the attribute 'Specified Table'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedTable() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_SpecifiedTable() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultTable Default Table}'. - * - * - * @return the meta object for the attribute 'Default Table'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultTable() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_DefaultTable() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getCatalog Catalog}'. - * - * - * @return the meta object for the attribute 'Catalog'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getCatalog() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_Catalog() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedCatalog Specified Catalog}'. - * - * - * @return the meta object for the attribute 'Specified Catalog'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedCatalog() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_SpecifiedCatalog() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultCatalog Default Catalog}'. - * - * - * @return the meta object for the attribute 'Default Catalog'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultCatalog() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_DefaultCatalog() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSchema Schema}'. - * - * - * @return the meta object for the attribute 'Schema'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSchema() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_Schema() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedSchema Specified Schema}'. - * - * - * @return the meta object for the attribute 'Specified Schema'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedSchema() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_SpecifiedSchema() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultSchema Default Schema}'. - * - * - * @return the meta object for the attribute 'Default Schema'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultSchema() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_DefaultSchema() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(8); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnName Pk Column Name}'. - * - * - * @return the meta object for the attribute 'Pk Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnName() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_PkColumnName() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(9); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnName Specified Pk Column Name}'. - * - * - * @return the meta object for the attribute 'Specified Pk Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnName() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_SpecifiedPkColumnName() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(10); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnName Default Pk Column Name}'. - * - * - * @return the meta object for the attribute 'Default Pk Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnName() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_DefaultPkColumnName() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(11); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getValueColumnName Value Column Name}'. - * - * - * @return the meta object for the attribute 'Value Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getValueColumnName() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_ValueColumnName() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(12); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedValueColumnName Specified Value Column Name}'. - * - * - * @return the meta object for the attribute 'Specified Value Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedValueColumnName() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_SpecifiedValueColumnName() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(13); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultValueColumnName Default Value Column Name}'. - * - * - * @return the meta object for the attribute 'Default Value Column Name'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultValueColumnName() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_DefaultValueColumnName() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(14); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnValue Pk Column Value}'. - * - * - * @return the meta object for the attribute 'Pk Column Value'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnValue() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_PkColumnValue() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(15); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnValue Specified Pk Column Value}'. - * - * - * @return the meta object for the attribute 'Specified Pk Column Value'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnValue() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_SpecifiedPkColumnValue() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(16); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnValue Default Pk Column Value}'. - * - * - * @return the meta object for the attribute 'Default Pk Column Value'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnValue() - * @see #getITableGenerator() - * @generated - */ - public EAttribute getITableGenerator_DefaultPkColumnValue() { - return (EAttribute) iTableGeneratorEClass.getEStructuralFeatures().get(17); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getUniqueConstraints Unique Constraints}'. - * - * - * @return the meta object for the containment reference list 'Unique Constraints'. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getUniqueConstraints() - * @see #getITableGenerator() - * @generated - */ - public EReference getITableGenerator_UniqueConstraints() { - return (EReference) iTableGeneratorEClass.getEStructuralFeatures().get(18); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator ISequence Generator}'. - * - * - * @return the meta object for class 'ISequence Generator'. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator - * @generated - */ - public EClass getISequenceGenerator() { - return iSequenceGeneratorEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSequenceName Sequence Name}'. - * - * - * @return the meta object for the attribute 'Sequence Name'. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSequenceName() - * @see #getISequenceGenerator() - * @generated - */ - public EAttribute getISequenceGenerator_SequenceName() { - return (EAttribute) iSequenceGeneratorEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSpecifiedSequenceName Specified Sequence Name}'. - * - * - * @return the meta object for the attribute 'Specified Sequence Name'. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getSpecifiedSequenceName() - * @see #getISequenceGenerator() - * @generated - */ - public EAttribute getISequenceGenerator_SpecifiedSequenceName() { - return (EAttribute) iSequenceGeneratorEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getDefaultSequenceName Default Sequence Name}'. - * - * - * @return the meta object for the attribute 'Default Sequence Name'. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator#getDefaultSequenceName() - * @see #getISequenceGenerator() - * @generated - */ - public EAttribute getISequenceGenerator_DefaultSequenceName() { - return (EAttribute) iSequenceGeneratorEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue IGenerated Value}'. - * - * - * @return the meta object for class 'IGenerated Value'. - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue - * @generated - */ - public EClass getIGeneratedValue() { - return iGeneratedValueEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getStrategy Strategy}'. - * - * - * @return the meta object for the attribute 'Strategy'. - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getStrategy() - * @see #getIGeneratedValue() - * @generated - */ - public EAttribute getIGeneratedValue_Strategy() { - return (EAttribute) iGeneratedValueEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getGenerator Generator}'. - * - * - * @return the meta object for the attribute 'Generator'. - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue#getGenerator() - * @see #getIGeneratedValue() - * @generated - */ - public EAttribute getIGeneratedValue_Generator() { - return (EAttribute) iGeneratedValueEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IQuery IQuery}'. - * - * - * @return the meta object for class 'IQuery'. - * @see org.eclipse.jpt.core.internal.mappings.IQuery - * @generated - */ - public EClass getIQuery() { - return iQueryEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IQuery#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.mappings.IQuery#getName() - * @see #getIQuery() - * @generated - */ - public EAttribute getIQuery_Name() { - return (EAttribute) iQueryEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IQuery#getQuery Query}'. - * - * - * @return the meta object for the attribute 'Query'. - * @see org.eclipse.jpt.core.internal.mappings.IQuery#getQuery() - * @see #getIQuery() - * @generated - */ - public EAttribute getIQuery_Query() { - return (EAttribute) iQueryEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.IQuery#getHints Hints}'. - * - * - * @return the meta object for the containment reference list 'Hints'. - * @see org.eclipse.jpt.core.internal.mappings.IQuery#getHints() - * @see #getIQuery() - * @generated - */ - public EReference getIQuery_Hints() { - return (EReference) iQueryEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.INamedQuery INamed Query}'. - * - * - * @return the meta object for class 'INamed Query'. - * @see org.eclipse.jpt.core.internal.mappings.INamedQuery - * @generated - */ - public EClass getINamedQuery() { - return iNamedQueryEClass; - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery INamed Native Query}'. - * - * - * @return the meta object for class 'INamed Native Query'. - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery - * @generated - */ - public EClass getINamedNativeQuery() { - return iNamedNativeQueryEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultClass Result Class}'. - * - * - * @return the meta object for the attribute 'Result Class'. - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultClass() - * @see #getINamedNativeQuery() - * @generated - */ - public EAttribute getINamedNativeQuery_ResultClass() { - return (EAttribute) iNamedNativeQueryEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultSetMapping Result Set Mapping}'. - * - * - * @return the meta object for the attribute 'Result Set Mapping'. - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery#getResultSetMapping() - * @see #getINamedNativeQuery() - * @generated - */ - public EAttribute getINamedNativeQuery_ResultSetMapping() { - return (EAttribute) iNamedNativeQueryEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint IQuery Hint}'. - * - * - * @return the meta object for class 'IQuery Hint'. - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint - * @generated - */ - public EClass getIQueryHint() { - return iQueryHintEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint#getName() - * @see #getIQueryHint() - * @generated - */ - public EAttribute getIQueryHint_Name() { - return (EAttribute) iQueryHintEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint#getValue() - * @see #getIQueryHint() - * @generated - */ - public EAttribute getIQueryHint_Value() { - return (EAttribute) iQueryHintEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ICascade ICascade}'. - * - * - * @return the meta object for class 'ICascade'. - * @see org.eclipse.jpt.core.internal.mappings.ICascade - * @generated - */ - public EClass getICascade() { - return iCascadeEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isAll All}'. - * - * - * @return the meta object for the attribute 'All'. - * @see org.eclipse.jpt.core.internal.mappings.ICascade#isAll() - * @see #getICascade() - * @generated - */ - public EAttribute getICascade_All() { - return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isPersist Persist}'. - * - * - * @return the meta object for the attribute 'Persist'. - * @see org.eclipse.jpt.core.internal.mappings.ICascade#isPersist() - * @see #getICascade() - * @generated - */ - public EAttribute getICascade_Persist() { - return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isMerge Merge}'. - * - * - * @return the meta object for the attribute 'Merge'. - * @see org.eclipse.jpt.core.internal.mappings.ICascade#isMerge() - * @see #getICascade() - * @generated - */ - public EAttribute getICascade_Merge() { - return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRemove Remove}'. - * - * - * @return the meta object for the attribute 'Remove'. - * @see org.eclipse.jpt.core.internal.mappings.ICascade#isRemove() - * @see #getICascade() - * @generated - */ - public EAttribute getICascade_Remove() { - return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh Refresh}'. - * - * - * @return the meta object for the attribute 'Refresh'. - * @see org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh() - * @see #getICascade() - * @generated - */ - public EAttribute getICascade_Refresh() { - return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType Default Eager Fetch Type}'. - * - * - * @return the meta object for enum 'Default Eager Fetch Type'. - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @generated - */ - public EEnum getDefaultEagerFetchType() { - return defaultEagerFetchTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType Default Lazy Fetch Type}'. - * - * - * @return the meta object for enum 'Default Lazy Fetch Type'. - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @generated - */ - public EEnum getDefaultLazyFetchType() { - return defaultLazyFetchTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean Default False Boolean}'. - * - * - * @return the meta object for enum 'Default False Boolean'. - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @generated - */ - public EEnum getDefaultFalseBoolean() { - return defaultFalseBooleanEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean Default True Boolean}'. - * - * - * @return the meta object for enum 'Default True Boolean'. - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @generated - */ - public EEnum getDefaultTrueBoolean() { - return defaultTrueBooleanEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.TemporalType Temporal Type}'. - * - * - * @return the meta object for enum 'Temporal Type'. - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @generated - */ - public EEnum getTemporalType() { - return temporalTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.InheritanceType Inheritance Type}'. - * - * - * @return the meta object for enum 'Inheritance Type'. - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @generated - */ - public EEnum getInheritanceType() { - return inheritanceTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType Discriminator Type}'. - * - * - * @return the meta object for enum 'Discriminator Type'. - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @generated - */ - public EEnum getDiscriminatorType() { - return discriminatorTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.GenerationType Generation Type}'. - * - * - * @return the meta object for enum 'Generation Type'. - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @generated - */ - public EEnum getGenerationType() { - return generationTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.EnumType Enum Type}'. - * - * - * @return the meta object for enum 'Enum Type'. - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @generated - */ - public EEnum getEnumType() { - return enumTypeEEnum; - } - - /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.CascadeType Cascade Type}'. - * - * - * @return the meta object for enum 'Cascade Type'. - * @see org.eclipse.jpt.core.internal.mappings.CascadeType - * @generated - */ - public EEnum getCascadeType() { - return cascadeTypeEEnum; - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public JpaCoreMappingsFactory getJpaCoreMappingsFactory() { - return (JpaCoreMappingsFactory) getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) - return; - isCreated = true; - // Create classes and their features - iMappedSuperclassEClass = createEClass(IMAPPED_SUPERCLASS); - createEAttribute(iMappedSuperclassEClass, IMAPPED_SUPERCLASS__ID_CLASS); - iEntityEClass = createEClass(IENTITY); - createEAttribute(iEntityEClass, IENTITY__SPECIFIED_NAME); - createEAttribute(iEntityEClass, IENTITY__DEFAULT_NAME); - createEReference(iEntityEClass, IENTITY__TABLE); - createEReference(iEntityEClass, IENTITY__SPECIFIED_SECONDARY_TABLES); - createEReference(iEntityEClass, IENTITY__PRIMARY_KEY_JOIN_COLUMNS); - createEReference(iEntityEClass, IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS); - createEReference(iEntityEClass, IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS); - createEAttribute(iEntityEClass, IENTITY__INHERITANCE_STRATEGY); - createEAttribute(iEntityEClass, IENTITY__DEFAULT_DISCRIMINATOR_VALUE); - createEAttribute(iEntityEClass, IENTITY__SPECIFIED_DISCRIMINATOR_VALUE); - createEAttribute(iEntityEClass, IENTITY__DISCRIMINATOR_VALUE); - createEReference(iEntityEClass, IENTITY__DISCRIMINATOR_COLUMN); - createEReference(iEntityEClass, IENTITY__SEQUENCE_GENERATOR); - createEReference(iEntityEClass, IENTITY__TABLE_GENERATOR); - createEReference(iEntityEClass, IENTITY__ATTRIBUTE_OVERRIDES); - createEReference(iEntityEClass, IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES); - createEReference(iEntityEClass, IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES); - createEReference(iEntityEClass, IENTITY__ASSOCIATION_OVERRIDES); - createEReference(iEntityEClass, IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES); - createEReference(iEntityEClass, IENTITY__DEFAULT_ASSOCIATION_OVERRIDES); - createEReference(iEntityEClass, IENTITY__NAMED_QUERIES); - createEReference(iEntityEClass, IENTITY__NAMED_NATIVE_QUERIES); - createEAttribute(iEntityEClass, IENTITY__ID_CLASS); - iEmbeddableEClass = createEClass(IEMBEDDABLE); - iTableEClass = createEClass(ITABLE); - createEAttribute(iTableEClass, ITABLE__NAME); - createEAttribute(iTableEClass, ITABLE__SPECIFIED_NAME); - createEAttribute(iTableEClass, ITABLE__DEFAULT_NAME); - createEAttribute(iTableEClass, ITABLE__CATALOG); - createEAttribute(iTableEClass, ITABLE__SPECIFIED_CATALOG); - createEAttribute(iTableEClass, ITABLE__DEFAULT_CATALOG); - createEAttribute(iTableEClass, ITABLE__SCHEMA); - createEAttribute(iTableEClass, ITABLE__SPECIFIED_SCHEMA); - createEAttribute(iTableEClass, ITABLE__DEFAULT_SCHEMA); - createEReference(iTableEClass, ITABLE__UNIQUE_CONSTRAINTS); - iUniqueConstraintEClass = createEClass(IUNIQUE_CONSTRAINT); - createEAttribute(iUniqueConstraintEClass, IUNIQUE_CONSTRAINT__COLUMN_NAMES); - iNamedColumnEClass = createEClass(INAMED_COLUMN); - createEAttribute(iNamedColumnEClass, INAMED_COLUMN__NAME); - createEAttribute(iNamedColumnEClass, INAMED_COLUMN__SPECIFIED_NAME); - createEAttribute(iNamedColumnEClass, INAMED_COLUMN__DEFAULT_NAME); - createEAttribute(iNamedColumnEClass, INAMED_COLUMN__COLUMN_DEFINITION); - iAbstractColumnEClass = createEClass(IABSTRACT_COLUMN); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__UNIQUE); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__NULLABLE); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__INSERTABLE); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__UPDATABLE); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__TABLE); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__SPECIFIED_TABLE); - createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__DEFAULT_TABLE); - iColumnEClass = createEClass(ICOLUMN); - createEAttribute(iColumnEClass, ICOLUMN__LENGTH); - createEAttribute(iColumnEClass, ICOLUMN__PRECISION); - createEAttribute(iColumnEClass, ICOLUMN__SCALE); - iColumnMappingEClass = createEClass(ICOLUMN_MAPPING); - iBasicEClass = createEClass(IBASIC); - createEAttribute(iBasicEClass, IBASIC__FETCH); - createEAttribute(iBasicEClass, IBASIC__OPTIONAL); - createEReference(iBasicEClass, IBASIC__COLUMN); - createEAttribute(iBasicEClass, IBASIC__LOB); - createEAttribute(iBasicEClass, IBASIC__TEMPORAL); - createEAttribute(iBasicEClass, IBASIC__ENUMERATED); - iIdEClass = createEClass(IID); - createEReference(iIdEClass, IID__COLUMN); - createEReference(iIdEClass, IID__GENERATED_VALUE); - createEAttribute(iIdEClass, IID__TEMPORAL); - createEReference(iIdEClass, IID__TABLE_GENERATOR); - createEReference(iIdEClass, IID__SEQUENCE_GENERATOR); - iTransientEClass = createEClass(ITRANSIENT); - iVersionEClass = createEClass(IVERSION); - createEReference(iVersionEClass, IVERSION__COLUMN); - createEAttribute(iVersionEClass, IVERSION__TEMPORAL); - iEmbeddedIdEClass = createEClass(IEMBEDDED_ID); - iEmbeddedEClass = createEClass(IEMBEDDED); - createEReference(iEmbeddedEClass, IEMBEDDED__ATTRIBUTE_OVERRIDES); - createEReference(iEmbeddedEClass, IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES); - createEReference(iEmbeddedEClass, IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES); - iRelationshipMappingEClass = createEClass(IRELATIONSHIP_MAPPING); - createEAttribute(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__TARGET_ENTITY); - createEAttribute(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY); - createEAttribute(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY); - createEReference(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY); - createEReference(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__CASCADE); - iNonOwningMappingEClass = createEClass(INON_OWNING_MAPPING); - createEAttribute(iNonOwningMappingEClass, INON_OWNING_MAPPING__MAPPED_BY); - iMultiRelationshipMappingEClass = createEClass(IMULTI_RELATIONSHIP_MAPPING); - createEAttribute(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__ORDER_BY); - createEAttribute(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__FETCH); - createEReference(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE); - createEAttribute(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__MAP_KEY); - iOneToManyEClass = createEClass(IONE_TO_MANY); - iManyToManyEClass = createEClass(IMANY_TO_MANY); - iSingleRelationshipMappingEClass = createEClass(ISINGLE_RELATIONSHIP_MAPPING); - createEAttribute(iSingleRelationshipMappingEClass, ISINGLE_RELATIONSHIP_MAPPING__FETCH); - createEReference(iSingleRelationshipMappingEClass, ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS); - createEReference(iSingleRelationshipMappingEClass, ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS); - createEReference(iSingleRelationshipMappingEClass, ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS); - createEAttribute(iSingleRelationshipMappingEClass, ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL); - iManyToOneEClass = createEClass(IMANY_TO_ONE); - iOneToOneEClass = createEClass(IONE_TO_ONE); - iJoinTableEClass = createEClass(IJOIN_TABLE); - createEReference(iJoinTableEClass, IJOIN_TABLE__JOIN_COLUMNS); - createEReference(iJoinTableEClass, IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS); - createEReference(iJoinTableEClass, IJOIN_TABLE__DEFAULT_JOIN_COLUMNS); - createEReference(iJoinTableEClass, IJOIN_TABLE__INVERSE_JOIN_COLUMNS); - createEReference(iJoinTableEClass, IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS); - createEReference(iJoinTableEClass, IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS); - iAbstractJoinColumnEClass = createEClass(IABSTRACT_JOIN_COLUMN); - createEAttribute(iAbstractJoinColumnEClass, IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME); - createEAttribute(iAbstractJoinColumnEClass, IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME); - createEAttribute(iAbstractJoinColumnEClass, IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME); - iJoinColumnEClass = createEClass(IJOIN_COLUMN); - iOverrideEClass = createEClass(IOVERRIDE); - createEAttribute(iOverrideEClass, IOVERRIDE__NAME); - iAttributeOverrideEClass = createEClass(IATTRIBUTE_OVERRIDE); - createEReference(iAttributeOverrideEClass, IATTRIBUTE_OVERRIDE__COLUMN); - iAssociationOverrideEClass = createEClass(IASSOCIATION_OVERRIDE); - createEReference(iAssociationOverrideEClass, IASSOCIATION_OVERRIDE__JOIN_COLUMNS); - createEReference(iAssociationOverrideEClass, IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS); - createEReference(iAssociationOverrideEClass, IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS); - iDiscriminatorColumnEClass = createEClass(IDISCRIMINATOR_COLUMN); - createEAttribute(iDiscriminatorColumnEClass, IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); - createEAttribute(iDiscriminatorColumnEClass, IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH); - createEAttribute(iDiscriminatorColumnEClass, IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH); - createEAttribute(iDiscriminatorColumnEClass, IDISCRIMINATOR_COLUMN__LENGTH); - iSecondaryTableEClass = createEClass(ISECONDARY_TABLE); - createEReference(iSecondaryTableEClass, ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS); - createEReference(iSecondaryTableEClass, ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS); - createEReference(iSecondaryTableEClass, ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS); - iPrimaryKeyJoinColumnEClass = createEClass(IPRIMARY_KEY_JOIN_COLUMN); - iGeneratorEClass = createEClass(IGENERATOR); - createEAttribute(iGeneratorEClass, IGENERATOR__NAME); - createEAttribute(iGeneratorEClass, IGENERATOR__INITIAL_VALUE); - createEAttribute(iGeneratorEClass, IGENERATOR__SPECIFIED_INITIAL_VALUE); - createEAttribute(iGeneratorEClass, IGENERATOR__DEFAULT_INITIAL_VALUE); - createEAttribute(iGeneratorEClass, IGENERATOR__ALLOCATION_SIZE); - createEAttribute(iGeneratorEClass, IGENERATOR__SPECIFIED_ALLOCATION_SIZE); - createEAttribute(iGeneratorEClass, IGENERATOR__DEFAULT_ALLOCATION_SIZE); - iTableGeneratorEClass = createEClass(ITABLE_GENERATOR); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__TABLE); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_TABLE); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_TABLE); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__CATALOG); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_CATALOG); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_CATALOG); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SCHEMA); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_SCHEMA); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_SCHEMA); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__PK_COLUMN_NAME); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__VALUE_COLUMN_NAME); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__PK_COLUMN_VALUE); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE); - createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE); - createEReference(iTableGeneratorEClass, ITABLE_GENERATOR__UNIQUE_CONSTRAINTS); - iSequenceGeneratorEClass = createEClass(ISEQUENCE_GENERATOR); - createEAttribute(iSequenceGeneratorEClass, ISEQUENCE_GENERATOR__SEQUENCE_NAME); - createEAttribute(iSequenceGeneratorEClass, ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME); - createEAttribute(iSequenceGeneratorEClass, ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME); - iGeneratedValueEClass = createEClass(IGENERATED_VALUE); - createEAttribute(iGeneratedValueEClass, IGENERATED_VALUE__STRATEGY); - createEAttribute(iGeneratedValueEClass, IGENERATED_VALUE__GENERATOR); - iQueryEClass = createEClass(IQUERY); - createEAttribute(iQueryEClass, IQUERY__NAME); - createEAttribute(iQueryEClass, IQUERY__QUERY); - createEReference(iQueryEClass, IQUERY__HINTS); - iNamedQueryEClass = createEClass(INAMED_QUERY); - iNamedNativeQueryEClass = createEClass(INAMED_NATIVE_QUERY); - createEAttribute(iNamedNativeQueryEClass, INAMED_NATIVE_QUERY__RESULT_CLASS); - createEAttribute(iNamedNativeQueryEClass, INAMED_NATIVE_QUERY__RESULT_SET_MAPPING); - iQueryHintEClass = createEClass(IQUERY_HINT); - createEAttribute(iQueryHintEClass, IQUERY_HINT__NAME); - createEAttribute(iQueryHintEClass, IQUERY_HINT__VALUE); - iCascadeEClass = createEClass(ICASCADE); - createEAttribute(iCascadeEClass, ICASCADE__ALL); - createEAttribute(iCascadeEClass, ICASCADE__PERSIST); - createEAttribute(iCascadeEClass, ICASCADE__MERGE); - createEAttribute(iCascadeEClass, ICASCADE__REMOVE); - createEAttribute(iCascadeEClass, ICASCADE__REFRESH); - // Create enums - defaultEagerFetchTypeEEnum = createEEnum(DEFAULT_EAGER_FETCH_TYPE); - defaultLazyFetchTypeEEnum = createEEnum(DEFAULT_LAZY_FETCH_TYPE); - defaultFalseBooleanEEnum = createEEnum(DEFAULT_FALSE_BOOLEAN); - defaultTrueBooleanEEnum = createEEnum(DEFAULT_TRUE_BOOLEAN); - temporalTypeEEnum = createEEnum(TEMPORAL_TYPE); - inheritanceTypeEEnum = createEEnum(INHERITANCE_TYPE); - discriminatorTypeEEnum = createEEnum(DISCRIMINATOR_TYPE); - generationTypeEEnum = createEEnum(GENERATION_TYPE); - enumTypeEEnum = createEEnum(ENUM_TYPE); - cascadeTypeEEnum = createEEnum(CASCADE_TYPE); - } - - /** - * - * - * @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. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) - return; - isInitialized = true; - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - // Obtain other dependent packages - JpaCorePackage theJpaCorePackage = (JpaCorePackage) EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI); - EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - // Create type parameters - // Set bounds for type parameters - // Add supertypes to classes - iMappedSuperclassEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping()); - iEntityEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping()); - iEmbeddableEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping()); - iTableEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iUniqueConstraintEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iNamedColumnEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iAbstractColumnEClass.getESuperTypes().add(this.getINamedColumn()); - iColumnEClass.getESuperTypes().add(this.getIAbstractColumn()); - iBasicEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iBasicEClass.getESuperTypes().add(this.getIColumnMapping()); - iIdEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iIdEClass.getESuperTypes().add(this.getIColumnMapping()); - iTransientEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iVersionEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iVersionEClass.getESuperTypes().add(this.getIColumnMapping()); - iEmbeddedIdEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iEmbeddedEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iRelationshipMappingEClass.getESuperTypes().add(theJpaCorePackage.getIAttributeMapping()); - iNonOwningMappingEClass.getESuperTypes().add(this.getIRelationshipMapping()); - iMultiRelationshipMappingEClass.getESuperTypes().add(this.getINonOwningMapping()); - iOneToManyEClass.getESuperTypes().add(this.getIMultiRelationshipMapping()); - iManyToManyEClass.getESuperTypes().add(this.getIMultiRelationshipMapping()); - iSingleRelationshipMappingEClass.getESuperTypes().add(this.getIRelationshipMapping()); - iManyToOneEClass.getESuperTypes().add(this.getISingleRelationshipMapping()); - iOneToOneEClass.getESuperTypes().add(this.getISingleRelationshipMapping()); - iOneToOneEClass.getESuperTypes().add(this.getINonOwningMapping()); - iJoinTableEClass.getESuperTypes().add(this.getITable()); - iAbstractJoinColumnEClass.getESuperTypes().add(this.getINamedColumn()); - iJoinColumnEClass.getESuperTypes().add(this.getIAbstractColumn()); - iJoinColumnEClass.getESuperTypes().add(this.getIAbstractJoinColumn()); - iOverrideEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iAttributeOverrideEClass.getESuperTypes().add(this.getIOverride()); - iAttributeOverrideEClass.getESuperTypes().add(this.getIColumnMapping()); - iAssociationOverrideEClass.getESuperTypes().add(this.getIOverride()); - iDiscriminatorColumnEClass.getESuperTypes().add(this.getINamedColumn()); - iSecondaryTableEClass.getESuperTypes().add(this.getITable()); - iPrimaryKeyJoinColumnEClass.getESuperTypes().add(this.getIAbstractJoinColumn()); - iGeneratorEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iTableGeneratorEClass.getESuperTypes().add(this.getIGenerator()); - iSequenceGeneratorEClass.getESuperTypes().add(this.getIGenerator()); - iGeneratedValueEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iQueryEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iNamedQueryEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iNamedQueryEClass.getESuperTypes().add(this.getIQuery()); - iNamedNativeQueryEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iNamedNativeQueryEClass.getESuperTypes().add(this.getIQuery()); - iQueryHintEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iCascadeEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - // Initialize classes and features; add operations and parameters - initEClass(iMappedSuperclassEClass, IMappedSuperclass.class, "IMappedSuperclass", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIMappedSuperclass_IdClass(), theEcorePackage.getEString(), "idClass", null, 0, 1, IMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iEntityEClass, IEntity.class, "IEntity", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIEntity_SpecifiedName(), ecorePackage.getEString(), "specifiedName", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIEntity_DefaultName(), ecorePackage.getEString(), "defaultName", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_Table(), this.getITable(), null, "table", null, 1, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_SpecifiedSecondaryTables(), this.getISecondaryTable(), null, "specifiedSecondaryTables", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_PrimaryKeyJoinColumns(), this.getIPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, IEntity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_SpecifiedPrimaryKeyJoinColumns(), this.getIPrimaryKeyJoinColumn(), null, "specifiedPrimaryKeyJoinColumns", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_DefaultPrimaryKeyJoinColumns(), this.getIPrimaryKeyJoinColumn(), null, "defaultPrimaryKeyJoinColumns", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIEntity_InheritanceStrategy(), this.getInheritanceType(), "inheritanceStrategy", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIEntity_DefaultDiscriminatorValue(), theEcorePackage.getEString(), "defaultDiscriminatorValue", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIEntity_SpecifiedDiscriminatorValue(), theEcorePackage.getEString(), "specifiedDiscriminatorValue", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIEntity_DiscriminatorValue(), theEcorePackage.getEString(), "discriminatorValue", null, 0, 1, IEntity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_DiscriminatorColumn(), this.getIDiscriminatorColumn(), null, "discriminatorColumn", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_SequenceGenerator(), this.getISequenceGenerator(), null, "sequenceGenerator", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_TableGenerator(), this.getITableGenerator(), null, "tableGenerator", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_AttributeOverrides(), this.getIAttributeOverride(), null, "attributeOverrides", null, 0, -1, IEntity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_SpecifiedAttributeOverrides(), this.getIAttributeOverride(), null, "specifiedAttributeOverrides", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_DefaultAttributeOverrides(), this.getIAttributeOverride(), null, "defaultAttributeOverrides", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_AssociationOverrides(), this.getIAssociationOverride(), null, "associationOverrides", null, 0, -1, IEntity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_SpecifiedAssociationOverrides(), this.getIAssociationOverride(), null, "specifiedAssociationOverrides", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_DefaultAssociationOverrides(), this.getIAssociationOverride(), null, "defaultAssociationOverrides", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_NamedQueries(), this.getINamedQuery(), null, "namedQueries", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEntity_NamedNativeQueries(), this.getINamedNativeQuery(), null, "namedNativeQueries", null, 0, -1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIEntity_IdClass(), theEcorePackage.getEString(), "idClass", null, 0, 1, IEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - addEOperation(iEntityEClass, ecorePackage.getEBoolean(), "discriminatorValueIsAllowed", 0, 1); - addEOperation(iEntityEClass, this.getISecondaryTable(), "getSecondaryTables", 0, -1); - addEOperation(iEntityEClass, this.getIEntity(), "parentEntity", 0, 1); - addEOperation(iEntityEClass, this.getIEntity(), "rootEntity", 0, 1); - initEClass(iEmbeddableEClass, IEmbeddable.class, "IEmbeddable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iTableEClass, ITable.class, "ITable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getITable_Name(), ecorePackage.getEString(), "name", null, 0, 1, ITable.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_SpecifiedName(), ecorePackage.getEString(), "specifiedName", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_DefaultName(), ecorePackage.getEString(), "defaultName", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_Catalog(), ecorePackage.getEString(), "catalog", null, 0, 1, ITable.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_SpecifiedCatalog(), ecorePackage.getEString(), "specifiedCatalog", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_DefaultCatalog(), ecorePackage.getEString(), "defaultCatalog", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_Schema(), ecorePackage.getEString(), "schema", null, 0, 1, ITable.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_SpecifiedSchema(), ecorePackage.getEString(), "specifiedSchema", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITable_DefaultSchema(), ecorePackage.getEString(), "defaultSchema", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getITable_UniqueConstraints(), this.getIUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iUniqueConstraintEClass, IUniqueConstraint.class, "IUniqueConstraint", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIUniqueConstraint_ColumnNames(), theEcorePackage.getEString(), "columnNames", null, 0, -1, IUniqueConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iNamedColumnEClass, INamedColumn.class, "INamedColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getINamedColumn_Name(), ecorePackage.getEString(), "name", null, 0, 1, INamedColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getINamedColumn_SpecifiedName(), ecorePackage.getEString(), "specifiedName", null, 0, 1, INamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getINamedColumn_DefaultName(), ecorePackage.getEString(), "defaultName", null, 0, 1, INamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getINamedColumn_ColumnDefinition(), ecorePackage.getEString(), "columnDefinition", null, 0, 1, INamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iAbstractColumnEClass, IAbstractColumn.class, "IAbstractColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIAbstractColumn_Unique(), this.getDefaultFalseBoolean(), "unique", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractColumn_Nullable(), this.getDefaultTrueBoolean(), "nullable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractColumn_Insertable(), this.getDefaultTrueBoolean(), "insertable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractColumn_Updatable(), this.getDefaultTrueBoolean(), "updatable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractColumn_Table(), ecorePackage.getEString(), "table", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractColumn_SpecifiedTable(), ecorePackage.getEString(), "specifiedTable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractColumn_DefaultTable(), ecorePackage.getEString(), "defaultTable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iColumnEClass, IColumn.class, "IColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIColumn_Length(), ecorePackage.getEInt(), "length", "255", 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIColumn_Precision(), ecorePackage.getEInt(), "precision", null, 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIColumn_Scale(), ecorePackage.getEInt(), "scale", null, 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iColumnMappingEClass, IColumnMapping.class, "IColumnMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iColumnMappingEClass, this.getIColumn(), "getColumn", 0, 1); - initEClass(iBasicEClass, IBasic.class, "IBasic", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIBasic_Fetch(), this.getDefaultEagerFetchType(), "fetch", null, 0, 1, IBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIBasic_Optional(), this.getDefaultTrueBoolean(), "optional", null, 0, 1, IBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIBasic_Column(), this.getIColumn(), null, "column", null, 1, 1, IBasic.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIBasic_Lob(), ecorePackage.getEBoolean(), "lob", null, 0, 1, IBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIBasic_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, IBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIBasic_Enumerated(), this.getEnumType(), "enumerated", null, 0, 1, IBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iIdEClass, IId.class, "IId", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIId_Column(), this.getIColumn(), null, "column", null, 1, 1, IId.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIId_GeneratedValue(), this.getIGeneratedValue(), null, "generatedValue", null, 0, 1, IId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIId_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, IId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIId_TableGenerator(), this.getITableGenerator(), null, "tableGenerator", null, 0, 1, IId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIId_SequenceGenerator(), this.getISequenceGenerator(), null, "sequenceGenerator", null, 0, 1, IId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iTransientEClass, ITransient.class, "ITransient", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iVersionEClass, IVersion.class, "IVersion", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIVersion_Column(), this.getIColumn(), null, "column", null, 1, 1, IVersion.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIVersion_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, IVersion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iEmbeddedIdEClass, IEmbeddedId.class, "IEmbeddedId", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iEmbeddedEClass, IEmbedded.class, "IEmbedded", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIEmbedded_AttributeOverrides(), this.getIAttributeOverride(), null, "attributeOverrides", null, 0, -1, IEmbedded.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEmbedded_SpecifiedAttributeOverrides(), this.getIAttributeOverride(), null, "specifiedAttributeOverrides", null, 0, -1, IEmbedded.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIEmbedded_DefaultAttributeOverrides(), this.getIAttributeOverride(), null, "defaultAttributeOverrides", null, 0, -1, IEmbedded.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - addEOperation(iEmbeddedEClass, this.getIEmbeddable(), "embeddable", 0, 1); - initEClass(iRelationshipMappingEClass, IRelationshipMapping.class, "IRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIRelationshipMapping_TargetEntity(), ecorePackage.getEString(), "targetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getIRelationshipMapping_SpecifiedTargetEntity(), ecorePackage.getEString(), "specifiedTargetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIRelationshipMapping_DefaultTargetEntity(), ecorePackage.getEString(), "defaultTargetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIRelationshipMapping_ResolvedTargetEntity(), this.getIEntity(), null, "resolvedTargetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIRelationshipMapping_Cascade(), this.getICascade(), null, "cascade", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iNonOwningMappingEClass, INonOwningMapping.class, "INonOwningMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getINonOwningMapping_MappedBy(), theEcorePackage.getEString(), "mappedBy", null, 0, 1, INonOwningMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iMultiRelationshipMappingEClass, IMultiRelationshipMapping.class, "IMultiRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIMultiRelationshipMapping_OrderBy(), theEcorePackage.getEString(), "orderBy", null, 0, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getIMultiRelationshipMapping_Fetch(), this.getDefaultLazyFetchType(), "fetch", null, 0, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIMultiRelationshipMapping_JoinTable(), this.getIJoinTable(), null, "joinTable", null, 1, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIMultiRelationshipMapping_MapKey(), theEcorePackage.getEString(), "mapKey", null, 0, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - addEOperation(iMultiRelationshipMappingEClass, ecorePackage.getEBoolean(), "isNoOrdering", 1, 1); - addEOperation(iMultiRelationshipMappingEClass, null, "setNoOrdering"); - addEOperation(iMultiRelationshipMappingEClass, theEcorePackage.getEBoolean(), "isOrderByPk", 1, 1); - addEOperation(iMultiRelationshipMappingEClass, null, "setOrderByPk"); - addEOperation(iMultiRelationshipMappingEClass, theEcorePackage.getEBoolean(), "isCustomOrdering", 1, 1); - initEClass(iOneToManyEClass, IOneToMany.class, "IOneToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iManyToManyEClass, IManyToMany.class, "IManyToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iSingleRelationshipMappingEClass, ISingleRelationshipMapping.class, "ISingleRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getISingleRelationshipMapping_Fetch(), this.getDefaultEagerFetchType(), "fetch", null, 0, 1, ISingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getISingleRelationshipMapping_JoinColumns(), this.getIJoinColumn(), null, "joinColumns", null, 0, -1, ISingleRelationshipMapping.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getISingleRelationshipMapping_SpecifiedJoinColumns(), this.getIJoinColumn(), null, "specifiedJoinColumns", null, 0, -1, ISingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getISingleRelationshipMapping_DefaultJoinColumns(), this.getIJoinColumn(), null, "defaultJoinColumns", null, 0, -1, ISingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getISingleRelationshipMapping_Optional(), this.getDefaultTrueBoolean(), "optional", null, 0, 1, ISingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iManyToOneEClass, IManyToOne.class, "IManyToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iOneToOneEClass, IOneToOne.class, "IOneToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iJoinTableEClass, IJoinTable.class, "IJoinTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIJoinTable_JoinColumns(), this.getIJoinColumn(), null, "joinColumns", null, 0, -1, IJoinTable.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIJoinTable_SpecifiedJoinColumns(), this.getIJoinColumn(), null, "specifiedJoinColumns", null, 0, -1, IJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIJoinTable_DefaultJoinColumns(), this.getIJoinColumn(), null, "defaultJoinColumns", null, 0, -1, IJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIJoinTable_InverseJoinColumns(), this.getIJoinColumn(), null, "inverseJoinColumns", null, 0, -1, IJoinTable.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIJoinTable_SpecifiedInverseJoinColumns(), this.getIJoinColumn(), null, "specifiedInverseJoinColumns", null, 0, -1, IJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIJoinTable_DefaultInverseJoinColumns(), this.getIJoinColumn(), null, "defaultInverseJoinColumns", null, 0, -1, IJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iAbstractJoinColumnEClass, IAbstractJoinColumn.class, "IAbstractJoinColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIAbstractJoinColumn_ReferencedColumnName(), ecorePackage.getEString(), "referencedColumnName", null, 0, 1, IAbstractJoinColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractJoinColumn_SpecifiedReferencedColumnName(), ecorePackage.getEString(), "specifiedReferencedColumnName", null, 0, 1, IAbstractJoinColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIAbstractJoinColumn_DefaultReferencedColumnName(), ecorePackage.getEString(), "defaultReferencedColumnName", null, 0, 1, IAbstractJoinColumn.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iJoinColumnEClass, IJoinColumn.class, "IJoinColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iOverrideEClass, IOverride.class, "IOverride", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIOverride_Name(), theEcorePackage.getEString(), "name", null, 0, 1, IOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iAttributeOverrideEClass, IAttributeOverride.class, "IAttributeOverride", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIAttributeOverride_Column(), this.getIColumn(), null, "column", null, 1, 1, IAttributeOverride.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iAssociationOverrideEClass, IAssociationOverride.class, "IAssociationOverride", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getIAssociationOverride_JoinColumns(), this.getIJoinColumn(), null, "joinColumns", null, 0, -1, IAssociationOverride.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIAssociationOverride_SpecifiedJoinColumns(), this.getIJoinColumn(), null, "specifiedJoinColumns", null, 0, -1, IAssociationOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIAssociationOverride_DefaultJoinColumns(), this.getIJoinColumn(), null, "defaultJoinColumns", null, 0, -1, IAssociationOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iDiscriminatorColumnEClass, IDiscriminatorColumn.class, "IDiscriminatorColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIDiscriminatorColumn_DiscriminatorType(), this.getDiscriminatorType(), "discriminatorType", null, 0, 1, IDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIDiscriminatorColumn_DefaultLength(), theEcorePackage.getEInt(), "defaultLength", "31", 0, 1, IDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIDiscriminatorColumn_SpecifiedLength(), theEcorePackage.getEInt(), "specifiedLength", "-1", 0, 1, IDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIDiscriminatorColumn_Length(), theEcorePackage.getEInt(), "length", null, 0, 1, IDiscriminatorColumn.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEClass(iSecondaryTableEClass, ISecondaryTable.class, "ISecondaryTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getISecondaryTable_PrimaryKeyJoinColumns(), this.getIPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, ISecondaryTable.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getISecondaryTable_SpecifiedPrimaryKeyJoinColumns(), this.getIPrimaryKeyJoinColumn(), null, "specifiedPrimaryKeyJoinColumns", null, 0, -1, ISecondaryTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getISecondaryTable_DefaultPrimaryKeyJoinColumns(), this.getIPrimaryKeyJoinColumn(), null, "defaultPrimaryKeyJoinColumns", null, 0, -1, ISecondaryTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - addEOperation(iSecondaryTableEClass, theJpaCorePackage.getITypeMapping(), "typeMapping", 0, 1); - initEClass(iPrimaryKeyJoinColumnEClass, IPrimaryKeyJoinColumn.class, "IPrimaryKeyJoinColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iGeneratorEClass, IGenerator.class, "IGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIGenerator_Name(), ecorePackage.getEString(), "name", null, 0, 1, IGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIGenerator_InitialValue(), theEcorePackage.getEInt(), "initialValue", null, 0, 1, IGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getIGenerator_SpecifiedInitialValue(), theEcorePackage.getEInt(), "specifiedInitialValue", "-1", 0, 1, IGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIGenerator_DefaultInitialValue(), theEcorePackage.getEInt(), "defaultInitialValue", null, 0, 1, IGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIGenerator_AllocationSize(), theEcorePackage.getEInt(), "allocationSize", null, 0, 1, IGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getIGenerator_SpecifiedAllocationSize(), theEcorePackage.getEInt(), "specifiedAllocationSize", "-1", 0, 1, IGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIGenerator_DefaultAllocationSize(), theEcorePackage.getEInt(), "defaultAllocationSize", null, 0, 1, IGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iTableGeneratorEClass, ITableGenerator.class, "ITableGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getITableGenerator_Table(), ecorePackage.getEString(), "table", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_SpecifiedTable(), ecorePackage.getEString(), "specifiedTable", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_DefaultTable(), ecorePackage.getEString(), "defaultTable", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_Catalog(), ecorePackage.getEString(), "catalog", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_SpecifiedCatalog(), ecorePackage.getEString(), "specifiedCatalog", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_DefaultCatalog(), ecorePackage.getEString(), "defaultCatalog", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_Schema(), ecorePackage.getEString(), "schema", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_SpecifiedSchema(), ecorePackage.getEString(), "specifiedSchema", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_DefaultSchema(), ecorePackage.getEString(), "defaultSchema", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_PkColumnName(), ecorePackage.getEString(), "pkColumnName", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_SpecifiedPkColumnName(), ecorePackage.getEString(), "specifiedPkColumnName", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_DefaultPkColumnName(), ecorePackage.getEString(), "defaultPkColumnName", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_ValueColumnName(), ecorePackage.getEString(), "valueColumnName", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_SpecifiedValueColumnName(), ecorePackage.getEString(), "specifiedValueColumnName", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_DefaultValueColumnName(), ecorePackage.getEString(), "defaultValueColumnName", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_PkColumnValue(), ecorePackage.getEString(), "pkColumnValue", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_SpecifiedPkColumnValue(), ecorePackage.getEString(), "specifiedPkColumnValue", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getITableGenerator_DefaultPkColumnValue(), ecorePackage.getEString(), "defaultPkColumnValue", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getITableGenerator_UniqueConstraints(), this.getIUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iSequenceGeneratorEClass, ISequenceGenerator.class, "ISequenceGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getISequenceGenerator_SequenceName(), ecorePackage.getEString(), "sequenceName", null, 0, 1, ISequenceGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getISequenceGenerator_SpecifiedSequenceName(), ecorePackage.getEString(), "specifiedSequenceName", null, 0, 1, ISequenceGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getISequenceGenerator_DefaultSequenceName(), ecorePackage.getEString(), "defaultSequenceName", null, 0, 1, ISequenceGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iGeneratedValueEClass, IGeneratedValue.class, "IGeneratedValue", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIGeneratedValue_Strategy(), this.getGenerationType(), "strategy", null, 0, 1, IGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIGeneratedValue_Generator(), theEcorePackage.getEString(), "generator", null, 0, 1, IGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iQueryEClass, IQuery.class, "IQuery", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIQuery_Name(), theEcorePackage.getEString(), "name", null, 0, 1, IQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIQuery_Query(), theEcorePackage.getEString(), "query", null, 0, 1, IQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIQuery_Hints(), this.getIQueryHint(), null, "hints", null, 0, -1, IQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iNamedQueryEClass, INamedQuery.class, "INamedQuery", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(iNamedNativeQueryEClass, INamedNativeQuery.class, "INamedNativeQuery", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getINamedNativeQuery_ResultClass(), theEcorePackage.getEString(), "resultClass", null, 0, 1, INamedNativeQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getINamedNativeQuery_ResultSetMapping(), theEcorePackage.getEString(), "resultSetMapping", null, 0, 1, INamedNativeQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iQueryHintEClass, IQueryHint.class, "IQueryHint", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIQueryHint_Name(), theEcorePackage.getEString(), "name", null, 0, 1, IQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIQueryHint_Value(), theEcorePackage.getEString(), "value", null, 0, 1, IQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iCascadeEClass, ICascade.class, "ICascade", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getICascade_All(), theEcorePackage.getEBoolean(), "all", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getICascade_Persist(), theEcorePackage.getEBoolean(), "persist", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getICascade_Merge(), theEcorePackage.getEBoolean(), "merge", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getICascade_Remove(), theEcorePackage.getEBoolean(), "remove", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getICascade_Refresh(), theEcorePackage.getEBoolean(), "refresh", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - // Initialize enums and add enum literals - initEEnum(defaultEagerFetchTypeEEnum, DefaultEagerFetchType.class, "DefaultEagerFetchType"); - addEEnumLiteral(defaultEagerFetchTypeEEnum, DefaultEagerFetchType.DEFAULT); - addEEnumLiteral(defaultEagerFetchTypeEEnum, DefaultEagerFetchType.EAGER); - addEEnumLiteral(defaultEagerFetchTypeEEnum, DefaultEagerFetchType.LAZY); - initEEnum(defaultLazyFetchTypeEEnum, DefaultLazyFetchType.class, "DefaultLazyFetchType"); - addEEnumLiteral(defaultLazyFetchTypeEEnum, DefaultLazyFetchType.DEFAULT); - addEEnumLiteral(defaultLazyFetchTypeEEnum, DefaultLazyFetchType.LAZY); - addEEnumLiteral(defaultLazyFetchTypeEEnum, DefaultLazyFetchType.EAGER); - initEEnum(defaultFalseBooleanEEnum, DefaultFalseBoolean.class, "DefaultFalseBoolean"); - addEEnumLiteral(defaultFalseBooleanEEnum, DefaultFalseBoolean.DEFAULT); - addEEnumLiteral(defaultFalseBooleanEEnum, DefaultFalseBoolean.FALSE); - addEEnumLiteral(defaultFalseBooleanEEnum, DefaultFalseBoolean.TRUE); - initEEnum(defaultTrueBooleanEEnum, DefaultTrueBoolean.class, "DefaultTrueBoolean"); - addEEnumLiteral(defaultTrueBooleanEEnum, DefaultTrueBoolean.DEFAULT); - addEEnumLiteral(defaultTrueBooleanEEnum, DefaultTrueBoolean.TRUE); - addEEnumLiteral(defaultTrueBooleanEEnum, DefaultTrueBoolean.FALSE); - initEEnum(temporalTypeEEnum, TemporalType.class, "TemporalType"); - addEEnumLiteral(temporalTypeEEnum, TemporalType.NULL); - addEEnumLiteral(temporalTypeEEnum, TemporalType.DATE); - addEEnumLiteral(temporalTypeEEnum, TemporalType.TIME); - addEEnumLiteral(temporalTypeEEnum, TemporalType.TIMESTAMP); - initEEnum(inheritanceTypeEEnum, InheritanceType.class, "InheritanceType"); - addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.DEFAULT); - addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.SINGLE_TABLE); - addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.JOINED); - addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.TABLE_PER_CLASS); - initEEnum(discriminatorTypeEEnum, DiscriminatorType.class, "DiscriminatorType"); - addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.DEFAULT); - addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.STRING); - addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.CHAR); - addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.INTEGER); - initEEnum(generationTypeEEnum, GenerationType.class, "GenerationType"); - addEEnumLiteral(generationTypeEEnum, GenerationType.DEFAULT); - addEEnumLiteral(generationTypeEEnum, GenerationType.AUTO); - addEEnumLiteral(generationTypeEEnum, GenerationType.IDENTITY); - addEEnumLiteral(generationTypeEEnum, GenerationType.SEQUENCE); - addEEnumLiteral(generationTypeEEnum, GenerationType.TABLE); - initEEnum(enumTypeEEnum, EnumType.class, "EnumType"); - addEEnumLiteral(enumTypeEEnum, EnumType.DEFAULT); - addEEnumLiteral(enumTypeEEnum, EnumType.ORDINAL); - addEEnumLiteral(enumTypeEEnum, EnumType.STRING); - initEEnum(cascadeTypeEEnum, CascadeType.class, "CascadeType"); - addEEnumLiteral(cascadeTypeEEnum, CascadeType.ALL); - addEEnumLiteral(cascadeTypeEEnum, CascadeType.PERSIST); - addEEnumLiteral(cascadeTypeEEnum, CascadeType.MERGE); - addEEnumLiteral(cascadeTypeEEnum, CascadeType.REMOVE); - addEEnumLiteral(cascadeTypeEEnum, CascadeType.REFRESH); - } - - - /** - * - * Defines literals for the meta objects that represent - *

      - *
    • each class,
    • - *
    • each feature of each class,
    • - *
    • each enum,
    • - *
    • and each data type
    • - *
    - * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass IMapped Superclass}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMappedSuperclass() - * @generated - */ - public static final EClass IMAPPED_SUPERCLASS = eINSTANCE.getIMappedSuperclass(); - - /** - * The meta object literal for the 'Id Class' attribute feature. - * - * - * @generated - */ - public static final EAttribute IMAPPED_SUPERCLASS__ID_CLASS = eINSTANCE.getIMappedSuperclass_IdClass(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IEntity IEntity}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEntity - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEntity() - * @generated - */ - public static final EClass IENTITY = eINSTANCE.getIEntity(); - - /** - * The meta object literal for the 'Specified Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__SPECIFIED_NAME = eINSTANCE.getIEntity_SpecifiedName(); - - /** - * The meta object literal for the 'Default Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__DEFAULT_NAME = eINSTANCE.getIEntity_DefaultName(); - - /** - * The meta object literal for the 'Table' containment reference feature. - * - * - * @generated - */ - public static final EReference IENTITY__TABLE = eINSTANCE.getIEntity_Table(); - - /** - * The meta object literal for the 'Specified Secondary Tables' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__SPECIFIED_SECONDARY_TABLES = eINSTANCE.getIEntity_SpecifiedSecondaryTables(); - - /** - * The meta object literal for the 'Inheritance Strategy' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__INHERITANCE_STRATEGY = eINSTANCE.getIEntity_InheritanceStrategy(); - - /** - * The meta object literal for the 'Discriminator Column' containment reference feature. - * - * - * @generated - */ - public static final EReference IENTITY__DISCRIMINATOR_COLUMN = eINSTANCE.getIEntity_DiscriminatorColumn(); - - /** - * The meta object literal for the 'Sequence Generator' containment reference feature. - * - * - * @generated - */ - public static final EReference IENTITY__SEQUENCE_GENERATOR = eINSTANCE.getIEntity_SequenceGenerator(); - - /** - * The meta object literal for the 'Table Generator' containment reference feature. - * - * - * @generated - */ - public static final EReference IENTITY__TABLE_GENERATOR = eINSTANCE.getIEntity_TableGenerator(); - - /** - * The meta object literal for the 'Default Discriminator Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__DEFAULT_DISCRIMINATOR_VALUE = eINSTANCE.getIEntity_DefaultDiscriminatorValue(); - - /** - * The meta object literal for the 'Specified Discriminator Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__SPECIFIED_DISCRIMINATOR_VALUE = eINSTANCE.getIEntity_SpecifiedDiscriminatorValue(); - - /** - * The meta object literal for the 'Discriminator Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__DISCRIMINATOR_VALUE = eINSTANCE.getIEntity_DiscriminatorValue(); - - /** - * The meta object literal for the 'Primary Key Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getIEntity_PrimaryKeyJoinColumns(); - - /** - * The meta object literal for the 'Specified Primary Key Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getIEntity_SpecifiedPrimaryKeyJoinColumns(); - - /** - * The meta object literal for the 'Default Primary Key Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getIEntity_DefaultPrimaryKeyJoinColumns(); - - /** - * The meta object literal for the 'Attribute Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__ATTRIBUTE_OVERRIDES = eINSTANCE.getIEntity_AttributeOverrides(); - - /** - * The meta object literal for the 'Specified Attribute Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES = eINSTANCE.getIEntity_SpecifiedAttributeOverrides(); - - /** - * The meta object literal for the 'Default Attribute Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES = eINSTANCE.getIEntity_DefaultAttributeOverrides(); - - /** - * The meta object literal for the 'Association Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__ASSOCIATION_OVERRIDES = eINSTANCE.getIEntity_AssociationOverrides(); - - /** - * The meta object literal for the 'Specified Association Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES = eINSTANCE.getIEntity_SpecifiedAssociationOverrides(); - - /** - * The meta object literal for the 'Default Association Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__DEFAULT_ASSOCIATION_OVERRIDES = eINSTANCE.getIEntity_DefaultAssociationOverrides(); - - /** - * The meta object literal for the 'Named Queries' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__NAMED_QUERIES = eINSTANCE.getIEntity_NamedQueries(); - - /** - * The meta object literal for the 'Named Native Queries' containment reference list feature. - * - * - * @generated - */ - public static final EReference IENTITY__NAMED_NATIVE_QUERIES = eINSTANCE.getIEntity_NamedNativeQueries(); - - /** - * The meta object literal for the 'Id Class' attribute feature. - * - * - * @generated - */ - public static final EAttribute IENTITY__ID_CLASS = eINSTANCE.getIEntity_IdClass(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddable IEmbeddable}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddable() - * @generated - */ - public static final EClass IEMBEDDABLE = eINSTANCE.getIEmbeddable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ITable ITable}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ITable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable() - * @generated - */ - public static final EClass ITABLE = eINSTANCE.getITable(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__NAME = eINSTANCE.getITable_Name(); - - /** - * The meta object literal for the 'Specified Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__SPECIFIED_NAME = eINSTANCE.getITable_SpecifiedName(); - - /** - * The meta object literal for the 'Default Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__DEFAULT_NAME = eINSTANCE.getITable_DefaultName(); - - /** - * The meta object literal for the 'Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__CATALOG = eINSTANCE.getITable_Catalog(); - - /** - * The meta object literal for the 'Specified Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__SPECIFIED_CATALOG = eINSTANCE.getITable_SpecifiedCatalog(); - - /** - * The meta object literal for the 'Default Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__DEFAULT_CATALOG = eINSTANCE.getITable_DefaultCatalog(); - - /** - * The meta object literal for the 'Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__SCHEMA = eINSTANCE.getITable_Schema(); - - /** - * The meta object literal for the 'Specified Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__SPECIFIED_SCHEMA = eINSTANCE.getITable_SpecifiedSchema(); - - /** - * The meta object literal for the 'Default Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE__DEFAULT_SCHEMA = eINSTANCE.getITable_DefaultSchema(); - - /** - * The meta object literal for the 'Unique Constraints' containment reference list feature. - * - * - * @generated - */ - public static final EReference ITABLE__UNIQUE_CONSTRAINTS = eINSTANCE.getITable_UniqueConstraints(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint IUnique Constraint}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint() - * @generated - */ - public static final EClass IUNIQUE_CONSTRAINT = eINSTANCE.getIUniqueConstraint(); - - /** - * The meta object literal for the 'Column Names' attribute list feature. - * - * - * @generated - */ - public static final EAttribute IUNIQUE_CONSTRAINT__COLUMN_NAMES = eINSTANCE.getIUniqueConstraint_ColumnNames(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn INamed Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn() - * @generated - */ - public static final EClass INAMED_COLUMN = eINSTANCE.getINamedColumn(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute INAMED_COLUMN__NAME = eINSTANCE.getINamedColumn_Name(); - - /** - * The meta object literal for the 'Specified Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute INAMED_COLUMN__SPECIFIED_NAME = eINSTANCE.getINamedColumn_SpecifiedName(); - - /** - * The meta object literal for the 'Default Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute INAMED_COLUMN__DEFAULT_NAME = eINSTANCE.getINamedColumn_DefaultName(); - - /** - * The meta object literal for the 'Column Definition' attribute feature. - * - * - * @generated - */ - public static final EAttribute INAMED_COLUMN__COLUMN_DEFINITION = eINSTANCE.getINamedColumn_ColumnDefinition(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn IAbstract Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn() - * @generated - */ - public static final EClass IABSTRACT_COLUMN = eINSTANCE.getIAbstractColumn(); - - /** - * The meta object literal for the 'Unique' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__UNIQUE = eINSTANCE.getIAbstractColumn_Unique(); - - /** - * The meta object literal for the 'Nullable' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__NULLABLE = eINSTANCE.getIAbstractColumn_Nullable(); - - /** - * The meta object literal for the 'Insertable' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__INSERTABLE = eINSTANCE.getIAbstractColumn_Insertable(); - - /** - * The meta object literal for the 'Updatable' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__UPDATABLE = eINSTANCE.getIAbstractColumn_Updatable(); - - /** - * The meta object literal for the 'Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__TABLE = eINSTANCE.getIAbstractColumn_Table(); - - /** - * The meta object literal for the 'Specified Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__SPECIFIED_TABLE = eINSTANCE.getIAbstractColumn_SpecifiedTable(); - - /** - * The meta object literal for the 'Default Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_COLUMN__DEFAULT_TABLE = eINSTANCE.getIAbstractColumn_DefaultTable(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IColumn IColumn}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn() - * @generated - */ - public static final EClass ICOLUMN = eINSTANCE.getIColumn(); - - /** - * The meta object literal for the 'Length' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICOLUMN__LENGTH = eINSTANCE.getIColumn_Length(); - - /** - * The meta object literal for the 'Precision' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICOLUMN__PRECISION = eINSTANCE.getIColumn_Precision(); - - /** - * The meta object literal for the 'Scale' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICOLUMN__SCALE = eINSTANCE.getIColumn_Scale(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping IColumn Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IColumnMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumnMapping() - * @generated - */ - public static final EClass ICOLUMN_MAPPING = eINSTANCE.getIColumnMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IBasic IBasic}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IBasic - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic() - * @generated - */ - public static final EClass IBASIC = eINSTANCE.getIBasic(); - - /** - * The meta object literal for the 'Fetch' attribute feature. - * - * - * @generated - */ - public static final EAttribute IBASIC__FETCH = eINSTANCE.getIBasic_Fetch(); - - /** - * The meta object literal for the 'Optional' attribute feature. - * - * - * @generated - */ - public static final EAttribute IBASIC__OPTIONAL = eINSTANCE.getIBasic_Optional(); - - /** - * The meta object literal for the 'Column' containment reference feature. - * - * - * @generated - */ - public static final EReference IBASIC__COLUMN = eINSTANCE.getIBasic_Column(); - - /** - * The meta object literal for the 'Lob' attribute feature. - * - * - * @generated - */ - public static final EAttribute IBASIC__LOB = eINSTANCE.getIBasic_Lob(); - - /** - * The meta object literal for the 'Temporal' attribute feature. - * - * - * @generated - */ - public static final EAttribute IBASIC__TEMPORAL = eINSTANCE.getIBasic_Temporal(); - - /** - * The meta object literal for the 'Enumerated' attribute feature. - * - * - * @generated - */ - public static final EAttribute IBASIC__ENUMERATED = eINSTANCE.getIBasic_Enumerated(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IId IId}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IId - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId() - * @generated - */ - public static final EClass IID = eINSTANCE.getIId(); - - /** - * The meta object literal for the 'Column' containment reference feature. - * - * - * @generated - */ - public static final EReference IID__COLUMN = eINSTANCE.getIId_Column(); - - /** - * The meta object literal for the 'Generated Value' containment reference feature. - * - * - * @generated - */ - public static final EReference IID__GENERATED_VALUE = eINSTANCE.getIId_GeneratedValue(); - - /** - * The meta object literal for the 'Temporal' attribute feature. - * - * - * @generated - */ - public static final EAttribute IID__TEMPORAL = eINSTANCE.getIId_Temporal(); - - /** - * The meta object literal for the 'Table Generator' containment reference feature. - * - * - * @generated - */ - public static final EReference IID__TABLE_GENERATOR = eINSTANCE.getIId_TableGenerator(); - - /** - * The meta object literal for the 'Sequence Generator' containment reference feature. - * - * - * @generated - */ - public static final EReference IID__SEQUENCE_GENERATOR = eINSTANCE.getIId_SequenceGenerator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ITransient ITransient}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ITransient - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITransient() - * @generated - */ - public static final EClass ITRANSIENT = eINSTANCE.getITransient(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IVersion IVersion}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IVersion - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIVersion() - * @generated - */ - public static final EClass IVERSION = eINSTANCE.getIVersion(); - - /** - * The meta object literal for the 'Column' containment reference feature. - * - * - * @generated - */ - public static final EReference IVERSION__COLUMN = eINSTANCE.getIVersion_Column(); - - /** - * The meta object literal for the 'Temporal' attribute feature. - * - * - * @generated - */ - public static final EAttribute IVERSION__TEMPORAL = eINSTANCE.getIVersion_Temporal(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddedId IEmbedded Id}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddedId - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddedId() - * @generated - */ - public static final EClass IEMBEDDED_ID = eINSTANCE.getIEmbeddedId(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded IEmbedded}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded() - * @generated - */ - public static final EClass IEMBEDDED = eINSTANCE.getIEmbedded(); - - /** - * The meta object literal for the 'Attribute Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IEMBEDDED__ATTRIBUTE_OVERRIDES = eINSTANCE.getIEmbedded_AttributeOverrides(); - - /** - * The meta object literal for the 'Specified Attribute Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES = eINSTANCE.getIEmbedded_SpecifiedAttributeOverrides(); - - /** - * The meta object literal for the 'Default Attribute Overrides' containment reference list feature. - * - * - * @generated - */ - public static final EReference IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES = eINSTANCE.getIEmbedded_DefaultAttributeOverrides(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping IRelationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping() - * @generated - */ - public static final EClass IRELATIONSHIP_MAPPING = eINSTANCE.getIRelationshipMapping(); - - /** - * The meta object literal for the 'Target Entity' attribute feature. - * - * - * @generated - */ - public static final EAttribute IRELATIONSHIP_MAPPING__TARGET_ENTITY = eINSTANCE.getIRelationshipMapping_TargetEntity(); - - /** - * The meta object literal for the 'Specified Target Entity' attribute feature. - * - * - * @generated - */ - public static final EAttribute IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY = eINSTANCE.getIRelationshipMapping_SpecifiedTargetEntity(); - - /** - * The meta object literal for the 'Default Target Entity' attribute feature. - * - * - * @generated - */ - public static final EAttribute IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY = eINSTANCE.getIRelationshipMapping_DefaultTargetEntity(); - - /** - * The meta object literal for the 'Resolved Target Entity' reference feature. - * - * - * @generated - */ - public static final EReference IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = eINSTANCE.getIRelationshipMapping_ResolvedTargetEntity(); - - /** - * The meta object literal for the 'Cascade' containment reference feature. - * - * - * @generated - */ - public static final EReference IRELATIONSHIP_MAPPING__CASCADE = eINSTANCE.getIRelationshipMapping_Cascade(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping INon Owning Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINonOwningMapping() - * @generated - */ - public static final EClass INON_OWNING_MAPPING = eINSTANCE.getINonOwningMapping(); - - /** - * The meta object literal for the 'Mapped By' attribute feature. - * - * - * @generated - */ - public static final EAttribute INON_OWNING_MAPPING__MAPPED_BY = eINSTANCE.getINonOwningMapping_MappedBy(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping IMulti Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping() - * @generated - */ - public static final EClass IMULTI_RELATIONSHIP_MAPPING = eINSTANCE.getIMultiRelationshipMapping(); - - /** - * The meta object literal for the 'Order By' attribute feature. - * - * - * @generated - */ - public static final EAttribute IMULTI_RELATIONSHIP_MAPPING__ORDER_BY = eINSTANCE.getIMultiRelationshipMapping_OrderBy(); - - /** - * The meta object literal for the 'Fetch' attribute feature. - * - * - * @generated - */ - public static final EAttribute IMULTI_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getIMultiRelationshipMapping_Fetch(); - - /** - * The meta object literal for the 'Join Table' containment reference feature. - * - * - * @generated - */ - public static final EReference IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = eINSTANCE.getIMultiRelationshipMapping_JoinTable(); - - /** - * The meta object literal for the 'Map Key' attribute feature. - * - * - * @generated - */ - public static final EAttribute IMULTI_RELATIONSHIP_MAPPING__MAP_KEY = eINSTANCE.getIMultiRelationshipMapping_MapKey(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IOneToMany IOne To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IOneToMany - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToMany() - * @generated - */ - public static final EClass IONE_TO_MANY = eINSTANCE.getIOneToMany(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IManyToMany IMany To Many}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IManyToMany - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToMany() - * @generated - */ - public static final EClass IMANY_TO_MANY = eINSTANCE.getIManyToMany(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping ISingle Relationship Mapping}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping() - * @generated - */ - public static final EClass ISINGLE_RELATIONSHIP_MAPPING = eINSTANCE.getISingleRelationshipMapping(); - - /** - * The meta object literal for the 'Fetch' attribute feature. - * - * - * @generated - */ - public static final EAttribute ISINGLE_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getISingleRelationshipMapping_Fetch(); - - /** - * The meta object literal for the 'Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference ISINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = eINSTANCE.getISingleRelationshipMapping_JoinColumns(); - - /** - * The meta object literal for the 'Specified Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS = eINSTANCE.getISingleRelationshipMapping_SpecifiedJoinColumns(); - - /** - * The meta object literal for the 'Default Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference ISINGLE_RELATIONSHIP_MAPPING__DEFAULT_JOIN_COLUMNS = eINSTANCE.getISingleRelationshipMapping_DefaultJoinColumns(); - - /** - * The meta object literal for the 'Optional' attribute feature. - * - * - * @generated - */ - public static final EAttribute ISINGLE_RELATIONSHIP_MAPPING__OPTIONAL = eINSTANCE.getISingleRelationshipMapping_Optional(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IManyToOne IMany To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IManyToOne - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToOne() - * @generated - */ - public static final EClass IMANY_TO_ONE = eINSTANCE.getIManyToOne(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IOneToOne IOne To One}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IOneToOne - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToOne() - * @generated - */ - public static final EClass IONE_TO_ONE = eINSTANCE.getIOneToOne(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable IJoin Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable() - * @generated - */ - public static final EClass IJOIN_TABLE = eINSTANCE.getIJoinTable(); - - /** - * The meta object literal for the 'Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IJOIN_TABLE__JOIN_COLUMNS = eINSTANCE.getIJoinTable_JoinColumns(); - - /** - * The meta object literal for the 'Specified Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS = eINSTANCE.getIJoinTable_SpecifiedJoinColumns(); - - /** - * The meta object literal for the 'Default Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IJOIN_TABLE__DEFAULT_JOIN_COLUMNS = eINSTANCE.getIJoinTable_DefaultJoinColumns(); - - /** - * The meta object literal for the 'Inverse Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IJOIN_TABLE__INVERSE_JOIN_COLUMNS = eINSTANCE.getIJoinTable_InverseJoinColumns(); - - /** - * The meta object literal for the 'Specified Inverse Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS = eINSTANCE.getIJoinTable_SpecifiedInverseJoinColumns(); - - /** - * The meta object literal for the 'Default Inverse Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IJOIN_TABLE__DEFAULT_INVERSE_JOIN_COLUMNS = eINSTANCE.getIJoinTable_DefaultInverseJoinColumns(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn IAbstract Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn() - * @generated - */ - public static final EClass IABSTRACT_JOIN_COLUMN = eINSTANCE.getIAbstractJoinColumn(); - - /** - * The meta object literal for the 'Referenced Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_JOIN_COLUMN__REFERENCED_COLUMN_NAME = eINSTANCE.getIAbstractJoinColumn_ReferencedColumnName(); - - /** - * The meta object literal for the 'Specified Referenced Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME = eINSTANCE.getIAbstractJoinColumn_SpecifiedReferencedColumnName(); - - /** - * The meta object literal for the 'Default Referenced Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME = eINSTANCE.getIAbstractJoinColumn_DefaultReferencedColumnName(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IJoinColumn IJoin Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IJoinColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinColumn() - * @generated - */ - public static final EClass IJOIN_COLUMN = eINSTANCE.getIJoinColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IOverride IOverride}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IOverride - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOverride() - * @generated - */ - public static final EClass IOVERRIDE = eINSTANCE.getIOverride(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IOVERRIDE__NAME = eINSTANCE.getIOverride_Name(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride IAttribute Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAttributeOverride() - * @generated - */ - public static final EClass IATTRIBUTE_OVERRIDE = eINSTANCE.getIAttributeOverride(); - - /** - * The meta object literal for the 'Column' containment reference feature. - * - * - * @generated - */ - public static final EReference IATTRIBUTE_OVERRIDE__COLUMN = eINSTANCE.getIAttributeOverride_Column(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride IAssociation Override}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride() - * @generated - */ - public static final EClass IASSOCIATION_OVERRIDE = eINSTANCE.getIAssociationOverride(); - - /** - * The meta object literal for the 'Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IASSOCIATION_OVERRIDE__JOIN_COLUMNS = eINSTANCE.getIAssociationOverride_JoinColumns(); - - /** - * The meta object literal for the 'Specified Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS = eINSTANCE.getIAssociationOverride_SpecifiedJoinColumns(); - - /** - * The meta object literal for the 'Default Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference IASSOCIATION_OVERRIDE__DEFAULT_JOIN_COLUMNS = eINSTANCE.getIAssociationOverride_DefaultJoinColumns(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn IDiscriminator Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn() - * @generated - */ - public static final EClass IDISCRIMINATOR_COLUMN = eINSTANCE.getIDiscriminatorColumn(); - - /** - * The meta object literal for the 'Discriminator Type' attribute feature. - * - * - * @generated - */ - public static final EAttribute IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = eINSTANCE.getIDiscriminatorColumn_DiscriminatorType(); - - /** - * The meta object literal for the 'Default Length' attribute feature. - * - * - * @generated - */ - public static final EAttribute IDISCRIMINATOR_COLUMN__DEFAULT_LENGTH = eINSTANCE.getIDiscriminatorColumn_DefaultLength(); - - /** - * The meta object literal for the 'Specified Length' attribute feature. - * - * - * @generated - */ - public static final EAttribute IDISCRIMINATOR_COLUMN__SPECIFIED_LENGTH = eINSTANCE.getIDiscriminatorColumn_SpecifiedLength(); - - /** - * The meta object literal for the 'Length' attribute feature. - * - * - * @generated - */ - public static final EAttribute IDISCRIMINATOR_COLUMN__LENGTH = eINSTANCE.getIDiscriminatorColumn_Length(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable ISecondary Table}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable() - * @generated - */ - public static final EClass ISECONDARY_TABLE = eINSTANCE.getISecondaryTable(); - - /** - * The meta object literal for the 'Primary Key Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference ISECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getISecondaryTable_PrimaryKeyJoinColumns(); - - /** - * The meta object literal for the 'Specified Primary Key Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getISecondaryTable_SpecifiedPrimaryKeyJoinColumns(); - - /** - * The meta object literal for the 'Default Primary Key Join Columns' containment reference list feature. - * - * - * @generated - */ - public static final EReference ISECONDARY_TABLE__DEFAULT_PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getISecondaryTable_DefaultPrimaryKeyJoinColumns(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn IPrimary Key Join Column}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIPrimaryKeyJoinColumn() - * @generated - */ - public static final EClass IPRIMARY_KEY_JOIN_COLUMN = eINSTANCE.getIPrimaryKeyJoinColumn(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IGenerator IGenerator}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IGenerator - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator() - * @generated - */ - public static final EClass IGENERATOR = eINSTANCE.getIGenerator(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__NAME = eINSTANCE.getIGenerator_Name(); - - /** - * The meta object literal for the 'Initial Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__INITIAL_VALUE = eINSTANCE.getIGenerator_InitialValue(); - - /** - * The meta object literal for the 'Specified Initial Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__SPECIFIED_INITIAL_VALUE = eINSTANCE.getIGenerator_SpecifiedInitialValue(); - - /** - * The meta object literal for the 'Default Initial Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__DEFAULT_INITIAL_VALUE = eINSTANCE.getIGenerator_DefaultInitialValue(); - - /** - * The meta object literal for the 'Allocation Size' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__ALLOCATION_SIZE = eINSTANCE.getIGenerator_AllocationSize(); - - /** - * The meta object literal for the 'Specified Allocation Size' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__SPECIFIED_ALLOCATION_SIZE = eINSTANCE.getIGenerator_SpecifiedAllocationSize(); - - /** - * The meta object literal for the 'Default Allocation Size' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATOR__DEFAULT_ALLOCATION_SIZE = eINSTANCE.getIGenerator_DefaultAllocationSize(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator ITable Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator() - * @generated - */ - public static final EClass ITABLE_GENERATOR = eINSTANCE.getITableGenerator(); - - /** - * The meta object literal for the 'Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__TABLE = eINSTANCE.getITableGenerator_Table(); - - /** - * The meta object literal for the 'Specified Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SPECIFIED_TABLE = eINSTANCE.getITableGenerator_SpecifiedTable(); - - /** - * The meta object literal for the 'Default Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__DEFAULT_TABLE = eINSTANCE.getITableGenerator_DefaultTable(); - - /** - * The meta object literal for the 'Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__CATALOG = eINSTANCE.getITableGenerator_Catalog(); - - /** - * The meta object literal for the 'Specified Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SPECIFIED_CATALOG = eINSTANCE.getITableGenerator_SpecifiedCatalog(); - - /** - * The meta object literal for the 'Default Catalog' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__DEFAULT_CATALOG = eINSTANCE.getITableGenerator_DefaultCatalog(); - - /** - * The meta object literal for the 'Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SCHEMA = eINSTANCE.getITableGenerator_Schema(); - - /** - * The meta object literal for the 'Specified Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SPECIFIED_SCHEMA = eINSTANCE.getITableGenerator_SpecifiedSchema(); - - /** - * The meta object literal for the 'Default Schema' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__DEFAULT_SCHEMA = eINSTANCE.getITableGenerator_DefaultSchema(); - - /** - * The meta object literal for the 'Pk Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__PK_COLUMN_NAME = eINSTANCE.getITableGenerator_PkColumnName(); - - /** - * The meta object literal for the 'Specified Pk Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME = eINSTANCE.getITableGenerator_SpecifiedPkColumnName(); - - /** - * The meta object literal for the 'Default Pk Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__DEFAULT_PK_COLUMN_NAME = eINSTANCE.getITableGenerator_DefaultPkColumnName(); - - /** - * The meta object literal for the 'Value Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__VALUE_COLUMN_NAME = eINSTANCE.getITableGenerator_ValueColumnName(); - - /** - * The meta object literal for the 'Specified Value Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME = eINSTANCE.getITableGenerator_SpecifiedValueColumnName(); - - /** - * The meta object literal for the 'Default Value Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__DEFAULT_VALUE_COLUMN_NAME = eINSTANCE.getITableGenerator_DefaultValueColumnName(); - - /** - * The meta object literal for the 'Pk Column Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__PK_COLUMN_VALUE = eINSTANCE.getITableGenerator_PkColumnValue(); - - /** - * The meta object literal for the 'Specified Pk Column Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE = eINSTANCE.getITableGenerator_SpecifiedPkColumnValue(); - - /** - * The meta object literal for the 'Default Pk Column Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = eINSTANCE.getITableGenerator_DefaultPkColumnValue(); - - /** - * The meta object literal for the 'Unique Constraints' containment reference list feature. - * - * - * @generated - */ - public static final EReference ITABLE_GENERATOR__UNIQUE_CONSTRAINTS = eINSTANCE.getITableGenerator_UniqueConstraints(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator ISequence Generator}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator() - * @generated - */ - public static final EClass ISEQUENCE_GENERATOR = eINSTANCE.getISequenceGenerator(); - - /** - * The meta object literal for the 'Sequence Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ISEQUENCE_GENERATOR__SEQUENCE_NAME = eINSTANCE.getISequenceGenerator_SequenceName(); - - /** - * The meta object literal for the 'Specified Sequence Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME = eINSTANCE.getISequenceGenerator_SpecifiedSequenceName(); - - /** - * The meta object literal for the 'Default Sequence Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute ISEQUENCE_GENERATOR__DEFAULT_SEQUENCE_NAME = eINSTANCE.getISequenceGenerator_DefaultSequenceName(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue IGenerated Value}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGeneratedValue() - * @generated - */ - public static final EClass IGENERATED_VALUE = eINSTANCE.getIGeneratedValue(); - - /** - * The meta object literal for the 'Strategy' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATED_VALUE__STRATEGY = eINSTANCE.getIGeneratedValue_Strategy(); - - /** - * The meta object literal for the 'Generator' attribute feature. - * - * - * @generated - */ - public static final EAttribute IGENERATED_VALUE__GENERATOR = eINSTANCE.getIGeneratedValue_Generator(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IQuery IQuery}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IQuery - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery() - * @generated - */ - public static final EClass IQUERY = eINSTANCE.getIQuery(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IQUERY__NAME = eINSTANCE.getIQuery_Name(); - - /** - * The meta object literal for the 'Query' attribute feature. - * - * - * @generated - */ - public static final EAttribute IQUERY__QUERY = eINSTANCE.getIQuery_Query(); - - /** - * The meta object literal for the 'Hints' containment reference list feature. - * - * - * @generated - */ - public static final EReference IQUERY__HINTS = eINSTANCE.getIQuery_Hints(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.INamedQuery INamed Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INamedQuery - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedQuery() - * @generated - */ - public static final EClass INAMED_QUERY = eINSTANCE.getINamedQuery(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery INamed Native Query}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery() - * @generated - */ - public static final EClass INAMED_NATIVE_QUERY = eINSTANCE.getINamedNativeQuery(); - - /** - * The meta object literal for the 'Result Class' attribute feature. - * - * - * @generated - */ - public static final EAttribute INAMED_NATIVE_QUERY__RESULT_CLASS = eINSTANCE.getINamedNativeQuery_ResultClass(); - - /** - * The meta object literal for the 'Result Set Mapping' attribute feature. - * - * - * @generated - */ - public static final EAttribute INAMED_NATIVE_QUERY__RESULT_SET_MAPPING = eINSTANCE.getINamedNativeQuery_ResultSetMapping(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint IQuery Hint}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint() - * @generated - */ - public static final EClass IQUERY_HINT = eINSTANCE.getIQueryHint(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute IQUERY_HINT__NAME = eINSTANCE.getIQueryHint_Name(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - public static final EAttribute IQUERY_HINT__VALUE = eINSTANCE.getIQueryHint_Value(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ICascade ICascade}' class. - * - * - * @see org.eclipse.jpt.core.internal.mappings.ICascade - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade() - * @generated - */ - public static final EClass ICASCADE = eINSTANCE.getICascade(); - - /** - * The meta object literal for the 'All' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICASCADE__ALL = eINSTANCE.getICascade_All(); - - /** - * The meta object literal for the 'Persist' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICASCADE__PERSIST = eINSTANCE.getICascade_Persist(); - - /** - * The meta object literal for the 'Merge' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICASCADE__MERGE = eINSTANCE.getICascade_Merge(); - - /** - * The meta object literal for the 'Remove' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICASCADE__REMOVE = eINSTANCE.getICascade_Remove(); - - /** - * The meta object literal for the 'Refresh' attribute feature. - * - * - * @generated - */ - public static final EAttribute ICASCADE__REFRESH = eINSTANCE.getICascade_Refresh(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType Default Eager Fetch Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultEagerFetchType() - * @generated - */ - public static final EEnum DEFAULT_EAGER_FETCH_TYPE = eINSTANCE.getDefaultEagerFetchType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType Default Lazy Fetch Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultLazyFetchType() - * @generated - */ - public static final EEnum DEFAULT_LAZY_FETCH_TYPE = eINSTANCE.getDefaultLazyFetchType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean Default False Boolean}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultFalseBoolean() - * @generated - */ - public static final EEnum DEFAULT_FALSE_BOOLEAN = eINSTANCE.getDefaultFalseBoolean(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean Default True Boolean}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultTrueBoolean() - * @generated - */ - public static final EEnum DEFAULT_TRUE_BOOLEAN = eINSTANCE.getDefaultTrueBoolean(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.TemporalType Temporal Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.TemporalType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getTemporalType() - * @generated - */ - public static final EEnum TEMPORAL_TYPE = eINSTANCE.getTemporalType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.InheritanceType Inheritance Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.InheritanceType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getInheritanceType() - * @generated - */ - public static final EEnum INHERITANCE_TYPE = eINSTANCE.getInheritanceType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType Discriminator Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.DiscriminatorType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDiscriminatorType() - * @generated - */ - public static final EEnum DISCRIMINATOR_TYPE = eINSTANCE.getDiscriminatorType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.GenerationType Generation Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.GenerationType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getGenerationType() - * @generated - */ - public static final EEnum GENERATION_TYPE = eINSTANCE.getGenerationType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.EnumType Enum Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.EnumType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getEnumType() - * @generated - */ - public static final EEnum ENUM_TYPE = eINSTANCE.getEnumType(); - - /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.CascadeType Cascade Type}' enum. - * - * - * @see org.eclipse.jpt.core.internal.mappings.CascadeType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType() - * @generated - */ - public static final EEnum CASCADE_TYPE = eINSTANCE.getCascadeType(); - } -} //JpaCoreMappingsPackage diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/OrderingType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/OrderingType.java deleted file mode 100644 index 1eb81e3f64..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/OrderingType.java +++ /dev/null @@ -1,240 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.OrderingType.CUSTOM_VALUE; -import static org.eclipse.jpt.core.internal.mappings.OrderingType.NONE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.OrderingType.PRIMARY_KEY_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Ordering Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getOrderingType() - * @model - * @generated - */ -public enum OrderingType implements Enumerator { - /** - * The 'NONE' literal object. - * - * - * @see #NONE_VALUE - * @generated - * @ordered - */ - NONE(0, "NONE", "None"), - /** - * The 'PRIMARY KEY' literal object. - * - * - * @see #PRIMARY_KEY_VALUE - * @generated - * @ordered - */ - PRIMARY_KEY(1, "PRIMARY_KEY", "Primary Key"), - /** - * The 'CUSTOM' literal object. - * - * - * @see #CUSTOM_VALUE - * @generated - * @ordered - */ - CUSTOM(2, "CUSTOM", "Custom"); - /** - * The 'NONE' literal value. - * - *

    - * If the meaning of 'NONE' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #NONE - * @model literal="None" - * @generated - * @ordered - */ - public static final int NONE_VALUE = 0; - - /** - * The 'PRIMARY KEY' literal value. - * - *

    - * If the meaning of 'PRIMARY KEY' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #PRIMARY_KEY - * @model literal="Primary Key" - * @generated - * @ordered - */ - public static final int PRIMARY_KEY_VALUE = 1; - - /** - * The 'CUSTOM' literal value. - * - *

    - * If the meaning of 'CUSTOM' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #CUSTOM - * @model literal="Custom" - * @generated - * @ordered - */ - public static final int CUSTOM_VALUE = 2; - - /** - * An array of all the 'Ordering Type' enumerators. - * - * - * @generated - */ - private static final OrderingType[] VALUES_ARRAY = new OrderingType[] { - NONE, PRIMARY_KEY, CUSTOM, - }; - - /** - * A public read-only list of all the 'Ordering Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Ordering Type' literal with the specified literal value. - * - * - * @generated - */ - public static OrderingType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - OrderingType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Ordering Type' literal with the specified name. - * - * - * @generated - */ - public static OrderingType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - OrderingType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Ordering Type' literal with the specified integer value. - * - * - * @generated - */ - public static OrderingType get(int value) { - switch (value) { - case NONE_VALUE : - return NONE; - case PRIMARY_KEY_VALUE : - return PRIMARY_KEY; - case CUSTOM_VALUE : - return CUSTOM; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private OrderingType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } -} //OrderingType diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/RelationshipMappingTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/RelationshipMappingTools.java deleted file mode 100644 index 2d4be328fe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/RelationshipMappingTools.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import java.util.StringTokenizer; - -public class RelationshipMappingTools -{ - public static boolean targetEntityIsValid(String targetEntity) { - if (targetEntity == null) { - return true; - } - // balance is # of name tokens - # of period tokens seen so far - // initially 0; finally 1; should never drop < 0 or > 1 - int balance = 0; - for (StringTokenizer t = new StringTokenizer(targetEntity, ".", true); t.hasMoreTokens();) { - String s = t.nextToken(); - if (s.indexOf('.') >= 0) { - // this is a delimiter - if (s.length() > 1) { - // too many periods in a row - return false; - } - balance--; - if (balance < 0) { - return false; - } - } else { - // this is an identifier segment - balance++; - } - } - return (balance == 1); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/TemporalType.java deleted file mode 100644 index 2824053a47..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/TemporalType.java +++ /dev/null @@ -1,296 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings; - -import static org.eclipse.jpt.core.internal.mappings.TemporalType.DATE_VALUE; -import static org.eclipse.jpt.core.internal.mappings.TemporalType.NULL_VALUE; -import static org.eclipse.jpt.core.internal.mappings.TemporalType.TIMESTAMP_VALUE; -import static org.eclipse.jpt.core.internal.mappings.TemporalType.TIME_VALUE; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; - -/** - * - * A representation of the literals of the enumeration 'Temporal Type', - * and utility methods for working with them. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getTemporalType() - * @model - * @generated - */ -public enum TemporalType implements Enumerator { - /** - * The 'Null' literal object. - * - * - * @see #NULL_VALUE - * @generated - * @ordered - */ - NULL(0, "Null", ""), /** - * The 'DATE' literal object. - * - * - * @see #DATE_VALUE - * @generated - * @ordered - */ - DATE(1, "DATE", "Date"), /** - * The 'TIME' literal object. - * - * - * @see #TIME_VALUE - * @generated - * @ordered - */ - TIME(2, "TIME", "Time"), /** - * The 'TIMESTAMP' literal object. - * - * - * @see #TIMESTAMP_VALUE - * @generated - * @ordered - */ - TIMESTAMP(3, "TIMESTAMP", "Timestamp"); - /** - * The 'Null' literal value. - * - *

    - * If the meaning of 'Null' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #NULL - * @model name="Null" literal="" - * @generated - * @ordered - */ - public static final int NULL_VALUE = 0; - - /** - * The 'DATE' literal value. - * - *

    - * If the meaning of 'DATE' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #DATE - * @model literal="Date" - * @generated - * @ordered - */ - public static final int DATE_VALUE = 1; - - /** - * The 'TIME' literal value. - * - *

    - * If the meaning of 'TIME' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #TIME - * @model literal="Time" - * @generated - * @ordered - */ - public static final int TIME_VALUE = 2; - - /** - * The 'TIMESTAMP' literal value. - * - *

    - * If the meaning of 'TIMESTAMP' literal object isn't clear, - * there really should be more of a description here... - *

    - * - * @see #TIMESTAMP - * @model literal="Timestamp" - * @generated - * @ordered - */ - public static final int TIMESTAMP_VALUE = 3; - - /** - * An array of all the 'Temporal Type' enumerators. - * - * - * @generated - */ - private static final TemporalType[] VALUES_ARRAY = new TemporalType[] { - NULL, DATE, TIME, TIMESTAMP, - }; - - /** - * A public read-only list of all the 'Temporal Type' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Temporal Type' literal with the specified literal value. - * - * - * @generated - */ - public static TemporalType get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - TemporalType result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Temporal Type' literal with the specified name. - * - * - * @generated - */ - public static TemporalType getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - TemporalType result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Temporal Type' literal with the specified integer value. - * - * - * @generated - */ - public static TemporalType get(int value) { - switch (value) { - case NULL_VALUE : - return NULL; - case DATE_VALUE : - return DATE; - case TIME_VALUE : - return TIME; - case TIMESTAMP_VALUE : - return TIMESTAMP; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private TemporalType(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - - public static TemporalType fromJavaAnnotationValue(Object javaAnnotationValue) { - if (javaAnnotationValue == null) { - return NULL; - } - if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__DATE)) { - return DATE; - } - if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__TIME)) { - return TIME; - } - if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__TIMESTAMP)) { - return TIMESTAMP; - } - return NULL; - } - - public String convertToJavaAnnotationValue() { - switch (this.getValue()) { - case NULL_VALUE : - return null; - case DATE_VALUE : - return JPA.TEMPORAL_TYPE__DATE; - case TIME_VALUE : - return JPA.TEMPORAL_TYPE__TIME; - case TIMESTAMP_VALUE : - return JPA.TEMPORAL_TYPE__TIMESTAMP; - default : - throw new IllegalArgumentException("unknown temporal type: " + this); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java deleted file mode 100644 index 5a79a56363..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java +++ /dev/null @@ -1,1004 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage - * @generated - */ -public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static JpaCoreMappingsPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public JpaCoreMappingsAdapterFactory() { - if (modelPackage == null) { - modelPackage = JpaCoreMappingsPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the createXXX methods. - * - * - * @generated - */ - protected JpaCoreMappingsSwitch modelSwitch = new JpaCoreMappingsSwitch() { - @Override - public Adapter caseIMappedSuperclass(IMappedSuperclass object) { - return createIMappedSuperclassAdapter(); - } - - @Override - public Adapter caseIEntity(IEntity object) { - return createIEntityAdapter(); - } - - @Override - public Adapter caseIEmbeddable(IEmbeddable object) { - return createIEmbeddableAdapter(); - } - - @Override - public Adapter caseITable(ITable object) { - return createITableAdapter(); - } - - @Override - public Adapter caseIUniqueConstraint(IUniqueConstraint object) { - return createIUniqueConstraintAdapter(); - } - - @Override - public Adapter caseINamedColumn(INamedColumn object) { - return createINamedColumnAdapter(); - } - - @Override - public Adapter caseIAbstractColumn(IAbstractColumn object) { - return createIAbstractColumnAdapter(); - } - - @Override - public Adapter caseIColumn(IColumn object) { - return createIColumnAdapter(); - } - - @Override - public Adapter caseIColumnMapping(IColumnMapping object) { - return createIColumnMappingAdapter(); - } - - @Override - public Adapter caseIBasic(IBasic object) { - return createIBasicAdapter(); - } - - @Override - public Adapter caseIId(IId object) { - return createIIdAdapter(); - } - - @Override - public Adapter caseITransient(ITransient object) { - return createITransientAdapter(); - } - - @Override - public Adapter caseIVersion(IVersion object) { - return createIVersionAdapter(); - } - - @Override - public Adapter caseIEmbeddedId(IEmbeddedId object) { - return createIEmbeddedIdAdapter(); - } - - @Override - public Adapter caseIEmbedded(IEmbedded object) { - return createIEmbeddedAdapter(); - } - - @Override - public Adapter caseIRelationshipMapping(IRelationshipMapping object) { - return createIRelationshipMappingAdapter(); - } - - @Override - public Adapter caseINonOwningMapping(INonOwningMapping object) { - return createINonOwningMappingAdapter(); - } - - @Override - public Adapter caseIMultiRelationshipMapping(IMultiRelationshipMapping object) { - return createIMultiRelationshipMappingAdapter(); - } - - @Override - public Adapter caseIOneToMany(IOneToMany object) { - return createIOneToManyAdapter(); - } - - @Override - public Adapter caseIManyToMany(IManyToMany object) { - return createIManyToManyAdapter(); - } - - @Override - public Adapter caseISingleRelationshipMapping(ISingleRelationshipMapping object) { - return createISingleRelationshipMappingAdapter(); - } - - @Override - public Adapter caseIManyToOne(IManyToOne object) { - return createIManyToOneAdapter(); - } - - @Override - public Adapter caseIOneToOne(IOneToOne object) { - return createIOneToOneAdapter(); - } - - @Override - public Adapter caseIJoinTable(IJoinTable object) { - return createIJoinTableAdapter(); - } - - @Override - public Adapter caseIAbstractJoinColumn(IAbstractJoinColumn object) { - return createIAbstractJoinColumnAdapter(); - } - - @Override - public Adapter caseIJoinColumn(IJoinColumn object) { - return createIJoinColumnAdapter(); - } - - @Override - public Adapter caseIOverride(IOverride object) { - return createIOverrideAdapter(); - } - - @Override - public Adapter caseIAttributeOverride(IAttributeOverride object) { - return createIAttributeOverrideAdapter(); - } - - @Override - public Adapter caseIAssociationOverride(IAssociationOverride object) { - return createIAssociationOverrideAdapter(); - } - - @Override - public Adapter caseIDiscriminatorColumn(IDiscriminatorColumn object) { - return createIDiscriminatorColumnAdapter(); - } - - @Override - public Adapter caseISecondaryTable(ISecondaryTable object) { - return createISecondaryTableAdapter(); - } - - @Override - public Adapter caseIPrimaryKeyJoinColumn(IPrimaryKeyJoinColumn object) { - return createIPrimaryKeyJoinColumnAdapter(); - } - - @Override - public Adapter caseIGenerator(IGenerator object) { - return createIGeneratorAdapter(); - } - - @Override - public Adapter caseITableGenerator(ITableGenerator object) { - return createITableGeneratorAdapter(); - } - - @Override - public Adapter caseISequenceGenerator(ISequenceGenerator object) { - return createISequenceGeneratorAdapter(); - } - - @Override - public Adapter caseIGeneratedValue(IGeneratedValue object) { - return createIGeneratedValueAdapter(); - } - - @Override - public Adapter caseIQuery(IQuery object) { - return createIQueryAdapter(); - } - - @Override - public Adapter caseINamedQuery(INamedQuery object) { - return createINamedQueryAdapter(); - } - - @Override - public Adapter caseINamedNativeQuery(INamedNativeQuery object) { - return createINamedNativeQueryAdapter(); - } - - @Override - public Adapter caseIQueryHint(IQueryHint object) { - return createIQueryHintAdapter(); - } - - @Override - public Adapter caseICascade(ICascade object) { - return createICascadeAdapter(); - } - - @Override - public Adapter caseIJpaEObject(IJpaEObject object) { - return createIJpaEObjectAdapter(); - } - - @Override - public Adapter caseIJpaSourceObject(IJpaSourceObject object) { - return createIJpaSourceObjectAdapter(); - } - - @Override - public Adapter caseITypeMapping(ITypeMapping object) { - return createITypeMappingAdapter(); - } - - @Override - public Adapter caseIAttributeMapping(IAttributeMapping object) { - return createIAttributeMappingAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IMappedSuperclass IMapped Superclass}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IMappedSuperclass - * @generated - */ - public Adapter createIMappedSuperclassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEntity IEntity}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEntity - * @generated - */ - public Adapter createIEntityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITable ITable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITable - * @generated - */ - public Adapter createITableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint IUnique Constraint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint - * @generated - */ - public Adapter createIUniqueConstraintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn INamed Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedColumn - * @generated - */ - public Adapter createINamedColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractColumn IAbstract Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractColumn - * @generated - */ - public Adapter createIAbstractColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IColumn IColumn}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IColumn - * @generated - */ - public Adapter createIColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping IColumn Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IColumnMapping - * @generated - */ - public Adapter createIColumnMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddable IEmbeddable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddable - * @generated - */ - public Adapter createIEmbeddableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IBasic IBasic}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IBasic - * @generated - */ - public Adapter createIBasicAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IId IId}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IId - * @generated - */ - public Adapter createIIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITransient ITransient}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITransient - * @generated - */ - public Adapter createITransientAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IVersion IVersion}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IVersion - * @generated - */ - public Adapter createIVersionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbeddedId IEmbedded Id}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbeddedId - * @generated - */ - public Adapter createIEmbeddedIdAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IEmbedded IEmbedded}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IEmbedded - * @generated - */ - public Adapter createIEmbeddedAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping IRelationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping - * @generated - */ - public Adapter createIRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping INon Owning Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INonOwningMapping - * @generated - */ - public Adapter createINonOwningMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping IMulti Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping - * @generated - */ - public Adapter createIMultiRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOneToMany IOne To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOneToMany - * @generated - */ - public Adapter createIOneToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IManyToMany IMany To Many}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IManyToMany - * @generated - */ - public Adapter createIManyToManyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping ISingle Relationship Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping - * @generated - */ - public Adapter createISingleRelationshipMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IManyToOne IMany To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IManyToOne - * @generated - */ - public Adapter createIManyToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOneToOne IOne To One}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOneToOne - * @generated - */ - public Adapter createIOneToOneAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IJoinTable IJoin Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IJoinTable - * @generated - */ - public Adapter createIJoinTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn IAbstract Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn - * @generated - */ - public Adapter createIAbstractJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IJoinColumn IJoin Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IJoinColumn - * @generated - */ - public Adapter createIJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOverride IOverride}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOverride - * @generated - */ - public Adapter createIOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAttributeOverride IAttribute Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAttributeOverride - * @generated - */ - public Adapter createIAttributeOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IAssociationOverride IAssociation Override}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IAssociationOverride - * @generated - */ - public Adapter createIAssociationOverrideAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn IDiscriminator Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn - * @generated - */ - public Adapter createIDiscriminatorColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable ISecondary Table}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISecondaryTable - * @generated - */ - public Adapter createISecondaryTableAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn IPrimary Key Join Column}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn - * @generated - */ - public Adapter createIPrimaryKeyJoinColumnAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IGenerator IGenerator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IGenerator - * @generated - */ - public Adapter createIGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator ITable Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator - * @generated - */ - public Adapter createITableGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator ISequence Generator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ISequenceGenerator - * @generated - */ - public Adapter createISequenceGeneratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IGeneratedValue IGenerated Value}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IGeneratedValue - * @generated - */ - public Adapter createIGeneratedValueAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQuery IQuery}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IQuery - * @generated - */ - public Adapter createIQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedQuery INamed Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedQuery - * @generated - */ - public Adapter createINamedQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedNativeQuery INamed Native Query}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.INamedNativeQuery - * @generated - */ - public Adapter createINamedNativeQueryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQueryHint IQuery Hint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IQueryHint - * @generated - */ - public Adapter createIQueryHintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ICascade ICascade}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.ICascade - * @generated - */ - public Adapter createICascadeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public Adapter createIJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public Adapter createIJpaSourceObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @generated - */ - public Adapter createITypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @generated - */ - public Adapter createIAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } -} //JpaCoreMappingsAdapterFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java deleted file mode 100644 index db4c09b572..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java +++ /dev/null @@ -1,1383 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.mappings.util; - -import java.util.List; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.INamedNativeQuery; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage - * @generated - */ -public class JpaCoreMappingsSwitch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static JpaCoreMappingsPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public JpaCoreMappingsSwitch() { - if (modelPackage == null) { - modelPackage = JpaCoreMappingsPackage.eINSTANCE; - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List eSuperTypes = theEClass.getESuperTypes(); - return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case JpaCoreMappingsPackage.IMAPPED_SUPERCLASS : { - IMappedSuperclass iMappedSuperclass = (IMappedSuperclass) theEObject; - T result = caseIMappedSuperclass(iMappedSuperclass); - if (result == null) - result = caseITypeMapping(iMappedSuperclass); - if (result == null) - result = caseIJpaSourceObject(iMappedSuperclass); - if (result == null) - result = caseIJpaEObject(iMappedSuperclass); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IENTITY : { - IEntity iEntity = (IEntity) theEObject; - T result = caseIEntity(iEntity); - if (result == null) - result = caseITypeMapping(iEntity); - if (result == null) - result = caseIJpaSourceObject(iEntity); - if (result == null) - result = caseIJpaEObject(iEntity); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IEMBEDDABLE : { - IEmbeddable iEmbeddable = (IEmbeddable) theEObject; - T result = caseIEmbeddable(iEmbeddable); - if (result == null) - result = caseITypeMapping(iEmbeddable); - if (result == null) - result = caseIJpaSourceObject(iEmbeddable); - if (result == null) - result = caseIJpaEObject(iEmbeddable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ITABLE : { - ITable iTable = (ITable) theEObject; - T result = caseITable(iTable); - if (result == null) - result = caseIJpaSourceObject(iTable); - if (result == null) - result = caseIJpaEObject(iTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT : { - IUniqueConstraint iUniqueConstraint = (IUniqueConstraint) theEObject; - T result = caseIUniqueConstraint(iUniqueConstraint); - if (result == null) - result = caseIJpaSourceObject(iUniqueConstraint); - if (result == null) - result = caseIJpaEObject(iUniqueConstraint); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.INAMED_COLUMN : { - INamedColumn iNamedColumn = (INamedColumn) theEObject; - T result = caseINamedColumn(iNamedColumn); - if (result == null) - result = caseIJpaSourceObject(iNamedColumn); - if (result == null) - result = caseIJpaEObject(iNamedColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IABSTRACT_COLUMN : { - IAbstractColumn iAbstractColumn = (IAbstractColumn) theEObject; - T result = caseIAbstractColumn(iAbstractColumn); - if (result == null) - result = caseINamedColumn(iAbstractColumn); - if (result == null) - result = caseIJpaSourceObject(iAbstractColumn); - if (result == null) - result = caseIJpaEObject(iAbstractColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ICOLUMN : { - IColumn iColumn = (IColumn) theEObject; - T result = caseIColumn(iColumn); - if (result == null) - result = caseIAbstractColumn(iColumn); - if (result == null) - result = caseINamedColumn(iColumn); - if (result == null) - result = caseIJpaSourceObject(iColumn); - if (result == null) - result = caseIJpaEObject(iColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ICOLUMN_MAPPING : { - IColumnMapping iColumnMapping = (IColumnMapping) theEObject; - T result = caseIColumnMapping(iColumnMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IBASIC : { - IBasic iBasic = (IBasic) theEObject; - T result = caseIBasic(iBasic); - if (result == null) - result = caseIAttributeMapping(iBasic); - if (result == null) - result = caseIColumnMapping(iBasic); - if (result == null) - result = caseIJpaSourceObject(iBasic); - if (result == null) - result = caseIJpaEObject(iBasic); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IID : { - IId iId = (IId) theEObject; - T result = caseIId(iId); - if (result == null) - result = caseIAttributeMapping(iId); - if (result == null) - result = caseIColumnMapping(iId); - if (result == null) - result = caseIJpaSourceObject(iId); - if (result == null) - result = caseIJpaEObject(iId); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ITRANSIENT : { - ITransient iTransient = (ITransient) theEObject; - T result = caseITransient(iTransient); - if (result == null) - result = caseIAttributeMapping(iTransient); - if (result == null) - result = caseIJpaSourceObject(iTransient); - if (result == null) - result = caseIJpaEObject(iTransient); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IVERSION : { - IVersion iVersion = (IVersion) theEObject; - T result = caseIVersion(iVersion); - if (result == null) - result = caseIAttributeMapping(iVersion); - if (result == null) - result = caseIColumnMapping(iVersion); - if (result == null) - result = caseIJpaSourceObject(iVersion); - if (result == null) - result = caseIJpaEObject(iVersion); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IEMBEDDED_ID : { - IEmbeddedId iEmbeddedId = (IEmbeddedId) theEObject; - T result = caseIEmbeddedId(iEmbeddedId); - if (result == null) - result = caseIAttributeMapping(iEmbeddedId); - if (result == null) - result = caseIJpaSourceObject(iEmbeddedId); - if (result == null) - result = caseIJpaEObject(iEmbeddedId); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IEMBEDDED : { - IEmbedded iEmbedded = (IEmbedded) theEObject; - T result = caseIEmbedded(iEmbedded); - if (result == null) - result = caseIAttributeMapping(iEmbedded); - if (result == null) - result = caseIJpaSourceObject(iEmbedded); - if (result == null) - result = caseIJpaEObject(iEmbedded); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING : { - IRelationshipMapping iRelationshipMapping = (IRelationshipMapping) theEObject; - T result = caseIRelationshipMapping(iRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(iRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(iRelationshipMapping); - if (result == null) - result = caseIJpaEObject(iRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.INON_OWNING_MAPPING : { - INonOwningMapping iNonOwningMapping = (INonOwningMapping) theEObject; - T result = caseINonOwningMapping(iNonOwningMapping); - if (result == null) - result = caseIRelationshipMapping(iNonOwningMapping); - if (result == null) - result = caseIAttributeMapping(iNonOwningMapping); - if (result == null) - result = caseIJpaSourceObject(iNonOwningMapping); - if (result == null) - result = caseIJpaEObject(iNonOwningMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING : { - IMultiRelationshipMapping iMultiRelationshipMapping = (IMultiRelationshipMapping) theEObject; - T result = caseIMultiRelationshipMapping(iMultiRelationshipMapping); - if (result == null) - result = caseINonOwningMapping(iMultiRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(iMultiRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(iMultiRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(iMultiRelationshipMapping); - if (result == null) - result = caseIJpaEObject(iMultiRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IONE_TO_MANY : { - IOneToMany iOneToMany = (IOneToMany) theEObject; - T result = caseIOneToMany(iOneToMany); - if (result == null) - result = caseIMultiRelationshipMapping(iOneToMany); - if (result == null) - result = caseINonOwningMapping(iOneToMany); - if (result == null) - result = caseIRelationshipMapping(iOneToMany); - if (result == null) - result = caseIAttributeMapping(iOneToMany); - if (result == null) - result = caseIJpaSourceObject(iOneToMany); - if (result == null) - result = caseIJpaEObject(iOneToMany); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IMANY_TO_MANY : { - IManyToMany iManyToMany = (IManyToMany) theEObject; - T result = caseIManyToMany(iManyToMany); - if (result == null) - result = caseIMultiRelationshipMapping(iManyToMany); - if (result == null) - result = caseINonOwningMapping(iManyToMany); - if (result == null) - result = caseIRelationshipMapping(iManyToMany); - if (result == null) - result = caseIAttributeMapping(iManyToMany); - if (result == null) - result = caseIJpaSourceObject(iManyToMany); - if (result == null) - result = caseIJpaEObject(iManyToMany); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING : { - ISingleRelationshipMapping iSingleRelationshipMapping = (ISingleRelationshipMapping) theEObject; - T result = caseISingleRelationshipMapping(iSingleRelationshipMapping); - if (result == null) - result = caseIRelationshipMapping(iSingleRelationshipMapping); - if (result == null) - result = caseIAttributeMapping(iSingleRelationshipMapping); - if (result == null) - result = caseIJpaSourceObject(iSingleRelationshipMapping); - if (result == null) - result = caseIJpaEObject(iSingleRelationshipMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IMANY_TO_ONE : { - IManyToOne iManyToOne = (IManyToOne) theEObject; - T result = caseIManyToOne(iManyToOne); - if (result == null) - result = caseISingleRelationshipMapping(iManyToOne); - if (result == null) - result = caseIRelationshipMapping(iManyToOne); - if (result == null) - result = caseIAttributeMapping(iManyToOne); - if (result == null) - result = caseIJpaSourceObject(iManyToOne); - if (result == null) - result = caseIJpaEObject(iManyToOne); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IONE_TO_ONE : { - IOneToOne iOneToOne = (IOneToOne) theEObject; - T result = caseIOneToOne(iOneToOne); - if (result == null) - result = caseISingleRelationshipMapping(iOneToOne); - if (result == null) - result = caseINonOwningMapping(iOneToOne); - if (result == null) - result = caseIRelationshipMapping(iOneToOne); - if (result == null) - result = caseIAttributeMapping(iOneToOne); - if (result == null) - result = caseIJpaSourceObject(iOneToOne); - if (result == null) - result = caseIJpaEObject(iOneToOne); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IJOIN_TABLE : { - IJoinTable iJoinTable = (IJoinTable) theEObject; - T result = caseIJoinTable(iJoinTable); - if (result == null) - result = caseITable(iJoinTable); - if (result == null) - result = caseIJpaSourceObject(iJoinTable); - if (result == null) - result = caseIJpaEObject(iJoinTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN : { - IAbstractJoinColumn iAbstractJoinColumn = (IAbstractJoinColumn) theEObject; - T result = caseIAbstractJoinColumn(iAbstractJoinColumn); - if (result == null) - result = caseINamedColumn(iAbstractJoinColumn); - if (result == null) - result = caseIJpaSourceObject(iAbstractJoinColumn); - if (result == null) - result = caseIJpaEObject(iAbstractJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IJOIN_COLUMN : { - IJoinColumn iJoinColumn = (IJoinColumn) theEObject; - T result = caseIJoinColumn(iJoinColumn); - if (result == null) - result = caseIAbstractColumn(iJoinColumn); - if (result == null) - result = caseIAbstractJoinColumn(iJoinColumn); - if (result == null) - result = caseINamedColumn(iJoinColumn); - if (result == null) - result = caseIJpaSourceObject(iJoinColumn); - if (result == null) - result = caseIJpaEObject(iJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IOVERRIDE : { - IOverride iOverride = (IOverride) theEObject; - T result = caseIOverride(iOverride); - if (result == null) - result = caseIJpaSourceObject(iOverride); - if (result == null) - result = caseIJpaEObject(iOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE : { - IAttributeOverride iAttributeOverride = (IAttributeOverride) theEObject; - T result = caseIAttributeOverride(iAttributeOverride); - if (result == null) - result = caseIOverride(iAttributeOverride); - if (result == null) - result = caseIColumnMapping(iAttributeOverride); - if (result == null) - result = caseIJpaSourceObject(iAttributeOverride); - if (result == null) - result = caseIJpaEObject(iAttributeOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE : { - IAssociationOverride iAssociationOverride = (IAssociationOverride) theEObject; - T result = caseIAssociationOverride(iAssociationOverride); - if (result == null) - result = caseIOverride(iAssociationOverride); - if (result == null) - result = caseIJpaSourceObject(iAssociationOverride); - if (result == null) - result = caseIJpaEObject(iAssociationOverride); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN : { - IDiscriminatorColumn iDiscriminatorColumn = (IDiscriminatorColumn) theEObject; - T result = caseIDiscriminatorColumn(iDiscriminatorColumn); - if (result == null) - result = caseINamedColumn(iDiscriminatorColumn); - if (result == null) - result = caseIJpaSourceObject(iDiscriminatorColumn); - if (result == null) - result = caseIJpaEObject(iDiscriminatorColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ISECONDARY_TABLE : { - ISecondaryTable iSecondaryTable = (ISecondaryTable) theEObject; - T result = caseISecondaryTable(iSecondaryTable); - if (result == null) - result = caseITable(iSecondaryTable); - if (result == null) - result = caseIJpaSourceObject(iSecondaryTable); - if (result == null) - result = caseIJpaEObject(iSecondaryTable); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IPRIMARY_KEY_JOIN_COLUMN : { - IPrimaryKeyJoinColumn iPrimaryKeyJoinColumn = (IPrimaryKeyJoinColumn) theEObject; - T result = caseIPrimaryKeyJoinColumn(iPrimaryKeyJoinColumn); - if (result == null) - result = caseIAbstractJoinColumn(iPrimaryKeyJoinColumn); - if (result == null) - result = caseINamedColumn(iPrimaryKeyJoinColumn); - if (result == null) - result = caseIJpaSourceObject(iPrimaryKeyJoinColumn); - if (result == null) - result = caseIJpaEObject(iPrimaryKeyJoinColumn); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IGENERATOR : { - IGenerator iGenerator = (IGenerator) theEObject; - T result = caseIGenerator(iGenerator); - if (result == null) - result = caseIJpaSourceObject(iGenerator); - if (result == null) - result = caseIJpaEObject(iGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ITABLE_GENERATOR : { - ITableGenerator iTableGenerator = (ITableGenerator) theEObject; - T result = caseITableGenerator(iTableGenerator); - if (result == null) - result = caseIGenerator(iTableGenerator); - if (result == null) - result = caseIJpaSourceObject(iTableGenerator); - if (result == null) - result = caseIJpaEObject(iTableGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ISEQUENCE_GENERATOR : { - ISequenceGenerator iSequenceGenerator = (ISequenceGenerator) theEObject; - T result = caseISequenceGenerator(iSequenceGenerator); - if (result == null) - result = caseIGenerator(iSequenceGenerator); - if (result == null) - result = caseIJpaSourceObject(iSequenceGenerator); - if (result == null) - result = caseIJpaEObject(iSequenceGenerator); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IGENERATED_VALUE : { - IGeneratedValue iGeneratedValue = (IGeneratedValue) theEObject; - T result = caseIGeneratedValue(iGeneratedValue); - if (result == null) - result = caseIJpaSourceObject(iGeneratedValue); - if (result == null) - result = caseIJpaEObject(iGeneratedValue); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IQUERY : { - IQuery iQuery = (IQuery) theEObject; - T result = caseIQuery(iQuery); - if (result == null) - result = caseIJpaSourceObject(iQuery); - if (result == null) - result = caseIJpaEObject(iQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.INAMED_QUERY : { - INamedQuery iNamedQuery = (INamedQuery) theEObject; - T result = caseINamedQuery(iNamedQuery); - if (result == null) - result = caseIJpaSourceObject(iNamedQuery); - if (result == null) - result = caseIQuery(iNamedQuery); - if (result == null) - result = caseIJpaEObject(iNamedQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.INAMED_NATIVE_QUERY : { - INamedNativeQuery iNamedNativeQuery = (INamedNativeQuery) theEObject; - T result = caseINamedNativeQuery(iNamedNativeQuery); - if (result == null) - result = caseIJpaSourceObject(iNamedNativeQuery); - if (result == null) - result = caseIQuery(iNamedNativeQuery); - if (result == null) - result = caseIJpaEObject(iNamedNativeQuery); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.IQUERY_HINT : { - IQueryHint iQueryHint = (IQueryHint) theEObject; - T result = caseIQueryHint(iQueryHint); - if (result == null) - result = caseIJpaSourceObject(iQueryHint); - if (result == null) - result = caseIJpaEObject(iQueryHint); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCoreMappingsPackage.ICASCADE : { - ICascade iCascade = (ICascade) theEObject; - T result = caseICascade(iCascade); - if (result == null) - result = caseIJpaSourceObject(iCascade); - if (result == null) - result = caseIJpaEObject(iCascade); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpretting the object as an instance of 'IMapped Superclass'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMapped Superclass'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIMappedSuperclass(IMappedSuperclass object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEntity'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEntity'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEntity(IEntity object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITable(ITable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IUnique Constraint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IUnique Constraint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIUniqueConstraint(IUniqueConstraint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedColumn(INamedColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAbstract Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAbstract Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAbstractColumn(IAbstractColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IColumn'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IColumn'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIColumn(IColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IColumn Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IColumn Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIColumnMapping(IColumnMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbeddable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbeddable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbeddable(IEmbeddable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IBasic'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IBasic'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIBasic(IBasic object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IId'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IId'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIId(IId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITransient'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITransient'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITransient(ITransient object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IVersion'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IVersion'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIVersion(IVersion object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbedded Id'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbedded Id'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbeddedId(IEmbeddedId object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IEmbedded'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IEmbedded'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIEmbedded(IEmbedded object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IRelationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IRelationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIRelationshipMapping(IRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INon Owning Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INon Owning Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINonOwningMapping(INonOwningMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMulti Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMulti Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIMultiRelationshipMapping(IMultiRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOne To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOne To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOneToMany(IOneToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMany To Many'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMany To Many'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIManyToMany(IManyToMany object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISingle Relationship Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISingle Relationship Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISingleRelationshipMapping(ISingleRelationshipMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IMany To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IMany To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIManyToOne(IManyToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOne To One'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOne To One'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOneToOne(IOneToOne object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJoin Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJoin Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJoinTable(IJoinTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAbstract Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAbstract Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAbstractJoinColumn(IAbstractJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJoin Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJoin Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJoinColumn(IJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IOverride'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IOverride'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOverride(IOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeOverride(IAttributeOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAssociation Override'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAssociation Override'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAssociationOverride(IAssociationOverride object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IDiscriminator Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IDiscriminator Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIDiscriminatorColumn(IDiscriminatorColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISecondary Table'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISecondary Table'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISecondaryTable(ISecondaryTable object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPrimary Key Join Column'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPrimary Key Join Column'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPrimaryKeyJoinColumn(IPrimaryKeyJoinColumn object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IGenerator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IGenerator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIGenerator(IGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ITable Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ITable Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITableGenerator(ITableGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ISequence Generator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ISequence Generator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseISequenceGenerator(ISequenceGenerator object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IGenerated Value'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IGenerated Value'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIGeneratedValue(IGeneratedValue object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IQuery'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IQuery'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIQuery(IQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedQuery(INamedQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'INamed Native Query'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'INamed Native Query'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseINamedNativeQuery(INamedNativeQuery object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IQuery Hint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IQuery Hint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIQueryHint(IQueryHint object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'ICascade'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'ICascade'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseICascade(ICascade object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaEObject(IJpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Source Object'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Source Object'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaSourceObject(IJpaSourceObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IType Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IType Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITypeMapping(ITypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeMapping(IAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } -} //JpaCoreMappingsSwitch diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AbstractJoinColumnContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AbstractJoinColumnContext.java deleted file mode 100644 index 3f266f420d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AbstractJoinColumnContext.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; - -public abstract class AbstractJoinColumnContext extends BaseContext -{ - protected E column; - - public AbstractJoinColumnContext(IContext parentContext, E column) { - super(parentContext); - this.column = column; - } - - @Override - protected void initialize() {} - - public E getColumn() { - return this.column; - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.column.refreshDefaults(wrapDefaultsContext(defaultsContext)); - } - - public DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_NAME_KEY)) { - return buildDefaultName(); - } - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY)) { - return buildDefaultReferencedColumnName(); - } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - protected abstract String buildDefaultName(); - - protected abstract String buildDefaultReferencedColumnName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AssociationOverrideContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AssociationOverrideContext.java deleted file mode 100644 index ace55b40e0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AssociationOverrideContext.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class AssociationOverrideContext extends BaseContext -{ - IAssociationOverride associationOverride; - - private Collection joinColumnContexts; - - public AssociationOverrideContext(IContext parentContext, IAssociationOverride associationOverride) { - super(parentContext); - this.associationOverride = associationOverride; - this.joinColumnContexts = buildJoinColumnContexts(); - } - - @Override - protected void initialize() { - } - - protected Collection buildJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (IJoinColumn joinColumn : this.associationOverride.getJoinColumns() ) { - contexts.add(new JoinColumnContext(this, joinColumn)); - } - return contexts; - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - for (JoinColumnContext context : this.joinColumnContexts) { - context.refreshDefaults(defaultsContext); - } - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - addJoinColumnMessages(messages); - } - - protected void addJoinColumnMessages(List messages) { - ITypeMapping typeMapping = associationOverride.typeMapping(); - - for (IJoinColumn joinColumn : associationOverride.getJoinColumns()) { - String table = joinColumn.getTable(); - boolean doContinue = joinColumn.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - if (associationOverride.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE, - new String[] {associationOverride.getName(), table, joinColumn.getName()}, - joinColumn, joinColumn.tableTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE, - new String[] {table, joinColumn.getName()}, - joinColumn, joinColumn.tableTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! joinColumn.isResolved()) { - if (associationOverride.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {associationOverride.getName(), joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - } - - if (doContinue && ! joinColumn.isReferencedColumnResolved()) { - if (associationOverride.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {associationOverride.getName(), joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - } - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AttributeOverrideContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AttributeOverrideContext.java deleted file mode 100644 index 8d15c03d1b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AttributeOverrideContext.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class AttributeOverrideContext extends BaseContext -{ - IAttributeOverride attributeOverride; - - ColumnContext columnContext; - - public AttributeOverrideContext(IContext parentContext, IAttributeOverride attributeOverride) { - super(parentContext); - this.attributeOverride = attributeOverride; - this.columnContext = buildColumnContext(); - } - - @Override - protected void initialize() {} - - protected ColumnContext buildColumnContext() { - return new ColumnContext(this, this.attributeOverride.getColumn()); - } - - public DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)) { - return buildDefaultColumnName(); - } - else if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_TABLE_KEY)) { - String tableName = buildDefaultTableName(); - if (tableName != null) { - return tableName; - } - - } - return defaultsContext.getDefault(key); - } - }; - } - - /** - * The mapping that the attribute override is overriding - */ - protected IColumnMapping columnMapping() { - return (IColumnMapping) this.attributeOverride.getOwner().attributeMapping(this.attributeOverride.getName()); - } - - protected String buildDefaultColumnName() { - IColumnMapping columnMapping = columnMapping(); - if (columnMapping == null) { - return null; - } - return columnMapping.getColumn().getName(); - } - - protected String buildDefaultTableName() { - IColumnMapping columnMapping = columnMapping(); - if (columnMapping == null) { - return null; - } - return columnMapping.getColumn().getSpecifiedTable(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.columnContext.refreshDefaults(wrapDefaultsContext(defaultsContext)); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - addColumnMessages(messages); - } - - protected void addColumnMessages(List messages) { - ITypeMapping typeMapping = attributeOverride.getOwner().getTypeMapping(); - IColumn column = attributeOverride.getColumn(); - String table = column.getTable(); - boolean doContinue = column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - if (attributeOverride.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE, - new String[] {attributeOverride.getName(), table, column.getName()}, - column, column.tableTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - if (attributeOverride.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, - new String[] {attributeOverride.getName(), column.getName()}, - column, column.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseContext.java deleted file mode 100644 index fda56cf96b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseContext.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class BaseContext implements IContext -{ - private IContext parentContext; - - - public BaseContext(IContext parentContext) { - super(); - this.parentContext = parentContext; - } - - /** - * All inter-context based initialization should be done here - * (i.e. all initialization based on other contexts, parent or otherwise) - */ - protected abstract void initialize(); - - /** - * @see IContext#getParentContext() - */ - public IJpaPlatform getPlatform() { - return getParentContext().getPlatform(); - } - - /** - * @see IContext#getParentContext() - */ - public IContext getParentContext() { - return parentContext; - } - - /** - * All subclass implementation {@link #refreshDefaults(DefaultsContext)} - * should be preceded by a "super" call to this method - */ - public void refreshDefaults(DefaultsContext parentDefaults) { - initialize(); - } - - /** - * All subclass implementation {@link #refreshDefaults(DefaultsContext)} - * should be preceded by a "super" call to this method - */ - public void addToMessages(List messages) { - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaPlatform.java deleted file mode 100644 index 330a294074..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaPlatform.java +++ /dev/null @@ -1,213 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaFileContentProvider; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaJpaFileContentProvider; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaId; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion; -import org.eclipse.jpt.core.internal.content.orm.OrmXmlJpaFileContentProvider; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlJpaFileContentProvider; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class BaseJpaPlatform implements IJpaPlatform -{ - public static final String DEFAULT_TABLE_SCHEMA_KEY = "table.schema"; - public static final String DEFAULT_TABLE_CATALOG_KEY = "table.catalog"; - public static final String DEFAULT_TABLE_NAME_KEY = "table.name"; - public static final String DEFAULT_ACCESS_KEY = "access"; - public static final String DEFAULT_ENTITY_NAME_KEY = "entity.name"; - public static final String DEFAULT_COLUMN_TABLE_KEY = "column.table"; - public static final String DEFAULT_COLUMN_NAME_KEY = "column.name"; - public static final String DEFAULT_JOIN_TABLE_NAME_KEY = "joinTable.name"; - public static final String DEFAULT_TARGET_ENTITY_KEY = "oneToMany.targetEntity"; - public static final String DEFAULT_JOIN_COLUMN_TABLE_KEY = "joinColumn.table"; - public static final String DEFAULT_JOIN_COLUMN_NAME_KEY = "joinColumn.name"; - public static final String DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY = "joinColumn.referencedColumnName"; - public static final String DEFAULT_TABLE_GENERATOR_SCHEMA_KEY = "tableGenerator.schema"; - - private String id; - - protected IJpaProject project; - - private Collection contentProviders; - - private IContext context; - - public String getId() { - return this.id; - } - - /** - * ************* - * * IMPORTANT * For INTERNAL use only !! - * ************* - * - * @see IJpaPlatform#setId(String) - */ - public void setId(String theId) { - this.id = theId; - } - - public IJpaProject getProject() { - return this.project; - } - - public void setProject(IJpaProject jpaProject) { - this.project = jpaProject; - } - - // ********** Persistence Unit ******************************************** - - public boolean containsPersistenceUnitNamed(String name) { - return ((BaseJpaProjectContext)this.context).containsPersistenceUnitNamed(name); - } - - public PersistenceUnit persistenceUnitNamed(String name) { - return ((BaseJpaProjectContext)this.context).persistenceUnitNamed(name); - } - - public Iterator persistenceUnits() { - return ((BaseJpaProjectContext)this.context).persistenceUnits(); - } - - public int persistenceUnitSize() { - return ((BaseJpaProjectContext)this.context).persistenceUnitContextsSize(); - } - - - // ********** Persistent Types ******************************************** - - public Iterator persistentTypes(String persistenceUnitName) { - PersistenceUnitContext puContext = - ((BaseJpaProjectContext) this.context).persistenceUnitContext(persistenceUnitName); - return (puContext == null) ? null : puContext.persistentTypes(); - } - - - // ************************************************************************ - - public Collection jpaFileContentProviders() { - if (this.contentProviders == null) { - this.contentProviders = new ArrayList(); - this.contentProviders.add(PersistenceXmlJpaFileContentProvider.INSTANCE); - this.contentProviders.add(JavaJpaFileContentProvider.INSTANCE); - this.contentProviders.add(OrmXmlJpaFileContentProvider.INSTANCE); - } - return this.contentProviders; - } - - public IContext buildProjectContext() { - this.context = new BaseJpaProjectContext(getProject()); - return this.context; - } - - public Iterator validPersistenceXmlFiles(){ - return ((BaseJpaProjectContext)this.context).validPersistenceXmlFiles(); - } - - public IContext buildJavaTypeContext(IContext parentContext, IJavaTypeMapping typeMapping) { - String key = typeMapping.getKey(); - if (key == IMappingKeys.ENTITY_TYPE_MAPPING_KEY) { - return new JavaEntityContext(parentContext, (JavaEntity) typeMapping); - } - else if (key == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) { - return new JavaEmbeddableContext(parentContext, (JavaEmbeddable) typeMapping); - } - else if (key == IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) { - return new JavaMappedSuperclassContext(parentContext, (JavaMappedSuperclass) typeMapping); - } - else if (key == null) { - return new JavaNullTypeMappingContext(parentContext, (JavaNullTypeMapping) typeMapping); - } - else { - throw new IllegalArgumentException(typeMapping.toString()); - } - } - - public IContext buildJavaAttributeContext(IContext parentContext, IJavaAttributeMapping attributeMapping) { - String key = attributeMapping.getKey(); - if (key == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) { - return new JavaBasicContext(parentContext, (JavaBasic) attributeMapping); - } - else if (key == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY) { - return new JavaIdContext(parentContext, (JavaId) attributeMapping); - } - else if (key == IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) { - return new JavaVersionContext(parentContext, (JavaVersion) attributeMapping); - } - else if (key == IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) { - return new JavaEmbeddedContext(parentContext, (JavaEmbedded) attributeMapping); - } - else if (key == IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) { - return new JavaEmbeddedIdContext(parentContext, (JavaEmbeddedId) attributeMapping); - } - else if (key == IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) { - return new JavaOneToOneContext(parentContext, (JavaOneToOne) attributeMapping); - } - else if (key == IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) { - return new JavaOneToManyContext(parentContext, (JavaOneToMany) attributeMapping); - } - else if (key == IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) { - return new JavaManyToOneContext(parentContext, (JavaManyToOne) attributeMapping); - } - else if (key == IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) { - return new JavaManyToManyContext(parentContext, (JavaManyToMany) attributeMapping); - } - else if (key == IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) { - return new JavaTransientContext(parentContext, (JavaTransient) attributeMapping); - } - else if (key == null) { - return new JavaNullAttributeMappingContext(parentContext, (JavaNullAttributeMapping) attributeMapping); - } - else { - throw new IllegalArgumentException(attributeMapping.toString()); - } - } - - public void resynch(IContext contextHierarchy) { - ((BaseJpaProjectContext) contextHierarchy).refreshDefaults(); - } - - public void addToMessages(List messages) { - BaseJpaProjectContext context = (BaseJpaProjectContext) buildProjectContext(); - context.refreshDefaults(); - context.addToMessages(messages); - } - -// public IGeneratorRepository generatorRepository(IPersistentType persistentType) { -// return ((BaseJpaProjectContext) context).generatorRepository(persistentType); -// } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaProjectContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaProjectContext.java deleted file mode 100644 index dc70a872e3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaProjectContext.java +++ /dev/null @@ -1,391 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Path; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * The jpaProject context used for base jpa projects. It is assumed that - * the jpaProject contains at least 1 persistence.xml file. Multiple persistence.xml - * files will be treated as an error condition, no defaults or validation based - * on the context of a persistence-unit will be given. Currently no support for default orm.xml - * files or defaulting annotated java files, we don't know how the information will be packaged. - * - * Multiple persistence-units can be supported, but the resulting defaults/validation - * may be incorrect. If the persistence-units have overlap in the java files they specify - * as mapped, then the defaults could be wrong depending on the context. We can only use 1 set - * of defaults in our tooling. - */ -public class BaseJpaProjectContext extends BaseContext -{ - private IJpaProject jpaProject; - - private List validPersistenceXmlFiles; - private List invalidPersistenceXmlFiles; - - private Collection persistenceUnitContexts; - - public BaseJpaProjectContext(IJpaProject theJpaProject) { - super(null); - jpaProject = theJpaProject; - validPersistenceXmlFiles = new ArrayList(); - invalidPersistenceXmlFiles = new ArrayList(); - persistenceUnitContexts = new ArrayList(); - } - - @Override - protected void initialize() { - sortPersistenceXmlFiles(); - buildPersistenceUnitContexts(); - } - - private void sortPersistenceXmlFiles() { - for (IJpaFile jpaFile : persistenceXmlFiles()) { - if (isValidPersistenceXmlLocation(jpaFile)) { - validPersistenceXmlFiles.add(jpaFile); - } - else { - invalidPersistenceXmlFiles.add(jpaFile); - } - } - } - - private Collection persistenceXmlFiles() { - return this.jpaProject.jpaFiles(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE); - } - - private boolean isValidPersistenceXmlLocation(IJpaFile jpaFile) { - IFile file = jpaFile.getFile(); - IProject project = jpaProject.getProject(); - - // check flexible jpaProject structure - IVirtualComponent component = ComponentCore.createComponent(project); - IVirtualFolder rootFolder = component.getRootFolder(); - IVirtualFolder metaInfFolder = rootFolder.getFolder(new Path(jpaProject.rootDeployLocation() + '/' + J2EEConstants.META_INF)); - return metaInfFolder.exists() && CollectionTools.contains(metaInfFolder.getUnderlyingFolders(), file.getParent()); - } - - //TODO need to handle clearing out defaults for JpaFiles that aren't in a persistenceUnit - // or for when there are multiple persistence.xml files - //TODO how do we handle files being in multiple persistenceUnits? this is valid, but - //our tool can really only show defaults for one or the other. should clear out defaults and - //probably have a warning letting the user know why they get no defaults or validation - protected void buildPersistenceUnitContexts() { - // we currently only support *one* persistence.xml file per jpaProject, - // so we provide no defaults or validation for those that have more or less - if (validPersistenceXmlFiles.size() == 1) { - IJpaFile file = validPersistenceXmlFiles.get(0); - buildPersistenceUnitContexts(getPersistence(file)); - } - } - - protected void buildPersistenceUnitContexts(Persistence persistence) { - if (persistence != null) { - for (Iterator stream = persistence.getPersistenceUnits().iterator(); stream.hasNext();) { - PersistenceUnit persistenceUnit = (PersistenceUnit) stream.next(); - PersistenceUnitContext persistenceUnitContext = new PersistenceUnitContext(this, persistenceUnit); - persistenceUnitContexts.add(persistenceUnitContext); - } - } - } - - protected Persistence getPersistence(IJpaFile persistenceXmlFile) { - return ((PersistenceXmlRootContentNode) persistenceXmlFile.getContent()).getPersistence(); - } - - @Override - public IJpaPlatform getPlatform() { - return this.jpaProject.getPlatform(); - } - - protected Iterator validPersistenceXmlFiles(){ - return validPersistenceXmlFiles.iterator(); - } - - public void refreshDefaults() { - refreshDefaults(null); - } - - public void refreshDefaults(DefaultsContext parentDefaults) { - super.refreshDefaults(parentDefaults); - DefaultsContext defaultsContext = buildDefaultsContext(); - for (PersistenceUnitContext context : this.persistenceUnitContexts) { - context.refreshDefaults(defaultsContext); - } - } - - private DefaultsContext buildDefaultsContext() { - return new DefaultsContext(){ - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY) - || key.equals(BaseJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY)) { - return getProjectUserSchema(); - } - else if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)) { - return getProjectUserCatalog(); - } - return null; - } - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return null; - } - }; - } - - protected ConnectionProfile getProjectConnectionProfile() { - return this.jpaProject.connectionProfile(); - } - - //TODO is the userName what we want to use, or do we need a preference for the user? - private String getProjectUserSchema() { - ConnectionProfile profile = this.getProjectConnectionProfile(); - return profile.getUserName(); - } - - private String getProjectUserCatalog() { - ConnectionProfile profile = this.getProjectConnectionProfile(); - return profile.getCatalogName(); - } - - public boolean contains(IPersistentType persistentType) { - for (PersistenceUnitContext context : this.persistenceUnitContexts) { - if (context.contains(persistentType)) { - return true; - } - } - return false; - } - - private Iterator persistenceUnitContexts() { - return this.persistenceUnitContexts.iterator(); - } - - int persistenceUnitContextsSize() { - return this.persistenceUnitContexts.size(); - } - - PersistenceUnitContext persistenceUnitContext(String persistenceUnitName) { - for (Iterator stream = persistenceUnitContexts(); stream.hasNext(); ) { - PersistenceUnitContext puContext = stream.next(); - if (puContext.persistenceUnit().getName().equals(persistenceUnitName)) { - return puContext; - } - } - return null; - } - - Iterator persistenceUnits() { - return new TransformationIterator(this.persistenceUnitContexts()) { - @Override - protected PersistenceUnit transform(PersistenceUnitContext next) { - return next.persistenceUnit(); - } - }; - } - - public boolean containsPersistenceUnitNamed(String name) { - return this.persistenceUnitNamed(name) != null; - } - - PersistenceUnit persistenceUnitNamed(String name) { - for (PersistenceUnitContext context : this.persistenceUnitContexts) { - if( context.persistenceUnit().getName().equals(name)) { - return context.persistenceUnit(); - } - } - return null; - } - -// public IGeneratorRepository generatorRepository(IPersistentType persistentType) { -// for (PersistenceUnitContext context : this.persistenceUnitContexts) { -// if (context.contains(persistentType)) { -// context.getGeneratorRepository(); -// } -// } -// return NullGeneratorRepository.instance(); -// } - - /* If this is true, it may be assumed that all the requirements are valid - * for further validation. For example, if this is true at the point we - * are validating persistence units, it may be assumed that there is a - * single persistence.xml and that it has valid content down to the - * persistence unit level. */ - private boolean okToContinueValidation = true; - - public void addToMessages(List messages) { - super.addToMessages(messages); - addProjectLevelMessages(messages); - if (okToContinueValidation) { - for (PersistenceUnitContext context : persistenceUnitContexts) { - context.addToMessages(messages); - } - } - addOrphanedJavaClassMessages(messages); - } - - protected void addProjectLevelMessages(List messages) { - addConnectionMessages(messages); - addNoPersistenceXmlMessage(messages); - addMultiplePersistenceXmlMessage(messages); - addInvalidPersistenceXmlContentMessage(messages); - addNoPersistenceUnitMessage(messages); - addMultiplePersistenceUnitMessage(messages); - } - - protected void addConnectionMessages(List messages) { - addNoConnectionMessage(messages); - addInactiveConnectionMessage(messages); - } - - protected boolean okToProceedForConnectionValidation = true; - - protected void addNoConnectionMessage(List messages) { - Connection connection = jpaProject.getDataSource().getConnection(); - if (connection == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.NORMAL_SEVERITY, - IJpaValidationMessages.PROJECT_NO_CONNECTION, - jpaProject) - ); - okToProceedForConnectionValidation = false; - } - } - - protected void addInactiveConnectionMessage(List messages) { - Connection connection = jpaProject.getDataSource().getConnection(); - if (okToProceedForConnectionValidation && ! connection.isConnected()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.NORMAL_SEVERITY, - IJpaValidationMessages.PROJECT_INACTIVE_CONNECTION, - new String[] {jpaProject.getDataSource().getConnectionProfileName()}, - jpaProject) - ); - } - okToProceedForConnectionValidation = true; - } - - protected void addNoPersistenceXmlMessage(List messages) { - if (validPersistenceXmlFiles.isEmpty()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PROJECT_NO_PERSISTENCE_XML, - jpaProject) - ); - okToContinueValidation = false; - } - } - - protected void addMultiplePersistenceXmlMessage(List messages) { - if (validPersistenceXmlFiles.size() > 1) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PROJECT_MULTIPLE_PERSISTENCE_XML, - jpaProject) - ); - okToContinueValidation = false; - } - } - - protected void addInvalidPersistenceXmlContentMessage(List messages) { - if (validPersistenceXmlFiles.size() == 1) { - IJpaFile persistenceXmlFile = (IJpaFile) validPersistenceXmlFiles.get(0); - if (getPersistence(persistenceXmlFile) == null) { - PersistenceXmlRootContentNode root = - (PersistenceXmlRootContentNode) persistenceXmlFile.getContent(); - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_XML_INVALID_CONTENT, - root, root.validationTextRange()) - ); - okToContinueValidation = false; - } - } - } - - protected void addNoPersistenceUnitMessage(List messages) { - if (okToContinueValidation && persistenceUnitContexts.size() == 0) { - IJpaFile validPersistenceXml = validPersistenceXmlFiles.get(0); - Persistence persistence = getPersistence(validPersistenceXml); - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT, - persistence, persistence.validationTextRange()) - ); - okToContinueValidation = false; - } - } - - protected void addMultiplePersistenceUnitMessage(List messages) { - if (okToContinueValidation && persistenceUnitContexts.size() > 1) { - IJpaFile validPersistenceXml = validPersistenceXmlFiles.get(0); - Persistence persistence = getPersistence(validPersistenceXml); - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS, - persistence, persistence.validationTextRange()) - ); - okToContinueValidation = false; - } - } - - protected void addOrphanedJavaClassMessages(List messages) { - for (IJpaFile jpaFile : jpaProject.jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE)) { - for (JavaPersistentType jpType : ((JpaCompilationUnit) jpaFile.getContent()).getTypes()) { - if (jpType.getMappingKey() != IMappingKeys.NULL_TYPE_MAPPING_KEY && ! contains(jpType)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CONTEXT, - jpType.getMapping(), jpType.getMapping().validationTextRange()) - ); - } - } - } - } - - public String toString() { - return StringTools.buildToStringFor( this, this.jpaProject.getJavaProject().getProject().getName()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/ColumnContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/ColumnContext.java deleted file mode 100644 index b042c99fb3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/ColumnContext.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.mappings.IColumn; - -public class ColumnContext extends BaseContext -{ - private IColumn column; - - public ColumnContext(IContext parentContext, IColumn column) { - super(parentContext); - this.column = column; - } - - @Override - protected void initialize() {} - - public IColumn getColumn() { - return this.column; - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.column.refreshDefaults(defaultsContext); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/DefaultsContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/DefaultsContext.java deleted file mode 100644 index 556917fb35..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/DefaultsContext.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.IPersistentType; - -public interface DefaultsContext -{ - /** - * Return the default for the given key. Se BaseJpaPlatform - * for the defaults supported by it. - * @param key - * @return - */ - Object getDefault(String key); - - /** - * Return the IPersistentType with the given name found in the scope - * of the persistence unit - * @param fullyQualifiedTypeName - * @return - */ - IPersistentType persistentType(String fullyQualifiedTypeName); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GeneratorRepository.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GeneratorRepository.java deleted file mode 100644 index e116ab9b2d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GeneratorRepository.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.eclipse.jpt.core.internal.mappings.IGenerator; - -/** - * For now we are not going to handle duplicates. The spec says that it is undefined - * when you have multiple generators with the same name. A generator with the - * same name in an orm.xml file overrides one in the java. Duplicates will just - * be handled in a last in wins fashion. - * - * At some point we could handle duplicates that aren't overrides with a warning. It - * is difficult to tell the difference between an override and a duplicate so - * right now we are not handling it. - */ -public class GeneratorRepository implements IGeneratorRepository -{ - - private Map generators; - - public GeneratorRepository() { - super(); - this.generators = new HashMap(); - } - - /** - * Add the given IGenerator to the Map of generators. If there is - * already a generator with the given name it will be replaced in the map - * by the new one. - * @param generator - */ - public void addGenerator(IGenerator generator) { - this.generators.put(generator.getName(), generator); - } - - public IGenerator generator(String name) { - return this.generators.get(name); - } - - public Iterator generatorNames() { - return this.generators.keySet().iterator(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IContext.java deleted file mode 100644 index 507258582c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IContext.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public interface IContext -{ - IJpaPlatform getPlatform(); - - IContext getParentContext(); - - void refreshDefaults(DefaultsContext defaults); - - void addToMessages(List messages); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IGeneratorRepository.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IGeneratorRepository.java deleted file mode 100644 index c904fbb305..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IGeneratorRepository.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.Iterator; -import org.eclipse.jpt.core.internal.mappings.IGenerator; - -public interface IGeneratorRepository -{ - /** - * Return all generator names for this persistence unit. - * 1 namespace per persistence unit for all generators in xml and java - * @return - */ - Iterator generatorNames(); - - /** - * Return the Generator with the given name - * @param name - * @return - */ - IGenerator generator(String name); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaAttributeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaAttributeContext.java deleted file mode 100644 index ef40e6ae49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaAttributeContext.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class JavaAttributeContext extends BaseContext -{ - protected IJavaAttributeMapping attributeMapping; - - public JavaAttributeContext(IContext parentContext, IJavaAttributeMapping javaAttributeMapping) { - super(parentContext); - this.attributeMapping = javaAttributeMapping; - } - - @Override - protected void initialize() {} - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - //do nothing, override as necessary - } - - protected PersistenceUnitContext persistenceUnitContext() { - return (PersistenceUnitContext) persistentAttributeContext().javaTypeContext().getParentContext(); - } - - protected JavaPersistentAttributeContext persistentAttributeContext() { - return (JavaPersistentAttributeContext) getParentContext(); - } - - protected boolean embeddableOwned() { - return getMapping().typeMapping().getKey() == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - protected boolean entityOwned() { - return getMapping().typeMapping().getKey() == IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - public final void refreshDefaults(DefaultsContext defaultsContext) { - defaultsContext = wrapDefaultsContext(defaultsContext); - refreshDefaultsInternal(defaultsContext); - } - - protected void refreshDefaultsInternal(DefaultsContext defaultsContext) { - this.attributeMapping.refreshDefaults(defaultsContext); - } - - protected IAttributeMapping getMapping() { - return this.attributeMapping; - } - - public final DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - return JavaAttributeContext.this.getDefault(key, defaultsContext); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)) { - return getMapping().getPersistentAttribute().getName(); - } - return defaultsContext.getDefault(key); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - addModifierMessages(messages); - - addInvalidMappingMessage(messages); - } - - protected void addModifierMessages(List messages) { - JavaPersistentAttribute attribute = - (JavaPersistentAttribute) attributeMapping.getPersistentAttribute(); - if (attribute.getMapping().getKey() != IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY - && attribute.getAttribute().isField()) { - int flags; - - try { - flags = attribute.getAttribute().getJdtMember().getFlags(); - } catch (JavaModelException jme) { - /* no error to log, in that case */ - return; - } - - if (Flags.isFinal(flags)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD, - new String[] {attribute.getName()}, - attribute, attribute.validationTextRange()) - ); - } - - if (Flags.isPublic(flags)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD, - new String[] {attribute.getName()}, - attribute, attribute.validationTextRange()) - ); - - } - } - } - - protected void addInvalidMappingMessage(List messages) { - IAttributeMapping attributeMapping = getMapping(); - ITypeMapping typeMapping = attributeMapping.typeMapping(); - if (! typeMapping.attributeMappingKeyAllowed(attributeMapping.getKey())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING, - new String[] {attributeMapping.getPersistentAttribute().getName()}, - attributeMapping, attributeMapping.validationTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaBasicContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaBasicContext.java deleted file mode 100644 index f2a0d06f5e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaBasicContext.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaBasicContext extends JavaAttributeContext -{ - private ColumnContext columnContext; - - public JavaBasicContext(IContext parentContext, JavaBasic javaBasic) { - super(parentContext, javaBasic); - this.columnContext = new ColumnContext(this, javaBasic.getColumn()); - } - - protected JavaBasic getBasic() { - return (JavaBasic) attributeMapping; - } - - @Override - public void refreshDefaultsInternal(DefaultsContext defaultsContext) { - super.refreshDefaultsInternal(defaultsContext); - this.columnContext.refreshDefaults(defaultsContext); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - addColumnMessages(messages); - } - - protected void addColumnMessages(List messages) { - JavaBasic basic = getBasic(); - ITypeMapping typeMapping = basic.typeMapping(); - IColumn column = basic.getColumn(); - String table = column.getTable(); - boolean doContinue = entityOwned() && column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddableContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddableContext.java deleted file mode 100644 index 5a2500aafb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddableContext.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable; - -public class JavaEmbeddableContext extends JavaTypeContext -{ - public JavaEmbeddableContext(IContext parentContext, JavaEmbeddable mapping) { - super(parentContext, mapping); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedContext.java deleted file mode 100644 index a3d8f6d419..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedContext.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsFactory; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaEmbeddedContext extends JavaAttributeContext -{ - private Collection attributeOverrideContexts; - - public JavaEmbeddedContext(IContext parentContext, JavaEmbedded javaEmbedded) { - super(parentContext, javaEmbedded); - this.attributeOverrideContexts = buildAttributeOverrideContexts(); - } - - protected Collection buildAttributeOverrideContexts() { - Collection contexts = new ArrayList(); - for (IAttributeOverride attributeOverride : getEmbedded().getAttributeOverrides()) { - contexts.add(new AttributeOverrideContext(this, attributeOverride)); - } - - return contexts; - } - - private IEmbedded getEmbedded() { - return (IEmbedded) getMapping(); - } - - public void refreshDefaultsInternal(DefaultsContext defaultsContext) { - super.refreshDefaultsInternal(defaultsContext); - refreshDefaultAttributeOverrides(); - for (AttributeOverrideContext context : this.attributeOverrideContexts) { - context.refreshDefaults(defaultsContext); - } - } - - protected void refreshDefaultAttributeOverrides() { - for (Iterator i = getEmbedded().allOverridableAttributeNames(); i.hasNext(); ) { - String override = i.next(); - if (!getEmbedded().containsAttributeOverride(override)) { - JavaAttributeOverride attributeOverride = JpaJavaMappingsFactory.eINSTANCE.createJavaAttributeOverride(new IEmbedded.AttributeOverrideOwner(getEmbedded()), getEmbedded().getPersistentAttribute().getAttribute()); - getEmbedded().getDefaultAttributeOverrides().add(attributeOverride); - attributeOverride.setName(override); - } - } - - Collection attributeNames = CollectionTools.collection(getEmbedded().allOverridableAttributeNames()); - - //remove any default mappings that are not included in the attributeNames collection - Collection overridesToRemove = new ArrayList(); - for (IAttributeOverride attributeOverride : getEmbedded().getDefaultAttributeOverrides()) { - if (!attributeNames.contains(attributeOverride.getName()) - || getEmbedded().containsSpecifiedAttributeOverride(attributeOverride.getName())) { - overridesToRemove.add(attributeOverride); - } - } - - getEmbedded().getDefaultAttributeOverrides().removeAll(overridesToRemove); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - for (AttributeOverrideContext aoContext : attributeOverrideContexts) { - aoContext.addToMessages(messages); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedIdContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedIdContext.java deleted file mode 100644 index 99be7d12fd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedIdContext.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddedId; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaEmbeddedIdContext extends JavaAttributeContext -{ - public JavaEmbeddedIdContext(IContext parentContext, JavaEmbeddedId javaEmbeddedId) { - super(parentContext, javaEmbeddedId); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java deleted file mode 100644 index a976dd953f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java +++ /dev/null @@ -1,295 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity; -import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsFactory; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaEntityContext extends JavaTypeContext -{ - private TableContext tableContext; - - private Collection secondaryTableContexts; - - private Collection attributeOverrideContexts; - - private Collection associationOverrideContexts; - - private Collection pkJoinColumnContexts; - - public JavaEntityContext(IContext parentContext, JavaEntity javaEntity) { - super(parentContext, javaEntity); - this.tableContext = buildTableContext(javaEntity); - this.attributeOverrideContexts = buildAttributeOverrideContexts(); - this.associationOverrideContexts = buildAssociationOverrideContexts(); - this.secondaryTableContexts = buildSecondaryTableContexts(); - this.pkJoinColumnContexts = buildPkJoinColumnContexts(); - } - - protected JavaEntity getEntity() { - return (JavaEntity) getTypeMapping(); - } - - protected TableContext buildTableContext(JavaEntity javaEntity) { - return new TableContext(this, javaEntity.getTable()); - } - - protected Collection buildAttributeOverrideContexts() { - Collection contexts = new ArrayList(); - for (IAttributeOverride attributeOverride : getEntity().getAttributeOverrides()) { - contexts.add(new AttributeOverrideContext(this, attributeOverride)); - } - - return contexts; - } - - //only support default joinColumn information for the default association overrides, - //AssociationOverride has no defaults, the name and joinColumns must be specified - protected Collection buildAssociationOverrideContexts() { - Collection contexts = new ArrayList(); - for (IAssociationOverride associationOverride : getEntity().getDefaultAssociationOverrides()) { - contexts.add(new AssociationOverrideContext(this, associationOverride)); - } - - return contexts; - } - - protected Collection buildSecondaryTableContexts() { - Collection contexts = new ArrayList(); - for (ISecondaryTable secondaryTable : getEntity().getSecondaryTables()) { - contexts.add(new SecondaryTableContext(this, secondaryTable)); - } - - return contexts; - } - - protected Collection buildPkJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (IPrimaryKeyJoinColumn pkJoinColumn : getEntity().getPrimaryKeyJoinColumns()) { - contexts.add(new PrimaryKeyJoinColumnContext(this, pkJoinColumn)); - } - - return contexts; - } - - /** - * Mappings files will populate the generator repository after Java files. - * This will cause the mapping files to override any generators with the same name - * in the java - */ - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - super.populateGeneratorRepository(generatorRepository); - ITableGenerator tableGenerator = getEntity().getTableGenerator(); - if (tableGenerator != null) { - generatorRepository.addGenerator(tableGenerator); - } - ISequenceGenerator sequenceGenerator = getEntity().getSequenceGenerator(); - if (sequenceGenerator != null) { - generatorRepository.addGenerator(sequenceGenerator); - } - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - defaultsContext = wrapDefaultsContext(defaultsContext); - super.refreshDefaults(defaultsContext); - - if (this.tableContext != null) { - this.tableContext.refreshDefaults(defaultsContext); - } - refreshDefaultAttributeOverrides(); - refreshDefaultAssociationOverrides(); - for (SecondaryTableContext context : this.secondaryTableContexts) { - context.refreshDefaults(defaultsContext); - } - for (AttributeOverrideContext context : this.attributeOverrideContexts) { - context.refreshDefaults(defaultsContext); - } - for (AssociationOverrideContext context : this.associationOverrideContexts) { - context.refreshDefaults(defaultsContext); - } - for (PrimaryKeyJoinColumnContext context : this.pkJoinColumnContexts) { - context.refreshDefaults(defaultsContext); - } - } - - public DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - DefaultsContext wrappedDefaultsContext = new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY)) { - if (getEntity().rootEntity().getInheritanceStrategy().isSingleTable()) { - IEntity rootEntity = getEntity().rootEntity(); - if (rootEntity == getEntity()) { - return rootEntity.getName(); - } - return rootEntity.getTable().getName(); - } - return getEntity().getName(); - } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - if (this.tableContext != null) { - return this.tableContext.wrapDefaultsContext(wrappedDefaultsContext); - } - return wrappedDefaultsContext; - } - - protected void refreshDefaultAttributeOverrides() { - for (Iterator i = getEntity().allOverridableAttributeNames(); i.hasNext(); ) { - String override = i.next(); - if (!getEntity().containsAttributeOverride(override)) { - JavaAttributeOverride attributeOverride = JpaJavaMappingsFactory.eINSTANCE.createJavaAttributeOverride(new IEntity.AttributeOverrideOwner(getEntity()), getEntity().getType()); - getEntity().getDefaultAttributeOverrides().add(attributeOverride); - attributeOverride.setName(override); - } - - } - - Collection attributeNames = CollectionTools.collection(getEntity().allOverridableAttributeNames()); - - //remove any default mappings that are not included in the attributeNames collection - Collection overridesToRemove = new ArrayList(); - for (IAttributeOverride attributeOverride : getEntity().getDefaultAttributeOverrides()) { - if (!attributeNames.contains(attributeOverride.getName()) - || getEntity().containsSpecifiedAttributeOverride(attributeOverride.getName())) { - overridesToRemove.add(attributeOverride); - } - } - - getEntity().getDefaultAttributeOverrides().removeAll(overridesToRemove); - } - - protected void refreshDefaultAssociationOverrides() { - for (Iterator i = getEntity().allOverridableAssociationNames(); i.hasNext(); ) { - String override = i.next(); - if (!getEntity().containsAssociationOverride(override)) { - JavaAssociationOverride associationOverride = JpaJavaMappingsFactory.eINSTANCE.createJavaAssociationOverride(new IEntity.AssociationOverrideOwner(getEntity()), getEntity().getType()); - getEntity().getDefaultAssociationOverrides().add(associationOverride); - associationOverride.setName(override); - } - - } - - Collection attributeNames = CollectionTools.collection(getEntity().allOverridableAssociationNames()); - - //remove any default mappings that are not included in the attributeNames collection - Collection overridesToRemove = new ArrayList(); - for (IAssociationOverride associationOverride : getEntity().getDefaultAssociationOverrides()) { - if (!attributeNames.contains(associationOverride.getName()) - || getEntity().containsSpecifiedAssociationOverride(associationOverride.getName())) { - overridesToRemove.add(associationOverride); - } - } - - getEntity().getDefaultAssociationOverrides().removeAll(overridesToRemove); - } - - - public void addToMessages(List messages) { - super.addToMessages(messages); - addTableMessages(messages); - addIdMessages(messages); - - for (SecondaryTableContext context : secondaryTableContexts) { - context.addToMessages(messages); - } - - for (AttributeOverrideContext aoContext : attributeOverrideContexts) { - aoContext.addToMessages(messages); - } - - for (AssociationOverrideContext aoContext : associationOverrideContexts) { - aoContext.addToMessages(messages); - } - } - - protected void addTableMessages(List messages) { - ITable table = getEntity().getTable(); - boolean doContinue = table.isConnected(); - String schema = table.getSchema(); - - if (doContinue && ! table.hasResolvedSchema()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.TABLE_UNRESOLVED_SCHEMA, - new String[] {schema, table.getName()}, - table, table.schemaTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! table.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.TABLE_UNRESOLVED_NAME, - new String[] {table.getName()}, - table, table.nameTextRange()) - ); - } - } - - protected void addIdMessages(List messages) { - addNoIdMessage(messages); - - } - - protected void addNoIdMessage(List messages) { - IEntity entity = getEntity(); - if (entityHasNoId()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.ENTITY_NO_ID, - new String[] {entity.getName()}, - entity, entity.validationTextRange()) - ); - } - } - - private boolean entityHasNoId() { - return ! this.entityHasId(); - } - - private boolean entityHasId() { - for (Iterator stream = this.getEntity().getPersistentType().allAttributes(); stream.hasNext(); ) { - if (stream.next().isIdAttribute()) { - return true; - } - } - return false; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaIdContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaIdContext.java deleted file mode 100644 index 29861389f2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaIdContext.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaId; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaIdContext extends JavaAttributeContext -{ - private ColumnContext columnContext; - - public JavaIdContext(IContext parentContext, JavaId javaId) { - super(parentContext, javaId); - this.columnContext = new ColumnContext(this, javaId.getColumn()); - } - - protected JavaId getId() { - return (JavaId) attributeMapping; - } - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - ITableGenerator tableGenerator = getId().getTableGenerator(); - if (tableGenerator != null) { - generatorRepository.addGenerator(tableGenerator); - } - ISequenceGenerator sequenceGenerator = getId().getSequenceGenerator(); - if (sequenceGenerator != null) { - generatorRepository.addGenerator(sequenceGenerator); - } - } - - @Override - public void refreshDefaultsInternal(DefaultsContext defaultsContext) { - super.refreshDefaultsInternal(defaultsContext); - this.columnContext.refreshDefaults(defaultsContext); - ITableGenerator tableGenerator = getId().getTableGenerator(); - if (tableGenerator != null) { - tableGenerator.refreshDefaults(defaultsContext); - } - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - addColumnMessages(messages); - addGeneratorMessages(messages); - } - - protected void addColumnMessages(List messages) { - JavaId id = getId(); - ITypeMapping typeMapping = id.typeMapping(); - IColumn column = id.getColumn(); - String table = column.getTable(); - boolean doContinue = entityOwned() && column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } - - protected void addGeneratorMessages(List messages) { - JavaId id = getId(); - IGeneratedValue generatedValue = id.getGeneratedValue(); - if (generatedValue == null) { - return; - } - String generatorName = generatedValue.getGenerator(); - if (generatorName == null) { - return; - } - IGeneratorRepository generatorRepository = persistenceUnitContext().getGeneratorRepository(); - IGenerator generator = generatorRepository.generator(generatorName); - - if (generator == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.GENERATED_VALUE_UNRESOLVED_GENERATOR, - new String[] {generatorName}, - generatedValue, generatedValue.generatorTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToManyContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToManyContext.java deleted file mode 100644 index 14849d2dc1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToManyContext.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToMany; - -public class JavaManyToManyContext extends JavaMultiRelationshipMappingContext -{ - public JavaManyToManyContext(IContext parentContext, JavaManyToMany javaManyToMany) { - super(parentContext, javaManyToMany); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToOneContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToOneContext.java deleted file mode 100644 index 828ecaee82..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToOneContext.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaManyToOne; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaManyToOneContext extends JavaSingleRelationshipMappingContext -{ - public JavaManyToOneContext(IContext parentContext, JavaManyToOne javaManyToOne) { - super(parentContext, javaManyToOne); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - } - - //ManyToOne mapping is always the owning side - protected boolean isOwningSide() { - return true; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMappedSuperclassContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMappedSuperclassContext.java deleted file mode 100644 index 5748b2b556..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMappedSuperclassContext.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMappedSuperclass; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaMappedSuperclassContext extends JavaTypeContext -{ - public JavaMappedSuperclassContext(IContext parentContext, JavaMappedSuperclass mapping) { - super(parentContext, mapping); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java deleted file mode 100644 index 87b72940f7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class JavaMultiRelationshipMappingContext extends JavaRelationshipMappingContext -{ - private JoinTableContext joinTableContext; - - - protected JavaMultiRelationshipMappingContext( - IContext parentContext, JavaMultiRelationshipMapping mapping) { - super(parentContext, mapping); - this.joinTableContext = new JoinTableContext(this, mapping.getJoinTable()); - } - - @Override - public void refreshDefaultsInternal(DefaultsContext defaultsContext) { - super.refreshDefaultsInternal(defaultsContext); - this.joinTableContext.refreshDefaults(defaultsContext); - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_TABLE_NAME_KEY)) { - return joinTableDefaultName(defaultsContext); - } - return super.getDefault(key, defaultsContext); - } - - protected String joinTableDefaultName(DefaultsContext defaultsContext) { - IEntity entity = getMapping().getEntity(); - if (entity == null) { - return null; - } - ITable owningTable = entity.getTable(); - if (owningTable == null) { - return null; - } - IEntity targetEntity = targetEntity(defaultsContext); - if (targetEntity == null) { - return null; - } - ITable targetTable = targetEntity.getTable(); - return (targetTable == null) ? null : owningTable.getName() + "_" + targetTable.getName(); - } - - - protected JavaMultiRelationshipMapping getMapping() { - return (JavaMultiRelationshipMapping) super.getMapping(); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - JavaMultiRelationshipMapping mapping = getMapping(); - - if (getMapping().isJoinTableSpecified()) { - addJoinTableMessages(messages); - } - if (getMapping().getMappedBy() != null) { - addMappedByMessages(messages); - } - } - - protected void addJoinTableMessages(List messages) { - JavaMultiRelationshipMapping mapping = getMapping(); - IJoinTable joinTable = mapping.getJoinTable(); - - boolean doContinue = joinTable.isConnected(); - String schema = joinTable.getSchema(); - - if (doContinue && ! joinTable.hasResolvedSchema()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA, - new String[] {schema, joinTable.getName()}, - joinTable, joinTable.schemaTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! joinTable.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME, - new String[] {joinTable.getName()}, - joinTable, joinTable.nameTextRange()) - ); - doContinue = false; - } - - for (Iterator stream = joinTable.getJoinColumns().iterator(); stream.hasNext(); ) { - IJoinColumn joinColumn = stream.next(); - - if (doContinue && ! joinColumn.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - - if (doContinue && ! joinColumn.isReferencedColumnResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - } - - for (Iterator stream = joinTable.getInverseJoinColumns().iterator(); stream.hasNext(); ) { - IJoinColumn joinColumn = stream.next(); - - if (doContinue && ! joinColumn.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - - if (doContinue && ! joinColumn.isReferencedColumnResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - } - } - - protected void addMappedByMessages(List messages) { - JavaMultiRelationshipMapping mapping = getMapping(); - String mappedBy = mapping.getMappedBy(); - - if (mapping.isJoinTableSpecified()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_MAPPED_BY_WITH_JOIN_TABLE, - mapping.getJoinTable(), mapping.getJoinTable().validationTextRange()) - ); - - } - - IEntity targetEntity = mapping.getResolvedTargetEntity(); - - if (targetEntity == null) { - // already have validation messages for that - return; - } - - IPersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(mappedBy); - - if (attribute == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - if (! mapping.mappedByIsValid(attribute.getMapping())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_INVALID_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - INonOwningMapping mappedByMapping; - try { - mappedByMapping = (INonOwningMapping) attribute.getMapping(); - } catch (ClassCastException cce) { - // there is no error then - return; - } - - if (mappedByMapping.getMappedBy() != null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES, - mapping, mapping.mappedByTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullAttributeMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullAttributeMappingContext.java deleted file mode 100644 index 36c85345bc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullAttributeMappingContext.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapping; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaNullAttributeMappingContext extends JavaAttributeContext -{ - public JavaNullAttributeMappingContext( - IContext parentContext, JavaNullAttributeMapping javaNullAttributeMapping) { - super(parentContext, javaNullAttributeMapping); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullTypeMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullTypeMappingContext.java deleted file mode 100644 index 93d371fb43..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullTypeMappingContext.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaNullTypeMappingContext extends JavaTypeContext -{ - public JavaNullTypeMappingContext(IContext parentContext, JavaNullTypeMapping mapping) { - super(parentContext, mapping); - } - - public void addToMessages(List messages) { - // no-op, nothing to really add - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToManyContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToManyContext.java deleted file mode 100644 index 603d50f56e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToManyContext.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaOneToManyContext extends JavaMultiRelationshipMappingContext -{ - public JavaOneToManyContext(IContext parentContext, JavaOneToMany javaOneToMany) { - super(parentContext, javaOneToMany); - } - - @Override - protected void addJoinTableMessages(List messages) { - // TODO - // a 1-M doesn't *have* to have a join table - return; - - //super.addJoinTableMessages(messages); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToOneContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToOneContext.java deleted file mode 100644 index ab3a6c2674..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToOneContext.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaOneToOneContext extends JavaSingleRelationshipMappingContext -{ - public JavaOneToOneContext(IContext parentContext, JavaOneToOne javaOneToOne) { - super(parentContext, javaOneToOne); - } - - protected JavaOneToOne getMapping() { - return (JavaOneToOne) super.getMapping(); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - if (getMapping().getMappedBy() != null) { - addMappedByMessages(messages); - } - } - - protected void addMappedByMessages(List messages) { - JavaOneToOne mapping = getMapping(); - String mappedBy = mapping.getMappedBy(); - IEntity targetEntity = mapping.getResolvedTargetEntity(); - - if (targetEntity == null) { - // already have validation messages for that - return; - } - - IPersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(mappedBy); - - if (attribute == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - if (! mapping.mappedByIsValid(attribute.getMapping())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_INVALID_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - INonOwningMapping mappedByMapping; - try { - mappedByMapping = (INonOwningMapping) attribute.getMapping(); - } catch (ClassCastException cce) { - // there is no error then - return; - } - - if (mappedByMapping.getMappedBy() != null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES, - mapping, mapping.mappedByTextRange()) - ); - } - } - - @Override - protected boolean isOwningSide() { - return getMapping().getMappedBy() == null; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaPersistentAttributeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaPersistentAttributeContext.java deleted file mode 100644 index 573dab570d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaPersistentAttributeContext.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaPersistentAttributeContext extends BaseContext -{ - private JavaPersistentAttribute javaPersistentAttribute; - - private JavaAttributeContext javaAttributeMappingContext; - - private JavaAttributeContext defaultJavaAttributeMappingContext; - - public JavaPersistentAttributeContext(IContext parentContext, JavaPersistentAttribute javaPersistentAttribute) { - super(parentContext); - this.javaPersistentAttribute = javaPersistentAttribute; - this.javaAttributeMappingContext = buildJavaAttributeMappingContext(); - } - - protected JavaTypeContext javaTypeContext() { - return (JavaTypeContext) getParentContext(); - } - - protected JavaAttributeContext buildJavaAttributeMappingContext() { - IJavaAttributeMapping javaAttributeMapping = this.javaPersistentAttribute.getSpecifiedMapping(); - if (javaAttributeMapping != null) { - return (JavaAttributeContext) getPlatform().buildJavaAttributeContext(this,javaAttributeMapping ); - } - return null; - } - - @Override - protected void initialize() {} - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - if (this.javaAttributeMappingContext != null) { - this.javaAttributeMappingContext.populateGeneratorRepository(generatorRepository); - } - } - - protected boolean embeddableOwned() { - return getPersistentAttribute().typeMapping().getKey() == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - protected boolean entityOwned() { - return getPersistentAttribute().typeMapping().getKey() == IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - public final void refreshDefaults(DefaultsContext defaultsContext) { - defaultsContext = wrapDefaultsContext(defaultsContext); - refreshDefaultsInternal(defaultsContext); - } - - protected void refreshDefaultsInternal(DefaultsContext defaultsContext) { - this.javaPersistentAttribute.refreshDefaults(defaultsContext); - - if (this.javaAttributeMappingContext != null) { - this.javaAttributeMappingContext.refreshDefaults(defaultsContext); - this.defaultJavaAttributeMappingContext = null; - } - else { - IJavaAttributeMapping javaAttributeMapping = this.javaPersistentAttribute.getDefaultMapping(); - if (javaAttributeMapping != null) { - this.defaultJavaAttributeMappingContext = (JavaAttributeContext) getPlatform().buildJavaAttributeContext(this, javaAttributeMapping); - this.defaultJavaAttributeMappingContext.refreshDefaults(defaultsContext); - } - } - } - - protected JavaPersistentAttribute getPersistentAttribute() { - return this.javaPersistentAttribute; - } - - public final DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - return JavaPersistentAttributeContext.this.getDefault(key, defaultsContext); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)) { - return getPersistentAttribute().getName(); - } - return defaultsContext.getDefault(key); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - if (this.javaAttributeMappingContext != null) { - this.javaAttributeMappingContext.addToMessages(messages); - } - else if (this.defaultJavaAttributeMappingContext != null) { - this.defaultJavaAttributeMappingContext.addToMessages(messages); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaRelationshipMappingContext.java deleted file mode 100644 index 8c5b1f40b7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaRelationshipMappingContext.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; - -public abstract class JavaRelationshipMappingContext extends JavaAttributeContext -{ - protected JavaRelationshipMappingContext(IContext parentContext, JavaRelationshipMapping mapping) { - super(parentContext, mapping); - } - - protected IRelationshipMapping getMapping() { - return (IRelationshipMapping) super.getMapping(); - } - - protected IEntity targetEntity(DefaultsContext defaultsContext) { - String targetEntity = getMapping().fullyQualifiedTargetEntity(); - if (targetEntity == null) { - return null; - } - IPersistentType persistentType = defaultsContext.persistentType(targetEntity); - if (persistentType != null) { - ITypeMapping typeMapping = persistentType.getMapping(); - if (typeMapping instanceof IEntity) { - return (IEntity) typeMapping; - } - } - return null; - } - - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_TARGET_ENTITY_KEY)) { - return getMapping().fullyQualifiedTargetEntity(); - } - return super.getDefault(key, defaultsContext); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaSingleRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaSingleRelationshipMappingContext.java deleted file mode 100644 index a9526299ee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaSingleRelationshipMappingContext.java +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class JavaSingleRelationshipMappingContext - extends JavaRelationshipMappingContext -{ - private Collection joinColumnContexts; - - protected JavaSingleRelationshipMappingContext( - IContext parentContext, JavaSingleRelationshipMapping mapping) { - super(parentContext, mapping); - this.joinColumnContexts = buildJoinColumnContexts(); - } - - protected Collection buildJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (Iterator i = getMapping().getJoinColumns().iterator(); i.hasNext(); ) { - IJoinColumn column = (IJoinColumn) i.next(); - contexts.add(new JoinColumnContext(this, column)); - } - return contexts; - } - - protected ISingleRelationshipMapping getMapping() { - return (ISingleRelationshipMapping) super.getMapping(); - } - - protected ITable getTable() { - IEntity entity = getMapping().getEntity(); - if (entity == null) { - return null; - } - return entity.getTable(); - } - - public void refreshDefaultsInternal(DefaultsContext defaultsContext) { - super.refreshDefaultsInternal(defaultsContext); - DefaultsContext joinColumnsDefaultsContext = wrapDefaultsContextForJoinColumn(defaultsContext); - for (JoinColumnContext context : this.joinColumnContexts) { - context.refreshDefaults(joinColumnsDefaultsContext); - } - } - - protected DefaultsContext wrapDefaultsContextForJoinColumn(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_TABLE_KEY)) { - ITable table = getTable(); - if (table == null) { - return null; - } - return table.getName(); - } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - //bug 192287 - do not want joinColumn validation errors on the non-owning side - //of a bidirectional relationship. This is a low risk fix for RC3, but a better - //solution would be to not have the default joinColumns on the non-owning side. - //This would fix another bug that we show default joinColumns in this situation. - if (entityOwned() && isOwningSide()) { - addJoinColumnMessages(messages); - } - } - - protected abstract boolean isOwningSide(); - - protected void addJoinColumnMessages(List messages) { - ISingleRelationshipMapping mapping = getMapping(); - ITypeMapping typeMapping = mapping.typeMapping(); - - for (IJoinColumn joinColumn : mapping.getJoinColumns()) { - String table = joinColumn.getTable(); - boolean doContinue = joinColumn.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE, - new String[] {table, joinColumn.getName()}, - joinColumn, joinColumn.tableTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! joinColumn.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - - if (doContinue && ! joinColumn.isReferencedColumnResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTransientContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTransientContext.java deleted file mode 100644 index 088e34a48a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTransientContext.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaTransientContext extends JavaAttributeContext -{ - public JavaTransientContext(IContext parentContext, JavaTransient javaTransient) { - super(parentContext, javaTransient); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTypeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTypeContext.java deleted file mode 100644 index 12ce71d299..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTypeContext.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class JavaTypeContext extends BaseContext - implements TypeContext -{ - private IJavaTypeMapping typeMapping; - - private Collection javaPersistentAttributeContexts; - - private boolean refreshed; - - public JavaTypeContext(IContext parentContext, IJavaTypeMapping typeMapping) { - super(parentContext); - this.typeMapping = typeMapping; - this.javaPersistentAttributeContexts = buildJavaPersistentAttributeContexts(); - } - - protected Collection buildJavaPersistentAttributeContexts() { - Collection persistentAttributes = new ArrayList(); - for (Iterator i = getPersistentType().getAttributes().iterator(); i.hasNext(); ) { - persistentAttributes.add(new JavaPersistentAttributeContext(this, i.next())); - } - - return persistentAttributes; - } - - - @Override - protected void initialize() {} - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - for (JavaPersistentAttributeContext context : getJavaPersistentAttributeContexts()) { - context.populateGeneratorRepository(generatorRepository); - } - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.refreshed = true; - this.getPersistentType().refreshDefaults(defaultsContext); - for (JavaPersistentAttributeContext context : this.javaPersistentAttributeContexts) { - context.refreshDefaults(defaultsContext); - } - } - - public JavaPersistentType getPersistentType() { - return (JavaPersistentType) typeMapping.getPersistentType(); - } - - protected IJavaTypeMapping getTypeMapping() { - return typeMapping; - } - - protected Collection getJavaPersistentAttributeContexts() { - return this.javaPersistentAttributeContexts; - } - - public boolean isRefreshed() { - return this.refreshed; - } - - public boolean contains(IPersistentType persistentType) { - return persistentType == getPersistentType(); - } - - public void addToMessages(List messages) { - addAttributeMessages(messages); - } - - protected void addAttributeMessages(List messages) { - for (JavaPersistentAttributeContext attributeContext : javaPersistentAttributeContexts) { - attributeContext.addToMessages(messages); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaVersionContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaVersionContext.java deleted file mode 100644 index 543a66cb55..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaVersionContext.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JavaVersionContext extends JavaAttributeContext -{ - private ColumnContext columnContext; - - public JavaVersionContext(IContext parentContext, JavaVersion javaVersion) { - super(parentContext, javaVersion); - this.columnContext = new ColumnContext(this, javaVersion.getColumn()); - } - - protected JavaVersion version() { - return (JavaVersion) attributeMapping; - } - - @Override - public void refreshDefaultsInternal(DefaultsContext defaultsContext) { - super.refreshDefaultsInternal(defaultsContext); - this.columnContext.refreshDefaults(defaultsContext); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - addColumnMessages(messages); - } - - protected void addColumnMessages(List messages) { - JavaVersion version = version(); - ITypeMapping typeMapping = version.typeMapping(); - IColumn column = version.getColumn(); - String table = column.getTable(); - boolean doContinue = entityOwned() && column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinColumnContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinColumnContext.java deleted file mode 100644 index 648f412bb3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinColumnContext.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JoinColumnContext extends AbstractJoinColumnContext -{ - public JoinColumnContext(IContext parentContext, IJoinColumn column) { - super(parentContext, column); - } - - /** - * return the join column's default name; - * which is typically <attribute name>_<referenced column name> - * but, if we don't have an attribute name (e.g. in a unidirectional - * OneToMany or ManyToMany) is - * <target entity name>_<referenced column name> - */ - // _ - // or - // _ - protected String buildDefaultName() { - if (getColumn().getOwner().joinColumns().size() != 1) { - return null; - } - String prefix = getColumn().getOwner().attributeName(); - if (prefix == null) { - prefix = targetEntityName(); - } - if (prefix == null) { - return null; - } - // TODO not sure which of these is correct... - // (the spec implies that the referenced column is always the - // primary key column of the target entity) - // String targetColumn = this.targetPrimaryKeyColumnName(); - String targetColumn = getColumn().getReferencedColumnName(); - if (targetColumn == null) { - return null; - } - return prefix + "_" + targetColumn; - } - - /** - * return the name of the target entity - */ - private String targetEntityName() { - IEntity targetEntity = getColumn().getOwner().targetEntity(); - return (targetEntity == null) ? null : targetEntity.getName(); - } - - protected String buildDefaultReferencedColumnName() { - if (getColumn().getOwner().joinColumns().size() != 1) { - return null; - } - return this.targetPrimaryKeyColumnName(); - } - /** - * return the name of the single primary key column of the target entity - */ - private String targetPrimaryKeyColumnName() { - IEntity targetEntity = getColumn().getOwner().targetEntity(); - return (targetEntity == null) ? null : targetEntity.primaryKeyColumnName(); - } - - /** used internally as a mechanism to short circuit continued message adding */ - private boolean doContinue; - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - String table = column.getTable(); - XmlRelationshipMapping mapping = - (XmlRelationshipMapping) column.getOwner().getRelationshipMapping(); - XmlTypeMapping typeMapping = - (XmlTypeMapping) column.getOwner().getTypeMapping(); - doContinue = column.isConnected(); - -// if (doContinue && typeMapping.tableNameIsInvalid(table)) { -// if (mapping.isVirtual()) { -// messages.add( -// JpaValidationMessages.buildMessage( -// IMessage.HIGH_SEVERITY, -// IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE, -// new String[] {mapping.getPersistentAttribute().getName(), table, column.getName()}, -// column, column.getTableTextRange()) -// ); -// } -// else { -// messages.add( -// JpaValidationMessages.buildMessage( -// IMessage.HIGH_SEVERITY, -// IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, -// new String[] {table, column.getName()}, -// column, column.getTableTextRange()) -// ); -// } -// doContinue = false; -// } -// - if (doContinue && ! column.isResolved()) { - if (mapping.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME, - new String[] {mapping.getPersistentAttribute().getName(), column.getName()}, - column, column.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinTableContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinTableContext.java deleted file mode 100644 index 2b7351632f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinTableContext.java +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JoinTableContext extends BaseContext -{ - private IJoinTable table; - - private Collection joinColumnContexts; - - private Collection inverseJoinColumnContexts; - - public JoinTableContext(IContext parentContext, IJoinTable table) { - super(parentContext); - this.table = table; - this.joinColumnContexts = buildJoinColumnContexts(); - this.inverseJoinColumnContexts = buildInverseJoinColumnContexts(); - } - - @Override - protected void initialize() {} - - protected Collection buildJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (IJoinColumn joinColumn : this.table.getJoinColumns() ) { - contexts.add(new JoinColumnContext(this, joinColumn)); - } - return contexts; - } - - protected Collection buildInverseJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (IJoinColumn joinColumn : this.table.getInverseJoinColumns() ) { - contexts.add(new JoinColumnContext(this, joinColumn)); - } - return contexts; - } - - - public IJoinTable getTable() { - return this.table; - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.table.refreshDefaults(defaultsContext); - DefaultsContext joinColumnsDefaultsContext = wrapDefaultsContextForJoinColumn(defaultsContext); - for (JoinColumnContext context : this.joinColumnContexts) { - context.refreshDefaults(joinColumnsDefaultsContext); - } - DefaultsContext inverseJoinColumnsDefaultsContext = wrapDefaultsContextForInverseJoinColumn(defaultsContext); - for (JoinColumnContext context : this.inverseJoinColumnContexts) { - context.refreshDefaults(inverseJoinColumnsDefaultsContext); - } - } - - protected DefaultsContext wrapDefaultsContextForJoinColumn(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - /** - * by default, the join column is, obviously, in the join table; - * not sure whether it can be anywhere else... - */ - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_TABLE_KEY)) { - return getTable().getName(); - } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - protected DefaultsContext wrapDefaultsContextForInverseJoinColumn(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_TABLE_KEY)) { - return getTable().getName(); - } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - /** used internally as a mechanism to short circuit continued message adding */ - private boolean doContinue; - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - addTableMessages(messages); - - if (doContinue) { - for (JoinColumnContext context : joinColumnContexts) { - context.addToMessages(messages); - } - - for (JoinColumnContext context : inverseJoinColumnContexts) { - context.addToMessages(messages); - } - } - } - - protected void addTableMessages(List messages) { - doContinue = table.isConnected(); - String schema = table.getSchema(); - XmlRelationshipMapping mapping = (XmlRelationshipMapping) table.relationshipMapping(); - - if (doContinue && ! table.hasResolvedSchema()) { - if (mapping.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA, - new String[] {mapping.getPersistentAttribute().getName(), schema, table.getName()}, - table, table.schemaTextRange()) - ); - - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA, - new String[] {schema, table.getName()}, - table, table.schemaTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! table.isResolved()) { - if (mapping.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME, - new String[] {mapping.getPersistentAttribute().getName(), table.getName()}, - table, table.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME, - new String[] {table.getName()}, - table, table.nameTextRange()) - ); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/MappingFileContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/MappingFileContext.java deleted file mode 100644 index 8817da2f64..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/MappingFileContext.java +++ /dev/null @@ -1,168 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable; -import org.eclipse.jpt.core.internal.content.orm.XmlEntity; -import org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass; -import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class MappingFileContext extends BaseContext -{ - private XmlRootContentNode ormRoot; - - private List xmlTypeContexts; - - - public MappingFileContext( - PersistenceUnitContext parentContext, XmlRootContentNode xmlRootContentNode) { - super(parentContext); - this.ormRoot = xmlRootContentNode; - this.xmlTypeContexts = buildXmlTypeContexts(); - } - - protected List buildXmlTypeContexts() { - List contexts = new ArrayList(); - for (XmlTypeMapping typeMapping : this.ormRoot.getEntityMappings().getTypeMappings()) { - XmlTypeContext xmlTypeContext = buildContext(typeMapping); - contexts.add(xmlTypeContext); - } - return contexts; - } - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - for (ISequenceGenerator generator : this.ormRoot.getEntityMappings().getSequenceGenerators()) { - generatorRepository.addGenerator(generator); - } - for (ITableGenerator generator : this.ormRoot.getEntityMappings().getTableGenerators()) { - generatorRepository.addGenerator(generator); - } - for (XmlTypeContext context : this.xmlTypeContexts) { - context.populateGeneratorRepository(generatorRepository); - } - } - - @Override - protected void initialize() { - // nothing yet ... - } - - protected XmlTypeContext buildContext(XmlTypeMapping typeMapping) { - String key = typeMapping.getKey(); - if (key == IMappingKeys.ENTITY_TYPE_MAPPING_KEY) { - return new XmlEntityContext(this, (XmlEntity) typeMapping); - } - else if (key == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) { - return new XmlEmbeddableContext(this, (XmlEmbeddable) typeMapping); - } - else if (key == IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) { - return new XmlMappedSuperclassContext(this, (XmlMappedSuperclass) typeMapping); - } - else { - throw new IllegalArgumentException(typeMapping.toString()); - } - } - - protected XmlTypeContext xmlTypeMappingContextFor(IJavaTypeMapping javaTypeMapping) { - for (XmlTypeContext context : this.xmlTypeContexts) { - if (javaTypeMapping == context.getJavaTypeMapping()) { - return context; - } - } - return null; - } - - public void refreshDefaults(DefaultsContext parentDefaults) { - super.refreshDefaults(parentDefaults); - ormRoot.getEntityMappings().refreshDefaults(parentDefaults); - DefaultsContext wrappedDefaultsContext = wrapDefaultsContext(parentDefaults); - for (XmlTypeContext context : this.xmlTypeContexts) { - if (!context.isRefreshed()) { - context.refreshDefaults(wrappedDefaultsContext); - } - } - } - - private DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY) - || key.equals(BaseJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY)) { - String schema = ormRoot.getEntityMappings().getSchema(); - if (schema != null) { - return schema; - } - } - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)) { - String catalog = ormRoot.getEntityMappings().getCatalog(); - if (catalog != null) { - return catalog; - } - } - - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - public XmlRootContentNode getXmlRootContentNode() { - return ormRoot; - } - - public PersistenceUnitContext getPersistenceUnitContext() { - return (PersistenceUnitContext) getParentContext(); - } - - public Iterator typeContexts() { - return this.xmlTypeContexts.iterator(); - } - - public boolean contains(IPersistentType persistentType) { - for (XmlTypeContext context : this.xmlTypeContexts) { - if (persistentType == context.getPersistentType()) { - return true; - } - if (persistentType == context.javaPersistentType()) { - return true; - } - } - return false; - } - - Iterator persistentTypes() { - return new TransformationIterator(xmlTypeContexts.iterator()) { - @Override - protected IPersistentType transform(XmlTypeContext next) { - return next.getPersistentType(); - } - }; - } - - @Override - public void addToMessages(List messages) { - for (XmlTypeContext typeMappingContext : this.xmlTypeContexts) { - typeMappingContext.addToMessages(messages); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/NullGeneratorRepository.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/NullGeneratorRepository.java deleted file mode 100644 index dc329d473f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/NullGeneratorRepository.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.Iterator; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -public class NullGeneratorRepository implements IGeneratorRepository -{ - // singleton - private static final NullGeneratorRepository INSTANCE = new NullGeneratorRepository(); - - /** - * Return the singleton. - */ - public static NullGeneratorRepository instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private NullGeneratorRepository() { - super(); - } - - public IGenerator generator(String name) { - return null; - } - - public Iterator generatorNames() { - return EmptyIterator.instance(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PersistenceUnitContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PersistenceUnitContext.java deleted file mode 100644 index bdecab480f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PersistenceUnitContext.java +++ /dev/null @@ -1,549 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode; -import org.eclipse.jpt.core.internal.content.persistence.JavaClassRef; -import org.eclipse.jpt.core.internal.content.persistence.MappingFileRef; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.HashBag; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class PersistenceUnitContext extends BaseContext -{ - private PersistenceUnit persistenceUnit; - - private List persistenceUnitMetadatas; // datas ?? datae ?? datata ?? - - private List mappingFileContexts; - private List javaPersistentTypeContexts; - //private Collection jarFilesContexts; - - private IGeneratorRepository generatorRepository; - - /** - * Stores the JavaPersistentTypeContext for JavaPersistentTypes that are referenced - * by more than one orm.xml file. An error will be given to the user for this condition - * and the defaults will not be based on a persistence unit or orm.xml file. - */ - private Collection duplicateJavaPersistentTypes; - - - public PersistenceUnitContext(IContext parentContext, PersistenceUnit persistenceUnit) { - super(parentContext); - this.persistenceUnit = persistenceUnit; - this.persistenceUnitMetadatas = buildPersistenceUnitMetadatas(); - this.duplicateJavaPersistentTypes = new ArrayList(); - this.mappingFileContexts = buildMappingFileContexts(); - this.javaPersistentTypeContexts = buildJavaClassesContexts(); - this.generatorRepository = buildGeneratorRepository(); - } - - @Override - protected void initialize() { - } - - private List buildPersistenceUnitMetadatas() { - List metadatas = new ArrayList(); - for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFiles()) { - XmlRootContentNode content = xmlRootContentNodeFor(mappingFileRef); - if (content != null && content.getEntityMappings() != null - && ! content.getEntityMappings().getPersistenceUnitMetadata().isAllFeaturesUnset()) { - metadatas.add(content.getEntityMappings().getPersistenceUnitMetadata()); - } - } - return metadatas; - } - - protected List buildMappingFileContexts() { - List contexts = new ArrayList(); - for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFiles()) { - XmlRootContentNode xmlRootContentNode = xmlRootContentNodeFor(mappingFileRef); - if (xmlRootContentNode != null && xmlRootContentNode.getEntityMappings() != null) { - contexts.add(new MappingFileContext(this, xmlRootContentNode)); - } - } - return contexts; - } - - private XmlRootContentNode xmlRootContentNodeFor(MappingFileRef mappingFileRef) { - IJpaFile jpaFile = mappingFileRef.getMappingFile(); - if (jpaFile != null) { - try { - return (XmlRootContentNode) jpaFile.getContent(); - } - catch (ClassCastException cce) { /* do nothing, return null */ } - } - return null; - } - - protected List buildJavaClassesContexts() { - List javaPersistentTypeContexts = new ArrayList(); - for (JavaPersistentType jpType : allIncludedJavaPersistentTypes()) { - //if it's already specified in an orm.xml file then that is its context, - //no need to add a javaTypeMappingContext - if (xmlTypeMappingContextFor(jpType.getMapping()) == null) { - JavaTypeContext javaTypeContext = - (JavaTypeContext) getPlatform().buildJavaTypeContext(this, jpType.getMapping()); - javaPersistentTypeContexts.add(javaTypeContext); - } - } - return javaPersistentTypeContexts; - } - - protected List allIncludedJavaPersistentTypes() { - List jpTypes = new ArrayList(); - for (Iterator stream = listedJavaPersistentTypes(); stream.hasNext(); ) { - JavaPersistentType listedJpType = stream.next(); - if (listedJpType != null && ! jpTypes.contains(listedJpType)) { - jpTypes.add(listedJpType); - } - } - for (Iterator stream = discoveredJavaPersistentTypes(); stream.hasNext(); ) { - JavaPersistentType discoveredJpType = stream.next(); - if (discoveredJpType != null && discoveredJpType.getMappingKey() != IMappingKeys.NULL_TYPE_MAPPING_KEY && ! jpTypes.contains(discoveredJpType)) { - jpTypes.add(discoveredJpType); - } - } - return jpTypes; - } - - protected Iterator listedJavaPersistentTypes() { - return new TransformationIterator(persistenceUnit.getClasses().iterator()) { - @Override - protected JavaPersistentType transform(JavaClassRef next) { - return javaPersistentTypeFor(next); - } - }; - } - - protected Iterator discoveredJavaPersistentTypes() { - if (! persistenceUnit.getJpaProject().isDiscoverAnnotatedClasses()) { - return EmptyIterator.instance(); - } - Collection javaJpaFiles = persistenceUnit.getJpaProject().jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE); - return new CompositeIterator( - new TransformationIterator>(javaJpaFiles.iterator()) { - @Override - protected Iterator transform(IJpaFile next) { - JpaCompilationUnit jcu = (JpaCompilationUnit) next.getContent(); - return jcu.getTypes().iterator(); - } - } - ); - } - - /** - * Iterate JavaTypeContexts firt to add generators to the repository. - * Then iterator through the MappingFileContexts and override any generators - * with the same name in the java - * - * @return - */ - protected IGeneratorRepository buildGeneratorRepository() { - GeneratorRepository generatorRepository = new GeneratorRepository(); - for (JavaTypeContext context : this.javaPersistentTypeContexts) { - context.populateGeneratorRepository(generatorRepository); - } - for (MappingFileContext context : this.mappingFileContexts) { - context.populateGeneratorRepository(generatorRepository); - } - - return generatorRepository; - } - - private JavaPersistentType javaPersistentTypeFor(JavaClassRef javaClassRef) { - IType type = javaClassRef.findJdtType(); - return jpaProject().findJavaPersistentType(type); - } - - /** - * Find an XmlTypeMappingContext that references the given IJavaTYpeMapping by - * specifying that java class for one of its entities, embeddables, or mapped superclasses - - */ - public XmlTypeContext xmlTypeMappingContextFor(IJavaTypeMapping javaTypeMapping) { - for (MappingFileContext context : this.mappingFileContexts) { - XmlTypeContext xmlTypeMappingContext = context.xmlTypeMappingContextFor(javaTypeMapping); - if (xmlTypeMappingContext != null) { - return xmlTypeMappingContext; - } - } - return null; - } - - protected IJpaProject jpaProject() { - return this.persistenceUnit.getJpaProject(); - } - - PersistenceUnit persistenceUnit() { - return this.persistenceUnit; - } - - Iterator persistentTypes() { - return - new CompositeIterator( - new CompositeIterator( - new TransformationIterator>(mappingFileContexts.iterator()) { - @Override - protected Iterator transform(MappingFileContext next) { - return next.persistentTypes(); - } - } - ), - new TransformationIterator(javaPersistentTypeContexts.iterator()) { - @Override - protected IPersistentType transform(JavaTypeContext next) { - return next.getPersistentType(); - } - } - ); - } - - public void refreshDefaults(DefaultsContext parentDefaults) { - super.refreshDefaults(parentDefaults); - for (JavaTypeContext context : this.duplicateJavaPersistentTypes) { - // context for duplicates not be based on the persistenceUnit defaults, - // so we're going to use the one passed here without wrapping it - context.refreshDefaults(parentDefaults); - } - DefaultsContext defaults = wrapDefaultsContext(parentDefaults); - for (MappingFileContext context : this.mappingFileContexts) { - context.refreshDefaults(defaults); - } - for (JavaTypeContext context : this.javaPersistentTypeContexts) { - context.refreshDefaults(defaults); - } - - //TODO somehow need to clear out defaults for the duplicateJpaFiles, - //do i have to build JavaTypeContext for those as well? - } - - protected DefaultsContext wrapDefaultsContext(DefaultsContext defaults) { - final DefaultsContext puDefaults = buildPersistenceUnitDefaults(defaults); - return new DefaultsContext(){ - public Object getDefault(String key) { - return puDefaults.getDefault(key); - } - public IPersistentType persistentType(String fullyQualifiedTypeName) { - for (Iterator i = typeContexts(); i.hasNext(); ) { - TypeContext typeContext = i.next(); - IPersistentType persistentType = typeContext.getPersistentType(); - IType jdtType = persistentType.findJdtType(); - if (jdtType != null - && fullyQualifiedTypeName.equals(jdtType.getFullyQualifiedName())) { - if (! typeContext.isRefreshed()) { - typeContext.refreshDefaults(this); - } - return persistentType; - } - } - return null; - } - }; - } - - protected DefaultsContext buildPersistenceUnitDefaults(final DefaultsContext defaults) { - if (persistenceUnitMetadatas.size() == 1) { - final PersistenceUnitDefaults puDefaults = persistenceUnitMetadatas.get(0).getPersistenceUnitDefaults(); - if (puDefaults.isAllFeaturesUnset()) { - return defaults; - } - - return new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY) - || key.equals(BaseJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY)) { - String schema = puDefaults.getSchema(); - if (schema != null) { - return schema; - } - } - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)) { - String catalog = puDefaults.getCatalog(); - if (catalog != null) { - return catalog; - } - } - if (key.equals(BaseJpaPlatform.DEFAULT_ACCESS_KEY)) { - AccessType access = puDefaults.getAccess(); - if (access != null) { - return access; - } - } - return defaults.getDefault(key); - } - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaults.persistentType(fullyQualifiedTypeName); - } - }; - } - - return defaults; - } - - private Iterator typeContexts() { - return new CompositeIterator(mappingFileTypeContexts(), javaTypeContexts()); - } - - private Iterator mappingFileTypeContexts() { - return new CompositeIterator( - new TransformationIterator(this.mappingFileContexts.iterator()) { - protected Object transform(Object next) { - return ((MappingFileContext) next).typeContexts(); - } - } - ); - } - - private Iterator javaTypeContexts() { - return this.javaPersistentTypeContexts.iterator(); - } - - public void addDuplicateJpaFile(JavaTypeContext javaPersistentTypeContext) { - this.duplicateJavaPersistentTypes.add(javaPersistentTypeContext); - } - - public boolean containsDuplicateJavaPersistentType(JavaPersistentType javaPersistentType) { - for (JavaTypeContext context : this.duplicateJavaPersistentTypes) { - if (context.getPersistentType() == javaPersistentType) { - return true; - } - } - return false; - } - - public boolean contains(IPersistentType persistentType) { - for (MappingFileContext context : this.mappingFileContexts) { - if (context.contains(persistentType)) { - return true; - } - } - for (JavaTypeContext context : this.javaPersistentTypeContexts) { - if (context.contains(persistentType)) { - return true; - } - } - return false; - } - - public IGeneratorRepository getGeneratorRepository() { - return this.generatorRepository; - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - addMappingFileMessages(messages); - addClassMessages(messages); - } - - protected void addMappingFileMessages(List messages) { - addMultipleMetadataMessages(messages); - addUnspecifiedMappingFileMessages(messages); - addUnresolvedMappingFileMessages(messages); - addInvalidMappingFileContentMessage(messages); - addDuplicateMappingFileMessages(messages); - - for (MappingFileContext mappingFileContext : mappingFileContexts) { - mappingFileContext.addToMessages(messages); - } - } - - protected void addMultipleMetadataMessages(List messages) { - if (persistenceUnitMetadatas.size() > 1) { - for (PersistenceUnitMetadata metadata : persistenceUnitMetadatas) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.ENTITY_MAPPINGS_MULTIPLE_METADATA, - new String[] {persistenceUnit.getName()}, - metadata, metadata.validationTextRange()) - ); - } - } - } - - protected void addUnspecifiedMappingFileMessages(List messages) { - for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFiles()) { - if (mappingFileRef.getFileName() == null || mappingFileRef.getFileName().equals("")) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE, - mappingFileRef, mappingFileRef.validationTextRange()) - ); - } - } - } - - protected void addUnresolvedMappingFileMessages(List messages) { - for (Iterator stream = persistenceUnit.getMappingFiles().iterator(); stream.hasNext(); ) { - MappingFileRef mappingFileRef = (MappingFileRef) stream.next(); - if (! (mappingFileRef.getFileName() == null || mappingFileRef.getFileName().equals("")) - && mappingFileRef.getMappingFile() == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE, - new String[] {mappingFileRef.getFileName()}, - mappingFileRef, mappingFileRef.validationTextRange()) - ); - } - } - } - - protected void addInvalidMappingFileContentMessage(List messages) { - for (Iterator stream = persistenceUnit.getMappingFiles().iterator(); stream.hasNext(); ) { - MappingFileRef mappingFileRef = (MappingFileRef) stream.next(); - if (mappingFileRef.getMappingFile() != null - && xmlRootContentNodeFor(mappingFileRef) == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_INVALID_MAPPING_FILE, - new String[] {mappingFileRef.getFileName()}, - mappingFileRef, mappingFileRef.validationTextRange()) - ); - } - } - } - - protected void addDuplicateMappingFileMessages(List messages) { - HashBag fileBag = new HashBag( - CollectionTools.collection( - new TransformationIterator(persistenceUnit.getMappingFiles().iterator()) { - @Override - protected Object transform(Object next) { - return ((MappingFileRef) next).getFileName(); - } - } - ) - ); - for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFiles()) { - if (fileBag.count(mappingFileRef.getFileName()) > 1) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE, - new String[] {mappingFileRef.getFileName()}, - mappingFileRef, mappingFileRef.validationTextRange()) - ); - } - } - } - - protected void addClassMessages(List messages) { - addUnspecifiedClassMessages(messages); - addUnresolvedClassMessages(messages); - addInvalidClassContentMessages(messages); - addDuplicateClassMessages(messages); - - for (JavaTypeContext persistentTypeContext : javaPersistentTypeContexts) { - persistentTypeContext.addToMessages(messages); - } - } - - protected void addUnspecifiedClassMessages(List messages) { - for (JavaClassRef javaClassRef : persistenceUnit.getClasses()) { - String javaClass = javaClassRef.getJavaClass(); - if (StringTools.stringIsEmpty(javaClass)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_CLASS, - javaClassRef, javaClassRef.validationTextRange()) - ); - } - } - } - - protected void addUnresolvedClassMessages(List messages) { - for (JavaClassRef javaClassRef : persistenceUnit.getClasses()) { - String javaClass = javaClassRef.getJavaClass(); - if (! StringTools.stringIsEmpty(javaClass) && javaClassRef.findJdtType() == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_CLASS, - new String[] {javaClass}, - javaClassRef, javaClassRef.validationTextRange()) - ); - } - } - } - - protected void addInvalidClassContentMessages(List messages) { - for (JavaClassRef javaClassRef : persistenceUnit.getClasses()) { - String javaClass = javaClassRef.getJavaClass(); - if (! StringTools.stringIsEmpty(javaClass) && javaClassRef.findJdtType() != null - && (javaPersistentTypeFor(javaClassRef) == null - || javaPersistentTypeFor(javaClassRef).getMappingKey() == IMappingKeys.NULL_TYPE_MAPPING_KEY)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_INVALID_CLASS, - new String[] {javaClassRef.getJavaClass()}, - javaClassRef, javaClassRef.validationTextRange()) - ); - } - } - } - - protected void addDuplicateClassMessages(List messages) { - HashBag fileBag = new HashBag( - CollectionTools.collection( - new TransformationIterator(persistenceUnit.getClasses().iterator()) { - @Override - protected Object transform(Object next) { - return ((JavaClassRef) next).getJavaClass(); - } - } - ) - ); - for (JavaClassRef javaClassRef : persistenceUnit.getClasses()) { - if (javaClassRef.getJavaClass() != null - && fileBag.count(javaClassRef.getJavaClass()) > 1) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_CLASS, - new String[] {javaClassRef.getJavaClass()}, - javaClassRef, javaClassRef.validationTextRange()) - ); - } - } - } - - public String toString() { - return StringTools.buildToStringFor( this, this.persistenceUnit.getName()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PrimaryKeyJoinColumnContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PrimaryKeyJoinColumnContext.java deleted file mode 100644 index 7b289fe6f6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PrimaryKeyJoinColumnContext.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class PrimaryKeyJoinColumnContext extends AbstractJoinColumnContext -{ - - public PrimaryKeyJoinColumnContext(IContext parentContext, IPrimaryKeyJoinColumn column) { - super(parentContext, column); - } - - //TODO This default is different for oneToOne mappings, we don't yet support pkJoinColumns there - protected String buildDefaultReferencedColumnName() { - return this.buildDefaultName(); - } - - protected String buildDefaultName() { - if (getColumn().getOwner().joinColumns().size() != 1) { - return null; - } - IEntity entity = (IEntity) getColumn().getOwner().getTypeMapping(); - String pkColumnName = entity.parentEntity().primaryKeyColumnName(); - return pkColumnName; - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - boolean doContinue = column.isConnected(); - if (doContinue && ! column.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - - if (doContinue && ! column.isReferencedColumnResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, - new String[] {column.getReferencedColumnName(), column.getName()}, - column, column.referencedColumnNameTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/SecondaryTableContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/SecondaryTableContext.java deleted file mode 100644 index dfc3d19961..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/SecondaryTableContext.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class SecondaryTableContext extends BaseContext -{ - private ISecondaryTable secondaryTable; - - private Collection pkJoinColumnContexts; - - public SecondaryTableContext(IContext parentContext, ISecondaryTable secondaryTable) { - super(parentContext); - this.secondaryTable = secondaryTable; - this.pkJoinColumnContexts = buildPkJoinColumnContexts(); - } - - protected Collection buildPkJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (IPrimaryKeyJoinColumn pkJoinColumn : getSecondaryTable().getPrimaryKeyJoinColumns()) { - contexts.add(new PrimaryKeyJoinColumnContext(this, pkJoinColumn)); - } - - return contexts; - } - - @Override - protected void initialize() {} - - public ISecondaryTable getSecondaryTable() { - return this.secondaryTable; - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.secondaryTable.refreshDefaults(defaultsContext); - for (PrimaryKeyJoinColumnContext context : this.pkJoinColumnContexts) { - context.refreshDefaults(defaultsContext); - } - } - - public DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { -// if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_TABLE_KEY)) { -// return getTable().getName(); -// } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - addTableMessages(messages); - for (PrimaryKeyJoinColumnContext context : this.pkJoinColumnContexts) { - context.addToMessages(messages); - } - } - - protected void addTableMessages(List messages) { - boolean doContinue = secondaryTable.isConnected(); - String schema = secondaryTable.getSchema(); - - if (doContinue && ! secondaryTable.hasResolvedSchema()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_SCHEMA, - new String[] {schema, secondaryTable.getName()}, - secondaryTable, secondaryTable.schemaTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! secondaryTable.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_NAME, - new String[] {secondaryTable.getName()}, - secondaryTable, secondaryTable.nameTextRange()) - ); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TableContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TableContext.java deleted file mode 100644 index 9949a8b372..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TableContext.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class TableContext extends BaseContext -{ - private ITable table; - - public TableContext(IContext parentContext, ITable table) { - super(parentContext); - this.table = table; - } - - @Override - protected void initialize() {} - - public ITable getTable() { - return this.table; - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - this.table.refreshDefaults(defaultsContext); - } - - public DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_TABLE_KEY)) { - return getTable().getName(); - } - return defaultsContext.getDefault(key); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - boolean doContinue = table.isConnected(); - String schema = table.getSchema(); - - if (doContinue && ! table.hasResolvedSchema()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.TABLE_UNRESOLVED_SCHEMA, - new String[] {schema, table.getName()}, - table, table.schemaTextRange()) - ); - doContinue = false; - } - - if (doContinue && ! table.isResolved()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.TABLE_UNRESOLVED_NAME, - new String[] {table.getName()}, - table, table.nameTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TypeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TypeContext.java deleted file mode 100644 index dc23fd424f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TypeContext.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.IPersistentType; - -public interface TypeContext -{ - IPersistentType getPersistentType(); - - void refreshDefaults(DefaultsContext defaultsContext); - - boolean isRefreshed(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeContext.java deleted file mode 100644 index 11827c7f6e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeContext.java +++ /dev/null @@ -1,185 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class XmlAttributeContext extends BaseContext -{ - private XmlAttributeMapping xmlAttributeMapping; - - private JavaAttributeContext javaAttributeContext; - - protected XmlAttributeContext(IContext parentContext, XmlAttributeMapping xmlAttributeMapping) { - super(parentContext); - this.xmlAttributeMapping = xmlAttributeMapping; - } - - @Override - protected void initialize() { - - } - - public XmlPersistentAttribute getAttribute() { - return xmlAttributeMapping.getPersistentAttribute(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - JavaPersistentType javaPersistentType = this.xmlAttributeMapping.getPersistentType().findJavaPersistentType(); - String name = this.xmlAttributeMapping.getPersistentAttribute().getName(); - if (name != null && javaPersistentType != null) { - JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.attributeNamed(name); - if (javaPersistentAttribute != null) { - this.javaAttributeContext = - (JavaAttributeContext) getPlatform().buildJavaAttributeContext(this, javaPersistentAttribute.getMapping()); - } - } - this.xmlAttributeMapping.refreshDefaults(defaultsContext); - } - - protected XmlAttributeMapping attributeMapping() { - return this.xmlAttributeMapping; - } - - protected IAttributeMapping javaAttributeMapping() { - if (this.javaAttributeContext != null) { - return this.javaAttributeContext.getMapping(); - } - return null; - } - - protected boolean embeddableOwned() { - return attributeMapping().typeMapping().getKey() == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - protected boolean entityOwned() { - return attributeMapping().typeMapping().getKey() == IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - public final DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - return XmlAttributeContext.this.getDefault(key, defaultsContext); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - protected Object getDefault(String key, DefaultsContext defaultsContext) { - return defaultsContext.getDefault(key); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - addAttributeMessages(messages); - addInvalidMappingMessage(messages); - } - - protected void addAttributeMessages(List messages) { - addUnspecifiedAttributeMessage(messages); - addUnresolvedAttributeMessage(messages); - addModifierMessages(messages); - } - - protected void addUnspecifiedAttributeMessage(List messages) { - XmlPersistentAttribute persistentAttribute = xmlAttributeMapping.getPersistentAttribute(); - if (StringTools.stringIsEmpty(persistentAttribute.getName())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME, - persistentAttribute, persistentAttribute.nameTextRange()) - ); - } - } - - protected void addUnresolvedAttributeMessage(List messages) { - XmlPersistentAttribute persistentAttribute = xmlAttributeMapping.getPersistentAttribute(); - if (! StringTools.stringIsEmpty(persistentAttribute.getName()) - && persistentAttribute.persistentType().findJdtType() != null - && persistentAttribute.getAttribute() == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME, - new String[] {persistentAttribute.getName(), persistentAttribute.persistentType().getClass_()}, - persistentAttribute, persistentAttribute.nameTextRange()) - ); - } - } - - protected void addModifierMessages(List messages) { - XmlPersistentAttribute attribute = xmlAttributeMapping.getPersistentAttribute(); - - if (attribute.getMapping().getKey() != IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY - && attribute.getAttribute() != null - && attribute.getAttribute().isField()) { - int flags; - try { - flags = attribute.getAttribute().getJdtMember().getFlags(); - } catch (JavaModelException jme) { - /* no error to log, in that case */ - return; - } - - if (Flags.isFinal(flags)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD, - new String[] {attribute.getName()}, - attribute, attribute.validationTextRange()) - ); - } - - if (Flags.isPublic(flags)) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD, - new String[] {attribute.getName()}, - attribute, attribute.validationTextRange()) - ); - - } - } - } - - protected void addInvalidMappingMessage(List messages) { - IAttributeMapping attributeMapping = attributeMapping(); - ITypeMapping typeMapping = attributeMapping.typeMapping(); - if (! typeMapping.attributeMappingKeyAllowed(attributeMapping.getKey())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING, - new String[] {attributeMapping.getPersistentAttribute().getName()}, - attributeMapping, attributeMapping.validationTextRange()) - ); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeOverrideContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeOverrideContext.java deleted file mode 100644 index ed9c2799c9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeOverrideContext.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IColumnMapping; - -public class XmlAttributeOverrideContext extends AttributeOverrideContext -{ - - public XmlAttributeOverrideContext(ParentContext parentContext, IAttributeOverride attributeOverride) { - super(parentContext, attributeOverride); - this.attributeOverride = attributeOverride; - } - - @Override - public ParentContext getParentContext() { - return (ParentContext) super.getParentContext(); - } - - @Override - protected String buildDefaultColumnName() { - IColumnMapping columnMapping = columnMapping(); - if (columnMapping == null) { - return null; - } - if (this.attributeOverride.isVirtual()) { - if (!((XmlTypeMapping) this.attributeOverride.getOwner().getTypeMapping()).isXmlMetadataComplete()) { - IAttributeOverride javaAttributeOverride = javaAttributeOverride(); - if (javaAttributeOverride != null) { - return javaAttributeOverride.getColumn().getName(); - } - } - return columnMapping.getColumn().getName(); - } - - return columnMapping.getColumn().getName(); - } - - @Override - protected String buildDefaultTableName() { - IColumnMapping columnMapping = columnMapping(); - if (columnMapping == null) { - return null; - } - if (this.attributeOverride.isVirtual()) { - if (!((XmlTypeMapping) this.attributeOverride.getOwner().getTypeMapping()).isXmlMetadataComplete()) { - IAttributeOverride javaAttributeOverride = javaAttributeOverride(); - if (javaAttributeOverride != null) { - return javaAttributeOverride.getColumn().getTable(); - } - } - return columnMapping.getColumn().getTable(); - } - - return columnMapping.getColumn().getTable(); - } - - public interface ParentContext extends IContext { - /** - * Return the JavaAttributeOverride that corresponds to the xml attribute override - * with the given name. Return null if it does not exist - */ - IAttributeOverride javaAttributeOverride(String overrideName); - } - - private IAttributeOverride javaAttributeOverride() { - return getParentContext().javaAttributeOverride(this.attributeOverride.getName()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlBasicContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlBasicContext.java deleted file mode 100644 index 90efe46a98..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlBasicContext.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic; -import org.eclipse.jpt.core.internal.content.orm.XmlBasic; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlBasicContext extends XmlAttributeContext -{ - private ColumnContext columnContext; - - public XmlBasicContext(IContext parentContext, XmlBasic xmlBasic) { - super(parentContext, xmlBasic); - this.columnContext = new ColumnContext(this, xmlBasic.getColumn()); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - this.columnContext.refreshDefaults(defaultsContext); - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)) { - if (attributeMapping().getPersistentAttribute().isVirtual()) { - if (javaBasicMapping() != null) { - if (!attributeMapping().getPersistentType().getMapping().isXmlMetadataComplete()) { - return javaBasicMapping().getColumn().getName(); - } - return javaBasicMapping().getColumn().getDefaultName(); - } - } - //doesn't matter what's in the java @Column annotation because it is completely - //overriden as soon as you specify the attribute in xml. - return attributeMapping().getPersistentAttribute().getName(); - } - - return super.getDefault(key, defaultsContext); - } - - protected JavaBasic javaBasicMapping() { - IAttributeMapping attributeMapping = javaAttributeMapping(); - if (attributeMapping.getKey() == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) { - return (JavaBasic) attributeMapping; - } - return null; - } - - protected XmlBasic getBasic() { - return (XmlBasic) attributeMapping(); - } - - public void addToMessages(List messages) { - if (entityOwned()) { - addColumnMessages(messages); - } - } - - protected void addColumnMessages(List messages) { - XmlBasic basic = getBasic(); - ITypeMapping typeMapping = basic.typeMapping(); - IColumn column = basic.getColumn(); - String table = column.getTable(); - boolean doContinue = column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - if (basic.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE, - new String[] {basic.getPersistentAttribute().getName(), table, column.getName()}, - column, column.tableTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - if (basic.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME, - new String[] {basic.getPersistentAttribute().getName(), column.getName()}, - column, column.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddableContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddableContext.java deleted file mode 100644 index 891269c1dc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddableContext.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable; - -public class XmlEmbeddableContext extends XmlTypeContext -{ - public XmlEmbeddableContext(MappingFileContext parentContext, XmlEmbeddable xmlEmbeddable) { - super(parentContext, xmlEmbeddable); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedContext.java deleted file mode 100644 index 9afd18d063..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedContext.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbedded; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbedded; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.platform.XmlAttributeOverrideContext.ParentContext; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlEmbeddedContext - extends XmlAttributeContext -{ - private Collection attributeOverrideContexts; - - public XmlEmbeddedContext(IContext parentContext, XmlEmbedded mapping) { - super(parentContext, mapping); - this.attributeOverrideContexts = buildAttributeOverrideContexts(); - } - - protected Collection buildAttributeOverrideContexts() { - Collection contexts = new ArrayList(); - for (IAttributeOverride attributeOverride : getEmbedded().getAttributeOverrides()) { - contexts.add(new XmlAttributeOverrideContext(buildParentContext(), attributeOverride)); - } - - return contexts; - } - private ParentContext buildParentContext() { - return new XmlAttributeOverrideContext.ParentContext() { - public void refreshDefaults(DefaultsContext defaults) { - XmlEmbeddedContext.this.refreshDefaults(defaults); - } - public IJpaPlatform getPlatform() { - return XmlEmbeddedContext.this.getPlatform(); - } - public IContext getParentContext() { - return XmlEmbeddedContext.this.getParentContext(); - } - public void addToMessages(List messages) { - XmlEmbeddedContext.this.addToMessages(messages); - } - public IAttributeOverride javaAttributeOverride(String overrideName) { - if (getEmbedded().isVirtual()) { - return getJavaEmbedded().attributeOverrideNamed(overrideName); - } - //if the xml mapping is specified, then it is as if no annotations are - //specified on the java mapping, so return null - return null; - } - }; - } - - @Override - public void refreshDefaults(DefaultsContext parentDefaults) { - super.refreshDefaults(parentDefaults); - refreshDefaultAttributeOverrides(); - for (XmlAttributeOverrideContext context : this.attributeOverrideContexts) { - context.refreshDefaults(parentDefaults); - } - } - - - protected void refreshDefaultAttributeOverrides() { - for (Iterator i = getEmbedded().allOverridableAttributeNames(); i.hasNext(); ) { - String override = i.next(); - if (!getEmbedded().containsAttributeOverride(override)) { - XmlAttributeOverride attributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverride(new IEmbedded.AttributeOverrideOwner(getEmbedded())); - getEmbedded().getDefaultAttributeOverrides().add(attributeOverride); - attributeOverride.setName(override); - } - } - - Collection attributeNames = CollectionTools.collection(getEmbedded().allOverridableAttributeNames()); - - //remove any default mappings that are not included in the attributeNames collection - Collection overridesToRemove = new ArrayList(); - for (IAttributeOverride attributeOverride : getEmbedded().getDefaultAttributeOverrides()) { - if (!attributeNames.contains(attributeOverride.getName()) - || getEmbedded().containsSpecifiedAttributeOverride(attributeOverride.getName())) { - overridesToRemove.add(attributeOverride); - } - } - - getEmbedded().getDefaultAttributeOverrides().removeAll(overridesToRemove); - } - - protected XmlTypeMapping getXmlTypeMapping() { - return getEmbedded().getPersistentAttribute().typeMapping(); - } - - private XmlEmbedded getEmbedded() { - return (XmlEmbedded) attributeMapping(); - } - - protected JavaEmbedded getJavaEmbedded() { - IAttributeMapping javaAttributeMapping = javaAttributeMapping(); - if (javaAttributeMapping != null - && javaAttributeMapping.getKey() == IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) { - return (JavaEmbedded) javaAttributeMapping; - } - return null; - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - for (XmlAttributeOverrideContext aoContext : this.attributeOverrideContexts) { - aoContext.addToMessages(messages); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedIdContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedIdContext.java deleted file mode 100644 index dc9e55f323..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedIdContext.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId; - -public class XmlEmbeddedIdContext - extends XmlAttributeContext -{ - public XmlEmbeddedIdContext(IContext parentContext, XmlEmbeddedId mapping) { - super(parentContext, mapping); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java deleted file mode 100644 index bd6e5f8b64..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java +++ /dev/null @@ -1,411 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaEntity; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaTable; -import org.eclipse.jpt.core.internal.content.orm.XmlEntity; -import org.eclipse.jpt.core.internal.content.orm.XmlTable; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.platform.XmlAttributeOverrideContext.ParentContext; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.utility.internal.ClassTools; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlEntityContext extends XmlTypeContext -{ - private TableContext tableContext; - - private Collection secondaryTableContexts; - - private JavaTable javaTable; - - private Collection attributeOverrideContexts; - - private Collection associationOverrideContexts; - - public XmlEntityContext(MappingFileContext parentContext, XmlEntity xmlEntity) { - super(parentContext, (XmlTypeMapping) xmlEntity); - this.attributeOverrideContexts = buildAttributeOverrideContexts(); - this.associationOverrideContexts = buildAssociationOverrideContexts(); - this.secondaryTableContexts = buildSecondaryTableContexts(); - } - - protected Collection buildAttributeOverrideContexts() { - Collection contexts = new ArrayList(); - for (IAttributeOverride attributeOverride : getEntity().getAttributeOverrides()) { - contexts.add(new XmlAttributeOverrideContext(buildParentContext(), attributeOverride)); - } - - return contexts; - } - - private ParentContext buildParentContext() { - return new XmlAttributeOverrideContext.ParentContext() { - public void refreshDefaults(DefaultsContext defaults) { - XmlEntityContext.this.refreshDefaults(defaults); - } - public IJpaPlatform getPlatform() { - return XmlEntityContext.this.getPlatform(); - } - public IContext getParentContext() { - return XmlEntityContext.this.getParentContext(); - } - public void addToMessages(List messages) { - XmlEntityContext.this.addToMessages(messages); - } - public IAttributeOverride javaAttributeOverride(String overrideName) { - JavaEntity javaEntity = getJavaEntity(); - if (javaEntity == null) { - return null; - } - return javaEntity.attributeOverrideNamed(overrideName); - } - }; - } - - //only support default joinColumn information for the default association overrides, - //AssociationOverride has no defaults, the name and joinColumns must be specified - protected Collection buildAssociationOverrideContexts() { - Collection contexts = new ArrayList(); - for (IAssociationOverride associationOverride : getEntity().getDefaultAssociationOverrides()) { - contexts.add(new AssociationOverrideContext(this, associationOverride)); - } - - return contexts; - } - - protected Collection buildSecondaryTableContexts() { - Collection contexts = new ArrayList(); - for (ISecondaryTable secondaryTable : getEntity().getSecondaryTables()) { - contexts.add(new SecondaryTableContext(this, secondaryTable)); - } - - return contexts; - } - - protected XmlEntity getEntity() { - return (XmlEntity) getXmlTypeMapping(); - } - - protected JavaEntity getJavaEntity() { - IJavaTypeMapping javaTypeMapping = javaTypeMapping(); - if (javaTypeMapping != null - && javaTypeMapping.getKey() == IMappingKeys.ENTITY_TYPE_MAPPING_KEY) { - return (JavaEntity) javaTypeMapping; - } - return null; - } - - @Override - public void initialize() { - super.initialize(); - IJavaTypeMapping javaTypeMapping = javaTypeMapping(); - XmlTable xmlTable = (XmlTable)((XmlEntity) getXmlTypeMapping()).getTable(); - if (javaTypeMapping instanceof IEntity) { - this.javaTable = (JavaTable) ((IEntity) javaTypeMapping).getTable(); - } - this.tableContext = new TableContext(this, xmlTable); - } - - /** - * XmlIdContexts will populate the generatorRepository themselves. - * XmlAttributeContexts are not built until the initialize method, so we - * don't have any yet to populate the generatorRepository. - */ - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - if (getEntity().getTableGenerator() != null) { - generatorRepository.addGenerator(getEntity().getTableGenerator()); - } - if (getEntity().getSequenceGenerator() != null) { - generatorRepository.addGenerator(getEntity().getSequenceGenerator()); - } - } - - public PersistenceUnitContext getPersistenceUnitContext() { - return ((MappingFileContext) getParentContext()).getPersistenceUnitContext(); - } - - @Override - public void refreshDefaults(DefaultsContext parentDefaults) { - super.refreshDefaults(parentDefaults); - DefaultsContext defaultsContext = wrapDefaultsContext(parentDefaults); - refreshDefaultAttributeOverrides(); - refreshDefaultAssociationOverrides(); - refreshDefaultSecondaryTables(); - for (SecondaryTableContext context : this.secondaryTableContexts) { - context.refreshDefaults(defaultsContext); - } - for (XmlAttributeOverrideContext context : this.attributeOverrideContexts) { - context.refreshDefaults(defaultsContext); - } - for (AssociationOverrideContext context : this.associationOverrideContexts) { - context.refreshDefaults(defaultsContext); - } - } - - protected void refreshTableContext(DefaultsContext defaultsContext) { - this.tableContext.refreshDefaults(defaultsContext); - } - - protected void refreshDefaultAttributeOverrides() { - - JavaEntity javaEntity = getJavaEntity(); - if (javaEntity != null && !getXmlTypeMapping().isXmlMetadataComplete()) { - for (IAttributeOverride attributeOverride : javaEntity.getAttributeOverrides()) { - if (!getEntity().containsAttributeOverride(attributeOverride.getName())) { - IAttributeOverride defaultAttributeOverride = getEntity().createAttributeOverride(0); - defaultAttributeOverride.setName(attributeOverride.getName()); - getEntity().getDefaultAttributeOverrides().add(defaultAttributeOverride); - } - } - } - else { - for (Iterator i = getEntity().allOverridableAttributeNames(); i.hasNext(); ) { - String override = i.next(); - if (!getEntity().containsAttributeOverride(override)) { - IAttributeOverride defaultAttributeOverride = getEntity().createAttributeOverride(0); - defaultAttributeOverride.setName(override); - getEntity().getDefaultAttributeOverrides().add(defaultAttributeOverride); - } - - } - } - - Collection attributeNames = CollectionTools.collection(getEntity().allOverridableAttributeNames()); - - //remove any default mappings that are not included in the attributeNames collection - Collection overridesToRemove = new ArrayList(); - for (IAttributeOverride attributeOverride : getEntity().getDefaultAttributeOverrides()) { - if (getEntity().containsSpecifiedAttributeOverride(attributeOverride.getName())) { - overridesToRemove.add(attributeOverride); - } - else if (!attributeNames.contains(attributeOverride.getName())) { - if (javaEntity == null) { - overridesToRemove.add(attributeOverride); - } - else if (getXmlTypeMapping().isXmlMetadataComplete()) { - if (!javaEntity.containsDefaultAttributeOverride(attributeOverride.getName())) { - overridesToRemove.add(attributeOverride); - } - } - else if (!javaEntity.containsSpecifiedAttributeOverride(attributeOverride.getName())) { - overridesToRemove.add(attributeOverride); - } - } - } - - getEntity().getDefaultAttributeOverrides().removeAll(overridesToRemove); - } - - protected void refreshDefaultAssociationOverrides() { - - JavaEntity javaEntity = getJavaEntity(); - if (javaEntity != null && !getXmlTypeMapping().isXmlMetadataComplete()) { - for (IAssociationOverride associationOverride : javaEntity.getAssociationOverrides()) { - if (!getEntity().containsAssociationOverride(associationOverride.getName())) { - IAssociationOverride defaultAssociationOverride = getEntity().createAssociationOverride(0); - defaultAssociationOverride.setName(associationOverride.getName()); - getEntity().getDefaultAssociationOverrides().add(defaultAssociationOverride); - } - } - } - else { - for (Iterator i = getEntity().allOverridableAssociationNames(); i.hasNext(); ) { - String override = i.next(); - if (!getEntity().containsAssociationOverride(override)) { - IAssociationOverride defaultAssociationOverride = getEntity().createAssociationOverride(0); - defaultAssociationOverride.setName(override); - getEntity().getDefaultAssociationOverrides().add(defaultAssociationOverride); - } - - } - } - - Collection attributeNames = CollectionTools.collection(getEntity().allOverridableAssociationNames()); - - //remove any default mappings that are not included in the attributeNames collection - Collection overridesToRemove = new ArrayList(); - for (IAssociationOverride associationOverride : getEntity().getDefaultAssociationOverrides()) { - if (getEntity().containsSpecifiedAttributeOverride(associationOverride.getName())) { - overridesToRemove.add(associationOverride); - } - else if (!attributeNames.contains(associationOverride.getName())) { - if (javaEntity == null) { - overridesToRemove.add(associationOverride); - } - else if (getXmlTypeMapping().isXmlMetadataComplete()) { - if (!javaEntity.containsDefaultAssociationOverride(associationOverride.getName())) { - overridesToRemove.add(associationOverride); - } - } - else if (!javaEntity.containsSpecifiedAssociationOverride(associationOverride.getName())) { - overridesToRemove.add(associationOverride); - } - } - } - - getEntity().getDefaultAssociationOverrides().removeAll(overridesToRemove); - } - - protected void refreshDefaultSecondaryTables() { - JavaEntity javaEntity = getJavaEntity(); - if (javaEntity != null && !getXmlTypeMapping().isXmlMetadataComplete()) { - for (ISecondaryTable secondaryTable : javaEntity.getSecondaryTables()) { - if (secondaryTable.getName() != null) { - if (!getEntity().containsSecondaryTable(secondaryTable.getName())) { - ISecondaryTable defaultSecondaryTable = getEntity().createSecondaryTable(0); - defaultSecondaryTable.setSpecifiedName(secondaryTable.getName()); - getEntity().getVirtualSecondaryTables().add(defaultSecondaryTable); - } - } - } - } - Collection secondaryTablesToRemove = new ArrayList(); - - for (Iterator i = getEntity().getVirtualSecondaryTables().iterator(); i.hasNext(); ) { - ISecondaryTable secondaryTable = i.next(); - - if (getXmlTypeMapping().isXmlMetadataComplete() || getEntity().containsSpecifiedSecondaryTable(secondaryTable.getName())) { - secondaryTablesToRemove.add(secondaryTable); - continue; - } - if (javaEntity == null) { - secondaryTablesToRemove.add(secondaryTable); - } - else if (!javaEntity.containsSecondaryTable(secondaryTable.getName())) { - secondaryTablesToRemove.add(secondaryTable); - } - } - getEntity().getVirtualSecondaryTables().removeAll(secondaryTablesToRemove); - - } - - @Override - public DefaultsContext wrapDefaultsContext(DefaultsContext defaultsContext) { - return super.wrapDefaultsContext(this.tableContext.wrapDefaultsContext(defaultsContext)); - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_ENTITY_NAME_KEY)) { - String className = getPersistentType().getClass_(); - if (className != null) { - return ClassTools.shortNameForClassNamed(className); - } - } - - XmlTable xmlTable = getXmlTable(); - if (javaTable != null) { - if (getXmlTypeMapping().isXmlMetadataComplete() || xmlTable.getNode() != null) { - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY)) { - return javaTable.getDefaultSchema(); - } - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)) { - return javaTable.getDefaultCatalog(); - } - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY)) { - return javaTable.getDefaultName(); - } - } - else { - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_SCHEMA_KEY)) { - return javaTable.getSchema(); - } - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY)) { - return javaTable.getCatalog(); - } - if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY)) { - return javaTable.getName(); - } - } - } - else if (key.equals(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY)) { - if (getEntity().rootEntity().getInheritanceStrategy().isSingleTable()) { - IEntity rootEntity = getEntity().rootEntity(); - if (rootEntity == getEntity()) { - return rootEntity.getName(); - } - return rootEntity.getTable().getName(); - } - return getEntity().getName(); - } - return super.getDefault(key, defaultsContext); - } - - private XmlTable getXmlTable() { - return (XmlTable) ((XmlEntity) getXmlTypeMapping()).getTable(); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - tableContext.addToMessages(messages); - addIdMessages(messages); - - for (SecondaryTableContext context : secondaryTableContexts) { - context.addToMessages(messages); - } - - for (XmlAttributeOverrideContext aoContext : attributeOverrideContexts) { - aoContext.addToMessages(messages); - } - - for (AssociationOverrideContext aoContext : associationOverrideContexts) { - aoContext.addToMessages(messages); - } - } - - protected void addIdMessages(List messages) { - addNoIdMessage(messages); - - } - - protected void addNoIdMessage(List messages) { - IEntity entity = getEntity(); - if (entityHasNoId()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.ENTITY_NO_ID, - new String[] {entity.getName()}, - entity, entity.validationTextRange()) - ); - } - } - - private boolean entityHasNoId() { - return ! this.entityHasId(); - } - - private boolean entityHasId() { - for (Iterator stream = this.getEntity().getPersistentType().allAttributes(); stream.hasNext(); ) { - if (stream.next().isIdAttribute()) { - return true; - } - } - return false; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlIdContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlIdContext.java deleted file mode 100644 index 11c211ea80..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlIdContext.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaId; -import org.eclipse.jpt.core.internal.content.orm.XmlId; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlIdContext extends XmlAttributeContext -{ - - private ColumnContext columnContext; - - public XmlIdContext(IContext parentContext, XmlId xmlId) { - super(parentContext, xmlId); - this.columnContext = new ColumnContext(this, xmlId.getColumn()); - populateGeneratorRepository((GeneratorRepository) getPersistenceUnitContext().getGeneratorRepository()); - } - - protected PersistenceUnitContext getPersistenceUnitContext() { - return ((MappingFileContext) getParentContext().getParentContext()).getPersistenceUnitContext(); - } - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - ITableGenerator tableGenerator = getId().getTableGenerator(); - if (tableGenerator != null) { - generatorRepository.addGenerator(tableGenerator); - } - ISequenceGenerator sequenceGenerator = getId().getSequenceGenerator(); - if (sequenceGenerator != null) { - generatorRepository.addGenerator(sequenceGenerator); - } - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - this.columnContext.refreshDefaults(defaultsContext); - ITableGenerator tableGenerator = getId().getTableGenerator(); - if (tableGenerator != null) { - tableGenerator.refreshDefaults(defaultsContext); - } - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)) { - if (attributeMapping().getPersistentAttribute().isVirtual()) { - if (javaIdMapping() != null) { - if (!attributeMapping().getPersistentType().getMapping().isXmlMetadataComplete()) { - return javaIdMapping().getColumn().getName(); - } - return javaIdMapping().getColumn().getDefaultName(); - } - } - //doesn't matter what's in the java @Column annotation because it is completely - //overriden as soon as you specify the attribute in xml. - return attributeMapping().getPersistentAttribute().getName(); - } - - return super.getDefault(key, defaultsContext); - } - - protected JavaId javaIdMapping() { - IAttributeMapping attributeMapping = javaAttributeMapping(); - if (attributeMapping.getKey() == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY) { - return (JavaId) attributeMapping; - } - return null; - } - - protected XmlId getId() { - return (XmlId) attributeMapping(); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - if (entityOwned()) { - addColumnMessages(messages); - } - addGeneratorMessages(messages); - } - - protected void addColumnMessages(List messages) { - XmlId id = getId(); - ITypeMapping typeMapping = id.typeMapping(); - IColumn column = id.getColumn(); - String table = column.getTable(); - boolean doContinue = column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - if (id.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE, - new String[] {id.getPersistentAttribute().getName(), table, column.getName()}, - column, column.tableTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - if (id.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME, - new String[] {id.getPersistentAttribute().getName(), column.getName()}, - column, column.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } - } - - protected void addGeneratorMessages(List messages) { - XmlId id = getId(); - IGeneratedValue generatedValue = id.getGeneratedValue(); - if (generatedValue == null) { - return; - } - String generatorName = generatedValue.getGenerator(); - if (generatorName == null) { - return; - } - IGeneratorRepository generatorRepository = getPersistenceUnitContext().getGeneratorRepository(); - IGenerator generator = generatorRepository.generator(generatorName); - - if (generator == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.GENERATED_VALUE_UNRESOLVED_GENERATOR, - new String[] {generatorName}, - generatedValue, generatedValue.validationTextRange()) - ); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToManyContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToManyContext.java deleted file mode 100644 index 37fb8b51aa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToManyContext.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlManyToMany; - -public class XmlManyToManyContext extends XmlMultiRelationshipMappingContext -{ - public XmlManyToManyContext(IContext parentContext, XmlManyToMany mapping) { - super(parentContext, mapping); - } - - protected XmlManyToMany getManyToMany() { - return (XmlManyToMany) attributeMapping(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToOneContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToOneContext.java deleted file mode 100644 index 9f1bdf6b7a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToOneContext.java +++ /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 - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlManyToOne; - -public class XmlManyToOneContext - extends XmlSingleRelationshipMappingContext -{ - public XmlManyToOneContext(IContext parentContext, XmlManyToOne mapping) { - super(parentContext, mapping); - } - - //ManyToOne mapping is always the owning side - protected boolean isOwningSide() { - return true; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMappedSuperclassContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMappedSuperclassContext.java deleted file mode 100644 index 83e71b6e7a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMappedSuperclassContext.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass; - -public class XmlMappedSuperclassContext extends XmlTypeContext -{ - public XmlMappedSuperclassContext(MappingFileContext parentContext, XmlMappedSuperclass xmlMappedSuperclass) { - super(parentContext, xmlMappedSuperclass); - } - -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java deleted file mode 100644 index becd8cd84d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class XmlMultiRelationshipMappingContext - extends XmlRelationshipMappingContext -{ - private JoinTableContext joinTableContext; - - protected XmlMultiRelationshipMappingContext( - IContext parentContext, XmlMultiRelationshipMappingInternal mapping) { - super(parentContext, mapping); - this.joinTableContext = new JoinTableContext(this, mapping.getJoinTable()); - } - - @Override - public void refreshDefaults(final DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - this.joinTableContext.refreshDefaults(defaultsContext); - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_TABLE_NAME_KEY)) { - return joinTableDefaultName(defaultsContext); - } - return super.getDefault(key, defaultsContext); - } - - protected String joinTableDefaultName(DefaultsContext defaultsContext) { - String tableName = multiRelationshipMapping().typeMapping().getTableName(); - if (tableName == null) { - return null; - } - IEntity targetEntity = targetEntity(defaultsContext); - if (targetEntity == null) { - return null; - } - ITable targetTable = targetEntity.getTable(); - return (targetTable == null) ? null : tableName + "_" + targetTable.getName(); - } - - protected XmlMultiRelationshipMappingInternal multiRelationshipMapping() { - return (XmlMultiRelationshipMappingInternal) relationshipMapping(); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - if (multiRelationshipMapping().getMappedBy() != null) { - addMappedByMessages(messages); - } - else if (entityOwned()) { - addJoinTableMessages(messages); - } - } - - protected void addJoinTableMessages(List messages) { - joinTableContext.addToMessages(messages); - } - - protected void addMappedByMessages(List messages) { - XmlMultiRelationshipMapping mapping = multiRelationshipMapping(); - String mappedBy = mapping.getMappedBy(); - - if (mapping.isJoinTableSpecified()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_MAPPED_BY_WITH_JOIN_TABLE, - mapping.getJoinTable(), mapping.getJoinTable().validationTextRange()) - ); - - } - - IEntity targetEntity = mapping.getResolvedTargetEntity(); - - if (targetEntity == null) { - // already have validation messages for that - return; - } - - IPersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(mappedBy); - - if (attribute == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - if (! mapping.mappedByIsValid(attribute.getMapping())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_INVALID_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - INonOwningMapping mappedByMapping; - try { - mappedByMapping = (INonOwningMapping) attribute.getMapping(); - } catch (ClassCastException cce) { - // there is no error then - return; - } - - if (mappedByMapping.getMappedBy() != null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES, - mapping, mapping.mappedByTextRange()) - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlNullAttributeMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlNullAttributeMappingContext.java deleted file mode 100644 index 6ee8dd748c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlNullAttributeMappingContext.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping; - -public class XmlNullAttributeMappingContext extends XmlAttributeContext -{ - public XmlNullAttributeMappingContext( - IContext parentContext, XmlNullAttributeMapping xmlNullAttributeMapping) { - super(parentContext, xmlNullAttributeMapping); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToManyContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToManyContext.java deleted file mode 100644 index 8a18f1d739..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToManyContext.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlOneToManyContext extends XmlMultiRelationshipMappingContext -{ - public XmlOneToManyContext(IContext parentContext, XmlOneToMany mapping) { - super(parentContext, mapping); - } - - @Override - protected void addJoinTableMessages(List messages) { - // TODO - // a 1-M doesn't *have* to have a join table - return; - - //super.addJoinTableMessages(messages); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToOneContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToOneContext.java deleted file mode 100644 index ebd501b23f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToOneContext.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToOne; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlOneToOneContext - extends XmlSingleRelationshipMappingContext -{ - public XmlOneToOneContext(IContext parentContext, XmlOneToOne mapping) { - super(parentContext, mapping); - } - - protected XmlOneToOne getMapping() { - return (XmlOneToOne) super.attributeMapping(); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - if (getMapping().getMappedBy() != null) { - addMappedByMessages(messages); - } - } - - protected void addMappedByMessages(List messages) { - XmlOneToOne mapping = getMapping(); - String mappedBy = mapping.getMappedBy(); - IEntity targetEntity = mapping.getResolvedTargetEntity(); - - if (targetEntity == null) { - // already have validation messages for that - return; - } - - IPersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(mappedBy); - - if (attribute == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - if (! mapping.mappedByIsValid(attribute.getMapping())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_INVALID_MAPPED_BY, - new String[] {mappedBy}, - mapping, mapping.mappedByTextRange()) - ); - return; - } - - INonOwningMapping mappedByMapping; - try { - mappedByMapping = (INonOwningMapping) attribute.getMapping(); - } catch (ClassCastException cce) { - // there is no error then - return; - } - - if (mappedByMapping.getMappedBy() != null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES, - mapping, mapping.mappedByTextRange()) - ); - } - } - - @Override - protected boolean isOwningSide() { - return getMapping().getMappedBy() == null; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlRelationshipMappingContext.java deleted file mode 100644 index 8c4eea914b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlRelationshipMappingContext.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping; -import org.eclipse.jpt.core.internal.jdtutility.Attribute; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; - -public abstract class XmlRelationshipMappingContext extends XmlAttributeContext -{ - protected XmlRelationshipMappingContext(IContext parentContext, XmlRelationshipMapping mapping) { - super(parentContext, mapping); - } - - protected IEntity targetEntity(DefaultsContext defaultsContext) { - String targetEntity = relationshipMapping().fullyQualifiedTargetEntity(); - if (targetEntity == null) { - return null; - } - IPersistentType persistentType = defaultsContext.persistentType(targetEntity); - if (persistentType == null) { - return null; - } - ITypeMapping typeMapping = persistentType.getMapping(); - if (typeMapping instanceof IEntity) { - return (IEntity) typeMapping; - } - return null; - } - - protected XmlRelationshipMapping relationshipMapping() { - return (XmlRelationshipMapping) attributeMapping(); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - relationshipMapping().refreshDefaults(defaultsContext); - } - - protected IRelationshipMapping javaRelationshipMapping() { - IAttributeMapping javaAttributeMapping = javaAttributeMapping(); - if (javaAttributeMapping instanceof IRelationshipMapping) { - return ((IRelationshipMapping) javaAttributeMapping); - } - return null; - } - - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_TARGET_ENTITY_KEY)) { - IRelationshipMapping javaMapping = javaRelationshipMapping(); - if (javaMapping != null) { - if (!relationshipMapping().isVirtual() && relationshipMapping().getPersistentType().getMapping().isXmlMetadataComplete()) { - return javaMapping.getDefaultTargetEntity(); - } - return javaMapping.getTargetEntity(); - } - Attribute attribute = relationshipMapping().getPersistentAttribute().getAttribute(); - if (attribute != null) { - IType iType = relationshipMapping().getPersistentType().findJdtType(); - if (iType != null) { - return relationshipMapping().javaDefaultTargetEntity(); - } - } - } - return super.getDefault(key, defaultsContext); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlSingleRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlSingleRelationshipMappingContext.java deleted file mode 100644 index 3976246d77..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlSingleRelationshipMappingContext.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlSingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class XmlSingleRelationshipMappingContext - extends XmlRelationshipMappingContext -{ - private Collection joinColumnContexts; - - protected XmlSingleRelationshipMappingContext( - IContext parentContext, XmlSingleRelationshipMapping mapping) { - super(parentContext, mapping); - this.joinColumnContexts = buildJoinColumnContexts(); - } - - protected Collection buildJoinColumnContexts() { - Collection contexts = new ArrayList(); - for (Iterator i = singleRelationshipMapping().getJoinColumns().iterator(); i.hasNext(); ) { - contexts.add(new JoinColumnContext(this, i.next())); - } - return contexts; - } - - protected XmlSingleRelationshipMapping singleRelationshipMapping() { - return (XmlSingleRelationshipMapping) relationshipMapping(); - } - - - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - for (JoinColumnContext context : this.joinColumnContexts) { - context.refreshDefaults(defaultsContext); - } - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - /** - * by default, the join column is in the type mapping's primary table - */ - if (key.equals(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_TABLE_KEY)) { - return singleRelationshipMapping().typeMapping().getTableName(); - } - return super.getDefault(key, defaultsContext); - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - - //bug 192287 - do not want joinColumn validation errors on the non-owning side - //of a bidirectional relationship. This is a low risk fix for RC3, but a better - //solution would be to not have the default joinColumns on the non-owning side. - //This would fix another bug that we show default joinColumns in this situation. - if (entityOwned() && isOwningSide()) { - addJoinColumnMessages(messages); - } - } - - protected abstract boolean isOwningSide(); - - - protected void addJoinColumnMessages(List messages) { - XmlSingleRelationshipMapping mapping = singleRelationshipMapping(); - ITypeMapping typeMapping = mapping.typeMapping(); - - for (IJoinColumn joinColumn : mapping.getJoinColumns()) { - String table = joinColumn.getTable(); - boolean doContinue = joinColumn.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - if (mapping.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE, - new String[] {mapping.getPersistentAttribute().getName(), table, joinColumn.getName()}, - joinColumn, joinColumn.tableTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE, - new String[] {table, joinColumn.getName()}, - joinColumn, joinColumn.tableTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! joinColumn.isResolved()) { - if (mapping.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {mapping.getPersistentAttribute().getName(), joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getName()}, - joinColumn, joinColumn.nameTextRange()) - ); - } - } - - if (doContinue && ! joinColumn.isReferencedColumnResolved()) { - if (mapping.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {mapping.getPersistentAttribute().getName(), joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, - new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()}, - joinColumn, joinColumn.referencedColumnNameTextRange()) - ); - } - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTransientContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTransientContext.java deleted file mode 100644 index c5b824ca27..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTransientContext.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import org.eclipse.jpt.core.internal.content.orm.XmlTransient; - -public class XmlTransientContext - extends XmlAttributeContext -{ - public XmlTransientContext( - IContext parentContext, XmlTransient mapping) { - super(parentContext, mapping); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java deleted file mode 100644 index 24c82d31b4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java +++ /dev/null @@ -1,391 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlBasic; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbedded; -import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddedId; -import org.eclipse.jpt.core.internal.content.orm.XmlId; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToMany; -import org.eclipse.jpt.core.internal.content.orm.XmlManyToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; -import org.eclipse.jpt.core.internal.content.orm.XmlOneToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlTransient; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlVersion; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public abstract class XmlTypeContext extends BaseContext - implements TypeContext -{ - private XmlTypeMapping xmlTypeMapping; - - private JavaTypeContext javaTypeContext; - - private Collection attributeMappingContexts; - - private Collection virtualAttributeMappingContexts; - - private boolean refreshed; - - public XmlTypeContext(MappingFileContext parentContext, XmlTypeMapping xmlTypeMapping) { - super(parentContext); - this.xmlTypeMapping = xmlTypeMapping; - this.attributeMappingContexts = new ArrayList(); - this.virtualAttributeMappingContexts = new ArrayList(); - } - - public void initialize() { - JavaPersistentType javaPersistentType = javaPersistentType(); - PersistenceUnitContext puContext = getMappingFileContext().getPersistenceUnitContext(); - if (javaPersistentType != null) { - if (puContext.containsDuplicateJavaPersistentType(javaPersistentType)) { - return; - } - JavaTypeContext javaContext = - (JavaTypeContext) getPlatform().buildJavaTypeContext(this, javaPersistentType.getMapping()); - XmlTypeContext duplicate = puContext.xmlTypeMappingContextFor(javaPersistentType.getMapping()); - if (duplicate != null) { - duplicate.setDuplicateJavaTypeMapping(); - puContext.addDuplicateJpaFile(javaContext); - return; - } - this.javaTypeContext = javaContext; - } - - initializeAttributeMappingContexts(); - } - - protected void initializeAttributeMappingContexts() { - for (XmlAttributeMapping xmlAttributeMapping: this.xmlTypeMapping.getPersistentType().getSpecifiedAttributeMappings()) { - this.attributeMappingContexts.add(buildContext(xmlAttributeMapping)); - } - } - - protected XmlAttributeContext buildContext(XmlAttributeMapping attributeMapping) { - String key = attributeMapping.getKey(); - if (key == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY) { - return new XmlIdContext(this, (XmlId) attributeMapping); - } - else if (key == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) { - return new XmlBasicContext(this, (XmlBasic) attributeMapping); - } - else if (key == IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) { - return new XmlOneToManyContext(this, (XmlOneToMany) attributeMapping); - } - else if (key == IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) { - return new XmlManyToOneContext(this, (XmlManyToOne) attributeMapping); - } - else if (key == IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) { - return new XmlManyToManyContext(this, (XmlManyToMany) attributeMapping); - } - else if (key == IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) { - return new XmlTransientContext(this, (XmlTransient) attributeMapping); - } - else if (key == IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) { - return new XmlEmbeddedContext(this, (XmlEmbedded) attributeMapping); - } - else if (key == IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) { - return new XmlEmbeddedIdContext(this, (XmlEmbeddedId) attributeMapping); - } - else if (key == IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) { - return new XmlVersionContext(this, (XmlVersion) attributeMapping); - } - else if (key == IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) { - return new XmlOneToOneContext(this, (XmlOneToOne) attributeMapping); - } - else if (key == null) { - return new XmlNullAttributeMappingContext(this, (XmlNullAttributeMapping) attributeMapping); - } - else { - throw new IllegalArgumentException(attributeMapping.toString()); - } - } - - protected void populateGeneratorRepository(GeneratorRepository generatorRepository) { - //override as necessary - } - - protected Collection getXmlAttributeContexts() { - return this.attributeMappingContexts; - } - - protected MappingFileContext getMappingFileContext() { - return (MappingFileContext) getParentContext(); - } - - protected XmlTypeMapping getXmlTypeMapping() { - return this.xmlTypeMapping; - } - - protected JavaTypeContext getJavaPersistentTypeContext() { - return this.javaTypeContext; - } - - protected IJavaTypeMapping getJavaTypeMapping() { - if (this.javaTypeContext != null) { - return this.javaTypeContext.getPersistentType().getMapping(); - } - return null; - } - - protected JavaPersistentType javaPersistentType() { - return this.xmlTypeMapping.getPersistentType().findJavaPersistentType(); - } - - protected IJavaTypeMapping javaTypeMapping() { - JavaPersistentType javaPersistentType = javaPersistentType(); - if (javaPersistentType != null) { - return javaPersistentType.getMapping(); - } - return null; - } - /** - * A java class is specified to be mapped in to orm.xml files in the same persistence unit. - * Null out the javaTypeMapping for this case, so that the context is no longer a particular - * orm.xml file. - */ - public void setDuplicateJavaTypeMapping() { - this.javaTypeContext = null; - } - - public DefaultsContext wrapDefaultsContext(final DefaultsContext defaultsContext) { - return new DefaultsContext() { - public Object getDefault(String key) { - return XmlTypeContext.this.getDefault(key, defaultsContext); - } - - public IPersistentType persistentType(String fullyQualifiedTypeName) { - return defaultsContext.persistentType(fullyQualifiedTypeName); - } - }; - } - - - protected Object getDefault(String key, DefaultsContext defaultsContext) { - return defaultsContext.getDefault(key); - } - - public XmlPersistentType getPersistentType() { - return getXmlTypeMapping().getPersistentType(); - } - - public boolean isRefreshed() { - return this.refreshed; - } - - public void refreshDefaults(DefaultsContext parentDefaults) { - super.refreshDefaults(parentDefaults); - this.refreshed = true; - if (this.javaTypeContext != null) { - this.javaTypeContext.refreshDefaults(parentDefaults); - } - refreshPersistentType(parentDefaults); - DefaultsContext wrappedDefaultsContext = wrapDefaultsContext(parentDefaults); - refreshTableContext(wrappedDefaultsContext); - this.xmlTypeMapping.refreshDefaults(wrappedDefaultsContext); - - refreshAttributeMappingContextDefaults(wrappedDefaultsContext); - } - - protected void refreshTableContext(DefaultsContext defaultsContext) { - } - - public void refreshAttributeMappingContextDefaults(DefaultsContext defaultsContext) { - for (XmlAttributeContext context : this.attributeMappingContexts) { - context.refreshDefaults(context.wrapDefaultsContext(defaultsContext)); - } - for (XmlAttributeContext context : this.virtualAttributeMappingContexts) { - context.refreshDefaults(context.wrapDefaultsContext(defaultsContext)); - } - } - - protected void refreshPersistentType(DefaultsContext defaultsContext) { - XmlPersistentType xmlPersistentType = this.getXmlTypeMapping().getPersistentType(); - xmlPersistentType.refreshDefaults(defaultsContext); - //get the java attribute names - //check the specified xml attributes (those with an element in the xml), add - //a xmlAttribute mapping for any java attribute name with default = true - //if we already have an xml attribute mapping, then do nothing, - //the defaults refresh will get forwarded on the attribute mappings later. - Collection javaAttributes = javaAttributes(); - Collection javaAttributeNames = new ArrayList(); - for (IPersistentAttribute javaAttribute : javaAttributes) { - String javaAttributeName = javaAttribute.getName(); - javaAttributeNames.add(javaAttributeName); - XmlPersistentAttribute xmlAttribute = xmlPersistentType.attributeNamed(javaAttributeName); - if (xmlAttribute == null) { - createAndAddXmlAttributeFrom(javaAttribute, xmlPersistentType); - } - else { - if (xmlAttribute.isVirtual()) { - if (xmlAttribute.typeMapping().isXmlMetadataComplete()) { - xmlAttribute.setSpecifiedMappingKey(javaAttribute.defaultMappingKey()); - } - else { - xmlAttribute.setSpecifiedMappingKey(javaAttribute.mappingKey()); - } - } - } - } - - Collection specifiedXmlAttributeNames = new ArrayList(); - for (XmlPersistentAttribute specifiedAttribute : xmlPersistentType.getSpecifiedPersistentAttributes()) { - String attributeName = specifiedAttribute.getName(); - if (! StringTools.stringIsEmpty(attributeName)) { - specifiedXmlAttributeNames.add(attributeName); - } - } - - // remove virtual attribute if there's no java representation - // *or* if it is mapped specifically - Collection mappingsToRemove = new ArrayList(); - for (XmlAttributeMapping mapping : xmlPersistentType.getVirtualAttributeMappings()) { - String attributeName = mapping.getPersistentAttribute().getName(); - if (! javaAttributeNames.contains(attributeName) - || specifiedXmlAttributeNames.contains(attributeName)) { - mappingsToRemove.add(mapping); - } - } - - for (XmlAttributeMapping xmlAttributeMapping : mappingsToRemove) { - xmlPersistentType.getVirtualAttributeMappings().remove(xmlAttributeMapping); - } - - for (XmlAttributeMapping xmlAttributeMapping : this.xmlTypeMapping.getPersistentType().getVirtualAttributeMappings()) { - this.virtualAttributeMappingContexts.add(buildContext(xmlAttributeMapping)); - } - } - - private void createAndAddXmlAttributeFrom(IPersistentAttribute javaAttribute, XmlPersistentType persistentType) { - //TODO also need to check xml mapping meta data complete flags and - //probably move all of this code to the context classes - XmlAttributeMapping xmlAttributeMapping = null; - String mappingKey; - if (persistentType.getMapping().isXmlMetadataComplete()) { - mappingKey = javaAttribute.defaultMappingKey(); - } - else { - mappingKey = javaAttribute.getMapping().getKey(); - } - if (mappingKey == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlBasic(); - } - else if (mappingKey == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlId(); - } - else if (mappingKey == IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlManyToMany(); - } - else if (mappingKey == IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlManyToOne(); - } - else if (mappingKey == IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlOneToMany(); - } - else if (mappingKey == IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlTransient(); - } - else if (mappingKey == IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlEmbedded(); - } - else if (mappingKey == IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlEmbeddedId(); - } - else if (mappingKey == IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlVersion(); - } - else if (mappingKey == IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlOneToOne(); - } - else if (mappingKey == null) { - xmlAttributeMapping = OrmFactory.eINSTANCE.createXmlNullAttributeMapping(); - } - //TODO this isn't the way to do it, should update all the settings on the default mapping - // during the refresh defaults of attribute mappings - //xmlAttributeMapping.initializeFromAttributeMapping(javaAttribute.getMapping()); - persistentType.getVirtualAttributeMappings().add(xmlAttributeMapping); - xmlAttributeMapping.getPersistentAttribute().setName(javaAttribute.getName()); - } - - protected Collection javaAttributes() { - Collection javaAttributes = new ArrayList(); - JavaPersistentType javaPersistentType = javaPersistentType(); - if (javaPersistentType != null) { - for (Iterator i = javaPersistentType.attributes(); i.hasNext(); ) { - JavaPersistentAttribute persistentAttribute = i.next(); - javaAttributes.add(persistentAttribute); - } - } - return javaAttributes; - } - - @Override - public void addToMessages(List messages) { - super.addToMessages(messages); - addClassMessages(messages); - - for (XmlAttributeContext context : this.attributeMappingContexts) { - context.addToMessages(messages); - } - for (XmlAttributeContext context : this.virtualAttributeMappingContexts) { - context.addToMessages(messages); - } - } - - protected void addClassMessages(List messages) { - addUnspecifiedClassMessage(messages); - addUnresolvedClassMessage(messages); - } - - protected void addUnspecifiedClassMessage(List messages) { - XmlPersistentType persistentType = xmlTypeMapping.getPersistentType(); - if (StringTools.stringIsEmpty(persistentType.getClass_())) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS, - persistentType, persistentType.classTextRange()) - ); - } - } - - protected void addUnresolvedClassMessage(List messages) { - XmlPersistentType persistentType = xmlTypeMapping.getPersistentType(); - if (! StringTools.stringIsEmpty(persistentType.getClass_()) - && persistentType.findJdtType() == null) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS, - new String[] {persistentType.getClass_()}, - persistentType, persistentType.classTextRange()) - ); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlVersionContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlVersionContext.java deleted file mode 100644 index cabd99591f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlVersionContext.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform; - -import java.util.List; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion; -import org.eclipse.jpt.core.internal.content.orm.XmlVersion; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.validation.IJpaValidationMessages; -import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class XmlVersionContext - extends XmlAttributeContext -{ - private ColumnContext columnContext; - - public XmlVersionContext( - IContext parentContext, XmlVersion xmlVersion) { - super(parentContext, xmlVersion); - this.columnContext = new ColumnContext(this, xmlVersion.getColumn()); - } - - @Override - public void refreshDefaults(DefaultsContext defaultsContext) { - super.refreshDefaults(defaultsContext); - this.columnContext.refreshDefaults(defaultsContext); - } - - @Override - protected Object getDefault(String key, DefaultsContext defaultsContext) { - if (key.equals(BaseJpaPlatform.DEFAULT_COLUMN_NAME_KEY)) { - if (attributeMapping().getPersistentAttribute().isVirtual()) { - if (javaVersionMapping() != null) { - if (!attributeMapping().getPersistentType().getMapping().isXmlMetadataComplete()) { - return javaVersionMapping().getColumn().getName(); - } - return javaVersionMapping().getColumn().getDefaultName(); - } - } - //doesn't matter what's in the java @Column annotation because it is completely - //overriden as soon as you specify the attribute in xml. - return attributeMapping().getPersistentAttribute().getName(); - } - - return super.getDefault(key, defaultsContext); - } - - protected JavaVersion javaVersionMapping() { - IAttributeMapping attributeMapping = javaAttributeMapping(); - if (attributeMapping.getKey() == IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) { - return (JavaVersion) attributeMapping; - } - return null; - } - - protected XmlVersion getVersion() { - return (XmlVersion) attributeMapping(); - } - - public void addToMessages(List messages) { - super.addToMessages(messages); - - if (entityOwned()) { - addColumnMessages(messages); - } - } - - protected void addColumnMessages(List messages) { - XmlVersion version = getVersion(); - ITypeMapping typeMapping = version.typeMapping(); - IColumn column = version.getColumn(); - String table = column.getTable(); - boolean doContinue = entityOwned() && column.isConnected(); - - if (doContinue && typeMapping.tableNameIsInvalid(table)) { - if (version.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE, - new String[] {version.getPersistentAttribute().getName(), table, column.getName()}, - column, column.tableTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_TABLE, - new String[] {table, column.getName()}, - column, column.tableTextRange()) - ); - } - doContinue = false; - } - - if (doContinue && ! column.isResolved()) { - if (version.isVirtual()) { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME, - new String[] {version.getPersistentAttribute().getName(), column.getName()}, - column, column.nameTextRange()) - ); - } - else { - messages.add( - JpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - IJpaValidationMessages.COLUMN_UNRESOLVED_NAME, - new String[] {column.getName()}, - column, column.nameTextRange()) - ); - } - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/generic/GenericPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/generic/GenericPlatform.java deleted file mode 100644 index 5776081cf2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/generic/GenericPlatform.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.platform.generic; - -import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform; - -public class GenericPlatform - extends BaseJpaPlatform -{ - public final static String ID = "generic"; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java deleted file mode 100644 index fdd98cd73c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.prefs; - -/** - * Constant definitions for plug-in preferences - */ -public class JpaPreferenceConstants -{ - public static final String PREF_DEFAULT_JPA_LIB = "defaultJpaLib"; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java deleted file mode 100644 index 7573522266..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.prefs; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.jpt.core.internal.JptCorePlugin; - -/** - * Class used to initialize default preference values. - */ -public class JpaPreferenceInitializer extends AbstractPreferenceInitializer -{ - /** - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - public void initializeDefaultPreferences() { - IEclipsePreferences node = new DefaultScope().getNode(JptCorePlugin.getPlugin().getBundle().getSymbolicName()); - - // default JPA library - node.put(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB, ""); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java deleted file mode 100644 index ff760c1e76..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - * - *******************************************************************************/ -package org.eclipse.jpt.core.internal.synch; - -import java.io.IOException; -import java.util.Iterator; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -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.jdt.core.IType; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.JptCoreMessages; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode; -import org.eclipse.jpt.core.internal.content.persistence.JavaClassRef; -import org.eclipse.jpt.core.internal.content.persistence.MappingFileRef; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceFactory; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode; -import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceResource; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Synchronizes the lists of persistent classes in a persistence unit and a - * persistence project. - */ -public class SynchronizeClassesJob extends Job -{ - private IFile persistenceXmlFile; - - - public SynchronizeClassesJob(IFile file) { - super(JptCoreMessages.SYNCHRONIZE_CLASSES_JOB); - persistenceXmlFile = file; - } - - protected IStatus run(IProgressMonitor monitor) { - IProject project = persistenceXmlFile.getProject(); - - monitor.beginTask(JptCoreMessages.SYNCHRONIZING_CLASSES_TASK, 150); - - if (monitor.isCanceled()) { - return Status.CANCEL_STATUS; - } - - IJpaFile jpaFile = JptCorePlugin.getJpaFile(persistenceXmlFile); - PersistenceXmlRootContentNode root; - try { - root = (PersistenceXmlRootContentNode) jpaFile.getContent(); - } - catch (ClassCastException cce) { - return new Status(Status.ERROR, JptCorePlugin.PLUGIN_ID, JptCoreMessages.INVALID_PERSISTENCE_XML_CONTENT); - } - - Persistence persistence = root.getPersistence(); - - if (persistence == null) { - persistence = PersistenceFactory.eINSTANCE.createPersistence(); - root.setPersistence(persistence); - } - - PersistenceUnit persistenceUnit; - - if (persistence.getPersistenceUnits().size() > 0) { - persistenceUnit = persistence.getPersistenceUnits().get(0); - } - else { - persistenceUnit = PersistenceFactory.eINSTANCE.createPersistenceUnit(); - persistenceUnit.setName(persistenceXmlFile.getProject().getName()); - persistence.getPersistenceUnits().add(persistenceUnit); - } - - PersistenceResource resource = (PersistenceResource) persistenceUnit.eResource(); - - persistenceUnit.getClasses().clear(); - for (Iterator stream = mappedTypeNames(persistenceUnit); stream.hasNext(); ) { - String typeName = stream.next(); - JavaClassRef classRef = PersistenceFactory.eINSTANCE.createJavaClassRef(); - classRef.setJavaClass(typeName); - persistenceUnit.getClasses().add(classRef); - } - - monitor.worked(50); - - try { - resource.save(null); - } - catch (IOException ioe) { - return new Status(Status.ERROR, JptCorePlugin.PLUGIN_ID, JptCoreMessages.ERROR_WRITING_FILE, ioe); - } - - return Status.OK_STATUS; - } - - private Iterator mappedTypeNames(PersistenceUnit persistenceUnit) { - return CollectionTools.sort( - new TransformationIterator(mappedTypes(persistenceUnit)) { - @Override - protected String transform(IPersistentType next) { - return next.findJdtType().getFullyQualifiedName(); - } - } - ); - } - - private Iterator mappedTypes(PersistenceUnit persistenceUnit) { - return new FilteringIterator(allJavaTypes(persistenceUnit.getJpaProject()), filter(persistenceUnit)); - } - - private Iterator allJavaTypes(IJpaProject jpaProject) { - return new TransformationIterator(jpaProject.jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE).iterator()) { - @Override - protected IPersistentType transform(IJpaFile next) { - JpaCompilationUnit jcu = (JpaCompilationUnit) next.getContent(); - return (jcu.getTypes().isEmpty()) ? null : jcu.getTypes().get(0); - } - }; - } - - private Filter filter(final PersistenceUnit persistenceUnit) { - return new Filter() { - public boolean accept(IPersistentType o) { - if (o == null) { - return false; - } - if (o.getMappingKey() == IMappingKeys.NULL_TYPE_MAPPING_KEY) { - return false; - } - IType jdtType = o.findJdtType(); - if (jdtType == null) { - return false; - } - for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFiles()) { - if (containsType(mappingFileRef, jdtType)) { - return false; - } - } - return true; - } - }; - } - - private boolean containsType(MappingFileRef mappingFileRef, IType jdtType) { - IJpaFile mappingFile = mappingFileRef.getMappingFile(); - if (mappingFile == null) { - return false; - } - - XmlRootContentNode root; - try { - root = (XmlRootContentNode) mappingFile.getContent(); - } - catch (ClassCastException cce) { - return false; - } - - EntityMappingsInternal entityMappings = root.getEntityMappings(); - - if (entityMappings == null) { - return false; - } - - for (IPersistentType persistentType : entityMappings.getPersistentTypes()) { - IType otherJdtType = persistentType.findJdtType(); - if (otherJdtType != null && otherJdtType.equals(jdtType)) { - return true; - } - } - - return false; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreAdapterFactory.java deleted file mode 100644 index 781a1fc4c2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreAdapterFactory.java +++ /dev/null @@ -1,524 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaDataSource; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaModel; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.IXmlEObject; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.JpaDataSource; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.JpaFile; -import org.eclipse.jpt.core.internal.JpaModel; -import org.eclipse.jpt.core.internal.JpaProject; -import org.eclipse.jpt.core.internal.NullTypeMapping; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage - * @generated - */ -public class JpaCoreAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static JpaCorePackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public JpaCoreAdapterFactory() { - if (modelPackage == null) { - modelPackage = JpaCorePackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the createXXX methods. - * - * - * @generated - */ - protected JpaCoreSwitch modelSwitch = new JpaCoreSwitch() { - @Override - public Adapter caseIJpaModel(IJpaModel object) { - return createIJpaModelAdapter(); - } - - @Override - public Adapter caseJpaModel(JpaModel object) { - return createJpaModelAdapter(); - } - - @Override - public Adapter caseIJpaEObject(IJpaEObject object) { - return createIJpaEObjectAdapter(); - } - - @Override - public Adapter caseJpaEObject(JpaEObject object) { - return createJpaEObjectAdapter(); - } - - @Override - public Adapter caseIJpaProject(IJpaProject object) { - return createIJpaProjectAdapter(); - } - - @Override - public Adapter caseJpaProject(JpaProject object) { - return createJpaProjectAdapter(); - } - - @Override - public Adapter caseIJpaPlatform(IJpaPlatform object) { - return createIJpaPlatformAdapter(); - } - - @Override - public Adapter caseIJpaDataSource(IJpaDataSource object) { - return createIJpaDataSourceAdapter(); - } - - @Override - public Adapter caseJpaDataSource(JpaDataSource object) { - return createJpaDataSourceAdapter(); - } - - @Override - public Adapter caseIJpaFile(IJpaFile object) { - return createIJpaFileAdapter(); - } - - @Override - public Adapter caseJpaFile(JpaFile object) { - return createJpaFileAdapter(); - } - - @Override - public Adapter caseIJpaSourceObject(IJpaSourceObject object) { - return createIJpaSourceObjectAdapter(); - } - - @Override - public Adapter caseIXmlEObject(IXmlEObject object) { - return createIXmlEObjectAdapter(); - } - - @Override - public Adapter caseXmlEObject(XmlEObject object) { - return createXmlEObjectAdapter(); - } - - @Override - public Adapter caseIJpaContentNode(IJpaContentNode object) { - return createIJpaContentNodeAdapter(); - } - - @Override - public Adapter caseIJpaRootContentNode(IJpaRootContentNode object) { - return createIJpaRootContentNodeAdapter(); - } - - @Override - public Adapter caseIPersistentType(IPersistentType object) { - return createIPersistentTypeAdapter(); - } - - @Override - public Adapter caseITypeMapping(ITypeMapping object) { - return createITypeMappingAdapter(); - } - - @Override - public Adapter caseNullTypeMapping(NullTypeMapping object) { - return createNullTypeMappingAdapter(); - } - - @Override - public Adapter caseIPersistentAttribute(IPersistentAttribute object) { - return createIPersistentAttributeAdapter(); - } - - @Override - public Adapter caseIAttributeMapping(IAttributeMapping object) { - return createIAttributeMappingAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaModel IJpa Model}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaModel - * @generated - */ - public Adapter createIJpaModelAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaModel Jpa Model}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaModel - * @generated - */ - public Adapter createJpaModelAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject IJpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaEObject - * @generated - */ - public Adapter createIJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaEObject Jpa EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaEObject - * @generated - */ - public Adapter createJpaEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaProject IJpa Project}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaProject - * @generated - */ - public Adapter createIJpaProjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaProject Jpa Project}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaProject - * @generated - */ - public Adapter createJpaProjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaFile IJpa File}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaFile - * @generated - */ - public Adapter createIJpaFileAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaFile Jpa File}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaFile - * @generated - */ - public Adapter createJpaFileAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaSourceObject IJpa Source Object}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaSourceObject - * @generated - */ - public Adapter createIJpaSourceObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IXmlEObject IXml EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IXmlEObject - * @generated - */ - public Adapter createIXmlEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaContentNode IJpa Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaContentNode - * @generated - */ - public Adapter createIJpaContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaRootContentNode IJpa Root Content Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaRootContentNode - * @generated - */ - public Adapter createIJpaRootContentNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IPersistentType IPersistent Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IPersistentType - * @generated - */ - public Adapter createIPersistentTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.ITypeMapping IType Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.ITypeMapping - * @generated - */ - public Adapter createITypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.NullTypeMapping Null Type Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.NullTypeMapping - * @generated - */ - public Adapter createNullTypeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IPersistentAttribute IPersistent Attribute}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IPersistentAttribute - * @generated - */ - public Adapter createIPersistentAttributeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IAttributeMapping IAttribute Mapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IAttributeMapping - * @generated - */ - public Adapter createIAttributeMappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.XmlEObject Xml EObject}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.XmlEObject - * @generated - */ - public Adapter createXmlEObjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaDataSource IJpa Data Source}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaDataSource - * @generated - */ - public Adapter createIJpaDataSourceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.JpaDataSource Jpa Data Source}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.JpaDataSource - * @generated - */ - public Adapter createJpaDataSourceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaPlatform IJpa Platform}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.IJpaPlatform - * @generated - */ - public Adapter createIJpaPlatformAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } -} //JpaCoreAdapterFactory diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreSwitch.java deleted file mode 100644 index 184193ea3b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreSwitch.java +++ /dev/null @@ -1,675 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.util; - -import java.util.List; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaDataSource; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaModel; -import org.eclipse.jpt.core.internal.IJpaPlatform; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IJpaRootContentNode; -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.IXmlEObject; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.JpaDataSource; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.JpaFile; -import org.eclipse.jpt.core.internal.JpaModel; -import org.eclipse.jpt.core.internal.JpaProject; -import org.eclipse.jpt.core.internal.NullTypeMapping; -import org.eclipse.jpt.core.internal.XmlEObject; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.jpt.core.internal.JpaCorePackage - * @generated - */ -public class JpaCoreSwitch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static JpaCorePackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public JpaCoreSwitch() { - if (modelPackage == null) { - modelPackage = JpaCorePackage.eINSTANCE; - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List eSuperTypes = theEClass.getESuperTypes(); - return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case JpaCorePackage.IJPA_MODEL : { - IJpaModel iJpaModel = (IJpaModel) theEObject; - T result = caseIJpaModel(iJpaModel); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.JPA_MODEL : { - JpaModel jpaModel = (JpaModel) theEObject; - T result = caseJpaModel(jpaModel); - if (result == null) - result = caseJpaEObject(jpaModel); - if (result == null) - result = caseIJpaModel(jpaModel); - if (result == null) - result = caseIJpaEObject(jpaModel); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_EOBJECT : { - IJpaEObject iJpaEObject = (IJpaEObject) theEObject; - T result = caseIJpaEObject(iJpaEObject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.JPA_EOBJECT : { - JpaEObject jpaEObject = (JpaEObject) theEObject; - T result = caseJpaEObject(jpaEObject); - if (result == null) - result = caseIJpaEObject(jpaEObject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_PROJECT : { - IJpaProject iJpaProject = (IJpaProject) theEObject; - T result = caseIJpaProject(iJpaProject); - if (result == null) - result = caseIJpaEObject(iJpaProject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.JPA_PROJECT : { - JpaProject jpaProject = (JpaProject) theEObject; - T result = caseJpaProject(jpaProject); - if (result == null) - result = caseJpaEObject(jpaProject); - if (result == null) - result = caseIJpaProject(jpaProject); - if (result == null) - result = caseIJpaEObject(jpaProject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_PLATFORM : { - IJpaPlatform iJpaPlatform = (IJpaPlatform) theEObject; - T result = caseIJpaPlatform(iJpaPlatform); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_DATA_SOURCE : { - IJpaDataSource iJpaDataSource = (IJpaDataSource) theEObject; - T result = caseIJpaDataSource(iJpaDataSource); - if (result == null) - result = caseIJpaEObject(iJpaDataSource); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.JPA_DATA_SOURCE : { - JpaDataSource jpaDataSource = (JpaDataSource) theEObject; - T result = caseJpaDataSource(jpaDataSource); - if (result == null) - result = caseJpaEObject(jpaDataSource); - if (result == null) - result = caseIJpaDataSource(jpaDataSource); - if (result == null) - result = caseIJpaEObject(jpaDataSource); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_FILE : { - IJpaFile iJpaFile = (IJpaFile) theEObject; - T result = caseIJpaFile(iJpaFile); - if (result == null) - result = caseIJpaEObject(iJpaFile); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.JPA_FILE : { - JpaFile jpaFile = (JpaFile) theEObject; - T result = caseJpaFile(jpaFile); - if (result == null) - result = caseJpaEObject(jpaFile); - if (result == null) - result = caseIJpaFile(jpaFile); - if (result == null) - result = caseIJpaEObject(jpaFile); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_SOURCE_OBJECT : { - IJpaSourceObject iJpaSourceObject = (IJpaSourceObject) theEObject; - T result = caseIJpaSourceObject(iJpaSourceObject); - if (result == null) - result = caseIJpaEObject(iJpaSourceObject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IXML_EOBJECT : { - IXmlEObject iXmlEObject = (IXmlEObject) theEObject; - T result = caseIXmlEObject(iXmlEObject); - if (result == null) - result = caseIJpaEObject(iXmlEObject); - if (result == null) - result = caseIJpaSourceObject(iXmlEObject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.XML_EOBJECT : { - XmlEObject xmlEObject = (XmlEObject) theEObject; - T result = caseXmlEObject(xmlEObject); - if (result == null) - result = caseJpaEObject(xmlEObject); - if (result == null) - result = caseIXmlEObject(xmlEObject); - if (result == null) - result = caseIJpaEObject(xmlEObject); - if (result == null) - result = caseIJpaSourceObject(xmlEObject); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_CONTENT_NODE : { - IJpaContentNode iJpaContentNode = (IJpaContentNode) theEObject; - T result = caseIJpaContentNode(iJpaContentNode); - if (result == null) - result = caseIJpaSourceObject(iJpaContentNode); - if (result == null) - result = caseIJpaEObject(iJpaContentNode); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IJPA_ROOT_CONTENT_NODE : { - IJpaRootContentNode iJpaRootContentNode = (IJpaRootContentNode) theEObject; - T result = caseIJpaRootContentNode(iJpaRootContentNode); - if (result == null) - result = caseIJpaContentNode(iJpaRootContentNode); - if (result == null) - result = caseIJpaSourceObject(iJpaRootContentNode); - if (result == null) - result = caseIJpaEObject(iJpaRootContentNode); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IPERSISTENT_TYPE : { - IPersistentType iPersistentType = (IPersistentType) theEObject; - T result = caseIPersistentType(iPersistentType); - if (result == null) - result = caseIJpaContentNode(iPersistentType); - if (result == null) - result = caseIJpaSourceObject(iPersistentType); - if (result == null) - result = caseIJpaEObject(iPersistentType); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.ITYPE_MAPPING : { - ITypeMapping iTypeMapping = (ITypeMapping) theEObject; - T result = caseITypeMapping(iTypeMapping); - if (result == null) - result = caseIJpaSourceObject(iTypeMapping); - if (result == null) - result = caseIJpaEObject(iTypeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.NULL_TYPE_MAPPING : { - NullTypeMapping nullTypeMapping = (NullTypeMapping) theEObject; - T result = caseNullTypeMapping(nullTypeMapping); - if (result == null) - result = caseJpaEObject(nullTypeMapping); - if (result == null) - result = caseITypeMapping(nullTypeMapping); - if (result == null) - result = caseIJpaSourceObject(nullTypeMapping); - if (result == null) - result = caseIJpaEObject(nullTypeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IPERSISTENT_ATTRIBUTE : { - IPersistentAttribute iPersistentAttribute = (IPersistentAttribute) theEObject; - T result = caseIPersistentAttribute(iPersistentAttribute); - if (result == null) - result = caseIJpaContentNode(iPersistentAttribute); - if (result == null) - result = caseIJpaSourceObject(iPersistentAttribute); - if (result == null) - result = caseIJpaEObject(iPersistentAttribute); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case JpaCorePackage.IATTRIBUTE_MAPPING : { - IAttributeMapping iAttributeMapping = (IAttributeMapping) theEObject; - T result = caseIAttributeMapping(iAttributeMapping); - if (result == null) - result = caseIJpaSourceObject(iAttributeMapping); - if (result == null) - result = caseIJpaEObject(iAttributeMapping); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Model'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Model'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaModel(IJpaModel object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa Model'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa Model'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaModel(JpaModel object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaEObject(IJpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaEObject(JpaEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Project'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Project'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaProject(IJpaProject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa Project'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa Project'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaProject(JpaProject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa File'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa File'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaFile(IJpaFile object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa File'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa File'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaFile(JpaFile object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Source Object'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Source Object'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaSourceObject(IJpaSourceObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IXml EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IXml EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIXmlEObject(IXmlEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaContentNode(IJpaContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Root Content Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaRootContentNode(IJpaRootContentNode object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPersistent Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPersistent Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPersistentType(IPersistentType object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IType Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IType Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseITypeMapping(ITypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Null Type Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Null Type Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseNullTypeMapping(NullTypeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IPersistent Attribute'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IPersistent Attribute'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIPersistentAttribute(IPersistentAttribute object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IAttribute Mapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IAttribute Mapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIAttributeMapping(IAttributeMapping object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Xml EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Xml EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlEObject(XmlEObject object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Data Source'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Data Source'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaDataSource(IJpaDataSource object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'Jpa Data Source'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'Jpa Data Source'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJpaDataSource(JpaDataSource object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'IJpa Platform'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'IJpa Platform'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIJpaPlatform(IJpaPlatform object) { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } -} //JpaCoreSwitch diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/IJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/IJpaValidationMessages.java deleted file mode 100644 index b6fa20698c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/IJpaValidationMessages.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This program and - * the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.internal.validation; - -public interface IJpaValidationMessages -{ - public static final String BUNDLE = "jpa_validation"; - - - public static final String PROJECT_NO_CONNECTION = "PROJECT_NO_CONNECTION"; - - public static final String PROJECT_INACTIVE_CONNECTION = "PROJECT_INACTIVE_CONNECTION"; - - public static final String PROJECT_NO_PERSISTENCE_XML = "PROJECT_NO_PERSISTENCE_XML"; - - public static final String PROJECT_MULTIPLE_PERSISTENCE_XML = "PROJECT_MULTIPLE_PERSISTENCE_XML"; - - public static final String PERSISTENCE_XML_INVALID_CONTENT = "PERSISTENCE_XML_INVALID_CONTENT"; - - public static final String PERSISTENCE_NO_PERSISTENCE_UNIT = "PERSISTENCE_NO_PERSISTENCE_UNIT"; - - public static final String PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS = "PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS"; - - public static final String PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE = "PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE"; - - public static final String PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE = "PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE"; - - public static final String PERSISTENCE_UNIT_INVALID_MAPPING_FILE = "PERSISTENCE_UNIT_INVALID_MAPPING_FILE"; - - public static final String PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE = "PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE"; - - public static final String PERSISTENCE_UNIT_UNSPECIFIED_CLASS = "PERSISTENCE_UNIT_UNSPECIFIED_CLASS"; - - public static final String PERSISTENCE_UNIT_NONEXISTENT_CLASS = "PERSISTENCE_UNIT_NONEXISTENT_CLASS"; - - public static final String PERSISTENCE_UNIT_INVALID_CLASS = "PERSISTENCE_UNIT_INVALID_CLASS"; - - public static final String PERSISTENCE_UNIT_DUPLICATE_CLASS = "PERSISTENCE_UNIT_DUPLICATE_CLASS"; - - public static final String ENTITY_MAPPINGS_MULTIPLE_METADATA = "ENTITY_MAPPINGS_MULTIPLE_METADATA"; - - public static final String PERSISTENT_TYPE_UNSPECIFIED_CONTEXT = "PERSISTENT_TYPE_UNSPECIFIED_CONTEXT"; - - public static final String PERSISTENT_TYPE_UNSPECIFIED_CLASS = "PERSISTENT_TYPE_UNSPECIFIED_CLASS"; - - public static final String PERSISTENT_TYPE_UNRESOLVED_CLASS = "PERSISTENT_TYPE_UNRESOLVED_CLASS"; - - public static final String ENTITY_NO_ID = "ENTITY_NO_ID"; - - public static final String PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME = "PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME"; - - public static final String PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME = "PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME"; - - public static final String PERSISTENT_ATTRIBUTE_FINAL_FIELD = "PERSISTENT_ATTRIBUTE_FINAL_FIELD"; - - public static final String PERSISTENT_ATTRIBUTE_PUBLIC_FIELD = "PERSISTENT_ATTRIBUTE_PUBLIC_FIELD"; - - public static final String PERSISTENT_ATTRIBUTE_INVALID_MAPPING = "PERSISTENT_ATTRIBUTE_INVALID_MAPPING"; - - public static final String MAPPING_UNRESOLVED_MAPPED_BY = "MAPPING_UNRESOLVED_MAPPED_BY"; - - public static final String MAPPING_INVALID_MAPPED_BY = "MAPPING_INVALID_MAPPED_BY"; - - public static final String MAPPING_MAPPED_BY_WITH_JOIN_TABLE = "MAPPING_MAPPED_BY_WITH_JOIN_TABLE"; - - public static final String MAPPING_MAPPED_BY_ON_BOTH_SIDES = "MAPPING_MAPPED_BY_ON_BOTH_SIDES"; - - public static final String TABLE_UNRESOLVED_SCHEMA = "TABLE_UNRESOLVED_SCHEMA"; - - public static final String TABLE_UNRESOLVED_NAME = "TABLE_UNRESOLVED_NAME"; - - public static final String SECONDARY_TABLE_UNRESOLVED_SCHEMA = "SECONDARY_TABLE_UNRESOLVED_SCHEMA"; - - public static final String SECONDARY_TABLE_UNRESOLVED_NAME = "SECONDARY_TABLE_UNRESOLVED_NAME"; - - public static final String JOIN_TABLE_UNRESOLVED_SCHEMA = "JOIN_TABLE_UNRESOLVED_SCHEMA"; - - public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA"; - - public static final String JOIN_TABLE_UNRESOLVED_NAME = "JOIN_TABLE_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME"; - - public static final String COLUMN_UNRESOLVED_TABLE = "COLUMN_UNRESOLVED_TABLE"; - - public static final String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE"; - - public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE"; - - public static final String COLUMN_UNRESOLVED_NAME = "COLUMN_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME"; - - public static final String JOIN_COLUMN_UNRESOLVED_TABLE = "JOIN_COLUMN_UNRESOLVED_TABLE"; - - public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE"; - - public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE"; - - public static final String JOIN_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME"; - - public static final String JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME"; - - public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME"; - - public static final String GENERATED_VALUE_UNRESOLVED_GENERATOR = "GENERATED_VALUE_UNRESOLVED_GENERATOR"; - - public static final String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME"; - - public static final String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME"; - -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java deleted file mode 100644 index 2b74ce7bac..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.validation; - -import org.eclipse.core.resources.IResource; -import org.eclipse.jpt.core.internal.IJpaEObject; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.wst.validation.internal.operations.WorkbenchContext; - -public class JpaHelper extends WorkbenchContext -{ - IJpaProject getJpaProject() { - return JptCorePlugin.getJpaProject(getProject()); - } - - @Override - public IResource getResource(Object obj) { - return ((IJpaEObject) obj).getResource(); - } - - /* - * This is used when no line number is set. We generally use line numbers. - * Therefore, when this is called, we will use the default location, i.e. - * null. - */ - @Override - public String getLocation(Object object) { - return null; - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java deleted file mode 100644 index 8318f55ea0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.validation; - -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.SimpleTextRange; -import org.eclipse.wst.validation.internal.core.Message; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -public class JpaValidationMessages - implements IJpaValidationMessages -{ - private static String[] DEFAULT_PARAMS = new String[0]; - - private static ITextRange DEFAULT_TEXT_RANGE = new SimpleTextRange(0, 0, 0); - - public static IMessage buildMessage( - int severity, String messageId, Object targetObject) { - return buildMessage(severity, messageId, DEFAULT_PARAMS, targetObject); - } - - public static IMessage buildMessage( - int severity, String messageId, String[] params, Object targetObject) { - return buildMessage(severity, messageId, params, targetObject, DEFAULT_TEXT_RANGE); - } - - public static IMessage buildMessage( - int severity, String messageId, Object targetObject, ITextRange textRange) { - return buildMessage(severity, messageId, DEFAULT_PARAMS, targetObject, textRange); - } - - public static IMessage buildMessage( - int severity, String messageId, String[] params, Object targetObject, ITextRange textRange) { - IMessage message = new Message(BUNDLE, severity, messageId, params, targetObject); - message.setLineNo(textRange.getLineNumber()); - message.setOffset(textRange.getOffset()); - message.setLength(textRange.getLength()); - return message; - } - - - private JpaValidationMessages() { - super(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java deleted file mode 100644 index 4f5b65a735..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.internal.validation; - -import java.util.Iterator; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.wst.validation.internal.core.Message; -import org.eclipse.wst.validation.internal.core.ValidationException; -import org.eclipse.wst.validation.internal.operations.IWorkbenchContext; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; -import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; -import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob; - -public class JpaValidator implements IValidatorJob -{ - public ISchedulingRule getSchedulingRule(IValidationContext helper) { - // don't know what to return here. my guess is that we want to return - // the resource that is possibly being changed during our validation, - // and since many resources in the project may be changed during this - // validation, returning the project makes the most sense. - return ((IWorkbenchContext) helper).getProject(); - } - - public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException { - JpaHelper jpaHelper = (JpaHelper) helper; - IJpaProject jpaProject = jpaHelper.getJpaProject(); - - reporter.removeAllMessages(this); - - for (Iterator stream = jpaProject.validationMessages(); stream.hasNext(); ) { - reporter.addMessage(this, (Message) stream.next()); - } - - return OK_STATUS; - } - - public void cleanup(IReporter reporter) { - // TODO Auto-generated method stub - return; - } - - public void validate(IValidationContext helper, IReporter reporter) throws ValidationException { - validateInJob(helper, reporter); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath b/jpa/plugins/org.eclipse.jpt.db.ui/.classpath deleted file mode 100644 index 304e86186a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore deleted file mode 100644 index 814c6a80a6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -build.xml -javaCompiler...args \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.project b/jpa/plugins/org.eclipse.jpt.db.ui/.project deleted file mode 100644 index 88ea5da610..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.db.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index ee4b8c1b90..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:10:38 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 842c286bb1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:59:42 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 38a4d91ae9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.db.ui -Bundle-Version: 1.0.0.qualifier -Bundle-ClassPath: . -Bundle-Localization: plugin -Export-Package: org.eclipse.jpt.db.ui.internal; x-friends:="org.eclipse.jpt.ui" -Require-Bundle: org.eclipse.ui, - org.eclipse.jpt.db, - org.eclipse.datatools.connectivity.ui, - org.eclipse.datatools.sqltools.editor.core -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/about.html b/jpa/plugins/org.eclipse.jpt.db.ui/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/build.properties b/jpa/plugins/org.eclipse.jpt.db.ui/build.properties deleted file mode 100644 index 0d56981f21..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/build.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - about.html,\ - plugin.properties -jars.compile.order = . diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/component.xml b/jpa/plugins/org.eclipse.jpt.db.ui/component.xml deleted file mode 100644 index bf648aaa4f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/component.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties deleted file mode 100644 index 2b0e5835b1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence API Tools - DB UI -providerName = Eclipse.org - diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java b/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java deleted file mode 100644 index 632fe81411..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java +++ /dev/null @@ -1,99 +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.db.ui.internal; - -import org.eclipse.datatools.connectivity.ICategory; -import org.eclipse.datatools.connectivity.IConnectionProfile; -import org.eclipse.datatools.connectivity.IProfileListener; -import org.eclipse.datatools.connectivity.ProfileManager; -import org.eclipse.datatools.connectivity.internal.ConnectionProfileManager; -import org.eclipse.datatools.connectivity.internal.ui.wizards.CPWizardNode; -import org.eclipse.datatools.connectivity.internal.ui.wizards.NewCPWizard; -import org.eclipse.datatools.connectivity.internal.ui.wizards.ProfileWizardProvider; -import org.eclipse.datatools.connectivity.ui.wizards.IWizardCategoryProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * ConnectionProfileUiTools - */ -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 is cancelled. ConnectionProfileRepository - * can be used to retrieve the added connection profile. - */ - public static String createNewProfile() { - NewCPWizard wizard; - WizardDialog wizardDialog; - - // Filter datasource category - ViewerFilter viewerFilter = new ViewerFilter() { - - public boolean select( Viewer viewer, Object parentElement, Object element) { - - CPWizardNode wizardNode = ( CPWizardNode) element; - if( !( wizardNode.getProvider() instanceof IWizardCategoryProvider)) { - ICategory cat = ConnectionProfileManager.getInstance().getProvider( - (( ProfileWizardProvider) wizardNode.getProvider()).getProfile()).getCategory(); - - // Only display wizards belong to database category - while( cat != null) { - if( cat.getId().equals( ConnectionProfileRepository.DATABASE_CATEGORY_ID)) - return true; - else - cat = cat.getParent(); - } - } - return false; - } - }; - wizard = new NewCPWizard( viewerFilter, null); - Shell currentShell = Display.getCurrent().getActiveShell(); - wizardDialog = new WizardDialog( currentShell, wizard); - wizardDialog.setBlockOnOpen( true); - - LocalProfileListener listener = new LocalProfileListener(); - ProfileManager.getInstance().addProfileListener( listener); - - if( wizardDialog.open() == Window.CANCEL) { - ProfileManager.getInstance().removeProfileListener( listener); - return null; - } - IConnectionProfile addedProfile = listener.addedProfile; - ProfileManager.getInstance().removeProfileListener( listener); - - return addedProfile.getName(); - } - - private static class LocalProfileListener implements IProfileListener { - IConnectionProfile addedProfile; - - public void profileAdded( IConnectionProfile profile) { - addedProfile = profile; - } - - public void profileChanged( IConnectionProfile profile) { - // do nothing - } - - public void profileDeleted( IConnectionProfile profile) { - // do nothing - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/.classpath b/jpa/plugins/org.eclipse.jpt.db/.classpath deleted file mode 100644 index 304e86186a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.db/.cvsignore b/jpa/plugins/org.eclipse.jpt.db/.cvsignore deleted file mode 100644 index 814c6a80a6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -build.xml -javaCompiler...args \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.db/.project b/jpa/plugins/org.eclipse.jpt.db/.project deleted file mode 100644 index 5675a48e3a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.db - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 797ea025b1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:10:29 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 929d54536d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:59:18 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF deleted file mode 100644 index a8da4753cf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.db -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.jpt.db.internal.JptDbPlugin -Bundle-ClassPath: . -Bundle-Localization: plugin -Eclipse-LazyStart: true -Export-Package: org.eclipse.jpt.db.internal -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.datatools.sqltools.editor.core, - org.eclipse.jpt.utility -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/jpa/plugins/org.eclipse.jpt.db/about.html b/jpa/plugins/org.eclipse.jpt.db/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/plugins/org.eclipse.jpt.db/build.properties b/jpa/plugins/org.eclipse.jpt.db/build.properties deleted file mode 100644 index 974eadac6b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -javacSource=1.5 -javacTarget=1.5 -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - about.html,\ - plugin.properties -jars.compile.order = . diff --git a/jpa/plugins/org.eclipse.jpt.db/component.xml b/jpa/plugins/org.eclipse.jpt.db/component.xml deleted file mode 100644 index 644c396149..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/component.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.db/plugin.properties b/jpa/plugins/org.eclipse.jpt.db/plugin.properties deleted file mode 100644 index e87a2d3972..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/plugin.properties +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################### -# Copyright (c) 2006 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence API Tools - DB -providerName = Eclipse.org - diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java deleted file mode 100644 index 0c4238e616..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java +++ /dev/null @@ -1,108 +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.db.internal; - -import java.text.Collator; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; -import org.eclipse.emf.common.util.EList; - -/** - * Wrap a DTP Catalogs - */ -final class Catalog extends DTPWrapper implements Comparable { - private final Database database; - final org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog; - @SuppressWarnings("unused") - private ICatalogObjectListener catalogListener; //TODO listen for change - - // ********** constructors ********** - - Catalog( Database database, org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) { - super(); - this.database = database; - this.dtpCatalog = dtpCatalog; - } - - // ********** behavior ********** - - @Override - protected boolean connectionIsOnline() { - return this.database.connectionIsOnline(); - } - - @SuppressWarnings("unused") - private ICatalogObjectListener buildCatalogListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject catalog, final int eventType) { - if( catalog == Catalog.this.dtpCatalog) { -// Catalog.this.refresh(); -// Catalog.this.database.catalogChanged( Catalog.this, eventType); - } - } - }; - } - - @Override - protected void dispose() { -// this.removeCatalogObjectListener(( ICatalogObject) this.dtpCatalog, this.catalogListener); - } - - boolean wraps( org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) { - return this.dtpCatalog == catalog; - } - - // ********** queries ********** - - @Override - public String getName() { - return this.dtpCatalog.getName(); - } - - boolean isCaseSensitive() { - return this.database.isCaseSensitive(); - } - - Column column( org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) { - return this.database.column(dtpColumn); - } - - // ***** schemata - - synchronized Set buildSchemata() { - EList dtpSchemata = this.dtpSchemata(); - - Set result = new HashSet( dtpSchemata.size()); - for (org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema : dtpSchemata) { - result.add( this.wrap(dtpSchema)); - } - return result; - } - - @SuppressWarnings("unchecked") - private EList dtpSchemata() { - return this.dtpCatalog.getSchemas(); - } - - private Schema wrap( org.eclipse.datatools.modelbase.sql.schema.Schema schema) { - - return new Schema( this.database, schema); - } - - // ********** Comparable implementation ********** - - public int compareTo( Catalog catalog) { - return Collator.getInstance().compare( this.getName(), catalog.getName()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java deleted file mode 100644 index 547ba01aad..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java +++ /dev/null @@ -1,162 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; -import org.eclipse.datatools.modelbase.sql.datatypes.DataType; -import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType; -import org.eclipse.jpt.utility.internal.JavaType; -import org.eclipse.jpt.utility.internal.NameTools; - -/** - * Wrap a DTP Column - */ -public final class Column extends DTPWrapper implements Comparable { - private final Table table; - private final org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn; - private ICatalogObjectListener columnListener; - - // TODO Object is the default? - private static final JavaType DEFAULT_JAVA_TYPE = new JavaType(java.lang.Object.class); - - private static final JavaType BLOB_JAVA_TYPE = new JavaType(java.sql.Blob.class); - private static final JavaType BYTE_ARRAY_JAVA_TYPE = new JavaType(byte[].class); - - private static final JavaType CLOB_JAVA_TYPE = new JavaType(java.sql.Clob.class); - private static final JavaType STRING_JAVA_TYPE = new JavaType(java.lang.String.class); - - - // ********** constructors ********** - - Column( Table table, org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) { - super(); - this.table = table; - this.dtpColumn = dtpColumn; - this.initialize(); - } - - // ********** behavior ********** - - private void initialize() { - if( this.connectionIsOnline()) { - this.columnListener = this.buildColumnListener(); - this.addCatalogObjectListener(( ICatalogObject) this.dtpColumn, this.columnListener); - } - } - - @Override - protected boolean connectionIsOnline() { - return this.table.connectionIsOnline(); - } - - private ICatalogObjectListener buildColumnListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject column, final int eventType) { -// TODO -// if( column == Column.this.dtpColumn) { -// Column.this.table.columnChanged( Column.this, eventType); -// } - } - }; - } - - @Override - protected void dispose() { - - this.removeCatalogObjectListener(( ICatalogObject) this.dtpColumn, this.columnListener); - } - - // ********** queries ********** - - @Override - public String getName() { - return this.dtpColumn.getName(); - } - - boolean isCaseSensitive() { - return this.table.isCaseSensitive(); - } - - public String dataTypeName() { - DataType dataType = this.dtpColumn.getDataType(); - return (dataType == null) ? null : dataType.getName(); - } - - public String javaFieldName() { - String jName = this.getName(); - if ( ! this.isCaseSensitive()) { - jName = jName.toLowerCase(); - } - return NameTools.convertToJavaIdentifier(jName); - } - - public boolean matchesJavaFieldName(String javaFieldName) { - return this.isCaseSensitive() ? - this.getName().equals(javaFieldName) - : - this.getName().equalsIgnoreCase(javaFieldName); - } - - /** - * Return a Java type declaration that is reasonably - * similar to the column's data type. - */ - public String javaTypeDeclaration() { - return this.javaType().declaration(); - } - - /** - * Return a Java type that is reasonably - * similar to the column's data type. - */ - public JavaType javaType() { - DataType dataType = this.dtpColumn.getDataType(); - return (dataType instanceof PredefinedDataType) ? - this.jpaSpecCompliantJavaType(DTPTools.javaTypeFor(((PredefinedDataType) dataType).getPrimitiveType())) - : - DEFAULT_JAVA_TYPE; - } - - /** - * The JDBC spec says JDBC drivers should be able to map BLOBs and CLOBs - * directly, but the JPA spec does not allow them. - */ - private JavaType jpaSpecCompliantJavaType(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; - } - - public boolean isLob() { - DataType dataType = this.dtpColumn.getDataType(); - return (dataType instanceof PredefinedDataType) ? - DTPTools.dataTypeIsLob(((PredefinedDataType) dataType).getPrimitiveType()) - : - false; - } - - boolean wraps( org.eclipse.datatools.modelbase.sql.tables.Column column) { - return this.dtpColumn == column; - } - - // ********** Comparable implementation ********** - - public int compareTo( Column column) { - return Collator.getInstance().compare( this.getName(), column.getName()); - } -} - diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java deleted file mode 100644 index 3e1e7365db..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; - - -/** - * Connection wrapper base class. - */ -public abstract class Connection extends DTPWrapper implements Comparable { - - // ********** constructors ********** - - /** - * Create a wrapper for the given IManagedConnection. - */ - static Connection createConnection( org.eclipse.datatools.connectivity.IManagedConnection dtpConnection) { - return ( dtpConnection == null) ? NullConnection.instance() : new DTPConnectionWrapper( dtpConnection); - } - - Connection() { - super(); - } - - // ********** listeners ********** - - public abstract void addConnectionListener( ConnectionListener listener); - - public abstract void removeConnectionListener( ConnectionListener listener); - - - // ********** behavior ********** - - abstract void databaseChanged( Database database, int eventType); - - abstract void schemaChanged( Schema schema, Database database, int eventType); - - abstract void tableChanged( Table table, Schema schema, Database database, int eventType); - - - // ********** queries ********** - - public abstract boolean isConnected(); - - public abstract String getFactoryId(); - - @Override - protected boolean connectionIsOnline() { - return this.isConnected(); - } - - // ********** Comparable implementation ********** - - public int compareTo(Connection connection) { - return Collator.getInstance().compare( this.getName(), connection.getName()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java deleted file mode 100644 index d778cbb1e4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - - -/** - * ConnectionListener integrate th DTP IManagedConnectionListener listener. - * This class purpose is to decouple from the DTP listeners by accepting wrappers as parameter. - * - * @see org.eclipse.datatools.connectivity.IManagedConnectionListener - */ -public interface ConnectionListener { - - public void opened( Connection connection); - public void modified( Connection connection); - public boolean okToClose( Connection connection); - public void aboutToClose( Connection connection); - public void closed( Connection connection); - - public void databaseChanged( Connection connection, Database database); - public void schemaChanged( Connection connection, Schema schema); - public void tableChanged( Connection connection, Table table); - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java deleted file mode 100644 index e0c38d366f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java +++ /dev/null @@ -1,257 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; -import java.util.NoSuchElementException; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; - -/** - * ConnectionProfile wrapper base class. - */ -public abstract class ConnectionProfile extends DTPWrapper implements Comparable { - - private Connection connection; // Lazy initialized - private Database database; // Lazy initialized - private String catalogName; // Catalog used for this profile - - private ConnectionListener connectionListener; - - private ConnectionProfileRepository profileRepository; - - // ********** constructors ********** - - static ConnectionProfile createProfile( ConnectionProfileRepository profileRepository, org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) { - return ( dtpProfile == null) ? NullConnectionProfile.instance() : new DTPConnectionProfileWrapper( profileRepository, dtpProfile); - } - - ConnectionProfile( ConnectionProfileRepository profileRepository) { - super(); - this.profileRepository = profileRepository; - this.connectionListener = buildConnectionListener(); - this.catalogName = ""; - } - - // ********** behavior ********** - - public abstract void connect(); - - public abstract void disconnect(); - - protected abstract Connection buildConnection(); - - protected abstract Database buildDatabase(); - - abstract void databaseChanged( Database db, int eventType); - - abstract void catalogChanged( Catalog catalog, Database db, int eventType); - - abstract void schemaChanged( Schema schema, Database db, int eventType); - - abstract void tableChanged( Table table, Schema schema, Database db, int eventType); - - protected void refreshDatabase() { - this.disposeDatabase(); - this.database = null; - } - - @Override - protected void dispose() { - this.disengageConnectionListener(); - - this.disposeConnection(); - this.disposeDatabase(); - } - - private void disposeConnection() { - if( this.connection != null) { - this.getConnection().dispose(); - } - } - - private void disposeDatabase() { - if( this.database != null) { - this.getDatabase().dispose(); - } - } - - // ********** queries ********** - - public Connection getConnection() { - - if( this.connection == null) { - this.connection = this.buildConnection(); - this.engageConnectionListener(); - - } - return this.connection; - } - - public Database getDatabase() { - - if( this.database == null) { - this.database = this.buildDatabase(); - this.setDefaultCatalogName(); - } - return this.database; - } - - public abstract String getDatabaseName(); - - public abstract String getDatabaseProduct(); - - public abstract String getDatabaseVendor(); - - public abstract String getDatabaseVersion(); - - public abstract String getDriverClass(); - - public abstract String getUrl(); - - public abstract String getUserName(); - - public abstract String getUserPassword(); - - public abstract String getInstanceId(); - - public abstract String getProviderId(); - - public abstract String getDriverDefinitionId(); - - public abstract String getDriverJarList(); - - public abstract boolean isConnected(); - - @Override - protected boolean connectionIsOnline() { - return this.isConnected(); - } - - abstract boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile); - - public boolean isNull() { - return true; - } - - ConnectionProfileRepository getProfileRepository() { - return this.profileRepository; - } - - public String getCatalogName() { - return this.catalogName; - } - - /** - * Set the default catalog name for this profile. - */ - public void setDefaultCatalogName() { - this.setCatalogName( this.database.getDefaultCatalogName()); - } - - /** - * Can only set the catalog to use for this profile, when the database supports catalogs. - */ - public void setCatalogName( String catalogName) { - if( this.catalogName == catalogName) { - return; - } - if( this.database.supportsCatalogs()) { - String name = ( catalogName != null) ? catalogName : this.database.getDefaultCatalogName(); - - Catalog catalog = this.database.catalogNamed( name); - if( catalog == null) { - throw new NoSuchElementException(); - } - this.catalogName = name; - this.database.refresh(); - this.catalogChanged( catalog, this.database, ICatalogObjectListener.EventTypeEnumeration.ELEMENT_REFRESH); - } - else { - this.catalogName = ""; - this.database.refresh(); - } - } - - // ********** listeners ********** - - abstract public void addProfileListener( ProfileListener listener); - - abstract public void removeProfileListener( ProfileListener listener); - - abstract public void addConnectionListener( ConnectionListener listener); - - abstract public void removeConnectionListener( ConnectionListener listener); - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - - public void aboutToClose(Connection c) { - // not interested to this event. - } - - public void closed(Connection c) { - ConnectionProfile.this.refreshDatabase(); - } - - public void modified(Connection c) { - // not interested to this event. - return; - } - - public boolean okToClose(Connection c) { - // not interested to this event. - return true; - } - - public void opened(Connection c) { - ConnectionProfile.this.refreshDatabase(); - } - - public void databaseChanged(Connection c, final Database db) { - // not interested to this event. - return; - } - - public void schemaChanged(Connection c, final Schema schema) { - // not interested to this event. - return; - } - - public void tableChanged(Connection c, final Table table) { - // not interested to this event. - return; - } - }; - } - - protected void disengageConnectionListener() { - this.removeConnectionListener(); - } - - protected void engageConnectionListener() { - this.addConnectionListener(); - } - - private void addConnectionListener() { - this.addConnectionListener( this.connectionListener); - } - - private void removeConnectionListener() { - this.removeConnectionListener( this.connectionListener); - } - - // ********** Comparable implementation ********** - - public int compareTo( ConnectionProfile connectionProfile) { - return Collator.getInstance().compare( this.getName(), connectionProfile.getName()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java deleted file mode 100644 index 25e7ea7acd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java +++ /dev/null @@ -1,253 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import org.eclipse.datatools.connectivity.IConnectionProfile; -import org.eclipse.datatools.connectivity.IProfileListener; -import org.eclipse.datatools.connectivity.ProfileManager; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * ConnectionProfileRepository is a mediator to the DTP ProfileManager. - */ -public class ConnectionProfileRepository { - private ProfileManager dtpProfileManager; - - private LocalRepositoryListener repositoryListener; - private LocalProfileListener profileListener; - private Set profiles; - - private static ConnectionProfileRepository INSTANCE; - - public static final String DATABASE_CATEGORY_ID = "org.eclipse.datatools.connectivity.db.category"; //$NON-NLS-1$ - - /** - * singleton support - */ - public static ConnectionProfileRepository instance() { - if (INSTANCE == null) { - INSTANCE = new ConnectionProfileRepository(); - } - return INSTANCE; - } - - // ********** constructors ********** - - private ConnectionProfileRepository() { - super(); - this.dtpProfileManager = ProfileManager.getInstance(); - } - - // ********** behavior ********** - - public void initializeListeners() { - - if( this.repositoryListener == null) { - this.repositoryListener = new LocalRepositoryListener(); - this.dtpProfileManager.addProfileListener( this.repositoryListener); - } - if( this.profileListener == null) { - this.profileListener = new LocalProfileListener(); - this.dtpProfileManager.addProfileListener( this.profileListener); - } - } - - public void disposeListeners() { - for( Iterator stream = this.profiles(); stream.hasNext(); ) { - stream.next().dispose(); - } - if( this.repositoryListener != null) { - this.dtpProfileManager.removeProfileListener( this.repositoryListener); - this.repositoryListener = null; - } - if( this.profileListener != null) { - this.dtpProfileManager.removeProfileListener( this.profileListener); - this.profileListener = null; - } - } - - public Connection getConnectionWithProfileNamed( String name) { - return this.profileNamed( name).getConnection(); - } - - - @Override - public String toString() { - return this.profiles.toString(); - } - - // ********** profiles - - public Iterator profiles() { - return this.getProfiles().iterator(); - } - - public Iterator profileNames() { - return new TransformationIterator( this.profiles()) { - @Override - protected String transform( ConnectionProfile profile) { - return profile.getName(); - } - }; - } - - public ConnectionProfile profileNamed( String name) { - for( Iterator stream = this.profiles(); stream.hasNext(); ) { - ConnectionProfile profile = stream.next(); - if( profile.getName().equals( name)) { - return profile; - } - } - return NullConnectionProfile.instance(); - } - - private Set getProfiles() { - - if( this.profiles == null) { - this.profiles = this.buildProfiles(); - } - return this.profiles; - } - - private Set buildProfiles() { - IConnectionProfile[] dtpProfiles = this.dtpProfileManager.getProfiles(); - Set result = new HashSet( dtpProfiles.length); - for (IConnectionProfile dtpProfile : dtpProfiles) { - result.add( ConnectionProfile.createProfile( this, dtpProfile)); - } - return result; - } - - void addProfile( IConnectionProfile dtpProfile) { - - if( !this.profileExists( dtpProfile)) { - ConnectionProfile newProfile = ConnectionProfile.createProfile( ConnectionProfileRepository.this, dtpProfile); - this.profiles.add( newProfile); - } - } - - void removeProfile( IConnectionProfile dtpProfile) { - - this.profiles.remove( this.getProfile( dtpProfile)); - } - - private boolean profileExists( IConnectionProfile dtpProfile) { - - return ( this.getProfile( dtpProfile) == null) ? false : true; - } - - ConnectionProfile getProfile( IConnectionProfile dtpProfile) { - - for( Iterator stream = this.profiles(); stream.hasNext(); ) { - ConnectionProfile profile = stream.next(); - if( profile.wraps( dtpProfile)) { - return profile; - } - } - return null; - } - - // ********** listeners ********** - - public void addProfileListener( ProfileListener listener) { - - this.profileListener.addProfileListener( listener); - } - - public void removeProfileListener( ProfileListener listener) { - - this.profileListener.removeProfileListener( listener); - } - - @SuppressWarnings("unused") - private void addInternalProfileListener( IProfileListener listener) { - - this.dtpProfileManager.addProfileListener( listener); - } - - @SuppressWarnings("unused") - private void removeInternalProfileListener( IProfileListener listener) { - - this.dtpProfileManager.removeProfileListener( listener); - } - - // ********** member class ********** - /** - * Listens to ProfileManager events and updates the repository. - */ - private class LocalRepositoryListener implements IProfileListener { - - LocalRepositoryListener() { - super(); - } - - public void profileAdded( IConnectionProfile connectionProfile) { - ConnectionProfileRepository.this.addProfile( connectionProfile); - } - - public void profileChanged( IConnectionProfile connectionProfile) { - // do nothing - } - - public void profileDeleted( IConnectionProfile connectionProfile) { - ConnectionProfileRepository.this.removeProfile( connectionProfile); - } - } - - - /** - * This listener translates and forwards IProfileListener events to ProfileListener. - */ - private class LocalProfileListener implements IProfileListener { - private Collection listeners = new ArrayList(); - - LocalProfileListener() { - super(); - } - - void addProfileListener( ProfileListener listener) { - this.listeners.add( listener); - } - - void removeProfileListener( ProfileListener listener) { - this.listeners.remove( listener); - } - - // ********** behavior ********** - - public void profileAdded( IConnectionProfile dtpProfile) { - ConnectionProfile profile = getProfile( dtpProfile); - for (ProfileListener listener : this.listeners) { - listener.profileAdded( profile); - } - } - - public void profileChanged( IConnectionProfile dtpProfile) { - ConnectionProfile profile = getProfile( dtpProfile); - for (ProfileListener listener : this.listeners) { - listener.profileChanged( profile); - } - } - - public void profileDeleted( IConnectionProfile dtpProfile) { - String profileName = dtpProfile.getName(); - for (ProfileListener listener : this.listeners) { - listener.profileDeleted( profileName); - } - } - } -} - - diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java deleted file mode 100644 index 9d62b48c4c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java +++ /dev/null @@ -1,245 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.util.Properties; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.datatools.connectivity.IManagedConnection; -import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants; -import org.eclipse.datatools.connectivity.drivers.DriverManager; -import org.eclipse.datatools.sqltools.core.DatabaseIdentifier; -import org.eclipse.datatools.sqltools.core.profile.ProfileUtil; - -/** - * Wrap a DTP ConnectionProfile - */ -public final class DTPConnectionProfileWrapper extends ConnectionProfile { - - final private org.eclipse.datatools.connectivity.IConnectionProfile dtpConnectionProfile; - - public static final String CONNECTION_TYPE = "java.sql.Connection"; //$NON-NLS-1$ - public static final String CONNECTION_PROFILE_TYPE = "org.eclipse.datatools.connectivity.db.generic.connectionProfile"; //$NON-NLS-1$ - public static final String DATABASE_PRODUCT_PROPERTY = "org.eclipse.datatools.connectivity.server.version"; //$NON-NLS-1$ - /** - * This property is used in ConnectionProfile creation. - */ - public static final String DATABASE_SAVE_PWD_PROP_ID = IDBDriverDefinitionConstants.PROP_PREFIX + "savePWD"; //$NON-NLS-1$ - /** - * This property is used in ConnectionProfile creation. - */ - public static final String DRIVER_DEFINITION_PROP_ID = "org.eclipse.datatools.connectivity.driverDefinitionID"; //$NON-NLS-1$ - /** - * This property is used in DriverDefinition creation. - */ - public static final String DRIVER_DEFINITION_TYPE_PROP_ID = "org.eclipse.datatools.connectivity.drivers.defnType"; //$NON-NLS-1$ - /** - * This property is used in DriverDefinition creation. - */ - public static final String DRIVER_JAR_LIST_PROP_ID = "jarList"; //$NON-NLS-1$ - - // ********** constructors ********** - - DTPConnectionProfileWrapper( ConnectionProfileRepository profileRepository, org.eclipse.datatools.connectivity.IConnectionProfile dtpConnectionProfile) { - super( profileRepository); - this.dtpConnectionProfile = dtpConnectionProfile; - } - - // ********** listeners ********** - - @Override - public void addProfileListener( ProfileListener listener) { - - this.getProfileRepository().addProfileListener( listener); - } - - @Override - public void removeProfileListener( ProfileListener listener) { - - this.getProfileRepository().removeProfileListener( listener); - } - - @Override - public void addConnectionListener( ConnectionListener listener) { - - this.getConnection().addConnectionListener( listener); - } - - @Override - public void removeConnectionListener( ConnectionListener listener) { - - this.getConnection().removeConnectionListener( listener); - } - - // ********** behavior ********** - - private IManagedConnection buildDtpManagedConnection( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) { - return dtpProfile.getManagedConnection( CONNECTION_TYPE); - } - /** - * Connect using this profile. - */ - @Override - public void connect() { - if( !this.dtpConnectionProfile.isConnected()) { - - IStatus status = this.dtpConnectionProfile.connect(); - if( !status.isOK()) { - if( status.isMultiStatus()) { - IStatus[] statusChildren = status.getChildren(); - throw new RuntimeException( statusChildren[ 0].getMessage(), statusChildren[ 0].getException()); - } - throw new RuntimeException( status.getMessage(), status.getException()); - } - } - } - - @Override - public void disconnect() { - - IStatus status = this.dtpConnectionProfile.disconnect(); - if( !status.isOK()) { - if( status.isMultiStatus()) { - IStatus[] statusChildren = status.getChildren(); - throw new RuntimeException( statusChildren[ 0].getMessage(), statusChildren[ 0].getException()); - } - throw new RuntimeException( status.getMessage(), status.getException()); - } - } - - @Override - void databaseChanged( Database database, int eventType) { - this.getConnection().databaseChanged( database, eventType); - return; - } - - @Override - void catalogChanged( Catalog catalog, Database database, int eventType) { - //TODO -// this.getConnection().catalogChanged( catalog, eventType); - return; - } - - @Override - void schemaChanged( Schema schema, Database database, int eventType) { - this.getConnection().schemaChanged( schema, database, eventType); - } - - @Override - void tableChanged( Table table, Schema schema, Database database, int eventType) { - this.getConnection().tableChanged( table, schema, database, eventType); - } - - // ********** queries ********** - - @Override - public boolean isConnected() { - - return this.getConnection().isConnected(); - } - - @Override - public boolean isNull() { - return false; - } - - @Override - public String getName() { - - return this.dtpConnectionProfile.getName(); - } - - @Override - public String getDatabaseName() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID); - } - - @Override - public String getDatabaseProduct() { - return this.getProperties().getProperty( DATABASE_PRODUCT_PROPERTY); - } - - @Override - public String getDatabaseVendor() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID); - } - - @Override - public String getDatabaseVersion() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID); - } - - @Override - public String getUserName() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.USERNAME_PROP_ID); - } - - @Override - public String getUserPassword() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.PASSWORD_PROP_ID); - } - - @Override - public String getDriverClass() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID); - } - - @Override - public String getUrl() { - return this.getProperties().getProperty( IDBDriverDefinitionConstants.URL_PROP_ID); - } - - @Override - public String getInstanceId() { - return this.dtpConnectionProfile.getInstanceID(); - } - - @Override - public String getProviderId() { - return this.dtpConnectionProfile.getProviderId(); - } - - @Override - public String getDriverDefinitionId() { - return this.getProperties().getProperty( DTPConnectionProfileWrapper.DRIVER_DEFINITION_PROP_ID); - } - - @Override - public String getDriverJarList() { - return DriverManager.getInstance().getDriverInstanceByID( this.getDriverDefinitionId()).getJarList(); - } - - private Properties getProperties() { - return this.dtpConnectionProfile.getBaseProperties(); - } - - @Override - protected Connection buildConnection() { - - Connection connection = Connection.createConnection( this.buildDtpManagedConnection( this.dtpConnectionProfile)); //$NON-NLS-1$ - return connection; - } - - @Override - protected Database buildDatabase() { - - org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase; - if( this.isConnected()) { - dtpDatabase = ProfileUtil.getDatabase( new DatabaseIdentifier( this.getName(), this.getDatabaseName()), false); - return Database.createDatabase( this, dtpDatabase); - } - return NullDatabase.instance(); - } - - @Override - boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) { - return this.dtpConnectionProfile == dtpProfile; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java deleted file mode 100644 index 5440b35e3f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java +++ /dev/null @@ -1,170 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.datatools.connectivity.ConnectEvent; -import org.eclipse.datatools.connectivity.IManagedConnectionListener; - -/** - * Wrap a DTP Connection - */ -public final class DTPConnectionWrapper extends Connection { - - final private org.eclipse.datatools.connectivity.IManagedConnection dtpConnection; - private LocalConnectionListener connectionListener; - - // ********** constructors ********** - - DTPConnectionWrapper( org.eclipse.datatools.connectivity.IManagedConnection dtpConnection) { - super(); - this.dtpConnection = dtpConnection; - this.initialize(); - } - - // ********** behavior ********** - - protected void initialize() { - this.connectionListener = new LocalConnectionListener(); - this.dtpConnection.addConnectionListener( this.connectionListener); - } - - @Override - protected void dispose() { - this.dtpConnection.removeConnectionListener( this.connectionListener); - } - - @Override - public String getName() { - - return this.dtpConnection.getConnection().getConnectionProfile().getName(); - } - - @Override - public boolean isConnected() { - - return this.dtpConnection.isConnected(); - } - - @Override - public String getFactoryId() { - - return this.dtpConnection.getFactoryID(); - } - - @Override - void databaseChanged( Database database, int eventType) { - - this.connectionListener.databaseChanged( database, eventType); - } - - @Override - void schemaChanged( Schema schema, Database database, int eventType) { - - this.connectionListener.schemaChanged( schema, database, eventType); - } - - @Override - void tableChanged( Table table, Schema schema, Database database, int eventType) { - - this.connectionListener.tableChanged( table, schema, database, eventType); - } - - // ********** listeners ********** - - @Override - public void addConnectionListener( ConnectionListener listener) { - // hook up the specified listener to our intermediate listeners - this.connectionListener.addConnectionListener( listener); - } - - @Override - public void removeConnectionListener( ConnectionListener listener) { - - this.connectionListener.removeConnectionListener( listener); - } - - // ********** member classes ********** - - /** - * This listener translates and forwards IManagedConnectionListener events to ConnectionListeners. - */ - private class LocalConnectionListener implements IManagedConnectionListener { - private Collection listeners = new ArrayList(); - - LocalConnectionListener() { - super(); - } - - void addConnectionListener( ConnectionListener listener) { - this.listeners.add( listener); - } - - void removeConnectionListener( ConnectionListener listener) { - this.listeners.remove( listener); - } - - // ********** behavior ********** - - public void aboutToClose( ConnectEvent event) { - for (ConnectionListener listener : this.listeners) { - listener.aboutToClose( DTPConnectionWrapper.this); - } - } - - public void closed( ConnectEvent event) { - for (ConnectionListener listener : this.listeners) { - listener.closed( DTPConnectionWrapper.this); - } - } - - public void modified( ConnectEvent event) { - for (ConnectionListener listener : this.listeners) { - listener.modified( DTPConnectionWrapper.this); - } - } - - public boolean okToClose( ConnectEvent event) { - for (ConnectionListener listener : this.listeners) { - if( !listener.okToClose( DTPConnectionWrapper.this)) { - return false; - } - } - return true; - } - - public void opened( ConnectEvent event) { - for (ConnectionListener listener : this.listeners) { - listener.opened( DTPConnectionWrapper.this); - } - } - - void databaseChanged( Database database, int eventType) { - for (ConnectionListener listener : this.listeners) { - listener.databaseChanged( DTPConnectionWrapper.this, database); - } - } - - void schemaChanged( Schema schema, Database database, int eventType) { - for (ConnectionListener listener : this.listeners) { - listener.schemaChanged( DTPConnectionWrapper.this, schema); - } - } - - void tableChanged( Table table, Schema schema, Database database, int eventType) { - for (ConnectionListener listener : this.listeners) { - listener.tableChanged( DTPConnectionWrapper.this, table); - } - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java deleted file mode 100644 index d8b1dadb9e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java +++ /dev/null @@ -1,229 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Set; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; -import org.eclipse.emf.common.util.EList; - -/** - * Wrap a DTP Database - */ -public final class DTPDatabaseWrapper extends Database { - - final ConnectionProfile profile; - final org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase; - private ICatalogObjectListener databaseListener; - - private Set catalogs; // lazy-initialized - private Set schemata; // lazy-initialized - - DTPDatabaseWrapper( ConnectionProfile profile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) { - super(); - this.dtpDatabase = dtpDatabase; - this.profile = profile; - this.initialize(); - } - - // ********** behavior ********** - - private void initialize() { - - if( this.connectionIsOnline()) { - this.databaseListener = this.buildDatabaseListener(); - this.addCatalogObjectListener(( ICatalogObject) this.dtpDatabase, this.databaseListener); - } - } - - @Override - protected boolean connectionIsOnline() { - return this.profile.isConnected(); - } - - private ICatalogObjectListener buildDatabaseListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject database, final int eventType) { - if( database == DTPDatabaseWrapper.this.dtpDatabase) { - DTPDatabaseWrapper.this.refresh(); - DTPDatabaseWrapper.this.profile.databaseChanged( DTPDatabaseWrapper.this, eventType); - } - } - }; - } - - @Override - void refresh() { - this.disposeSchemata(); - this.disposeCatalogs(); - - this.schemata = null; - this.catalogs = null; - } - - @Override - void catalogChanged( Catalog catalog, int eventType) { - this.profile.catalogChanged( catalog, this, eventType); - return; - } - - @Override - void schemaChanged( Schema schema, int eventType) { - this.profile.schemaChanged( schema, this, eventType); - return; - } - - @Override - void tableChanged( Table table, Schema schema, int eventType) { - this.profile.tableChanged( table, schema, this, eventType); - return; - } - - @Override - protected void dispose() { - this.removeCatalogObjectListener(( ICatalogObject) this.dtpDatabase, this.databaseListener); - - this.disposeSchemata(); - this.disposeCatalogs(); - } - - private void disposeSchemata() { - if( this.schemata != null) { - for( Iterator stream = this.schemata(); stream.hasNext(); ) { - stream.next().dispose(); - } - } - } - - private void disposeCatalogs() { - if( this.catalogs != null) { - for( Iterator stream = this.catalogs(); stream.hasNext(); ) { - stream.next().dispose(); - } - } - } - - // ********** queries ********** - - @Override - public String getName() { - - return this.dtpDatabase.getName(); - } - - @Override - public String getVendor() { - - return this.dtpDatabase.getVendor(); - } - - @Override - public String getVersion() { - - return this.dtpDatabase.getVersion(); - } - - - // ***** schemata - - @Override - synchronized Set getSchemata() { - if( this.schemata == null) { - this.schemata = this.buildSchemata(); - } - return this.schemata; - } - - @SuppressWarnings("unchecked") - private EList dtpSchemata() { - return this.dtpDatabase.getSchemas(); - } - - private Set buildSchemata() { - Set result; - if( this.supportsCatalogs()) { - result = this.getSchemataForCatalogNamed( this.profile.getCatalogName()); - } - else { - EList dtpSchemata = this.dtpSchemata(); - result = new HashSet( dtpSchemata.size()); - for (org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema : dtpSchemata) { - result.add( this.wrap(dtpSchema)); - } - } - return result; - } - - // ***** catalogs - - @Override - public boolean supportsCatalogs() { - EList dtpSchemata = this.dtpSchemata(); - return ( dtpSchemata == null || dtpSchemata.size() == 0); - } - - @SuppressWarnings("unchecked") - private EList dtpCatalogs() { - return this.dtpDatabase.getCatalogs(); - } - - @Override - public String getDefaultCatalogName() { - - if( !this.supportsCatalogs()) { // this database doesn't support catalogs - return ""; - } - String userName = this.profile.getUserName(); - for (org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog : this.dtpCatalogs()) { - if( dtpCatalog.getName().length() == 0) { // special catalog that contains all schemata - return ""; - } - else if( dtpCatalog.getName().equals( userName)) { - return userName; // returns user name as default catalog - } - else if( dtpCatalog.getName().equals( this.getName())) { - return this.getName(); // special catalog with same name as DB (PostgreSQL) - } - } - throw new NoSuchElementException(); - } - - @Override - synchronized Set getCatalogs() { - if( this.catalogs == null) { - this.catalogs = this.buildCatalogs(); - } - return this.catalogs; - } - - private Set buildCatalogs() { - - EList dtpCatalogs = this.dtpCatalogs(); - if( dtpCatalogs == null) { - return Collections.emptySet(); - } - Set result = new HashSet( dtpCatalogs.size()); - for (org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog : dtpCatalogs) { - result.add( this.wrap(dtpCatalog)); - } - return result; - } - - private Set getSchemataForCatalogNamed( String catalogName) { - - Catalog catalog = this.catalogNamed( catalogName); - return ( catalog != null) ? catalog.buildSchemata() : Collections.emptySet(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java deleted file mode 100644 index 1c46efdfd5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java +++ /dev/null @@ -1,212 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.sql.Types; -import java.util.HashMap; -import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType; -import org.eclipse.jpt.utility.internal.JDBCTools; -import org.eclipse.jpt.utility.internal.JDBCType; -import org.eclipse.jpt.utility.internal.JavaType; - -/** - * Helper methods for dealing with Eclipse DTP. - */ -public final class DTPTools { - - /** - * Return the JDBC type corresponding to the specified Primitive type. - */ - public static JDBCType jdbcTypeForPrimitiveTypeNamed(String primitiveTypeName) { - PrimitiveToJDBCTypeMapping mapping = primitiveToJDBCTypeMapping(primitiveTypeName); - return (mapping == null) ? DEFAULT_JDBC_TYPE : mapping.getJDBCType(); - } - - /** - * Return the JDBC type corresponding to the specified Primitive type. - */ - public static JDBCType jdbcTypeFor(PrimitiveType primitiveType) { - return jdbcTypeForPrimitiveTypeNamed(primitiveType.getName()); - } - - /** - * Return the JDBC type corresponding to the specified Primitive type. - */ - public static JDBCType jdbcTypeForPrimitiveTypeCode(int primitiveTypeCode) { - return jdbcTypeFor(PrimitiveType.get(primitiveTypeCode)); - } - - /** - * Return the Java type corresponding to the specified Primitive type. - */ - public static JavaType javaTypeForPrimitiveTypeNamed(String primitiveTypeName) { - return JDBCTools.javaTypeFor(jdbcTypeForPrimitiveTypeNamed(primitiveTypeName)); - } - - /** - * Return the Java type corresponding to the specified Primitive type. - */ - public static JavaType javaTypeFor(PrimitiveType primitiveType) { - return JDBCTools.javaTypeFor(jdbcTypeFor(primitiveType)); - } - - /** - * Return the Java type corresponding to the specified Primitive type. - */ - public static JavaType javaTypeForPrimitiveTypeCode(int primitiveTypeCode) { - return JDBCTools.javaTypeFor(jdbcTypeForPrimitiveTypeCode(primitiveTypeCode)); - } - - /** - * Return whether the specified Primitive type is a LOB - * (i.e. a BLOB, CLOB, or NCLOB). - */ - public static boolean dataTypeIsLob(PrimitiveType primitiveType) { - return (primitiveType == PrimitiveType.BINARY_LARGE_OBJECT_LITERAL) - || (primitiveType == PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL) - || (primitiveType == PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL); - } - - - // ********** internal stuff ********** - - - // ********** DTP Primitive => JDBC ********** - - /** - * Primitive => JDBC type mappings, keyed by Primitive type name (e.g. "CHARACTER_VARYING") - */ - private static HashMap PRIMITIVE_TO_JDBC_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized - private static final JDBCType DEFAULT_JDBC_TYPE = JDBCType.type(Types.VARCHAR); // TODO VARCHAR is the default? - - - private static PrimitiveToJDBCTypeMapping primitiveToJDBCTypeMapping(String primitiveTypeName) { - return primitiveToJDBCTypeMappings().get(primitiveTypeName); - } - - private static synchronized HashMap primitiveToJDBCTypeMappings() { - if (PRIMITIVE_TO_JDBC_TYPE_MAPPINGS == null) { - PRIMITIVE_TO_JDBC_TYPE_MAPPINGS = buildPrimitiveToJDBCTypeMappings(); - } - return PRIMITIVE_TO_JDBC_TYPE_MAPPINGS; - } - - private static HashMap buildPrimitiveToJDBCTypeMappings() { - HashMap mappings = new HashMap(); - addPrimitiveToJDBCTypeMappingsTo(mappings); - return mappings; - } - - /** - * hard code the default mappings from the DTP primitive types to the - * appropriate JDBC types; - * pretty much a straight one-to-one mapping based on similar names; - * TODO some JDBC types are missing: INTERVAL, XML_TYPE - */ - private static void addPrimitiveToJDBCTypeMappingsTo(HashMap mappings) { - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BIGINT_LITERAL, Types.BIGINT, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BINARY_LARGE_OBJECT_LITERAL, Types.BLOB, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BINARY_LITERAL, Types.BINARY, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BINARY_VARYING_LITERAL, Types.VARBINARY, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BOOLEAN_LITERAL, Types.BOOLEAN, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL, Types.CLOB, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.CHARACTER_LITERAL, Types.CHAR, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.CHARACTER_VARYING_LITERAL, Types.VARCHAR, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DATALINK_LITERAL, Types.DATALINK, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DATE_LITERAL, Types.DATE, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DECIMAL_LITERAL, Types.DECIMAL, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DOUBLE_PRECISION_LITERAL, Types.DOUBLE, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.FLOAT_LITERAL, Types.FLOAT, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.INTEGER_LITERAL, Types.INTEGER, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.INTERVAL_LITERAL, Types.OTHER, mappings); // ??? - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL, Types.CLOB, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NATIONAL_CHARACTER_LITERAL, Types.CHAR, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NATIONAL_CHARACTER_VARYING_LITERAL, Types.VARCHAR, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NUMERIC_LITERAL, Types.NUMERIC, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.REAL_LITERAL, Types.REAL, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.SMALLINT_LITERAL, Types.SMALLINT, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.TIME_LITERAL, Types.TIME, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.TIMESTAMP_LITERAL, Types.TIMESTAMP, mappings); - addPrimitiveToJDBCTypeMappingTo(PrimitiveType.XML_TYPE_LITERAL, Types.OTHER, mappings); // ??? - } - - private static void addPrimitiveToJDBCTypeMappingTo(PrimitiveType primitiveType, int jdbcTypeCode, HashMap mappings) { - // check for duplicates - Object prev = mappings.put(primitiveType.getName(), buildPrimitiveToJDBCTypeMapping(primitiveType, jdbcTypeCode)); - if (prev != null) { - throw new IllegalArgumentException("duplicate Java class: " + ((PrimitiveToJDBCTypeMapping) prev).getPrimitiveType().getName()); - } - } - - private static PrimitiveToJDBCTypeMapping buildPrimitiveToJDBCTypeMapping(PrimitiveType primitiveType, int jdbcTypeCode) { - return new PrimitiveToJDBCTypeMapping(primitiveType, JDBCType.type(jdbcTypeCode)); - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private DTPTools() { - super(); - throw new UnsupportedOperationException(); - } - - - // ********** member classes ********** - - /** - * Primitive => JDBC - */ - private static class PrimitiveToJDBCTypeMapping { - private final PrimitiveType primitiveType; - private final JDBCType jdbcType; - - PrimitiveToJDBCTypeMapping(PrimitiveType primitiveType, JDBCType jdbcType) { - super(); - this.primitiveType = primitiveType; - this.jdbcType = jdbcType; - } - - public PrimitiveType getPrimitiveType() { - return this.primitiveType; - } - - public JDBCType getJDBCType() { - return this.jdbcType; - } - - public boolean maps(PrimitiveType pt) { - return this.primitiveType.equals(pt); - } - - public boolean maps(String primitiveTypeName) { - return this.primitiveType.getName().equals(primitiveTypeName); - } - - public boolean maps(int primitiveTypeCode) { - return this.primitiveType.getValue() == primitiveTypeCode; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - this.appendTo(sb); - return sb.toString(); - } - - public void appendTo(StringBuffer sb) { - sb.append(this.primitiveType.getName()); - sb.append(" => "); - this.jdbcType.appendTo(sb); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java deleted file mode 100644 index 11e9808ec6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.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.utility.internal.StringTools; - -/** - * DataTools Wrapper base class. - */ -public abstract class DTPWrapper { - - DTPWrapper() { - super(); - } - - // ********** behavior ********** - - protected abstract void dispose(); - - protected abstract boolean connectionIsOnline(); - - protected void addCatalogObjectListener( ICatalogObject catalogObject, ICatalogObjectListener catalogObjectListener) { - if( this.connectionIsOnline()) { - RefreshManager.getInstance().AddListener( catalogObject, catalogObjectListener); - } - } - - protected void removeCatalogObjectListener( ICatalogObject catalogObject, ICatalogObjectListener catalogObjectListener) { - if( this.connectionIsOnline()) { - RefreshManager.getInstance().removeListener( catalogObject, catalogObjectListener); - } - } - - // ********** queries ********** - - public abstract String getName(); - - @Override - public String toString() { - return StringTools.buildToStringFor( this, this.getName()); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java deleted file mode 100644 index ab7f5656e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java +++ /dev/null @@ -1,229 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Database wrapper base class. - */ -public abstract class Database extends DTPWrapper implements Comparable { - - private boolean caseSensitive = false; // TODO allow user to configure - - // ********** constructors ********** - - static Database createDatabase( ConnectionProfile profile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) { - return ( dtpDatabase == null) ? NullDatabase.instance() : new DTPDatabaseWrapper( profile, dtpDatabase); - } - - Database() { - super(); - } - - // ********** behavior ********** - - abstract void catalogChanged( Catalog catalog, int eventType); - - abstract void schemaChanged( Schema schema, int eventType); - - abstract void tableChanged( Table table, Schema schema, int eventType); - - abstract void refresh(); - - protected Schema wrap( org.eclipse.datatools.modelbase.sql.schema.Schema schema) { - return new Schema( this, schema); - } - - protected Catalog wrap( org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) { - return new Catalog( this, catalog); - } - - // ********** queries ********** - - public abstract String getVendor(); - - public abstract String getVersion(); - - /** - * return the column for the specified dtp column - */ - Column column( org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) { - return this.table( dtpColumn.getTable()).column( dtpColumn); - } - - /** - * return the table for the specified dtp table - */ - Table table( org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) { - return this.schema( dtpTable.getSchema()).table( dtpTable); - } - - // ********** Comparable implementation ********** - - public int compareTo( Database database) { - return Collator.getInstance().compare( this.getName(), database.getName()); - } - - // ***** caseSensitive - - public boolean isCaseSensitive() { - return this.caseSensitive; - } - - public void setCaseSensitive( boolean caseSensitive) { - this.caseSensitive = caseSensitive; - } - - // ***** catalogs - - abstract Set getCatalogs(); - - /** - * Returns true if this database accepts catalogs. - */ - public abstract boolean supportsCatalogs(); - - /** - * Returns the catalog to use by default. - */ - public abstract String getDefaultCatalogName(); - - public Iterator catalogs() { - return this.getCatalogs().iterator(); - } - - public int catalogSize() { - return this.getCatalogs().size(); - } - - public Iterator catalogNames() { - return new TransformationIterator( this.catalogs()) { - @Override - protected String transform( Catalog catalog) { - return catalog.getName(); - } - }; - } - - public boolean containsCatalogNamed( String name) { - return this.catalogNamed( name) != null; - } - - public Catalog catalogNamed( String name) { - return this.isCaseSensitive() ? this.catalogNamedInternal( name) : this.catalogNamedIgnoreCase( name); - } - - private Catalog catalogNamedInternal( String name) { - for ( Iterator stream = this.catalogs(); stream.hasNext(); ) { - Catalog catalog = stream.next(); - if ( catalog.getName().equals( name)) { - return catalog; - } - } - return null; - } - - private Catalog catalogNamedIgnoreCase( String name) { - for ( Iterator stream = this.catalogs(); stream.hasNext(); ) { - Catalog catalog = stream.next(); - if ( StringTools.stringsAreEqualIgnoreCase( catalog.getName(), name)) { - return catalog; - } - } - return null; - } - - /** - * return the catalog for the specified dtp catalog - */ - Catalog catalog( org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) { - for ( Iterator stream = this.catalogs(); stream.hasNext(); ) { - Catalog catalog = stream.next(); - if (catalog.wraps( dtpCatalog)) { - return catalog; - } - } - throw new IllegalArgumentException( "invalid dtp catalog: " + dtpCatalog); - } - - - // ***** schemata - - abstract Set getSchemata(); - - public Iterator schemata() { - return this.getSchemata().iterator(); - } - - public int schemataSize() { - return this.getSchemata().size(); - } - - public boolean schemataContains( Column column) { - return this.getSchemata().contains( column); - } - - public Iterator schemaNames() { - return new TransformationIterator( this.schemata()) { - @Override - protected String transform( Schema schema) { - return schema.getName(); - } - }; - } - - public boolean containsSchemaNamed( String name) { - return this.schemaNamed( name) != null; - } - - public Schema schemaNamed( String name) { - return this.isCaseSensitive() ? this.schemaNamedInternal( name) : this.schemaNamedIgnoreCase( name); - } - - private Schema schemaNamedInternal( String name) { - for ( Iterator stream = this.schemata(); stream.hasNext(); ) { - Schema schema = stream.next(); - if ( schema.getName().equals( name)) { - return schema; - } - } - return null; - } - - private Schema schemaNamedIgnoreCase( String name) { - for ( Iterator stream = this.schemata(); stream.hasNext(); ) { - Schema schema = stream.next(); - if ( StringTools.stringsAreEqualIgnoreCase( schema.getName(), name)) { - return schema; - } - } - return null; - } - - /** - * return the schema for the specified dtp schema - */ - Schema schema( org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) { - for ( Iterator stream = this.schemata(); stream.hasNext(); ) { - Schema schema = stream.next(); - if ( schema.wraps( dtpSchema)) { - return schema; - } - } - throw new IllegalArgumentException( "invalid dtp schema: " + dtpSchema); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java deleted file mode 100644 index 6fc0501d6a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java +++ /dev/null @@ -1,337 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Wrap a DTP ForeignKey - */ -public final class ForeignKey extends DTPWrapper implements Comparable { - private final Table baseTable; - private final org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey; - private ICatalogObjectListener foreignKeyListener; - - private Table referencedTable; // lazy-initialized - private Set columnPairs; // lazy-initialized - private String defaultEntityFieldName; // lazy-initialized - private boolean defaultEntityFieldNameCalculated = false; - - - // ********** constructors ********** - - ForeignKey(Table baseTable, org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey) { - super(); - this.baseTable = baseTable; - this.dtpForeignKey = dtpForeignKey; - this.initialize(); - } - - // ********** behavior ********** - - private void initialize() { - if( this.connectionIsOnline()) { - this.foreignKeyListener = this.buildForeignKeyListener(); - this.addCatalogObjectListener(( ICatalogObject) this.dtpForeignKey, this.foreignKeyListener); - } - } - - @Override - protected boolean connectionIsOnline() { - return this.baseTable.connectionIsOnline(); - } - - private ICatalogObjectListener buildForeignKeyListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject foreignKey, final int eventType) { -// TODO -// if( foreignKey == ForeignKey.this.dtpForeignKey) { -// ForeignKey.this.baseTable.foreignKeyChanged( ForeignKey.this, eventType); -// } - } - }; - } - - @Override - protected void dispose() { - - this.removeCatalogObjectListener(( ICatalogObject) this.dtpForeignKey, this.foreignKeyListener); - } - - // ********** queries ********** - - public Table getBaseTable() { - return this.baseTable; - } - - @Override - public String getName() { - return this.dtpForeignKey.getName(); - } - - boolean isCaseSensitive() { - return this.baseTable.isCaseSensitive(); - } - - boolean wraps(org.eclipse.datatools.modelbase.sql.constraints.ForeignKey foreignKey) { - return this.dtpForeignKey == foreignKey; - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.getName() + ": " + this.getColumnPairs()); - } - - public Table getReferencedTable() { - if (this.referencedTable == null) { - this.referencedTable = this.baseTable.table(this.dtpForeignKey.getUniqueConstraint().getBaseTable()); - } - return this.referencedTable; - } - - /** - * return the foreign key's "base" columns - */ - public Iterator baseColumns() { - return new TransformationIterator(this.columnPairs()) { - @Override - protected Column transform(ColumnPair pair) { - return pair.getBaseColumn(); - } - }; - } - - /** - * return the foreign key's "base" columns that are not part of - * the base table's primary key - */ - public Iterator nonPrimaryKeyBaseColumns() { - return new FilteringIterator(this.baseColumns()) { - @Override - protected boolean accept(Object o) { - return ! ForeignKey.this.getBaseTable().primaryKeyColumnsContains((Column) o); - } - }; - } - - /** - * return the foreign key's "referenced" columns - */ - public Iterator referencedColumns() { - return new TransformationIterator(this.columnPairs()) { - @Override - protected Column transform(ColumnPair columnPair) { - return columnPair.getReferencedColumn(); - } - }; - } - - public String javaFieldName() { - String fieldName = this.getDefaultEntityFieldName(); - return (fieldName == null) ? - this.nonDefaultEntityFieldName() - : - fieldName; - } - - public boolean matchesJavaFieldName(String javaFieldName) { - return this.isCaseSensitive() ? - javaFieldName.equals(this.getDefaultEntityFieldName()) - : - javaFieldName.equalsIgnoreCase(this.getDefaultEntityFieldName()); - } - - public boolean isDefaultFor(String javaFieldName) { - if (this.columnPairsSize() != 1) { - return false; - } - - if (this.getReferencedTable().primaryKeyColumnsSize() != 1) { - return false; - } - - ColumnPair columnPair = this.columnPairs().next(); - Column pkColumn = this.getReferencedTable().primaryKeyColumns().next(); - if (columnPair.getReferencedColumn() != pkColumn) { - return false; - } - - return columnPair.getBaseColumn().matchesJavaFieldName(javaFieldName + "_" + pkColumn.getName()); - } - - - // ***** column pairs - - private synchronized Set getColumnPairs() { - if (this.columnPairs == null) { - this.columnPairs = this.buildColumnPairs(); - } - return this.columnPairs; - } - - @SuppressWarnings("unchecked") - private List dtpBaseColumns() { - return this.dtpForeignKey.getMembers(); - } - - @SuppressWarnings("unchecked") - private List dtpRefColumns() { - return this.dtpForeignKey.getUniqueConstraint().getMembers(); - } - - private Set buildColumnPairs() { - List baseColumns = this.dtpBaseColumns(); - int size = baseColumns.size(); - List refColumns = this.dtpRefColumns(); - if (refColumns.size() != size) { - throw new IllegalStateException("mismatched sizes: " + size + " vs. " + refColumns.size()); - } - Set result = new HashSet(baseColumns.size()); - for (int i = baseColumns.size(); i-- > 0; ) { - Column baseColumn = this.baseTable.column(baseColumns.get(i)); - Column refColumn = this.baseTable.column(refColumns.get(i)); - result.add(new ColumnPair(baseColumn, refColumn)); - } - return result; - } - - public Iterator columnPairs() { - return this.getColumnPairs().iterator(); - } - - public int columnPairsSize() { - return this.getColumnPairs().size(); - } - - - // ***** default entity field name - - /** - * If the name of the "base" column adheres to the EJB standard for a - * default mapping (i.e. it ends with an underscore followed by the name - * of the "referenced" column, and the "referenced" column is the single - * primary key column of the "referenced" table), return the corresponding - * default entity field name: - * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE" - * Return a null if it does not adhere to the EJB standard: - * ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null - */ - private String getDefaultEntityFieldName() { - if ( ! this.defaultEntityFieldNameCalculated) { - this.defaultEntityFieldNameCalculated = true; - this.defaultEntityFieldName = this.buildDefaultEntityFieldName(); - } - return this.defaultEntityFieldName; - } - - /** - * @see #getDefaultEntityFieldName() - */ - private String buildDefaultEntityFieldName() { - if ( ! this.referencesSingleColumnPrimaryKey()) { - return null; - } - ColumnPair columnPair = this.columnPairs().next(); - 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; - } - String name = baseColName.substring(0, _index); - return this.isCaseSensitive() ? name : name.toLowerCase(); - } - - /** - * Return whether the foreign key references the primary key of the - * "referenced" table and that primary key has only a single column. - */ - public boolean referencesSingleColumnPrimaryKey() { - if (this.columnPairsSize() != 1) { - return false; - } - if (this.getReferencedTable().primaryKeyColumnsSize() != 1) { - return false; - } - - ColumnPair columnPair = this.columnPairs().next(); - return columnPair.getReferencedColumn() == this.getReferencedTable().primaryKeyColumns().next(); - } - - /** - * If this is a simple (single-column) foreign key, return the java field - * name of the single base column. If this is a compound foreign key, - * return the java field 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? - // TODO if the FK column name ends with the PK column name, strip the PK column name? - private String nonDefaultEntityFieldName() { - return (this.columnPairsSize() == 1) ? - this.columnPairs().next().getBaseColumn().javaFieldName() - : - this.getReferencedTable().javaFieldName(); - } - - - // ********** Comparable implementation ********** - - public int compareTo(ForeignKey foreignKey) { - return Collator.getInstance().compare(this.getName(), foreignKey.getName()); - } - - - // ********** member class ********** - - public static class ColumnPair implements Comparable { - private final Column baseColumn; - private final Column referencedColumn; - - ColumnPair(Column baseColumn, Column referencedColumn) { - super(); - this.baseColumn = baseColumn; - this.referencedColumn = referencedColumn; - } - - public Column getBaseColumn() { - return this.baseColumn; - } - - public Column getReferencedColumn() { - return this.referencedColumn; - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, baseColumn.getName() + "=>" + this.referencedColumn.getName()); - } - - public int compareTo(ColumnPair cp) { - return Collator.getInstance().compare(this.getBaseColumn().getName(), cp.getBaseColumn().getName()); - } - - } - -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java deleted file mode 100644 index 0d9f21777f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class JptDbPlugin extends Plugin { - private ConnectionProfileRepository connectionProfileRepository; - - // The shared instance - private static JptDbPlugin plugin; - - /** - * Returns the shared instance - */ - public static JptDbPlugin getDefault() { - return plugin; - } - - /** - * The constructor - */ - public JptDbPlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - this.connectionProfileRepository = ConnectionProfileRepository.instance(); - this.connectionProfileRepository.initializeListeners(); - } - - /** - * This method is called when the plug-in is stopped - */ - @Override - public void stop(BundleContext context) throws Exception { - this.connectionProfileRepository.disposeListeners(); - this.connectionProfileRepository = null; - plugin = null; - super.stop(context); - } - - - public ConnectionProfileRepository getConnectionProfileRepository() { - return this.connectionProfileRepository; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java deleted file mode 100644 index f09563360a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import org.eclipse.jpt.utility.internal.ClassTools; - -/** - * NullConnection - */ -public final class NullConnection extends Connection { - - private static NullConnection INSTANCE; - - /** - * singleton support - */ - static synchronized Connection instance() { - if( INSTANCE == null) { - INSTANCE = new NullConnection(); - } - return INSTANCE; - } - - private NullConnection() { - super(); - } - - // ********** behavior ********** - - @Override - protected void dispose() { - // do nothing - } - - @Override - public String getName() { - return ClassTools.shortClassNameForObject( this); - } - - @Override - void databaseChanged( Database database, int eventType) { - // do nothing - } - - @Override - void schemaChanged( Schema schema, Database database, int eventType) { - // do nothing - } - - @Override - void tableChanged( Table table, Schema schema, Database database, int eventType) { - // do nothing - } - - @Override - public boolean isConnected() { - return false; - } - - @Override - public String getFactoryId() { - return ""; - } - - @Override - public void addConnectionListener( ConnectionListener listener) { - // do nothing - } - - @Override - public void removeConnectionListener( ConnectionListener listener) { - // do nothing - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java deleted file mode 100644 index 09cd5e034b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import org.eclipse.datatools.connectivity.drivers.DriverManager; -import org.eclipse.jpt.utility.internal.ClassTools; - -/** - * NullConnectionProfile - */ -public final class NullConnectionProfile extends ConnectionProfile { - - private static NullConnectionProfile INSTANCE; - - /** - * singleton support - */ - static synchronized ConnectionProfile instance() { - if( INSTANCE == null) { - INSTANCE = new NullConnectionProfile(); - } - return INSTANCE; - } - - private NullConnectionProfile() { - super( null); - } - - // ********** behavior ********** - - @Override - protected Connection buildConnection() { - return NullConnection.instance(); - } - - @Override - protected Database buildDatabase() { - return NullDatabase.instance(); - } - - @Override - public void connect() { - // do nothing - } - - @Override - public void disconnect() { - // do nothing - } - - @Override - void databaseChanged( Database database, int eventType) { - // do nothing - } - - @Override - void catalogChanged( Catalog catalog, Database database, int eventType) { - // do nothing - } - - @Override - void schemaChanged( Schema schema, Database database, int eventType) { - // do nothing - } - - @Override - void tableChanged( Table table, Schema schema, Database database, int eventType) { - // do nothing - } - - // ********** queries ********** - - @Override - public Connection getConnection() { - return NullConnection.instance(); - } - - @Override - public Database getDatabase() { - return NullDatabase.instance(); - } - - @Override - public String getName() { - return ClassTools.shortClassNameForObject( this); - } - - @Override - public String getDatabaseName() { - return ""; - } - - @Override - public String getDatabaseProduct() { - return ""; - } - - @Override - public String getDatabaseVendor() { - return ""; - } - - @Override - public String getDatabaseVersion() { - return ""; - } - - @Override - public String getUserName() { - return ""; - } - - @Override - public String getUserPassword() { - return ""; - } - - @Override - public String getDriverClass() { - return ""; - } - - @Override - public String getUrl() { - return ""; - } - - @Override - public String getInstanceId() { - return ""; - } - - @Override - public String getProviderId() { - return ""; - } - - @Override - public String getDriverDefinitionId() { - return ""; - } - - @Override - public String getDriverJarList() { - return ""; - } - - @Override - public boolean isConnected() { - return false; - } - - @Override - boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) { - return false; - } - - // ********** listeners ********** - - @Override - public void addProfileListener( ProfileListener listener) { - // do nothing - } - - @Override - public void removeProfileListener( ProfileListener listener) { - // do nothing - } - - @Override - public void addConnectionListener( ConnectionListener listener) { - // do nothing - } - - @Override - public void removeConnectionListener( ConnectionListener listener) { - // do nothing - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java deleted file mode 100644 index fa316b82ef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.util.Collections; -import java.util.Set; -import org.eclipse.jpt.utility.internal.ClassTools; - -/** - * NullDatabase - */ -public final class NullDatabase extends Database { - - private static NullDatabase INSTANCE; - - /** - * singleton support - */ - static synchronized Database instance() { - if( INSTANCE == null) { - INSTANCE = new NullDatabase(); - } - return INSTANCE; - } - - private NullDatabase() { - super(); - } - - // ********** behavior ********** - - @Override - void catalogChanged( Catalog catalog, int eventType) { - // do nothing - } - - @Override - void schemaChanged( Schema schema, int eventType) { - // do nothing - } - - @Override - void tableChanged( Table table, Schema schema,int eventType) { - // do nothing - } - - @Override - void refresh() { - // do nothing - } - - @Override - protected void dispose() { - // do nothing - } - - @Override - protected boolean connectionIsOnline() { - return false; - } - - // ********** queries ********** - - @Override - public String getName() { - return ClassTools.shortClassNameForObject( this); - } - - @Override - public String getVendor() { - return this.getName(); - } - - @Override - public String getVersion() { - return ""; - } - - // ***** catalogs - - @Override - public boolean supportsCatalogs() { - return false; - } - - @Override - public String getDefaultCatalogName() { - return ""; - } - - @Override - Set getCatalogs() { - return Collections.emptySet(); - } - - // ***** schemata - - @Override - Set getSchemata() { - return Collections.emptySet(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java deleted file mode 100644 index 677b38c031..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -/** - * ProfileListener integrate th DTP IProfileListener listener. - * This class purpose is to decouple from the DTP listeners by accepting wrappers as parameter. - * - * @see org.eclipse.datatools.connectivity.IProfileListener - */ -public interface ProfileListener { - /** - * The specified profile has been added. - */ - public void profileAdded( ConnectionProfile profile); - - /** - * The specified profile has been deleted. - */ - public void profileDeleted( String profileName); - - /** - * The specified profile has been modified. Modification includes - * changes to any properties, the name, auto-connect flag, etc. - */ - public void profileChanged( ConnectionProfile profile); - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java deleted file mode 100644 index 9ef2c7fb04..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java +++ /dev/null @@ -1,299 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Wrap a DTP Schema - */ -public final class Schema extends DTPWrapper implements Comparable { - final Database database; - final org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema; - private ICatalogObjectListener schemaListener; - - private Set tables; // lazy-initialized - private Set sequences; // lazy-initialized - - - // ********** constructors ********** - - Schema( Database database, org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) { - super(); - this.database = database; - this.dtpSchema = dtpSchema; - this.initialize(); - } - - // ********** behavior ********** - - private void initialize() { - if( this.connectionIsOnline()) { - this.schemaListener = this.buildSchemaListener(); - this.addCatalogObjectListener(( ICatalogObject) this.dtpSchema, this.schemaListener); - } - } - - @Override - protected boolean connectionIsOnline() { - return this.database.connectionIsOnline(); - } - - private ICatalogObjectListener buildSchemaListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject schema, final int eventType) { - if( schema == Schema.this.dtpSchema) { - Schema.this.refresh(); - Schema.this.database.schemaChanged( Schema.this, eventType); - } - } - }; - } - - void refresh() { - this.disposeTables(); - this.disposeSequences(); - - this.tables = null; - this.sequences = null; - } - - void tableChanged( Table table, int eventType) { - this.database.tableChanged( table, this, eventType); - } - - protected Table wrap( org.eclipse.datatools.modelbase.sql.tables.Table table) { - return new Table( this, table); - } - - protected Sequence wrap( org.eclipse.datatools.modelbase.sql.schema.Sequence sequence) { - return new Sequence( this, sequence); - } - - @Override - protected void dispose() { - this.removeCatalogObjectListener(( ICatalogObject) this.dtpSchema, this.schemaListener); - - this.disposeTables(); - this.disposeSequences(); - } - - private void disposeTables() { - if( this.tables != null) { - for( Iterator
    stream = this.tables(); stream.hasNext(); ) { - stream.next().dispose(); - } - } - } - - private void disposeSequences() { - if( this.sequences != null) { - for( Iterator stream = this.sequences(); stream.hasNext(); ) { - stream.next().dispose(); - } - } - } - - // ********** queries ********** - - @Override - public String getName() { - return this.dtpSchema.getName(); - } - - boolean isCaseSensitive() { - return this.database.isCaseSensitive(); - } - - Column column( org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) { - return this.database.column(dtpColumn); - } - - - // ********** tables ********** - - private synchronized Collection
    getTables() { - if( this.tables == null) { - this.tables = this.buildTables(); - } - return this.tables; - } - - @SuppressWarnings("unchecked") - private Collection dtpTables() { - return this.dtpSchema.getTables(); - } - - private Set
    buildTables() { - Collection dtpTables = this.dtpTables(); - Set
    result = new HashSet
    ( dtpTables.size()); - for (org.eclipse.datatools.modelbase.sql.tables.Table dtpTable : dtpTables) { - result.add( this.wrap(dtpTable)); - } - return result; - } - - public Iterator
    tables() { - return this.getTables().iterator(); - } - - public int tablesSize() { - return this.getTables().size(); - } - - public boolean tablesContains( Column column) { - return this.getTables().contains( column); - } - - public Iterator tableNames() { - return new TransformationIterator( this.tables()) { - @Override - protected String transform( Table table) { - return table.getName(); - } - }; - } - - public boolean containsTableNamed( String name) { - return this.tableNamed( name) != null; - } - - public Table tableNamed( String name) { - return this.isCaseSensitive() ? this.tableNamedInternal( name) : this.tableNamedIgnoreCase( name); - } - - private Table tableNamedInternal( String name) { - for( Iterator
    stream = this.tables(); stream.hasNext(); ) { - Table table = stream.next(); - if( table.getName().equals( name)) { - return table; - } - } - return null; - } - - private Table tableNamedIgnoreCase( String name) { - for( Iterator
    stream = this.tables(); stream.hasNext(); ) { - Table table = stream.next(); - if( StringTools.stringsAreEqualIgnoreCase( table.getName(), name)) { - return table; - } - } - return null; - } - - /** - * return the table for the specified dtp table - */ - Table table( org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) { - if( dtpTable.getSchema() != this.dtpSchema) { - return this.database.table( dtpTable); - } - for( Iterator
    stream = this.tables(); stream.hasNext(); ) { - Table table = stream.next(); - if( table.wraps( dtpTable)) { - return table; - } - } - throw new IllegalArgumentException( "invalid DTP table: " + dtpTable); - } - - // ***** sequences - - private synchronized Collection getSequences() { - if( this.sequences == null) { - this.sequences = this.buildSequences(); - } - return this.sequences; - } - - @SuppressWarnings("unchecked") - private Collection dtpSequences() { - return this.dtpSchema.getSequences(); - } - - private Set buildSequences() { - Collection dtpSequences = this.dtpSequences(); - Set result = new HashSet( dtpSequences.size()); - for (org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence : dtpSequences) { - result.add( this.wrap(dtpSequence)); - } - return result; - } - - public Iterator sequences() { - return this.getSequences().iterator(); - } - - public int sequencesSize() { - return this.getSequences().size(); - } - - public boolean sequencesContains( Column column) { - return this.getSequences().contains( column); - } - - public Iterator sequenceNames() { - return new TransformationIterator(this.sequences()) { - @Override - protected String transform( Sequence sequence) { - return sequence.getName(); - } - }; - } - - public boolean containsSequenceNamed( String name) { - return this.sequenceNamed( name) != null; - } - - public Sequence sequenceNamed( String name) { - return this.isCaseSensitive() ? this.sequenceNamedInternal( name) : this.sequenceNamedIgnoreCase( name); - } - - private Sequence sequenceNamedInternal( String name) { - for( Iterator stream = this.sequences(); stream.hasNext(); ) { - Sequence sequence = stream.next(); - if( sequence.getName().equals( name)) { - return sequence; - } - } - return null; - } - - private Sequence sequenceNamedIgnoreCase( String name) { - for( Iterator stream = this.sequences(); stream.hasNext(); ) { - Sequence sequence = stream.next(); - if( sequence.getName().equalsIgnoreCase( name)) { - return sequence; - } - } - return null; - } - - boolean wraps( org.eclipse.datatools.modelbase.sql.schema.Schema schema) { - return this.dtpSchema == schema; - } - - // ********** Comparable implementation ********** - - public int compareTo( Schema schema) { - return Collator.getInstance().compare( this.getName(), schema.getName()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java deleted file mode 100644 index 7cb68a47e5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; - -/** - * Wrap a DTP Sequence - */ -public final class Sequence extends DTPWrapper implements Comparable { - private final Schema schema; - private final org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence; - private ICatalogObjectListener sequenceListener; - - Sequence( Schema schema, org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence) { - super(); - this.schema = schema; - this.dtpSequence = dtpSequence; - this.initialize(); - } - - // ********** behavior ********** - - private void initialize() { - if( this.connectionIsOnline()) { - this.sequenceListener = this.buildSequenceListener(); - this.addCatalogObjectListener(( ICatalogObject) this.dtpSequence, this.sequenceListener); - } - } - - @Override - protected boolean connectionIsOnline() { - return this.schema.connectionIsOnline(); - } - - private ICatalogObjectListener buildSequenceListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject sequence, final int eventType) { -// TODO -// if( sequence == Sequence.this.dtpSequence) { -// Sequence.this.schema.sequenceChanged( Sequence.this, eventType); -// } - } - }; - } - - - // ********** queries ********** - - @Override - protected void dispose() { - - this.removeCatalogObjectListener(( ICatalogObject) this.dtpSequence, this.sequenceListener); - } - - @Override - public String getName() { - return this.dtpSequence.getName(); - } - - public int compareTo( Sequence sequence) { - return Collator.getInstance().compare( this.getName(), sequence.getName()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java deleted file mode 100644 index 7b49b72f8c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java +++ /dev/null @@ -1,359 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.internal; - -import java.text.Collator; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject; -import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener; -import org.eclipse.datatools.modelbase.sql.constraints.PrimaryKey; -import org.eclipse.datatools.modelbase.sql.tables.BaseTable; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.NameTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Wrap a DTP Table - */ -public final class Table extends DTPWrapper implements Comparable
    { - final Schema schema; - final org.eclipse.datatools.modelbase.sql.tables.Table dtpTable; - private ICatalogObjectListener tableListener; - - private Set columns; // lazy-initialized - private Set primaryKeyColumns; // lazy-initialized - private Set foreignKeys; // lazy-initialized - private Set foreignKeyColumns; // lazy-initialized - - // ********** constructors ********** - - Table(Schema schema, org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) { - super(); - this.schema = schema; - this.dtpTable = dtpTable; - this.initialize(); - } - - - // ********** behavior ********** - - private void initialize() { - if( this.connectionIsOnline()) { - this.tableListener = this.buildTableListener(); - this.addCatalogObjectListener(( ICatalogObject) this.dtpTable, this.tableListener); - } - } - - @Override - protected boolean connectionIsOnline() { - return this.schema.connectionIsOnline(); - } - - private ICatalogObjectListener buildTableListener() { - return new ICatalogObjectListener() { - public void notifyChanged( final ICatalogObject table, final int eventType) { - if( table == Table.this.dtpTable) { - Table.this.refresh(); - Table.this.schema.tableChanged( Table.this, eventType); - } - } - }; - } - - void refresh() { - this.disposeColumns(); - - this.columns = null; - this.primaryKeyColumns = null; - this.foreignKeys = null; - this.foreignKeyColumns = null; - } - - @Override - protected void dispose() { - this.removeCatalogObjectListener(( ICatalogObject) this.dtpTable, this.tableListener); - - this.disposeColumns(); - this.disposeForeignKey(); - } - - private void disposeColumns() { - if( this.columns != null) { - for( Iterator stream = this.columns(); stream.hasNext(); ) { - stream.next().dispose(); - } - } - } - - private void disposeForeignKey() { - if( this.foreignKeys != null) { - for( Iterator stream = this.foreignKeys(); stream.hasNext(); ) { - stream.next().dispose(); - } - } - } - - // ********** queries ********** - - @Override - public String getName() { - return this.dtpTable.getName(); - } - - boolean isCaseSensitive() { - return this.schema.isCaseSensitive(); - } - - public String shortJavaClassName() { - String jName = this.getName(); - if ( ! this.isCaseSensitive()) { - jName = StringTools.capitalize(jName.toLowerCase()); - } - return NameTools.convertToJavaIdentifier(jName); - } - - public boolean matchesShortJavaClassName(String shortJavaClassName) { - return this.isCaseSensitive() ? - this.getName().equals(shortJavaClassName) - : - this.getName().equalsIgnoreCase(shortJavaClassName); - } - - public String javaFieldName() { - String jName = this.getName(); - if ( ! this.isCaseSensitive()) { - jName = jName.toLowerCase(); - } - return NameTools.convertToJavaIdentifier(jName); - } - - boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Table table) { - return this.dtpTable == table; - } - - /** - * return the table for the specified DTP table - */ - Table table(org.eclipse.datatools.modelbase.sql.tables.Table table) { - return this.schema.table(table); - } - - // ***** columns - - private synchronized Set getColumns() { - if (this.columns == null) { - this.columns = this.buildColumns(); - } - return this.columns; - } - - @SuppressWarnings("unchecked") - private Collection dtpColumns() { - return this.dtpTable.getColumns(); - } - - private Set buildColumns() { - Collection dtpColumns = this.dtpColumns(); - Set result = new HashSet(dtpColumns.size()); - for (org.eclipse.datatools.modelbase.sql.tables.Column c : dtpColumns) { - result.add(new Column(this, c)); - } - return result; - } - - public Iterator columns() { - return this.getColumns().iterator(); - } - - public int columnsSize() { - return this.getColumns().size(); - } - - public boolean columnsContains(Column column) { - return this.getColumns().contains(column); - } - - public Iterator columnNames() { - return new TransformationIterator(this.columns()) { - @Override - protected String transform(Column next) { - return next.getName(); - } - }; - } - - public boolean containsColumnNamed(String name) { - return this.columnNamed(name) != null; - } - - public Column columnNamed(String name) { - return this.isCaseSensitive() ? this.columnNamedInternal(name) : this.columnNamedIgnoreCase(name); - } - - private Column columnNamedInternal(String name) { - for (Iterator stream = this.columns(); stream.hasNext(); ) { - Column column = stream.next(); - if (column.getName().equals(name)) { - return column; - } - } - return null; - } - - private Column columnNamedIgnoreCase(String name) { - for (Iterator stream = this.columns(); stream.hasNext(); ) { - Column column = stream.next(); - if (StringTools.stringsAreEqualIgnoreCase(column.getName(), name)) { - return column; - } - } - return null; - } - - /** - * return the column for the specified dtp column - */ - Column column(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) { - if (dtpColumn.getTable() != this.dtpTable) { - return this.schema.column(dtpColumn); - } - for (Iterator stream = this.columns(); stream.hasNext(); ) { - Column column = stream.next(); - if (column.wraps(dtpColumn)) { - return column; - } - } - throw new IllegalArgumentException("invalid dtp column: " + dtpColumn); - } - - - // ***** primaryKeyColumns - - private synchronized Set getPrimaryKeyColumns() { - if (this.primaryKeyColumns == null) { - this.primaryKeyColumns = this.buildPrimaryKeyColumns(); - } - return this.primaryKeyColumns; - } - - @SuppressWarnings("unchecked") - private Collection columns(PrimaryKey pk) { - return pk.getMembers(); - } - - private Set buildPrimaryKeyColumns() { - if ( ! (this.dtpTable instanceof BaseTable)) { - return Collections.emptySet(); - } - PrimaryKey pk = ((BaseTable) this.dtpTable).getPrimaryKey(); - if (pk == null) { - // no PK was defined - return Collections.emptySet(); - } - Collection pkColumns = this.columns(pk); - Set result = new HashSet(pkColumns.size()); - for (org.eclipse.datatools.modelbase.sql.tables.Column pkColumn : pkColumns) { - result.add(this.column(pkColumn)); - } - return result; - } - - public Iterator primaryKeyColumns() { - return this.getPrimaryKeyColumns().iterator(); - } - - public int primaryKeyColumnsSize() { - return this.getPrimaryKeyColumns().size(); - } - - public boolean primaryKeyColumnsContains(Column column) { - return this.getPrimaryKeyColumns().contains(column); - } - - - // ***** foreignKeys - - private synchronized Set getForeignKeys() { - if (this.foreignKeys == null) { - this.foreignKeys = this.buildForeignKeys(); - } - return this.foreignKeys; - } - - @SuppressWarnings("unchecked") - private Collection dtpForeignKeys() { - return ((BaseTable) this.dtpTable).getForeignKeys(); - } - - private Set buildForeignKeys() { - if ( ! (this.dtpTable instanceof BaseTable)) { - return Collections.emptySet(); - } - Collection dtpForeignKeys = this.dtpForeignKeys(); - Set result = new HashSet(dtpForeignKeys.size()); - for (org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey : dtpForeignKeys) { - result.add(new ForeignKey(this, dtpForeignKey)); - } - return result; - } - - public Iterator foreignKeys() { - return this.getForeignKeys().iterator(); - } - - public int foreignKeysSize() { - return this.getForeignKeys().size(); - } - - - // ***** foreignKeyColumns - - private synchronized Set getForeignKeyColumns() { - if (this.foreignKeyColumns == null) { - this.foreignKeyColumns = this.buildForeignKeyColumns(); - } - return this.foreignKeyColumns; - } - - private Set buildForeignKeyColumns() { - if ( ! (this.dtpTable instanceof BaseTable)) { - return Collections.emptySet(); - } - Set result = new HashSet(this.columnsSize()); - for (Iterator stream = this.foreignKeys(); stream.hasNext(); ) { - CollectionTools.addAll(result, stream.next().baseColumns()); - } - return result; - } - - public Iterator foreignKeyColumns() { - return this.getForeignKeyColumns().iterator(); - } - - public int foreignKeyColumnsSize() { - return this.getForeignKeyColumns().size(); - } - - public boolean foreignKeyColumnsContains(Column column) { - return this.getForeignKeyColumns().contains(column); - } - - // ********** Comparable implementation ********** - - public int compareTo( Table table) { - return Collator.getInstance().compare( this.getName(), table.getName()); - } -} 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 @@ - - - org.eclipse.jpt.doc.user - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - 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 a3e8ae5c6a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.doc.user;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Localization: plugin -Eclipse-LazyStart: true 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 794af750a6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/about.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -About this content - - - - - - - - - - - - - - - -
    -
    - - - -
    -

    About this content

    -
    -

    June 06, 2007

    - -

    License

    -

    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 http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

    -

    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 http://www.eclipse.org.

    - - - - - - - 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 ade565e3e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties +++ /dev/null @@ -1,102 +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,\ - getting_started005.htm,\ - getting_started006.htm,\ - getting_started007.htm,\ - getting_started008.htm,\ - getting_started009.htm,\ - getting_started010.htm,\ - getting_started011.htm,\ - getting_started012.htm,\ - getting_started013.htm,\ - getting_started014.htm,\ - getting_started015.htm,\ - getting_started016.htm,\ - getting_started017.htm,\ - getting_started018.htm,\ - getting_started019.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,\ - task_add_persistence.htm,\ - task_additonal_tables.htm,\ - task_create_new_project.htm,\ - task_generate_entities.htm,\ - task_inheritance.htm,\ - task_manage_orm.htm,\ - task_manage_persistence.htm,\ - task_mapping.htm,\ - tasks.htm,\ - tasks001.htm,\ - tasks002.htm,\ - tasks003.htm,\ - tasks004.htm,\ - tasks005.htm,\ - tasks006.htm,\ - tasks007.htm,\ - tasks008.htm,\ - tasks009.htm,\ - tasks010.htm,\ - tasks011.htm,\ - tasks012.htm,\ - tasks013.htm,\ - tasks014.htm,\ - tasks015.htm,\ - tasks016.htm,\ - tasks017.htm,\ - tasks018.htm,\ - tasks019.htm,\ - tasks020.htm,\ - tasks021.htm,\ - tips_and_tricks.htm,\ - toc.xml,\ - whats_new.htm,\ - whats_new001.htm,\ - whats_new002.htm,\ - whats_new003.htm 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 @@ - - - - - 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 "Click to Begin" button below. - -Let's get started! - - - - - 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 "Click to Perform" button. - - - - - - - Use the New Project Wizard to create a JPA project. -Select File->New->Project... and choose JPA->JPA Project 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 Next to display the next page of the wizard. - -The "New JPA Project" wizard is automatically displayed when you click the "Click to Perform" button. - - - - - - - Use the Project Facet page to select a predefined project configuration or specific specific facets to include in the project. - -Click "Next" to display the next page of the wizard. - - - - - 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 Add Connections to create one. - -If you do not have a defined JPA implementation library, click Configure default JPA implementation library or Configure user libraries to define one. - -Click Finish to complete the wizard and open the open the project. - - - - - 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. - - - 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 @@ - - - - -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 Click to Begin button below. -Let's get started! - - - - -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 File->New->Project... and choose JPA->JPA Project in the list. Complete each page of the Create JPA Project wizard to create a new JPA project. - - - - - -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 Window->Open Perspective->Other in the menubar at the top of the workbench. In the Select Perspectives dialog, select JPA Development 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. - - - - -The next step is to create a new Java class. In the main toolbar again, click on New Java Class button (or the link below). -The Java editor will automatically open showing your new class. - - - - -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 Entity. 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. - - - - -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. - - - 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 @@ - - - - - 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 "Click to Begin" button below. - -Let's get started! - - - - - 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 "Click to Skip" button. - -The Database Connection dialog automatically appears when you click the "Click to Perform" button. - - - - - - - Use the New Project Wizard to create a JPA project. -Select File->New->Project... and choose JPA->JPA Project in the list. - -Complete each page of the wizard to create a new JPA project. - -The "New JPA Project" wizard is automatically displayed when you click the "Click to Perform" button. - -If you already have a JPA project, you may skip this step by clicking the "Click to Skip" button. - - - - - - - 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 Window->Open Perspective->Other in the menubar at the top of the workbench. In the Select Perspectives dialog, select JPA Development 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. - - - - - - - The next step is to create a new Java class. In the main toolbar again, click on New Java Class button (or the link below). -The Java editor will automatically open showing your new class. - - - - - 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 Entity. 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. - - - - - 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 "Click to Skip" button. If not, use the Java editor to add fields to the entity. - - - - - - - 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. - - - - - - - Congratulations! You have successfully mapped the fields from a Java persistent entity to a column in a database table. - - - 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 c17e916319..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -Understanding OR mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Understanding OR mappings

    -
    -

    The Dali OR (object-relational) Mapping Tool allows you to describe how your entity objects map to the data source (or other objects). This approach isolates persistence information from the object model–developers are free to design their ideal object model, and DBAs are free to design their ideal schema.

    -

    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.

    -

    You can use these mappings to map simple data types including primitives (such as int), JDK classes (such as String), 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.

    -Related task
    -
    -Mapping an entity -

     

    -
    - - - - - - 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 cf984163c4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - - -Understanding Java persistence - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Understanding Java persistence

    -
    -

    Persistence 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.

    -

    Entity beans 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 application-managed persistence or container-managed persistence.

    -
    - - - - - - 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 e709730f90..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -Concepts - - - - - - - - - - - - - - - -

    - - - - -
    -

    Concepts

    -
    -

    This section contains an overview of concepts you should be familiar with when using Dali to create mappings for Java persistent entities.

    - -

    In addition to these sections, you should review the following resources for additional information:

    - - - - - - 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 c9ac9b2dae..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -Understanding EJB 3.0 Java Persistence API - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Understanding EJB 3.0 Java Persistence API

    -
    -

    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.

    -

    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.

    -Related task
    -
    -Mapping an entity -

     

    - - -
    - - 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 2d86027a37..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm +++ /dev/null @@ -1,50 +0,0 @@ - - - - - -The persistence.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    The persistence.xml file

    -
    -

    The JPA specification requires the use of a persistence.xml file for deployment. This file defines the database and entity manager options, and may contain more than one persistence unit. Dali can use the Eclipse XML Editor to create and maintain this information. See "Managing the persistence.xml file" for more information.

    -Related task
    -
    -Managing the persistence.xml file
    -Creating a new JPA project -

     

    -
    - - - - - - 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 5f4bd90908..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -The orm.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    The orm.xml file

    -
    -

    Although the JPA specification emphasizes the use of annotations to specify persistence, you can also the orm.xml file to store this metadata. Dali can use the Eclipse XML Editor to create and maintain this information. The metadata must match the XSD specification of your selected JPA implementation. See "Managing the orm.xml file" for more information.

    -Related task
    -
    -Managing the orm.xml file
    -Creating a new JPA project -

     

    -
    - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml b/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml deleted file mode 100644 index 34de0ef6d1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml +++ /dev/null @@ -1,422 +0,0 @@ - - - - - Specify how the variable is accessed: Property (default) or Field. - - - - - - The name of this entity. By default, the class name is used as the entity name. - - - - - - The database table assigned to this entity. By default, the class name is used as the database table name. - - - - - - - Specify a property or field to be overridden (from the default mappings). - - - - - - Name of the database column. - - - - - - The database column that overrides a property or field. - - - - - - Specifies if the column is always included in SQL INSERT statements. - - - - - - Specifies if the column is always included in SQL UPDATE statements. - - - - - - Specify how this attribute maps to the database. - - - - - - The database column that contains the value for the attribute. - - - - - - Name of the database table that contains the selected column. - - - - - - Specifies if the column is always included in SQL INSERT statements. - - - - - - Specifies if the column is always included in SQL UPDATE statements. - - - - - - Defines how data is loaded from the database: Eager (default) or Lazy - - - - - - Specifies if this field is can be null. - - - - - - Determines how the primary key is generated: Auto (default), Sequence, Identity, or Table. - - - - - - Unique name of the generator. - - - - - - The entity to which this attribute is mapped. - - - - - - Specify which operations are propagated throughout the entity: All, Persist, Merge, or Move. - - - - - - The field in the database table that owns the relationship. - - - - - - The name of the database column that contains the foreign key reference for the entity association. - - - - - - Name of the join table that contains the foreign key column. - - - - - - Specify to override the default mapping of an entity’s attribute. - - - - - - The database column that is being mapped to the entity’s attribute. - - - - - - Specify the type of persistent domain object for the Java class: Persistent, Embedded, or Mapped Superclass. - - - - - - Specify how an entity may inherit properties from other entities: Single table, One table per class, or Joined tables. - - - - - Use to specify the name of the discriminator column when using a Single or Joined inheritance strategy. - - - - - 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. - - - - - Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified discriminator type. - - - - - Specify the default order for objects returned from a query. - - - - - 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. - - - - - Specify two or more join columns (that is, a composite primary key). - - - - - Specify the join column on the owned (or inverse side) of the association: the owned entity's primary key column. - - - - - Use the Java Persistence options on the Properties page to select the database connection to use with the project. - - - - - - The database connection used to map the persistent entities. - - - - - The database schema used to map the persistent entities. - - - - - Use the Add Persistence dialog to define the database connection use to store the persistence entities. - - - - - 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. - - - - - Use the Generate Entities dialog to create Java persistent entities based on your database tables. - - - - - The project folder name in which to generate the Java persistent entities. Click Browse to select an existing folder. - - - - The package in which to generate the Java persistent entities, or click Browse to select an existing package. - - - - Select the tables from which to create Java persistent entities. - - - - - Use this dialog to define the database connection used to store the persistence entities and to create the persistence.xml file. - - - - - - Use this dialog to define the new JPA project name, its location, target runtime, and other configuration settings. - - - - - - - Use these fields to define the database connection used to store the persistent entities. - - - - - Use this option to add libraries or JARs that contain the Java Persistence API (JPA) and entities to the project’s Java Build Path. - - - - - 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. - - - - - Use this page to select which script options will be included in the generated script. - - - - - Use this page to select which elements will be included in the generated script. - - - - - 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. - - - - - This page shows the settings that you selected for the generated DDL. To change any option click "Back" or click "Finish" to continue. - - - - The name of the table sequence generator. This name is global to to the persistence unit (across all generator types). - - - - - The database table that stores the generated ID values. - - - - - The database column of the generator table that stores the generated ID values. - - - - - The name for the column that stores the generated ID values. - - - - - The database column of the generator table that defines the primary key value. - - - - - 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. - - - - Specify if the mapped field contains a Date (java.sql.Date), Time (java.sql.Time), or Timestamp (java.sql.Timestamp) value. - - - - - Define how the primary key is generated - - - - - - Specify to use a specific database table for generating the primary key. - - - - - - Specify to use a specific sequence for generating the primary key. - - - - - - Name of the sequence. - - - - - - - - - - - - Specify if the field is mapped to java.sql.Clob or java.sql.Blob. - - - - - - Specify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema. - - - - - - . - - - - The database catalog that contains the Table. This field overrides the defaults in the orm.xml file. - - - - - - The database schema that contains the Table. This field overrides the defaults in the orm.xml file. - - - - - - The Java package that contains the persistent entities to which the orm.xml file applies. - - - - - The database schema to use as the default for all entities managed by this persistence unit. - - - - - The database catalog to use as the default for all entities managed by this persistence unit. - - - - - The default access method for variables in this project: Property or Field. - - - - - Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit. - - - - - Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored. - - - - - Specify the vendor-specific JPA implementation.Default is Generic.. - - - - Create an initial orm.xml file. Use this file to specify project and persistence unit defaults. - - - - - - - - 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 4fa017b8b0..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: 75%} - -.footer {padding-top: 2em;} \ 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 @@ - - - - - - - -

    License Information

    - - 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 c0f78f6584..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -Getting started - - - - - - - - - - - - - - - -

    - - - - -
    -

    Getting started

    -
    -

    This section provides information on getting started with the Java Persistence Tools.

    - -

    For additional information, please visit the Dali home page at: http://www.eclipse.org/webtools/dali/main.php/.

    - - - - - 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 ffee83ab0d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -Requirements and installation - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Requirements and installation

    -
    -

    Before installing Dali, ensure that your environment meets the following minimum requirements:

    - -
    -https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html
    -
    -
    -

    Refer to http://www.eclipse.org/webtools/dali/gettingstarted_main.html for additional installation information.

    -

    Review the Dali quick start and Dali basic tutorial to build your first Dali project.

    -
    - - - - - - 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 efba0eb9f3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - - -Dali quick start - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Dali quick start

    -
    -

    This section includes information to help you quickly start using Dali to create relational mappings between Java persistent entities and database tables.

    - -

    The Dali basic tutorial contains detailed procedures for building you first Dali project.

    -Related reference
    -
    -Dali basic tutorial
    -Tips and tricks
    -What's new - -
    - - 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 c0bc5e6268..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm +++ /dev/null @@ -1,90 +0,0 @@ - - - - - -Creating a new project - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Creating a new project

    -
    -

    This quick start shows how to create a new JPA project.

    -
      -
    1. -

      Select File > New > Project. The New Project dialog appears.

      -
    2. -
    3. -

      On the New Project dialog, select JPA > JPA Project and click Next. The Create a Java Project dialog appears.

      -
      -

      New JPA Project

      -New JPA Project dialog.
      -
    4. -
    5. -

      On the Create a JPA Project dialog, enter a Project name (such as QuickStart).

      -
    6. -
    7. -

      Select your Target Runtime (such as Apache Tomcat) and click Next. The Project Facets dialog appears.

      -
    8. -
    9. -

      Verify that the Java Persistence 1.0 facet is selected and click Next. The JPA Facet dialog appears.

      -
      -

      - - - - - - -
      -

      Note:

      -You must configure your project to use Java version 5.0 (or higher). See "Requirements and installation" for more information.
      -
      -
      -
    10. -
    11. -

      On the JPA Facet dialog, select your vendor-specific JPA platform, database connection (or create a new connection), JPA implementation library (such as TopLink Essentials), define how Dali should manage persistent classes, and click Finish.

      -
      -

      JPA Facet Dialog

      -JPA Facet dialog.
      -
    12. -
    -

    Eclipse adds the project to the workbench and opens the JPA perspective.

    -
    -

    Project in Package Explorer

    -Package Explorer showing the JPA project.
    - -

    Now that you have created a project with persistence, you can continue with Creating a Java persistent entity.

    -
    - - - - - - 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 da7900a1b5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm +++ /dev/null @@ -1,111 +0,0 @@ - - - - - -Creating a Java persistent entity - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Creating a Java persistent entity

    -
    -

    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.

    -
      -
    1. -

      Right-click the project in the Package Explorer and select New > Class. The New Java Class page appears.

      -
    2. -
    3. -

      On the Java Class page, enter a package name (such as quickstart.demo.model), class name (such as Address), and click Finish.

      -
    4. -
    5. -

      Right-click the Address.java file in the Package Explorer and select Open.

      -
      -

      Open Address.java

      -Opening a Java class.
      -
    6. -
    7. -

      Select the Address entity in the JPA Structure view.

      -
      -

      Address Class in JPA Structure View

      -Address class in JPA Structure view.
      -
    8. -
    9. -

      In the JPA Details view, in the Map As field, select Entity. In the Table field, select the ADDRESS database table.

      -
      -

      Address Entity in JPA Details View

      -JPA Details view.
      -
    10. -
    -

    Eclipse creates the persistent entity and adds the @Entity annotation to the class.

    -
    -

    Address Entity

    -Java editor with the Address entity.
    - -

    Eclipse also displays the Address entity in the JPA Structure view:

    -
    -

    Address Entity

    -Address entity in the JPA Structure view.
    - -

    After creating the entity, you must associate it with a database table.

    -
      -
    1. -

      Select the Address class in the Explorer view.

      -
    2. -
    3. -

      In the Persistence Properties view, notice that Dali has automatically associated the ADDRESS database table with the entity because they are named identically.

      -
      -

      - - - - - - -
      -

      Note:

      -Depending on your database connection type, you may need to specify the Schema.
      -
      -
      -
      -

      JPA Details View for Address Entity

      -Address entity in the JPA Details view.
      -
    4. -
    -

    After associating the entity with the database table, you must update the persistence.xml file to include this JPA entity.

    -

    Right-click the persistence.xml file in the Package Explorer and select JPA Tools > Synchronize Classes. Dali adds the following to the persistence.xml file:

    -

    <class>quickstart.demo.model.Address</class>

    -

     

    -

    Now that you have created a persistent entity, you can continue with Mapping an entity to map the entity's fields to columns on the database table.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm deleted file mode 100644 index f3e564ea9f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm +++ /dev/null @@ -1,140 +0,0 @@ - - - - - -Mapping an entity - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Mapping an entity

    -
    -

    This quick start shows how to map fields in a Java persistent entity. Before beginning, add the following fields to the Address class:

    -
    -private Long id;
    -private String city;
    -private String country;
    -private String stateOrProvince;
    -private String postalCode;
    -private String street;
    -
    -
    -

    Eclipse updates the Address entity in the JPA Structure view to show its fields:

    -
    -

    Address Entity and Fields

    -Address entity and its fields in the JPA Structure view.
    - -

    You will also need to add the following columns to the ADDRESS database table:

    -
    -NUMBER(10,0) ADDRESS_ID (primary key)
    -VARCHAR2(80) PROVINCE
    -VARCHAR2(80) COUNTRY
    -VARCHAR2(20) P_CODE
    -VARCHAR2(80) STREET
    -VARCHAR2(80) CITY
    -
    -
    -
    -

    Now we are ready to map each fields in the Address class to a column in the database table.

    -
      -
    1. -

      Select the id field in the JPA Details view.

      -
    2. -
    3. -

      In the JPA Details view:

      -
        -
      • -

        For the Map As field, select Id

        -
      • -
      • -

        For the Column field, select ADDRESS_ID.

        -
      • -
      -
      -

      JPA Details View for addressId Field

      -JPA Details view for the id field.
      - -

      Eclipse adds the following annotations to the Address entity:

      -
      -@Id
      -@Column(name="ADDRESS_ID")
      -
      -
    4. -
    5. -

      Map each of the following fields (as Basic mappings) to the appropriate database column:

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      FieldMap AsDatabase Column
      cityBasicCITY
      countryBasicCOUNTRY
      postalCodeBasicP_CODE
      provinceOrStateBasicPROVINCE
      streetBasicSTREET
      -
      -
    6. -
    -

    Notice that Dali will automatically map some fields to the correct database column (such as the city field to the CITY column) if the names are identical.

    -

    Refer to the Dali basic tutorial to map a complete object model using basic and relational mappings.

    -
    - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm deleted file mode 100644 index 28dc86e8e6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -Dali basic tutorial - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Dali basic tutorial

    -
    -

    In this tutorial, you will use Dali to map the object model of a company's HR application to track its employees. Figure: Tutorial Object Model illustrates the object model for the tutorial.

    -
    -

    Tutorial Object Model

    -This figure shows the object model for the tutorial.
    - -

    Next, you will Generate the tutorial database schema.

    - - -
    - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm deleted file mode 100644 index 909ad1f3c6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm +++ /dev/null @@ -1,215 +0,0 @@ - - - - - -Generate the tutorial database schema - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Generate the tutorial database schema

    -
    -

    The tutorial application uses three database tables to store each employee's information: EMPLOYEE, ADDRESS and PHONE. Table: Tutorial Database Schema describes the columns for each table.

    -

    You can download SQL scripts to build and populate the database tables with sample data from http://www.eclipse.org/webtools/dali/docs/dbscripts.zip.

    -
    -

    Tutorial Database Schema

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TableColumnTypeDetails
    -

    EMPLOYEE

    -
    -

    EMP_ID

    -
    -

    NUMBER(15)

    -
    -

    Primary Key

    -
    -

    F_NAME

    -
    -

    VARCHAR(40)

    -

    -

    L_NAME

    -
    -

    VARCHAR(40)

    -

    -

    ADDR_ID

    -
    -

    NUMBER(15)

    -
    -

    Foreign Key, references ADDRESS.ADDRES_ID

    -
    -

    VERSION

    -
    -

    NUMBER(15)

    -

    -

    ADDRESS

    -
    -

    ADDRESS_ID

    -
    -

    NUMBER(15)

    -
    -

    Primary Key

    -
    -

    PROVINCE

    -
    -

    VARCHAR(80)

    -

    -

    COUNTRY

    -
    -

    VARCHAR(80)

    -

    -

    STREET

    -
    -

    VARCHAR(80)

    -

    -

    P_CODE

    -
    -

    VARCHAR(20)

    -

    -

    CITY

    -
    -

    VARCHAR(80)

    -

    -

    PHONE

    -
    -

    EMP_ID

    -
    -

    NUMBER(15)

    -
    -

    Foreign Key, reference to EMPLOYEE.EMP_ID

    -
    -

    AREA_CODE

    -
    -

    VARCHAR(3)

    -

    -

    P_NUMBER

    -
    -

    VARCHAR(7)

    -
    -

    Primary key

    -
    -

    TYPE

    -
    -

    VARCHAR(15)

    -

    -
    - -

    Next, you will Create a database connection.

    - - -
    - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm deleted file mode 100644 index 4e4585c8c8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - - -Create a database connection - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create a database connection

    -
    -

    After creating the database you will need to create a database connection to use with the tutorial application. An active database connection is required to complete tutorial application.

    -

    Use the New Connection wizard to create a database connection.

    -
    -

    Database Explorer

    -This figure shows the Database Explorer.
    - -

    Now you're ready to Create a JPA project.

    -
    - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm deleted file mode 100644 index c9190e570d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm +++ /dev/null @@ -1,68 +0,0 @@ - - - - - -Create a JPA project - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create a JPA project

    -
    -

    In order to begin, you must create a new Java project.

    -
      -
    1. -

      Select File > New > Project. The New Project dialog appears.

      -
    2. -
    3. -

      On the New Project dialog, select JPA > JPA Project and click OK. The New JPA Project dialog appears.

      -
    4. -
    5. -

      On the New JPA Project dialog, enter Employee as the Project name and click Next. The Project Facets page appears.

      -
    6. -
    7. -

      Verify that you have selected a Java 5.0 (or higher) and JPA 1.0 facet, and click Next. The JPA Facet page appears.

      -
    8. -
    9. -

      Select your vender-specific platform, database connection, and JPA implementation library, and click Finish.

      -
    10. -
    -

    Eclipse adds the project to the workbench and opens the Java perspective.

    -
    -

    Persistence Perspective

    -This figure shows the main parts of the JPA Development Perspective: The JPA Structure and JPA Details views.
    - -

    The next step is to Create persistent Java entities.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm deleted file mode 100644 index df685ef8ac..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm +++ /dev/null @@ -1,63 +0,0 @@ - - - - - -Create persistent Java entities - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create persistent Java entities

    -
    -

    The Tutorial Object Model contains three entities: Employee, Address, and PhoneNumber. Use this procedure to add the entities to the project.

    -
      -
    1. -

      Right-click the Employee project in the Package Explorer and select New > Class. The New Java Class dialog appears.

      -
    2. -
    3. -

      On the Java Class dialog, enter a package name (such as dali.tutorial.model), class name (such as Employee), and click Finish. Eclipse adds the Employee entity to the Package Explorer.

      -
    4. -
    5. -

      Select the Employee entity in the JPA Structure view.

      -
    6. -
    7. -

      In the JPA Details view, in the Map As field, select Entity. In the Table field, select the EMPLOYEE database table.

      -
      -

      Employee Entity in JPA Details View

      -Employee entity in JPA Details view.
      -
    8. -
    -

    Eclipse adds the @Entity annotation to the class. Repeat this procedure to add the PhoneNumber and Address entities.

    -

    Notice that the Problems view reports several errors for each entity. We'll address these shortly.

    -

    Next, you will Add fields to the entities.

    - - -
    - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm deleted file mode 100644 index 55ab05f72f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm +++ /dev/null @@ -1,85 +0,0 @@ - - - - - -Add fields to the entities - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Add fields to the entities

    -
    -

    Before mapping the entities to the database, you must add the necessary fields to each entity.

    -
      -
    1. -

      Add the following fields to the Employee entity:

      -
      -private Long id;
      -private String firstNname;
      -private String lastName;
      -private String address;
      -private List<PhoneNumber> phoneNumbers;
      -private Long version;
      -
      -
    2. -
    3. -

      Import java.util.List.

      -
    4. -
    5. -

      Generate Getters and Setters for each field.

      -
    6. -
    7. -

      Add the following fields to the Address entity:

      -
      -private Long id;
      -private String street;
      -private String city;
      -private String stateOrProvince;
      -private String country;
      -private String postalCode;
      -
      -
    8. -
    9. -

      Add the following fields to the PhoneNumber entity:

      -
      -private String type;
      -private String areaCode;
      -private String number;
      -private Employee owner;
      -
      -
    10. -
    -

    Next, you will Associate the entity with a database table.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm deleted file mode 100644 index 3b0879844d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - - -Associate the entity with a database table - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Associate the entity with a database table

    -
    -

    Now you must associate each entity with its primary database table.

    -
      -
    1. -

      Select the Employee class in the Explorer view.

      -
    2. -
    3. -

      In the JPA Details view, notice that Dali has automatically selected the EMPLOYEE table as the table name.

      -
      -

      JPA Details View for the Employee Entity

      -JPA Details view for the Employee entity.
      -
    4. -
    -

    By default, Dali attempts to associate each entity with a similarly named database table. Notice that although you have not explicitly associated the Address entity yet, there is no error in the Problems view because the entity name, Address, is identical to the table name (ADDRESS).

    -

    For the PhoneNumber entity, however, there is an error. This is because the entity name (PhoneNumber) is different than the database table (PHONE). You must explicitly associate the entity with the PHONE table. Dali adds the @Table(name="PHONE") annotation to the entity.

    -

    Now you are ready to Create OR mappings.

    -
    - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm deleted file mode 100644 index 785a659348..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -Create OR mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create OR mappings

    -
    -

    Now you're ready to map the attributes of each persistent entity to columns in the appropriate database table. For the tutorial application, you will use the following mapping types:

    -
      -
    • -

      ID mappings

      -
    • -
    • -

      Basic mappings

      -
    • -
    • -

      One-to-one mappings

      -
    • -
    • -

      Many-to-one mappings

      -
    • -
    • -

      One-to-many mappings

      -
    • -
    • -

      Version mappings

      -
    • -
    -

    Next, you will Create ID mappings.

    - - -
    - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm deleted file mode 100644 index de4447d1ed..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm +++ /dev/null @@ -1,132 +0,0 @@ - - - - - -Create ID mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create ID mappings

    -
    -

    Use an ID Mapping to specify the primary key of an entity. Each persistent entity must have an ID. Notice that the Problems view reports that each entity is missing an ID.

    -
      -
    1. -

      Select the Employee entity in the Package Explorer view.

      -
    2. -
    3. -

      Expand the Employee entity in the JPA Structure view and select the id field. The JPA Details view (for attributes) displays the properties for the field.

      -
    4. -
    5. -

      In the Map As field, select ID.

      -
      -

      ID Mapping for emp_id Field

      -JPA Details view for the emp_id field.
      -
    6. -
    7. -

      Use this table to complete the remaining fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - -
      PropertyDescription
      Map AsDefines this mapping as an ID Mapping. Dali adds the @Id annotation to the entity.
      ColumnThe database column for the primary key of the table associated with the entity. Select EMP_ID. -

      Because the database column (EMP_ID) is named differently than the entity field (id), Dali adds the @Column(name="EMP_ID") annotation.

      -
      -
      -
    8. -
    9. -

      Leave all other fields on the tab as their defaults. Expand the Primary Key Generation area.

      -
      -

      Primary Key Generation for emp_id Field

      -JPA Details view (with Primary Key options) for the emp_id field.
      -
    10. -
    11. -

      Use this table to complete the Primary Key Generation fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescription
      Generated ValueThese fields define how the primary key is generated.
        StrategyFor the tutorial project, use the Auto option.
        Generator NameLeave this field blank.
      -
      -
    12. -
    -

    In the JPA Structure view, the id field is identified as the primary key by the following icon:

    -
    -

    JPA Structure for Employee Entity

    -emp_id attribute of the Employee entity in the JPA Structure view.
    - -

    Repeat this procedure to map the following primary keys (as shown in Table: Tutorial Database Schema):

    -
      -
    • -

      The id field of the Address entity to the ADDRESS_ID column of the ADDRESS table.

      -
    • -
    • -

      The number field of the PhoneNumber entity to the P_NUMBER column of the PHONE table.

      -
    • -
    -

    Next, you will Create basic mappings.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm deleted file mode 100644 index 63e9f803f7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -Create basic mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create basic mappings

    -
    -

    Use a Basic Mapping to map an attribute directly to a database column. In the Tutorial Object Model, the firstName field of the Employee class maps directly to the F_NAME column of the EMPLOYEE database table.

    -
      -
    1. -

      Select the Employee entity in the Package Explorer view.

      -
    2. -
    3. -

      In the JPA Structure view, select the firstName field of the Employee entity. The JPA Details view (for attributes) displays the properties for the field.

      -
    4. -
    5. -

      In the Map As field, select Basic. In the Column field, select F_NAME.

      -
      -

      Basic Mapping for firstName

      -JPA Details view for the firstName field.
      -
    6. -
    -

    Dali adds the @Column(name="F_NAME") annotation to the entity. In the JPA Structure, the firstName field is identified as a basic mapping as shown in the following figure:

    -
    -

    JPA Structure for Employee Entity

    -The firstName attribute of the Employee entity in the JPA Structure view.
    - -

    Repeat this procedure to map each of the following fields as Basic mappings:

    -
      -
    • -

      Employee entity

      -
        -
      • -

        lastName field to L_NAME column

        -
      • -
      -
    • -
    • -

      Address Entity

      -
        -
      • -

        city field to CITY column

        -
      • -
      • -

        country field to COUNTRY column

        -
      • -
      • -

        postalCode field to P_CODE column

        -
      • -
      • -

        stateOrProvice field to PROVINCE column

        -
      • -
      • -

        street field to STREET column

        -
      • -
      -
      -

      - - - - - - -
      -

      Note:

      -Because the city, country, and street fields are named identically to their database columns, Dali automatically maps the fields; no annotations are required.
      -
      -
      -
    • -
    • -

      Phone Entity

      -
        -
      • -

        areaCode field to AREA_CODE column

        -
      • -
      • -

        type field to TYPE column

        -
      • -
      -
      -

      - - - - - - -
      -

      Note:

      -Because the type field is named identically to its database column, Dali automatically maps the field. No annotation is required.
      -
      -
      -
    • -
    -

    Next, you will Create one-to-one mappings.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm deleted file mode 100644 index 0b21fc1fde..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm +++ /dev/null @@ -1,89 +0,0 @@ - - - - - -Create one-to-one mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create one-to-one mappings

    -
    -

    Use a One-to-One Mapping to define a relationship from an attribute to another class, with one-to-one multiplicity to a database column. In the Tutorial Object Model, the address field of the Employee class has a one-to-one relationship to the Address class; each employee may have a single address.

    -
      -
    1. -

      Select the Employee entity in the Package Explorer view.

      -
    2. -
    3. -

      In the JPA Structure view, select the address field of the Employee entity. The JPA Details view (for attributes) displays the properties for the field.

      -
    4. -
    5. -

      In the Map As field, select One-to-One.

      -
      -

      One-to-one Mapping for address

      -JPA Details view for the address field.
      -
    6. -
    7. -

      For the Target Entity, click Browse and select the Address persistent entity. Dali adds the @OneToOne(targetEntity=dali.tutorial.model.Address.class) entity to the class.

      -

      Leave the other fields with their default values.

      -
    8. -
    9. -

      Select the Override Default option to specify the relationship between the Employee and Address entities. Because you had to explicitly define the ID field for the Address entity in its ID mapping, you will need to edit the default join relationship.

      -
    10. -
    11. -

      Select the address_ADDRESS_ID -> ADDRESS_ID relationship in the Join Columns area and click Edit.

      -
    12. -
    13. -

      In the Edit Join Column dialog, select the following options and click OK.

      -
        -
      • -

        Name: ADDR_ID (from the EMPLOYEE table)

        -
      • -
      • -

        Referenced Column Name: ADDRESS_ID (from the ADDRESS table)

        -
      • -
      -
      -

      Editing Join Column for Address Mapping

      -Edit Join Column dialog for the address 1:1 mapping.
      -
    14. -
    -

    In the JPA Structure, the address field is identified as a one-to-one mapping, as shown in the following figure:

    -
    -

    JPA Structure for Employee Entity

    -The address attribute of the Employee entity in the JPA Structure view.
    - -

    Next, you will Create one-to-many mappings.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm deleted file mode 100644 index d75a00d3ff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - - -Create one-to-many mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create one-to-many mappings

    -
    -

    Use a One-to-Many Mapping to define a relationship from an attribute to another class, with one-to-many multiplicity to a database column. In the Tutorial Object Model, the phoneNumbers field of the Employee class has a one-to-many relationship to the Phone class; each employee may have many phone numbers.

    -
      -
    1. -

      Select the Employee entity in the Package Explorer view.

      -
    2. -
    3. -

      In the JPA Structure view, select the phoneNumber field of the Employee entity. The JPA Details view (for attributes) displays the properties for the field.

      -
    4. -
    5. -

      In the Map As field, select One-to-Many.

      -
      -

      One-to-many Mapping for phoneNumbers

      -JPA Details view for the phoneNumbers field.
      -
    6. -
    7. -

      Select PhoneNumber as the Target Entity. Leave the other fields with their default values.

      -
    8. -
    9. -

      In the Join Table area, notice that Dali has selected the correct joins, based on the foreign key associations in the database tables.

      -
    10. -
    -

    In the JPA Structure, the phoneNumbers field is identified as a one-to-many mapping as shown in the following figure:

    -
    -

    JPA Structure for Employee Entity

    -The phoneNumbers attribute of the Employee entity in the JPA Structure view.
    - -

    Next, you will Create many-to-one mappings.

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm deleted file mode 100644 index f2627f0553..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm +++ /dev/null @@ -1,89 +0,0 @@ - - - - - -Create many-to-one mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create many-to-one mappings

    -
    -

    Use a May-to-One Mapping to define a relationship from an attribute to another class, with many-to-one multiplicity to a database column. In the Tutorial Object Model, the owner field of the PhoneNumber class has a one-to-many relationship to the Employee class; there are many phone numbers that each employee may have.

    -

    This is the "back mapping" of the one-to-many mapping you previously defined.

    -
      -
    1. -

      Select the PhoneNumber entity in the Package Explorer view.

      -
    2. -
    3. -

      In the JPA Structure view, select the owner field of the PhoneNumber entity. The JPA Details view (for attributes) displays the properties for the field.

      -
    4. -
    5. -

      In the Map As field, select Many to One.

      -
      -

      Many to One Mapping for owner

      -The JPA Details view for the owner field.
      -
    6. -
    7. -

      Leave the other fields with their default values. Dali correctly completes the information based on the database structure and previously defined mappings.

      -
    8. -
    9. -

      Use the Join Columns area to specify the relationship between the PhoneNumber and Employee entities. Because you had to explicitly define the ID field for the Employee entity in its ID mapping, you will need to edit the default join relationship.

      -
    10. -
    11. -

      Select the Override Default option.

      -
    12. -
    13. -

      Select the owner_EMP_ID -> EMP_ID relationship in the Join Columns area and click Edit.

      -
    14. -
    15. -

      In the Edit Join Column dialog, select the following options and click OK.

      -
        -
      • -

        Name: EMP_ID (from the PHONE table)

        -
      • -
      • -

        Referenced Column Name: EMP_ID (from the EMPLOYEE table)

        -
      • -
      -
    16. -
    -

    In the JPA Structure, the owner field is identified as a many-to-one mapping as shown in the following figure:

    -
    -

    JPA Structure for PhoneNumber Entity

    -The owner attribute of the PhoneNumber entity in the JPA Structure view.
    - -

    Next, you will Create version mappings

    -
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm deleted file mode 100644 index 92230820b6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm +++ /dev/null @@ -1,67 +0,0 @@ - - - - - -Create version mappings - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create version mappings

    -
    -

    Use a Version Mapping to specify the database field used by a persistent entity for optimistic locking.

    -
      -
    1. -

      Select the Employee entity in the Package Explorer view.

      -
    2. -
    3. -

      In the JPA Structure view, select the version field of the Employee entity. The JPA Details view (for attributes) displays the properties for the field.

      -
    4. -
    5. -

      In the Map As field, select Version.

      -
      -

      Version Mapping for version

      -JPA Details view for the version field.
      -
    6. -
    -

    Dali automatically selects the Version column in the EMPLOYEE database table. In the JPA Structure, the Version field is identified as a version mapping, as shown in the following figure:

    -
    -

    JPA Structure for Employee Entity

    -The version attribute of the Employee entity in the JPA Structure view.
    - -

    Congratulations! All of the entities have been successfully mapped.

    -
    - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png deleted file mode 100644 index 7da0417133..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png deleted file mode 100644 index f96cc3f8b8..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png deleted file mode 100644 index a18a65652c..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png deleted file mode 100644 index e0a957185e..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png deleted file mode 100644 index 435be3dcc1..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png deleted file mode 100644 index 5bd48850fd..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png deleted file mode 100644 index 9cc32cf47c..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png deleted file mode 100644 index e3cb22b69a..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png deleted file mode 100644 index 6944826370..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png deleted file mode 100644 index 69d3193a5e..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png deleted file mode 100644 index 645922c306..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png deleted file mode 100644 index 0587544e2d..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png deleted file mode 100644 index 4bef3567ed..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png deleted file mode 100644 index 2b2a94becd..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png deleted file mode 100644 index a77a01ba6d..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png deleted file mode 100644 index 5d5fd1c145..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png deleted file mode 100644 index 001ef86ee2..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png deleted file mode 100644 index 7ea0b1d53e..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png deleted file mode 100644 index 952f11d131..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png deleted file mode 100644 index 1a70dd9e68..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png deleted file mode 100644 index aa7e0a6f15..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png deleted file mode 100644 index a9d721fcc4..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png deleted file mode 100644 index ff7eaa63b0..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png deleted file mode 100644 index d2c21ce726..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png deleted file mode 100644 index 18c294c06b..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png deleted file mode 100644 index 0fb14b17e1..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png deleted file mode 100644 index ad3ab04aa9..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png deleted file mode 100644 index b37937c5b4..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png deleted file mode 100644 index bd9351ce90..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png deleted file mode 100644 index 90d889fb4f..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png deleted file mode 100644 index bbcbb52d28..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png deleted file mode 100644 index 5a41682f77..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png deleted file mode 100644 index 3b8b032dc2..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png deleted file mode 100644 index f24fe486b9..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png deleted file mode 100644 index 25aca17350..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png deleted file mode 100644 index 4ba483ed2a..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png deleted file mode 100644 index f92ea6422b..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png deleted file mode 100644 index c186d3fef6..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png deleted file mode 100644 index a7e71ad7ca..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png deleted file mode 100644 index 91affa5e47..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png deleted file mode 100644 index 9c2811abd5..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png deleted file mode 100644 index 46fcc69d4f..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png deleted file mode 100644 index 01337ffab0..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png deleted file mode 100644 index 0a7685ae3f..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png deleted file mode 100644 index 67670ff6f0..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png deleted file mode 100644 index c9f02200b9..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png deleted file mode 100644 index ceb79d9623..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png deleted file mode 100644 index 148c735293..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png deleted file mode 100644 index 3e2b739dcd..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png deleted file mode 100644 index fea937d9b6..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png deleted file mode 100644 index b14dc15936..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png deleted file mode 100644 index fcc9886484..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png deleted file mode 100644 index c7c066427e..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png deleted file mode 100644 index e6a9159fd8..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png deleted file mode 100644 index bede63b968..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png and /dev/null 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 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png deleted file mode 100644 index eb25d7d6fb..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png and /dev/null 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 60f79a5d52..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 a36a2165a5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -Legal - - - - - - - - - - - - - - - -

    - - - - -
    -

    Legal

    -
    -

    -

    Notices

    -

    The material in this guide is copyright © 2006, 2007 by Oracle.

    -

    Terms and conditions regarding the use of this guide.

    - - - - - 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 85654952f5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence Documentation - Doc -providerName = Eclipse.org 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 e7d121acd2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - This cheat sheet helps you create a JPA project. - - - This cheat sheet helps you create a Java persistent entity. - - - 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/ref_details_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm deleted file mode 100644 index 3e14b3edd7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - - -JPA Details view (for orm.xml) - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    JPA Details view (for orm.xml)

    -
    -

    The JPA Details view displays the default mapping and persistence information for the project and contains the following areas:

    - -

    These defaults can be overridden by the settings on a specific entity or mapping.

    - - -
    - - 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 305de4fead..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm +++ /dev/null @@ -1,91 +0,0 @@ - - - - - -JPA Facet page - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    JPA Facet page

    -
    -

    This table lists the properties available on the JPA Facet page of the Create New JPA Project wizard.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    PlatformVendor-specific JPA implementation.Generic
    ConnectionSelect the database connection to use with the project. Dali requires an active database connection to use and validate the persistent entities and mappings. -

    Click Add connection to create a new database connection.

    -

    JPA ImplementationSelect to use the JPA implementation provided by the server at runtime, or select a specific implementation library that contain the Java Persistence API (JPA) and entities to be added to the project's Java Build Path. -

    Click Configure default JPA implementation library to create a default library for the project or click Configure user libraries to define additional libraries.

    -
    Determined by server.
    Persistent class managementSpecify if Dali will discover annotated classes automatically, or if the annotated classes must be listed in the persistence.xml file. -

    Note: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.

    -
    Determined by server.
    Create orm.xmlSpecify if Dali should create a default orm.xml file for your entity mappings and persistence unit defaults.Selected
    -
    -
    - - - - - - - - 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 85af149d8e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm +++ /dev/null @@ -1,213 +0,0 @@ - - - - - -General information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    General information

    -
    -

    This table lists the General properties available in the Java Details view for each mapping type.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefaultAvailable for Mapping Type
    Map AsDefine the mapping type for the attributeBasicAll mapping types
    ColumnThe database column that contains the value for the attribute. This field corresponds to the @Column annotation.By default, the Column is assumed to be named identically to the attribute.Basic mapping, Embedded mapping, ID mapping, Version mapping
      NameName of the database column. -

    This field corresponds to the @Column annotation.

    -

    Basic mapping, Embedded mapping, ID mapping
      TableName of the database table that contains the selected column.
    Basic mapping, Embedded mapping, ID mapping
    Fetch TypeDefines how data is loaded from the database: -
      -
    • -

      Eager – Data is loaded in before it is actually needed.

      -
    • -
    • -

      Lazy – Data is loaded only when required by the transaction.

      -
    • -
    -
    EagerBasic mapping, One-to-one mapping
    OptionalSpecifies if this field is can be null.YesBasic mapping, One-to-one mapping
    LobSpecify if the field is mapped to java.sql.Clob or java.sql.Blob. -

    This field corresponds to the @Lob annotation.

    -

    Basic mapping
    TemporalSpecifies if this field is one of the following: -
      -
    • -

      Date – java.sql.Date

      -
    • -
    • -

      Time – java.sql.Time

      -
    • -
    • -

      Timestamp – java.sql.Timestamp

      -
    • -
    -

    This field corresponds to the @Temporal annotation.

    -

    Basic mapping, ID mapping
    EnumeratedSpecify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema. -
      -
    • -

      ordinal

      -
    • -
    • -

      String

      -
    • -
    -

    This field corresponds to the @Enumerated annotation.

    -
    Ordinal
    Target EntityThe persistent entity to which the attribute is mapped.
    One-to-one mapping,, One-to-many mapping Many-to-many mapping, Many-to-one mapping
    Cascade TypeSpecify which operations are propagated throughout the entity. -
      -
    • -

      All – All operations

      -
    • -
    • -

      Persist

      -
    • -
    • -

      Merge

      -
    • -
    • -

      Move

      -
    • -
    -

    One-to-one mapping
    Mapped ByThe field in the database table that "owns" the relationship. This field is required only on the non-owning side of the relationship.
    One-to-one mapping, One-to-many mapping
    Order BySpecify the default order for objects returned from a query: -
      -
    • -

      No ordering

      -
    • -
    • -

      Primary key

      -
    • -
    • -

      Custom ordering

      -
    • -
    -

    This field corresponds to the @OrderBy annotation.

    -
    Primary keyOne-to-many mapping. Many-to-many mapping, Many-to-one mapping
    Attribute OverridesOverrides the column mappings from the mapped, entity tabled. (for example, if the inherited column name is incompatible with a pre-existing data model, or invalid as a column name in your database).
    Embedded mapping -

    Embedded mapping

    -
    -
    - -

     

    -Related task
    -
    -Mapping an entity
    - - - - - - 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 2a498d7bff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm +++ /dev/null @@ -1,91 +0,0 @@ - - - - - -New JPA Project page - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    New JPA Project page

    -
    -

    This table lists the properties available on the New JPA Project page of the Create New JPA Project wizard.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    Project nameName of the Eclipse JPA project.
    Project contentsLocation of the workspace in which to save the project. -

    Unselect The Use Default option and click Browse to select a new location.

    -
    Current workspace
    Target runtimeSelect a pre-defined target for the project. -

    Click New to create a new environment with the New Server Runtime wizard.

    -

    ConfigurationsSelect a project configuration with pre-defined facets. -

    Select <custom> to manually select the facets for this project.

    -
    Utility JPA project with Java 5.0
    EAR membershipSpecify if this project should be included in an EAR file for deployment. -

    Select the EAR Project Name, or click New to create a new EAR project.

    -

    -
    -
    - - - - - - 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 b68d3feaab..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -Create New JPA Project wizard - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create New JPA Project wizard

    -
    -

    The Create New JPA Project wizard allows you to create a new Java project using JPA. The wizard consists of the following pages:

    - - - -
    - - 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 12fffe6c47..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - - -JPA Details view (for attributes) - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    JPA Details view (for attributes)

    -
    -

    The JPA Details view displays the persistence information for the currently selected mapped attribute and contains the following areas:

    - - - -
    - - 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 083c276125..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -JPA Structure view - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    JPA Structure view

    -
    -

    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. The structural elements shown in the outline are the entity and its fields.

    -
    -

    Sample JPA Structure View

    -Sample JPA Structure view for an entity.
    - -

     

    -Related reference
    -
    -JPA Development perspective -

     

    -
    - - - - - - - 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 92641ca69c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -JPA Development perspective - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    JPA Development perspective

    -
    -

    The JPA Development perspective defines the initial set and layout of views in the Workbench window when using Dali. By default, the JPA Development perspective includes the following vies:

    - -
    -

    Sample JPA Development Perspective

    -JPA Development perspective with the JPA Structure and JPA Details views.
    - -Related concept
    -

    Perspectives

    -
    - - - - - - 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 83e0d102ef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -JPA Details view (for entities) - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    JPA Details view (for entities)

    -
    -

    The JPA Details view displays the persistence information for the currently selected entity and contains the following tabs:

    - - - -
    - - 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 887580090e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm +++ /dev/null @@ -1,144 +0,0 @@ - - - - - -Primary Key Generation information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Primary Key Generation information

    -
    -

    This table lists the fields available in the Primary Key Generation area in JPA Details view for ID mapping types.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    Primary Key GenerationThese fields define how the primary key is generated. These fields correspond to the @GeneratedValue annotation.Generated Value
       Strategy -
      -
    • Auto
    • -
    • -

      Identity – Values are assigned by the database's Identity column.

      -
    • -
    • -

      Sequence – Values are assigned by a sequence table (see Sequence Generator).

      -
    • -
    • -

      Table – Values are assigned by a database table (see Table Generator).

      -
    • -
    -
    Auto
      Generator NameUnique name of the generated value.
    Table GeneratorThese fields define the database table used for generating the primary key and correspond to the @TableGenerator annotation. -

    These fields apply only when Strategy = Table.

    -

      NameUnique name of the generator.
      TableDatabase table that stores the generated ID values.
      Primary Key ColumnThe column in the table generator's Table that contains the primary key.
      Value ColumnThe column that stores the generated ID values.
      Primary Key Column ValueThe value for the Primary Key Column in the generator table.
    Sequence GeneratorThese fields define the specific sequence used for generating the primary key and correspond to the @SequenceGenerator annotation. -

    These fields apply only when Strategy = Sequence.

    -

      NameName of the sequence table to use for defining primary key values.
      SequenceUnique name of the sequence.
    -
    - -

     

    -Related task
    -
    -ID mapping -

     

    -Related task
    -
    -JPA Details view (for attributes)
    - - - - - - - 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 9b7ac94a87..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm +++ /dev/null @@ -1,80 +0,0 @@ - - - - - -Project Properties page - JPA Options - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Project Properties page – JPA Options

    -
    -

    Use the JPA options on the Properties page to select the database connection to use with the project.

    -

    This table lists the properties available in the Persistence Properties page.

    -
    - - - - - - - - - - - - - - - - - -
    PropertyDescription
    PlatformSelect the vendor-specific platform.
    ConnectionThe database connection used to map the persistent entities. -
      -
    • -

      To create a new connection, click Add Connections.

      -
    • -
    • -

      To reconnect to an existing connection, click Reconnect.

      -
    • -
    -
    -
    - -

     

    -Related task
    -
    -Modifying persistent project properties
    - - - - - - - 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 7e82de0d86..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -Reference - - - - - - - - - - - - - - - -

    - - - - -
    -

    Reference

    -
    -

    This section includes detailed help information for each of the following elements in the Dali OR Mapping Tool:

    - - - - - - 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 cc6300ff36..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -Wizards - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Wizards

    -
    -

    This section includes information on the following wizards:

    - - - -
    - - 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 8a6374bf83..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - - -Property pages - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Property pages

    -
    -

    This section includes information on the following property pages:

    - - - -
    - - 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 57d9770f64..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm +++ /dev/null @@ -1,115 +0,0 @@ - - - - - -General information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    General information

    -
    -

    This table lists the General information fields available in the JPA Details view for each entity type.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefaultAvailable for Entity Type
    Map AsSpecify the type of entity: Entity, Mapped Superclass, Embeddable.EntityEntity, Embeddable, and Mapped superclass
    NameThe name of this entity. By default, the class name is used as the entity name.
    Entity
    TableThe primary database table associated with the entity.
    Entity
    CatalogThe database catalog that contains the Table.As defined in orm.xml.Entity
    SchemaThe database schema that contains the Table.As defined in orm.xml.Entity
    Attribute OverridesSpecify a property or field to be overridden (from the default mappings). Select Override Default.
    Entity
      ColumnThe database column (from the Table Name) mapped to the entity.
    Entity
      TableName of the database table that contains the selected column.
    Entity
    -
    - -

     

    -Related task
    -
    -Adding persistence to a class -

     

    -Related reference
    -
    -JPA Details view (for entities)
    - - - - - - 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 b695f6856c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - - -Secondary table information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Secondary table information

    -
    -

    Use the Secondary Tables area in the Java Details view to associate additional tables with an entity. Use this area if the data associated with an entity is spread across multiple tables.

    -

     

    -Related task
    -
    -Specifying additional tables
    -Adding persistence to a class -

     

    -Related reference
    -
    -JPA Details view (for entities)
    - - - - - - 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 6fa75a1e4a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm +++ /dev/null @@ -1,108 +0,0 @@ - - - - - -Inheritance information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Inheritance information

    -
    -

    This table lists the fields available on the Inheritance area in the Java Details view for each entity type.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    StrategySpecify the strategy to use when mapping a class or class hierarchy: -
      -
    • -

      Single table – All classes in the hierarchy are mapped to a single table.

      -
    • -
    • -

      Joined – The root of the hierarchy is mapped to a single table; each child maps to its own table.

      -
    • -
    • -

      Table per class – Each class is mapped to a separate table.

      -
    • -
    -
    Single table
    Discriminator ColumnUse to specify the name of the discriminator column when using a Single or Joined inheritance strategy.
    Discriminator TypeSet this field to set the discriminator type to Char or Integer (instead of its default: String). The Discriminator Value must conform to this type.String
    Discriminator ValueSpecify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified Discriminator Type.
    Primary Key Join Columns -

    Select Override Default.

    -

    This field corresponds with @PrimaryKeyJoinColumn annotation.

    -

    -
    - -

     

    -Related task
    -
    -Specifying entity inheritance
    -Adding persistence to a class -

     

    -Related reference
    -
    -JPA Details view (for entities)
    - - - - - - - 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 e6dee40319..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm +++ /dev/null @@ -1,84 +0,0 @@ - - - - - -Join Table Information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Join Table Information

    -
    -

    Use area to specify a mapped column for joining an entity association. By default, the mapping is assumed to have a single join.

    -

    This table lists the fields available on the Join Table area in the JPA Details view for One-to-many mapping and Many-to-many mapping mapping types.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    NameName of the join table that contains the foreign key column.By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.
    Join ColumnsSpecify a mapped column for joining an entity association. This field corresponds to the @JoinColum attribute. -

    Select Override Default, then Add, Edit, or Remove the join columns.

    -
    By default, the mapping is assumed to have a single join.
    Inverse Join ColumnsSelect Override Default, then Add, Edit, or Remove the join columns.
    -
    - -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related task
    -
    -Edit Join Columns Dialog
    - - - - - - 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 9ca50cdeaa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -Join Columns Information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Join Columns Information

    -
    -

    This table lists the fields available in the Join Table area in JPA Details view for Many-to-one mapping and One-to-one mapping mapping types.

    -
    - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    Join ColumnSpecify a mapped column for joining an entity association. This field corresponds to the @JoinColum attribute. -

    Select Override Default, then Add, Edit, or Remove the join columns.

    -
    By default, the mapping is assumed to have a single join.
    -
    - -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related task
    -
    -Edit Join Columns Dialog
    - - - - - - 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 ec9b54d253..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -General information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    General information

    -
    -

    This table lists the General information fields available in the JPA Details view for each entity type.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    PackageThe Java package that contains the persistent entities. Click Browse and select the package
    SchemaThe database schema that contains the Table. -

    This field corresponds to the <schema> element in the orm.xml file.

    -

    CatalogThe database catalog that contains the Table. -

    This field corresponds to the <catalog> element in the orm.xml file.

    -

    AccessSpecify the default access method for the variables in the project: -
      -
    • -

      Property

      -
    • -
    • -

      Field

      -
    • -
    -

    This field corresponds to the <access> element in the orm.xml file.

    -

    -
    - -

     

    -Related task
    -
    -Adding persistence to a class -

     

    -Related reference
    -
    -JPA Details view (for entities)
    - - - - - - 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 efc2cf7b67..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm +++ /dev/null @@ -1,102 +0,0 @@ - - - - - -Persistence Unit information - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Persistence Unit information

    -
    -

    This table lists the Persistence Unit information fields available in the JPA Details view for each entity type. These fields are contained in the <persistence-unit-metadata> element in the orm.xml file.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    XML Mapping Data CompleteSpecifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored. -

    This field corresponds to the <xml-mapping-metadata-complete> element in the orm.xml file.

    -

    PackageThe Java package that contains the persistent entities for this persistence unit. -

    Click Browse and select the package

    -

    SchemaThe database schema that contains the Table. -

    This field corresponds to the <schema> element in the orm.xml file.

    -

    CatalogThe database catalog that contains the Table. -

    This field corresponds to the <catalog> element in the orm.xml file.

    -

    Cascade PersistAdds cascade-persist to the set of cascade options in entity relationships of the persistence unit. -

    This field corresponds to the <cascade-persist> element in the orm.xml file.

    -

    -
    - -

     

    -Related task
    -
    -Adding persistence to a class -

     

    -Related reference
    -
    -JPA Details view (for entities)
    - - - - - - - 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 bf02a646bd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -Preferences - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Preferences

    -
    -

    This section includes information on the following preference pages:

    - - - -
    - - 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 ff0ec97ca8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -Dialogs - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Dialogs

    -
    -

    This section includes information on the following preference pages:

    - - - -
    - - 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 6c01c652ff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - - -Edit Join Columns Dialog - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Edit Join Columns Dialog

    -
    -

    Use the Join Columns dialog to create or modify the join tables and columns in relationship mappings.

    -

    This table lists the properties available in the Join Columns dialog.

    -
    - - - - - - - - - - - - - - - - - -
    PropertyDescription
    NameName of the joint table column that contains the foreign key column.
    Referenced Column NameName of the database column that contains the foreign key reference for the entity relationship.
    -
    - -Related reference
    -
    -Join Table Information
    -Join Columns Information
    - - - - - - - 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 8f9da2fc87..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -Icons and buttons - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Icons and buttons

    -
    -

    This section includes information on each of the icons and buttons used in the Dali OR Mapping Tool.

    - - - -
    - - 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 22e9292c83..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm +++ /dev/null @@ -1,116 +0,0 @@ - - - - - -Icons - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Icons

    -
    -

    The following icons are used throughout the Dali OR Mapping Tool.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    IconDescription
    Nonpersistent class icon
    Nonpersistent class
    Persistent entity icon
    Entity
    Embeddable entity icon
    Embeddable entity
    Mapped superclass icon
    Mapped superclass
    Basic mapping icon
    Basic mapping
    Embedded mapping icon
    Embedded mapping
    Embedded ID mapping icon
    Embedded ID mapping
    ID mapping icon
    ID mapping
    Many-to-many mapping icon
    Many-to-many mapping
    Many-to-one mapping icon
    Many-to-one mapping
    One-to-many mapping icon
    One-to-many mapping
    One-to-one mapping icon
    One-to-one mapping
    Transient mapping icon
    Transient mapping
    Version mapping icon
    Version mapping
    -
    - -Related concept
    -

    Icons and buttons

    -
    - - - - - - 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 40e1ef2249..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -Buttons - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Buttons

    -
    -

    The following buttons are used throughout the Dali OR Mapping Tool.

    -
    - - - - - - - - - - - - - -
    IconDescription
    Persistence Perspective button
    JPA Development perspective
    -
    - -Related concept
    -

    Icons and buttons

    -
    - - - - - - - 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 7c7c5271e5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm +++ /dev/null @@ -1,44 +0,0 @@ - - - - - -Javadoc - - - - - - - - - - - - - - - -
    - - - - -
    -

    Javadoc

    -
    -

    There is no public API for Release 1.0.0. Please refer to the Dali Developer Documentation for additional information.

    -
    - - - - - - 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 67612290f6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - -Dali Developer Documentation - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Dali Developer Documentation

    -
    -

    Additional Dali documentation is available online at:

    -

    http://wiki.eclipse.org/index.php/Dali_Developer_Documentation

    -

    This developer documentation includes information about:

    -
      -
    • -

      Dali architecture

      -
    • -
    • -

      Plugins that comprise the Dali JPA Eclipse feature

      -
    • -
    • -

      Extension points

      -
    • -
    -
    - - - - - - 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 9463c8bb14..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -Adding persistence to a class - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Adding persistence to a class

    -
    -

    You can make a Java class into one of the following persistent types:

    - -

     

    -Related tasks
    -
    -Specifying additional tables
    -Specifying entity inheritance
    -Mapping an entity -

     

    -Related concept
    -
    -Understanding Java persistence
    -The orm.xml file
    -The persistence.xml file - -
    - - 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 0674fcdf7d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm +++ /dev/null @@ -1,79 +0,0 @@ - - - - - -Specifying additional tables - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Specifying additional tables

    -
    -

    An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.

    -

    Use this procedure to specify inheritance (@Inheritance) for an existing entity (@Entity):

    -
      -
    1. -

      Select the entity in the Package Explorer.

      -
    2. -
    3. -

      In the JPA Details view, select the Secondary Tables information.

      -
      -

      Specifying Secondary Tables

      -Secondary Tables area on the JPA Details view.
      -
    4. -
    5. -

      Click Add to associate an additional table with the entity. The Edit Secondary Table dialog appears

      -
    6. -
    7. -

      Select the Name, Catalog, and Schema of the additional table to associate with the entity.

      -
    8. -
    -

    Eclipse adds the following annotations the entity:

    -
    -@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA"
    -
    -
    -
    -

     

    -Related reference
    -
    -

     

    -Related task
    -
    -Adding persistence to a class -

     

    -Related concept
    -
    -Understanding Java persistence
    - - - - - - 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 61239561d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm +++ /dev/null @@ -1,103 +0,0 @@ - - - - - -Creating a new JPA project - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Creating a new JPA project

    -
    -

    Use this procedure to create a new JPA project.

    -
      -
    1. -

      Select File > New > Other. The New Project dialog appears.

      -
    2. -
    3. -

      On the New Project dialog, select JPA > JPA Project and click Next. The New JPA Project wizard appears.

      -
      -

      New JPA Project

      -The New JPA Project dialog.
      -
    4. -
    5. -

      Complete the fields on the New JPA Project page to specify the project name and location, target runtime, and pre-defined configuration.

      -
    6. -
    7. -

      Click Next. The Project Facets page appears.

      -
    8. -
    9. -

      Select the project facets to use to create the project and click Next. The JPA Facet page appears.

      -
      -

      New JPA Project

      -The JPA Facet dialog
      -
    10. -
    11. -

      Complete the fields on the JPA Facet page to specify your vender-specific platform, database connection, and JPA implementation library.

      -
      -

      - - - - - - -
      -

      Note:

      -If the server runtime does not provide a JPA implementation, you must explicitly select a JPA implementation library. -

      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.

      -
      -
      -
      -
    12. -
    13. -

      Click Finish. You should now open the JPA Development perspective.

      -
    14. -
    -

     

    -Related reference
    -
    -Create New JPA Project wizard
    -JPA Development perspective -

     

    -Related tasks
    -
    -Managing the persistence.xml file
    -Adding persistence to a class -

     

    -Related concept
    -
    -Understanding Java persistence
    -The persistence.xml file
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm deleted file mode 100644 index 4ac1b09dc7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm +++ /dev/null @@ -1,74 +0,0 @@ - - - - - -Generate Entities from Tables dialog - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Generate Entities from Tables dialog

    -
    -

    Use the Generate Entities dialog to create Java persistent entities from your database tables and columns.

    -

    This table lists the properties available in the Generate Entities dialog.

    -
    - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescription
    Source FolderEnter a project folder name in which to generate the Java persistent entities, or click Browse to select an existing folder.
    PackageEnter a package name in which to generate the Java persistent entities, or click Browse to select an existing package.
    TablesSelect the tables from which to create Java persistent entities. The tables shown are determined by the database connection that you defined in the Project Properties page – JPA Options.
    -
    - -Related task
    -

    Generating entities from tables

    -

     

    -
    - - - - - - 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 9073764a6b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -Specifying entity inheritance - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Specifying entity inheritance

    -
    -

    An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.

    -

    Use this procedure to specify inheritance (@Inheritance) for an existing entity (@Entity):

    -
      -
    1. -

      Select the entity in the Package Explorer.

      -
    2. -
    3. -

      In the JPA Details view, select the Inheritance information.

      -
      -

      Specifying Inheritance

      -Selecting the Inheritance area on the JPA Details view.
      -
    4. -
    5. -

      In the Strategy list, select one of the following the inheritance strategies:

      -
        -
      • -

        A single table (default)

        -
      • -
      • -

        Joined table

        -
      • -
      • -

        One table per class

        -
      • -
      -
    6. -
    7. -

      Use the following table to complete the remaining fields on the tab. See "Inheritance information" for additional details.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Discriminator ColumnName of the discriminator column when using a Single or Joined inheritance strategy. -

      This field corresponds to the @DiscriminatorColumn annotation.

      -

      Discriminator TypeSet the discriminator type to Char or Integer (instead of its default: String). The Discriminator Value must conform to this type.String
      Discriminator ValueSpecify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified Discriminator Type. -

      This field corresponds to the @DiscriminatorValue annotation.

      -

      Override DefaultUse this field to specify custom primary key join columns. -

      This field corresponds to the @PrimaryKeyJoinClumn annotation.

      -

      -
      -
    8. -
    -

    Eclipse adds the following annotations the entity field:

    -
    -@Inheritance(strategy=InheritanceType.<INHERITANCE_STRATEGY>)
    -@DiscriminatorColumn(name="<DISCRIMINATOR_COLUMN>",
    -    discriminatorType=<DISCRIMINATOR_TYPE>)
    -@DiscriminatorValue(value-"<DISCRIMINATOR_VALUE>")
    -@PrimaryKeyJoinColumn(name="<JOIN_COLUMN_NAME>", 
    -    referencedColumnName = "<REFERENCED_COLUMN_NAME>")
    -
    -
    -
    -

    The following figures illustrates the different inheritance strategies.

    -
    -

    Single Table Inheritance

    -This figure illustrates entity inheritance in a single table.
    - -
    -

    Joined Table Inheritance

    -This figure shows a sample joined inheritance table strategy.
    - -

     

    -Related reference
    -
    -

     

    -Related task
    -
    -Adding persistence to a class -

     

    -Related concept
    -
    -Understanding Java persistence
    - - - - - - 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 5246efcd81..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -Managing the orm.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Managing the orm.xml file

    -
    -

    When creating a JPA project, (see "Creating a new JPA project") you can also create the orm.xml file that defines the mapping metadata and defaults.

    -

    Eclipse creates the META-INF\orm.xml file in your project's directory:

    -
    -<?xml version="1.0" encoding="UTF-8"?>
    -<persistence version="<PERSISTENCE_VERSION>"
    -      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">
    -  <persistence-unit name="<PERSISTENCE_UNIT_NAME>">
    -    <provider="<PERSISTENCE_PROVIDER>" />
    -  </persistence-unit>
    -</persistence>
    -
    -
    -

     

    -Related reference
    -
    -Create New JPA Project wizard -

     

    -Related task
    -
    -Working with orm.xml file
    -

     

    -Related concept
    -
    -The orm.xml file
    - - -
    - - 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 8150519565..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -Managing the persistence.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Managing the persistence.xml file

    -
    -

    When creating a JPA project, (see "Creating a new JPA project") you can also create the persistence.xml file.

    -

    Eclipse creates the META-INF\persistence.xml file in your project's directory:

    -
    -<?xml version="1.0" encoding="UTF-8"?>
    -<persistence version="<PERSISTENCE_VERSION>"
    -      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">
    -  <persistence-unit name="<PERSISTENCE_UNIT_NAME>">
    -    <provider="<PERSISTENCE_PROVIDER>" />
    -  </persistence-unit>
    -</persistence>
    -
    -
    -

     

    -Related reference
    -
    -Create New JPA Project wizard -

     

    -Related task
    -
    -Working with persistence.xml file
    -

     

    -Related concept
    -
    -The persistence.xml file
    - - -
    - - 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 e9bb1c3e38..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - -Mapping an entity - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Mapping an entity

    -
    -

    Dali supports the following mapping types for Java persistent entities:

    - -

     

    -Related concept
    -
    -Understanding OR mappings - -
    - - 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 0e1b27c20c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm +++ /dev/null @@ -1,74 +0,0 @@ - - - - - -Tasks - - - - - - - - - - - - - - - -

    - - - - -
    -

    Tasks

    -
    -

    This section includes detailed step-by-step procedures for accessing the Dali OR mapping tool functionality.

    - - - - - - 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 48e3c132b8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm +++ /dev/null @@ -1,67 +0,0 @@ - - - - - -Working with persistence.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Working with persistence.xml file

    -
    -

    You can work with the persistence.xml by using the XML Editor.

    -

    Use this procedure to work with the persistence.xml file:

    -
      -
    1. -

      Right-click the persistence.xml file in the Package Explorer and select Open With > XML Editor.

      -
      -

      Opening the Persistence XML Editor

      -This figure shows the Open > Persistence XML Editor option for the persistence.xml file.
      -
    2. -
    3. -

      Use the Persistence XML Editor to edit the persistence.xml file.

      -
      -

      Persistence XML Editor

      -This figure shows the Persistence XML Editor.
      -
    4. -
    -Related task
    -
    -Working with persistence.xml file
    -Working with XML Files -

     

    -Related concept
    -
    -The persistence.xml file
    - - - - - - 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 13aa22b2c7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm +++ /dev/null @@ -1,67 +0,0 @@ - - - - - -Synchronizing classes - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Synchronizing classes

    -
    -

    As you work with the classes in your Java project, you will need to update the persistence.xml file to reflect the changes.

    -

    Use this procedure to synchronize the persistence.xml file:

    -
      -
    1. -

      Right-click the persistence.xml file in the Package Explorer and select JPA Tools > Synchronize Classes.

      -
      -

      Synchronizing the persistence.xml File

      -This figure shows the JPA Tools > Synchronize Classes option.
      - -

      Dali adds the necessary <class> elements to the persistence.xml file.

      -
    2. -
    3. -

      Use the Persistence XML Editor to continue editing the persistence.xml file.

      -
    4. -
    -Related task
    -
    -Working with persistence.xml file -

     

    -Related concept
    -
    -The persistence.xml file
    -
    - - - - - - - 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 400091dab9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm +++ /dev/null @@ -1,68 +0,0 @@ - - - - - -Working with orm.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Working with orm.xml file

    -
    -

    You can work with the orm.xml by using the JPA Details view.

    -

    Use this procedure to work with the orm.xml file:

    -
      -
    1. -

      Right-click the orm.xml file in the Package Explorer and select Open.

      -
    2. -
    3. -

      In the JPA Structure view, select EntityMappings.

      -
    4. -
    5. -

      Use the JPA Details view to configure the entity mapping and persistence unit defaults.

      -
      -

      JPA Details view for EntityMappings (orm.xml)

      -JPA Details view for orm.xml file.
      -
    6. -
    -Related task
    -
    -Working with orm.xml file
    -Working with XML Files
    -

     

    -Related concept
    -
    -The orm.xml file
    - - - - - - - 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 feddf4d807..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -Entity - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Entity

    -
    -

    An Entity is a persistent domain object.

    -

    An entity can be:

    -
      -
    • -

      Abstract or concrete classes. Entities may also extend non-entity classes as well as entity classes, and non-entity classes may extend entity classes.

      -
    • -
    -

    An entity must have:

    -
      -
    • -

      A no-arg constructor (public or protected); the entity class may have other constructors as well.

      -
    • -
    -

    Each persistent entity must be mapped to a database table and contain a primary key. Persistent entities are identified by the @Entity annotation.

    -

    Use this procedure to add persistence to an existing entity:

    -
      -
    1. -

      Open the Java class in the Package Explorer.

      -
    2. -
    3. -

      Select the class in the JPA Structure view.

      -
    4. -
    5. -

      In the JPA Details view, use the Map As field to select Entity.

      -
      -

      Selecting Entity Persistence

      -Selecting entity persistence on the JPA Details view.
      -
    6. -
    7. -

      Complete the remaining JPA Details view (for entities).

      -
    8. -
    -

     

    -Related tasks
    -
    -Adding persistence to a class
    -Specifying additional tables
    -Specifying entity inheritance
    - - - - - - 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 1d220dd4b7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -Embeddable - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Embeddable

    -
    -

    An Embedded 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.

    -

    To override the mapping information for a specific subclass, use the @AttributeOverride annotation for that specific class.

    -

    An embeddable entity is identified by the @Embeddable annotation.

    -

    Use this procedure to add embeddable persistence to an existing entity:

    -
      -
    1. -

      Open the Java class in the Package Explorer.

      -
    2. -
    3. -

      Select the class in the JPA Structure view.

      -
    4. -
    5. -

      In the JPA Details view, use the Map As drop-list to select Embeddable.

      -
      -

      Selecting Embeddable Persistence

      -Selecting embedded persistence on the JPA Details view.
      -
    6. -
    7. -

      Complete the remaining JPA Details view (for entities).

      -
    8. -
    -

     

    -Related tasks
    -
    -
    Adding persistence to a class
    -
    Specifying additional tables
    -
    Specifying entity inheritance
    -
    -
    - - - - - - 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 7486209ff6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm +++ /dev/null @@ -1,86 +0,0 @@ - - - - - -Mapped superclass - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Mapped superclass

    -
    -

    An entities that extend a Mapped Superclass class inherit 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.

    -

    A mapped superclass can be:

    -
      -
    • -

      Abstract or concrete classes

      -
    • -
    -

    A mapped superclass cannot be:

    -
      -
    • -

      Be queried or passed as an argument to Entity-Manager or Query operations

      -
    • -
    • -

      Be the target of a persistent relationship

      -
    • -
    -

    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 @AttributeOverride annotation for that specific class.

    -

    A mapped superclass is identified by the @MappedSuperclass annotation.

    -

    Use this procedure to add Mapped Superclass persistence to an existing entity:

    -
      -
    1. -

      Open the Java class in the Package Explorer.

      -
    2. -
    3. -

      Select the class in the JPA Structure view.

      -
    4. -
    5. -

      In the JPA Details view, use the Map As drop-list to select Mapped Superclass.

      -
      -

      Selecting Mapped Superclass Persistence

      -Selecting embedded persistence on the JPA Details view.
      -
    6. -
    7. -

      Complete the remaining JPA Details view (for entities).

      -
    8. -
    -

     

    -Related tasks
    -
    -Adding persistence to a class
    -Specifying additional tables
    -Specifying entity inheritance
    - - - - - - - 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 10bb4cb5ae..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm +++ /dev/null @@ -1,206 +0,0 @@ - - - - - -Basic mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Basic mapping

    -
    -

    Use a Basic Mapping to map an attribute directly to a database column. Basic mappings may be used only with the following attribute types:

    -
      -
    • -

      Java primitive types and wrappers 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

      -
    • -
    • -

      any other type that implements Serializable

      -
    • -
    -

    To create a basic mapping:

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected field.

      -
    2. -
    3. -

      In the Map As field, select Basic.

      -
    4. -
    5. -

      Use this table to complete the remaining fields on the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Map AsDefines this mapping as a Basic Mapping. -

      This field corresponds to the @Basic annotation.

      -
      Basic
      ColumnThe database column mapped to the entity attribute. See "Column" for details. -
        -
      • -

        Name – Name of the database column.

        -
      • -
      • -

        Table – Name of the database table.

        -
      • -
      • -

        Insertable – Specify if the column is always included in SQL INSERT statements.

        -
      • -
      • -

        Updatable – Specify if the column is always included in SQL UPDATE statements.

        -
      • -
      -
      By default, the Column is assumed to be named identically to the attribute and always included in the INSERT and UPDATE statements.
      TableName of the database table.
      FetchDefines how data is loaded from the database. See "Fetch Type" for details. -
        -
      • -

        Eager

        -
      • -
      • -

        Lazy

        -
      • -
      -
      Eager
      OptionalSpecifies if this field is can be null.Yes
      LobSpecifies if this is a large objects (BLOB or CLOB). See "Lob" for details.
      TemporalSpecifies the type of data. See "Temporal" for details. -
        -
      • -

        Date

        -
      • -
      • -

        Time

        -
      • -
      • -

        Timestamp

        -
      • -
      -

      -
      -
    6. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@Column(name="<COLUMN_NAME>", table="<COLUMN_TABLE>", 
    -    insertable=<INSERTABLE>, updatable=<UPDATABLE>)
    -@Basic(fetch=FetchType.<FETCH_TYPE>, optional = <OPTIONAL>)
    -@Temporal(TemporalType.<TEMPORAL>)
    -
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 f621a37aeb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm +++ /dev/null @@ -1,120 +0,0 @@ - - - - - -Embedded mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Embedded mapping

    -
    -

    Use an Embedded Mapping to specify a persistent field or property of an entity whose value is an instance of an embeddable class.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected field.

      -
    2. -
    3. -

      In the Map As field, select Embedded.

      -
    4. -
    5. -

      Use this table to complete the remaining fields on the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Map AsDefines this mapping as a Embedded. -

      This field corresponds to the @Embedded annotation.

      -
      Embedded
      Attribute OverridesSpecify to override the default mapping of an entity's attribute. Select Override Default.
      ColumnsThe database column (and its table) mapped to the entity attribute. See "Column" for details. -
        -
      • -

        Name – Name of the database column.

        -
      • -
      • -

        Table – Name of the database table.

        -
      • -
      • -

        Insertable – Specify if the column is always included in SQL INSERT statements.

        -
      • -
      • -

        Updatable – Specify if the column is always included in SQL UPDATE statements.

        -
      • -
      -

      -
      -
    6. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@Embedded
    -@AttributeOverride(column=@Column(table="<COLUMN_TABLE>", name = "<COLUMN_NAME>"))
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 1df9648d7f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm +++ /dev/null @@ -1,94 +0,0 @@ - - - - - -Embedded ID mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Embedded ID mapping

    -
    -

    Use an Embedded ID Mapping to specify the primary key of an embedded ID. These mappings may be used with a Embeddable entities.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected field.

      -
    2. -
    3. -

      In the Map As field, select Embedded Id.

      -
    4. -
    5. -

      Use this table to complete the remaining fields on the JPA Details view.

      -
      - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Map AsDefines this mapping as a Embedded Id. -

      This field corresponds to the @EmbeddedId annotation.

      -
      Embedded Id
      -
      -
    6. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@EmbeddedId
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 e8a4380d02..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm +++ /dev/null @@ -1,176 +0,0 @@ - - - - - -ID mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    ID mapping

    -
    -

    Use an ID Mapping to specify the primary key of an entity. ID mappings may be used with a Entity or Mapped superclass. Each Entity must have an ID mapping.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select ID.

      -
    4. -
    5. -

      Use this table to complete the General information fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Map AsDefines this mapping as an ID Mapping. -

      This field corresponds to the @Id annotation.

      -
      ID
      ColumnThe database column mapped to the entity attribute. See "Column" for details.By default, the Column is assumed to be named identically to the attribute.
      TableThe database table mapped to the entity attribute.By default, the Table is assumed to be identical to the table associated with the entity.
      TemporalSpecifies the type of data. See "Temporal" for details. -
        -
      • -

        Date

        -
      • -
      • -

        Time

        -
      • -
      • -

        Timestamp

        -
      • -
      -

      -
      -
    6. -
    7. -

      Use this table to complete the fields in Primary Key Generation information area in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Primary Key GenerationThese fields define how the primary key is generated.
        StrategySee "Primary Key Generation" for details. -
        -
      • -

        Auto

        -
      • -
      • -

        Sequence

        -
      • -
      • -

        Identity

        -
      • -
      • -

        Table

        -
      • -
      -
      Auto
        Generator NameName of the primary key generator specified in the Strategy
      -
      -
    8. -
    -

    Additional fields will appear in the Primary Key Generation information area, depending on the selected Strategy. See "JPA Details view (for attributes)" for additional information.

    -

    Eclipse adds the following annotations to the field:

    -
    -@Id
    -@Column(name="<COLUMN_NAME>", table="<TABLE_NAME>", insertable=<INSERTABLE>,
    -    updatable=<UPDATABLE>)
    -@Temporal(<TEMPORAL>)
    -@GeneratedValue(strategy=GeneratorType.<STRATEGY>, generator="<GENERATOR_NAME>")@TableGenerator(name="<TABLE_GENERATOR_NAME>", table = "<TABLE_GENERATOR_TABLE>", 
    -    pkColumnName = "<TABLE_GENERATOR_PK>", 
    -    valueColumnName = "<TABLE_GENERATOR_VALUE_COLUMN>", 
    -    pkColumnValue = "<TABLE_GENERATOR_PK_COLUMN_VALUE>")@SequenceGenerator(name="<SEQUENCE_GENERATOR_NAME>", 
    -    sequenceName="<SEQUENCE_GENERATOR_SEQUENCE>")
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 d8c2ff90f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm +++ /dev/null @@ -1,179 +0,0 @@ - - - - - -Many-to-many mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Many-to-many mapping

    -
    -

    Use a Many-to-Many Mapping to define a many-valued association with many-to-many multiplicity. A many-to-many mapping has two sides: the owning side and non-owning side. You must specify the join table on the owning side. For bidirectional mappings, either side may be the owning side.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select Many-to-Many.

      -
    4. -
    5. -

      Use this table to complete the General information fields of the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Map AsDefines this mapping as a Many to Many Mapping. -

      This field corresponds to the @ManyToMany annotation.

      -
      Many to Many
      Target EntityThe entity to which this attribute is mapped.null -

      You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.

      -
      FetchDefines how data is loaded from the database. See "Fetch Type" for details. -
        -
      • -

        Eager

        -
      • -
      • -

        Lazy

        -
      • -
      -
      Lazy
      Mapped ByThe database field that owns the relationship.
      Order BySpecify the default order for objects returned from a query. See "Order By" for details. -
        -
      • -

        No ordering

        -
      • -
      • -

        Primary key

        -
      • -
      • -

        Custom

        -
      • -
      -
      No ordering
      -
      -
    6. -
    7. -

      Use this table to complete the fields in the Join Table Information area in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      NameName of the join table that contains the foreign key column.You must specify the join table on the owning side. -

      By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.

      -
      Join ColumnsSelect Override Default, then Add, Edit, or Remove the join columns.By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.
      Inverse Join ColumnsSelect Override Default, then Add, Edit, or Remove the join columns.By default, the mapping is assumed to have a single join.
      -
      -
    8. -
    9. -

      To add a new Join or Inverse Join Column, click Add.

      -

      To edit an existing Join or Inverse Join Column, select the field to and click Edit.

      -
    10. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@JoinTable(joinColumns=@JoinColumn(name="<JOIN_COLUMN>"), 
    -    name = "<JOIN_TABLE_NAME>")
    -@ManyToMany(cascade=CascadeType.<CASCADE_TYPE>, fetch=FetchType.<FETCH_TYPE>,
    -    targetEntity=<TARGET_ENTITY>, mappedBy = "<MAPPED_BY>")
    -@OrderBy("<ORDER_BY>")
    -
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 71bcf3d3df..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm +++ /dev/null @@ -1,134 +0,0 @@ - - - - - -Many-to-one mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Many-to-one mapping

    -
    -

    Use a Many-to-One mapping to defines a single-valued association to another entity class that has many-to-one multiplicity.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select Many-to-One.

      -
    4. -
    5. -

      Use this table to complete the General information fields JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Target EntityThe entity to which this attribute is mapped.null -

      You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.

      -
      Fetch TypeDefines how data is loaded from the database. See "Fetch Type" for details. -
        -
      • -

        Eager

        -
      • -
      • -

        Lazy

        -
      • -
      -
      Eager
      -
      -
    6. -
    7. -

      Use this table to complete the fields on the Join Columns Information tab in the JPA Details view.

      -
      - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Join ColumnSpecify a mapped column for joining an entity association. This field corresponds to the @JoinColum attribute. -

      Select Override Default, then Add, Edit, or Remove the join columns.

      -
      By default, the mapping is assumed to have a single join.
      -
      -
    8. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@JoinTable(joinColumns=@JoinColumn(name="<JOIN_COLUMN>"), 
    -    name = "<JOIN_TABLE_NAME>")
    -@ManyToOne(targetEntity=<TARGET_ENTITY>, fetch=<FETCH_TYPE>, 
    -    cascade=<CASCADE_TYPE>)
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 61a72af99b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm +++ /dev/null @@ -1,169 +0,0 @@ - - - - - -One-to-many mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    One-to-many mapping

    -
    -

    Use a One-to-Many Mapping to define a relationship with one-to-many multiplicity.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select One-to-many.

      -
    4. -
    5. -

      Use this table to complete the General information fields JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Target EntityThe entity to which this attribute is mapped.
      Fetch TypeDefines how data is loaded from the database. See "Fetch Type" for details. -
        -
      • -

        Eager

        -
      • -
      • -

        Lazy

        -
      • -
      -
      Eager
      Mapped ByThe database field that owns the relationship.
      Order BySpecify the default order for objects returned from a query. See "Order By" for details. -
        -
      • -

        No ordering

        -
      • -
      • -

        Primary key

        -
      • -
      • -

        Custom

        -
      • -
      -
      No ordering
      -
      -
    6. -
    7. -

      Use this table to complete the Join Table Information fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      NameName of the join tableBy default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.
      Join ColumnsSpecify two or more join columns (that is, a primary key).
      Inverse Join ColumnsThe join column on the owned (or inverse) side of the association: the owned entity's primary key column.
      -
      -
    8. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@OneToMany(targetEntity=<TARGET_ENTITY>)
    -@Column(name="<COLUMN>")
    -
    -
    -@OneToMany(targetEntity=<TARGET_ENTITY>.class, cascade=CascadeType.<CASCADE_TYPE>, 
    -    fetch = FetchType.<FETCH_TYPE>, mappedBy = "<MAPPED_BY>")@OrderBy("<ORDER_BY>")
    -@JoinTable(name="<JOIN_TABLE_NAME>", joinColumns=@JoinColumn(name=
    -    "<JOIN_COLUMN_NAME>", referencedColumnName="<JOIN_COLUMN_REFERENCED_COLUMN>"), 
    -    inverseJoinColumns=@JoinColumn(name="<INVERSE_JOIN_COLUMN_NAME>", 
    -    referencedColumnName="<INVERSE_JOIN_COLUMN_REFERENCED_COLUMN>"))
    -
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 99d29fa51c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm +++ /dev/null @@ -1,141 +0,0 @@ - - - - - -One-to-one mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    One-to-one mapping

    -
    -

    Use a One-to-One Mapping to define a relationship with one-to-many multiplicity.

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select One-to-one.

      -
    4. -
    5. -

      Use this table to complete the General information fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Target EntityThe entity to which this attribute is mapped.null -

      You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.

      -
      Fetch TypeDefines how data is loaded from the database. See "Fetch Type" for details. -
        -
      • -

        Eager

        -
      • -
      • -

        Lazy

        -
      • -
      -
      Eager
      Mapped ByThe database field that owns the relationship.
      -
      -
    6. -
    7. -

      Use this table to complete the Join Columns Information fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      Join ColumnSpecify a mapped column for joining an entity association. This field corresponds to the @JoinColum attribute. -

      Select Override Default, then Add, Edit, or Remove the join columns.

      -
      By default, the mapping is assumed to have a single join.
      -
      -
    8. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@OneToOne(targetEntity=<TARGET_ENTITY>, cascade=CascadeType.<CASCADE_TYPE>, 
    -    fetch = FetchType.<FETCH_TYPE>, mappedBy = "<MAPPED_BY>")
    -@JoinColumn(name="<JOIN_COLUMN_NAME>", referencedColumnName=
    -    "<JOIN_COLUMN_REFERENCED_COLUMN>", insertable = <INSERTABLE>, 
    -    updatable = <UPDATABLE>)
    -
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 92643c4ccd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -Transient mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Transient mapping

    -
    -

    Use the Transient Mapping to specify a or field of the entity class that is not persistent.

    -

    To create a version mapping:

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select Transient.

      -
    4. -
    -

    Eclipse adds the following annotation to the field:

    -
    -@Transient
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - 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 3043de54ce..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm +++ /dev/null @@ -1,135 +0,0 @@ - - - - - -Version mapping - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Version mapping

    -
    -

    Use a Version Mapping 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:

    -
      -
    • -

      int

      -
    • -
    • -

      Integer

      -
    • -
    • -

      short, Short

      -
    • -
    • -

      long, Long

      -
    • -
    • -

      Timestamp

      -
    • -
    -

    To create a version mapping:

    -
      -
    1. -

      In the JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.

      -
    2. -
    3. -

      In the Map As field, select Version.

      -
    4. -
    5. -

      Use this table to complete the remaining fields in the JPA Details view.

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyDescriptionDefault
      ColumnThe database column mapped to the entity attribute. See "Column" for details.By default, the Column is assumed to be named identically to the attribute and always included in the INSERT and UPDATE statements.
      TableName of the database table. This must be the primary table associated with the attribute's entity.
      TemporalSpecifies the type of data. See "Temporal" for details. -
        -
      • -

        Date

        -
      • -
      • -

        Time

        -
      • -
      • -

        Timestamp

        -
      • -
      -

      -
      -
    6. -
    -

    Eclipse adds the following annotations to the field:

    -
    -@Version
    -@Column(table="<COLUMN_TABLE>", name="<COLUMN_NAME>")
    -
    -
    -
    -

     

    -Related task
    -
    -Mapping an entity -

     

    -Related reference
    -
    -JPA Structure view
    -JPA Details view (for attributes) -

     

    -Related concept
    -
    -Understanding OR mappings
    -Understanding EJB 3.0 Java Persistence API
    - - - - - - - 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 571448f71f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm +++ /dev/null @@ -1,74 +0,0 @@ - - - - - -Generating entities from tables - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Generating entities from tables

    -
    -

    Use this procedure to generate Java persistent entities from database tables. You must create a JPA project and establish a database connection before generating persistent entities. See "Creating a new JPA project" for more information.

    -
      -
    1. -

      Right-click the JPA project in the Package Explorer and select JPA Tools > Generate Entities.

      -
      -

      Generating Entities

      -Using the JPA Tools > Generate Entities menu option.
      -
    2. -
    3. -

      If you are not currently connected to the database, the Database Connection page appears. Select your database connection and schema, and click Reconnect.

      -

      To create a new database connection, click Add connection.

      -

      After connecting to the database, click Next.

      -
    4. -
    5. -

      On the Generate Entities from Tables dialog dialog, select the tables from which to generate Java persistent entities and click Finish.

      -
    6. -
    -

    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. Figure: Generating Entities from Tables illustrates how Eclipse generates entities from tables.

    -
    -

    Generating Entities from Tables

    -This figure shows the EMPLOYEE and ADDRESS entities generated from database tabels.
    - -

     

    -Related task
    -
    -

     

    -Related reference
    -
    -

     

    -Related concept
    -
    - - - - - - 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 e9cee0e579..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - - -Validating mappings and reporting problems - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Validating mappings and reporting problems

    -
    -

    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.

    -
    -

    Sample Errors and Warnings

    -This figure shows sample error and warning icons in the Explorer view.
    - -

    This section contains information on the following:

    - -

     

    -Related concept
    -

    Problems view

    - - -
    - - 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 060ae2d105..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm +++ /dev/null @@ -1,98 +0,0 @@ - - - - - -Error messages - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Error messages

    -
    -

    This section contains information on error messages (including how to resolve the issue) you may encounter while working with Dali.

    - -

    Attribute "<ATTRIBUTE__NAME>" has invalid mapping type in this context

    -

    The mapped attribute is invalid. Either change the mapping type or change the entity type.

    -

    See "Mapping an entity" for more information.

    - -

    Attribute "<ATTRIBUTE_NAME>" cannot be resolved.

    -

    Dali cannot map the attribute to a database table and column. Verify that you database connection information is correct.

    -

    See "Creating a new JPA project" for more information.

    - -

    Class "<CLASS_NAME>" is not annotated as a persistent class.

    -

    The class has not been identified as a persistent class. Configure the class as an Entity, Mapped Superclass, or Embeddable persistent entity.

    -

    See "Adding persistence to a class".

    - -

    Column "<COLUMN_NAME>" cannot be resolved.

    -

    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.

    -

    Map the field to a valid row in the database table as shown in "Mapping an entity".

    - -

    Duplicate class "<CLASS_NAME>".

    -

    You created to persistence classes with the same name. Each Java class must have a unique name. See "Adding persistence to a class" for more information.

    - -

    Entity does not have an Id or Embedded Id.

    -

    You created a persistent entity without identifying its primary key. A persistent entity must have a primary key field designated with an @Id or @EmbeddedId annotation.

    -

    Add an ID mapping to the entity as shown in "ID mapping" or "Embedded ID mapping".

    - -

    Multiple persistence.xml files in project.

    -

    You created a JPA project with more than one persistence.xml file. Each JPA project must contain a single persistence.xml file.

    -

    See "Managing the persistence.xml file" for more information.

    - -

    No generator named "<GENERATOR_NAME>" is defined in persistence unit.

    -

    You created a persistence entity that uses sequencing, but did not define include the sequence generator in the psersistence.xml file. Synchronize the persistence.xml file with your current project.

    -

    See "Synchronizing classes" for more information.

    - -

    No persistence unit defined.

    -

    There is no <persistence-unit-metadata> information in the orm.xml file. Add the default persistence unit information.

    -

    See "Managing the orm.xml file" for more information.

    - -

    No persistence.xml file in project.

    -

    You created a JPA project without a persistence.xml file. Each JPA project must contain a single persistence.xml file.

    -

    See "Managing the persistence.xml file" for more information.

    - -

    Referenced column "<COLUMN_NAME>" in join column "<COLUMN_NAME>" cannot be resolved.

    -

    The column that you selected to join a relationship mapping does not exist on the database table. Either select a different column on the Join Table Information or create the necessary column on the database table.

    -

    See "JPA Details view (for attributes)" for more information.

    - -

    Schema "<SCHEMA_NAME>" cannot be resolved for table/join table "<TABLE_NAME>".

    -

    Define the default database schema information in the persistence unit.

    -

    See "Managing the orm.xml file" for more information.

    - -

    Table "<TABLE_NAME>" cannot be resolved.

    -

    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.

    -

    Associate the entity with a valid database table as shown in "Adding persistence to a class".

    -Related concept
    -

    Problems view

    -
    - - - - - - 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 3cc8ed877d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -Warning messages - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Warning messages

    -
    -

    This section contains information on warning messages (including how to resolve the issue) you may encounter while working with Dali.

    - -

    Connection "<CONNECTION_NAME>" is not active. No validation will be done against the data source.

    -

    The database connection you specified to use with the JPA project is not active. The JPA project requires an active connection.

    - -

    No connection specified for the project. No data-specific validation will be performed.

    -

    You created a JPA project without specifying a database connection. The JPA project requires an active connection.

    -

    See "Creating a new JPA project" or "Modifying persistent project properties" for information on specifying a database connection.

    -Related concept
    -

    Problems view

    -
    - - - - - - - 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 16bd18b438..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm +++ /dev/null @@ -1,89 +0,0 @@ - - - - - -Modifying persistent project properties - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Modifying persistent project properties

    -
    -

    Each persistent project must be associated with a database connection. To create a new database connection, click Database Connection use the New Connection wizard.

    -

    Use this procedure to modify the vender-specific platform and database connection associated with your JPA project.

    -
      -
    1. -

      Right-click the project in the Explorer view and select Properties. The Properties page appears.

      -
      -

      Properties – Persistence Page

      -This figure shows the JPA options on the Properties dialog.
      -
    2. -
    3. -

      Use this table to complete the remaining fields on the Properties – JPA page and click OK.

      -
      - - - - - - - - - - - - - - - - - -
      PropertyDescription
      PlatformSelect the vendor-specific platform for the JPA implementation.
      Database ConnectionDatabase connection to use to store the persistent entities. To create a new connection, click Add Connection.
      -
      -
    4. -
    -

    To create a new connection, click Add connections.

    -

     

    -Related task
    -
    -Creating a new JPA project -

     

    -Related reference
    -
    -Project Properties page – JPA Options -

     

    -Related concept
    -
    -Understanding Java persistence
    - - - - - - 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 f4175473f6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - - -Tips and tricks - - - - - - - - - - - - - - - -

    - - - - -
    -

    Tips and tricks

    -
    -

    The following tips and tricks give some helpful ideas for increasing your productivity.

    - -
    - - - - - - - - - - - - - - - - - -
    TipDescription
    Database ConnectionsWhen starting a new workbench session, be sure to reconnect to your database (if you are working online). This allows Dali to provide database-related mapping assistance and validation.
    Schema-based persistence.xmlIf you are behind a firewall, you may need to configure your Eclipse workspace proxy in the Preferences dialog (Preferences > Internet > Proxy Settings) to properly validate a schema-based persistence.xml file.
    -
    - - - - - - 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 0dc1abbc1d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 4d4da1ebca..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - - -What's new - - - - - - - - - - - - - - - -

    - - - - -
    -

    What's new

    -
    -

    This section contains descriptions of the following new feature and significant changes made to the Dali OR Mapping Tool for Release 1.0.0:

    - - - - - - 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 65fd8a9b8c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -Generate Persistent Entities from Tables wizard - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Generate Persistent Entities from Tables wizard

    -
    -

    Use the Generate Entities from Tables wizard to quickly create JPA entities from your database tables.

    -
    -

    Generating Entities

    -Selecting the JPA Tools > Generate Entities option.
    - -

    Dali automatically creates the necessary OR mappings, based on your database table constraints.

    -Related concept
    -
    -What's new Related task
    -
    -Generating entities from tables
    - - - - - - 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 4fd22af74e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - - -Create and Manage the persistence.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create and Manage the persistence.xml file

    -
    -

    When creating a JPA project, Dali automatically creates the perssistence.xml file.

    -
    -

    JPA Project with persistence.xml File

    -JPA project with persistence.xml file.
    - -

    Use the XML editor to edit the persistence.xml file.

    -

    After adding your JPA entities, use the Java Persistence > Synchronize Classes option to add the classes to the persistence.xml file.

    -
    -

    Synchronizing the persistence.xml File.

    -The JPA Tools > Synchronize Classes option.
    - -Related concept
    -
    -What's new
    - - - - - - 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 f02aba41d4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm +++ /dev/null @@ -1,56 +0,0 @@ - - - - - -Create and Manage the orm.xml file - - - - - - - - - - - - - - - -

    -
    - - - - -
    -

    Create and Manage the orm.xml file

    -
    -

    When creating a JPA project, you can also create the orm.xml file. Select the Create orm.xml option on the JPA Facet page page of the Create New JPA Project wizard.

    -
    -

    JPA Facet Dialog

    -JPA Facet dialog.
    - -

    Use the orm.xml file to define the project and persistence unit defaults.

    -
    -

    JPA Details view for orm.xml file.

    -JPA Details view for orm.xml file.
    - -Related concept
    -
    -What's new
    - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.gen/.classpath b/jpa/plugins/org.eclipse.jpt.gen/.classpath deleted file mode 100644 index 304e86186a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore b/jpa/plugins/org.eclipse.jpt.gen/.cvsignore deleted file mode 100644 index 2d14989f69..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -@dot -build.xml diff --git a/jpa/plugins/org.eclipse.jpt.gen/.project b/jpa/plugins/org.eclipse.jpt.gen/.project deleted file mode 100644 index ef2d5088ee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.gen - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 7e690b4d88..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:10:55 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 3e1d50ad46..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:28:54 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF deleted file mode 100644 index 0162a7c023..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/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.gen -Bundle-Version: 1.0.0.qualifier -Bundle-ClassPath: . -Bundle-Localization: plugin -Export-Package: org.eclipse.jpt.gen.internal; x-friends:="org.eclipse.jpt.ui" -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.jdt.core, - org.eclipse.jpt.core, - org.eclipse.jpt.db, - org.eclipse.jpt.utility -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/jpa/plugins/org.eclipse.jpt.gen/about.html b/jpa/plugins/org.eclipse.jpt.gen/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/plugins/org.eclipse.jpt.gen/build.properties b/jpa/plugins/org.eclipse.jpt.gen/build.properties deleted file mode 100644 index 41837ebdd1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/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.gen/component.xml b/jpa/plugins/org.eclipse.jpt.gen/component.xml deleted file mode 100644 index 7a4e04e21f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/component.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties b/jpa/plugins/org.eclipse.jpt.gen/plugin.properties deleted file mode 100644 index 4875a8b174..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence API Tools - Entity Gen -providerName = Eclipse.org diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java deleted file mode 100644 index 70d07a59e2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java +++ /dev/null @@ -1,1437 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -import java.io.PrintWriter; -import java.io.Serializable; -import java.io.StringWriter; -import java.lang.reflect.Modifier; -import java.text.Collator; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.core.IJavaModelStatusConstants; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.ForeignKey; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.IndentingPrintWriter; -import org.eclipse.jpt.utility.internal.JavaType; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -// TODO handle table names that are illegal class names -// TODO handle table names that are illegal file names -// TODO handle column names that are illegal field/method names -// TODO format code per preferences -// TODO organize imports per preferences -// TODO prompt user to overwrite existing classes -/** - * This generator will generate an entity for a table. - */ -public class EntityGenerator { - final Config config; - private final IPackageFragment packageFragment; - private final GenTable genTable; - private final String entityClassName; - private final OverwriteConfirmer overwriteConfirmer; - private final IProgressMonitor monitor; - - - // ********** public API ********** - - public static void generateEntity(Config config, IPackageFragment packageFragment, GenTable genTable, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) { - if ((config == null) || (packageFragment == null) || (genTable == null)) { - throw new NullPointerException(); - } - new EntityGenerator(config, packageFragment, genTable, overwriteConfirmer, monitor).generateEntity(); - } - - - // ********** constructor/initialization ********** - - private EntityGenerator(Config config, IPackageFragment packageFragment, GenTable genTable, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) { - super(); - this.config = config; - this.packageFragment = packageFragment; - this.genTable = genTable; - this.entityClassName = this.fullyQualify(this.entityName()); - this.overwriteConfirmer = overwriteConfirmer; - this.monitor = monitor; - } - - - // ********** code gen ********** - - private void generateEntity() { - try { - this.generateEntity_(); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private void generateEntity_() throws JavaModelException { - String fileName = this.entityName() + ".java"; - String source = this.buildSource(); - try { - this.packageFragment.createCompilationUnit(fileName, source, false, this.monitor); - } catch (JavaModelException ex) { - if (ex.getJavaModelStatus().getCode() == IJavaModelStatusConstants.NAME_COLLISION) { - if (this.overwriteConfirmer.overwrite(this.entityClassName)) { - this.packageFragment.createCompilationUnit(fileName, source, true, this.monitor); - } - } else { - throw ex; - } - } - } - - /** - * build the "body" source first; then build the "package" and "imports" source - * and concatenate the "body" source to it - */ - private String buildSource() { - // build the body source first so we can gather up the import statements - BodySource bodySource = this.buildBodySource(); - - StringWriter sw = new StringWriter(bodySource.length() + 1000); - PrintWriter pw = new PrintWriter(sw); - this.printPackageAndImportsOn(pw, bodySource); - pw.print(bodySource.source()); - return sw.toString(); - } - - private BodySource buildBodySource() { - EntitySourceWriter pw = new EntitySourceWriter(this.packageName(), this.entityClassName); - this.printBodySourceOn(pw); - return pw; - } - - private void printBodySourceOn(EntitySourceWriter pw) { - this.printClassDeclarationOn(pw); - - pw.indent(); - this.printEntityPrimaryKeyFieldsOn(pw); - this.printEntityNonPrimaryKeyBasicFieldsOn(pw); - this.printEntityManyToOneFieldsOn(pw); - this.printEntityOneToManyFieldsOn(pw); - this.printEntityOwnedManyToManyFieldsOn(pw); - this.printEntityNonOwnedManyToManyFieldsOn(pw); - this.printSerialVersionUID(pw); - pw.println(); - - this.printZeroArgumentConstructorOn(this.entityName(), this.config.methodVisibility(), pw); - if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) { - this.printEntityPrimaryKeyGettersAndSettersOn(pw); - this.printEntityNonPrimaryKeyBasicGettersAndSettersOn(pw); - this.printEntityManyToOneGettersAndSettersOn(pw); - this.printEntityOneToManyGettersAndSettersOn(pw); - this.printEntityOwnedManyToManyGettersAndSettersOn(pw); - this.printEntityNonOwnedManyToManyGettersAndSettersOn(pw); - } - - this.printPrimaryKeyClassOn(pw); - pw.undent(); - - pw.print('}'); - pw.println(); - } - - private void printClassDeclarationOn(EntitySourceWriter pw) { - this.printEntityAnnotationOn(pw); - this.printTableAnnotationOn(pw); - this.printIdClassAnnotationOn(pw); - - pw.print("public class "); - pw.printTypeDeclaration(this.entityClassName); - if (config.serializable()) { - pw.print(" implements "); - pw.printTypeDeclaration(Serializable.class.getName()); - } - pw.print(" {"); - pw.println(); - } - - private void printEntityAnnotationOn(EntitySourceWriter pw) { - pw.printAnnotation(JPA.ENTITY); - pw.println(); - } - - private void printTableAnnotationOn(EntitySourceWriter pw) { - if ( ! this.table().matchesShortJavaClassName(this.entityName())) { - pw.printAnnotation(JPA.TABLE); - pw.print("(name=\""); - pw.print(this.table().getName()); - pw.print("\")"); - pw.println(); - } - } - - private void printIdClassAnnotationOn(EntitySourceWriter pw) { - if ((this.table().primaryKeyColumnsSize() > 1) && this.config.generateIdClassForCompoundPK()) { - pw.printAnnotation(JPA.ID_CLASS); - pw.print('('); - pw.printTypeDeclaration(this.entityClassName + ".PK"); - pw.print(".class)"); - pw.println(); - } - } - - private void printEntityPrimaryKeyFieldsOn(EntitySourceWriter pw) { - if ((this.table().primaryKeyColumnsSize() > 1) && this.config.generateEmbeddedIdForCompoundPK()) { - this.printEntityEmbeddedIdPrimaryKeyFieldOn(pw); - } else { - this.printEntityReadOnlyPrimaryKeyFieldsOn(pw); - this.printEntityWritablePrimaryKeyFieldsOn(pw); - } - } - - private void printEntityEmbeddedIdPrimaryKeyFieldOn(EntitySourceWriter pw) { - if (this.config.fieldAccessType()) { - pw.printAnnotation(JPA.EMBEDDED_ID); - pw.println(); - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(this.entityClassName + ".PK"); - pw.print(' '); - pw.print(this.genTable.fieldNameForEmbeddedId()); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printEntityReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.readOnlyPrimaryKeyColumns(); stream.hasNext(); ) { - this.printEntityReadOnlyPrimaryKeyFieldOn(stream.next(), pw); - } - } - - private void printEntityReadOnlyPrimaryKeyFieldOn(Column column, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(column); - if (this.config.fieldAccessType()) { - pw.printAnnotation(JPA.ID); - pw.println(); - if (column.matchesJavaFieldName(fieldName)) { - this.printReadOnlyColumnAnnotationOn(pw); // no Column name needed - } else { - this.printReadOnlyColumnAnnotationOn(column.getName(), pw); - } - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(column.javaTypeDeclaration()); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printReadOnlyColumnAnnotationOn(String columnName, EntitySourceWriter pw) { - pw.printAnnotation(JPA.COLUMN); - pw.print("(name=\""); - pw.print(columnName); - pw.print("\", insertable=false, updatable=false)"); - pw.println(); - } - - private void printReadOnlyColumnAnnotationOn(EntitySourceWriter pw) { - pw.printAnnotation(JPA.COLUMN); - pw.print("(insertable=false, updatable=false)"); - pw.println(); - } - - private void printEntityWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.writablePrimaryKeyColumns(); stream.hasNext(); ) { - this.printEntityWritablePrimaryKeyFieldOn(stream.next(), pw); - } - } - - private void printEntityWritablePrimaryKeyFieldOn(Column column, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(column); - if (this.config.fieldAccessType()) { - pw.printAnnotation(JPA.ID); - pw.println(); - if ( ! column.matchesJavaFieldName(fieldName)) { - this.printColumnAnnotationOn(column.getName(), pw); - } - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(column.javaTypeDeclaration()); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printEntityNonPrimaryKeyBasicFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) { - this.printEntityNonPrimaryKeyBasicFieldOn(stream.next(), pw); - } - } - - private void printEntityNonPrimaryKeyBasicFieldOn(Column column, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(column); - if (this.config.fieldAccessType()) { - if ( ! column.matchesJavaFieldName(fieldName)) { - this.printColumnAnnotationOn(column.getName(), pw); - } - } - if (column.isLob()) { - pw.printAnnotation(JPA.LOB); - pw.println(); - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(column.javaTypeDeclaration()); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printColumnAnnotationOn(String columnName, EntitySourceWriter pw) { - pw.printAnnotation(JPA.COLUMN); - pw.print("(name=\""); - pw.print(columnName); - pw.print("\")"); - pw.println(); - } - - private void printEntityManyToOneFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) { - this.printEntityManyToOneFieldOn(stream.next(), pw); - } - } - - private void printEntityManyToOneFieldOn(ManyToOneRelation relation, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(relation); - if (this.config.fieldAccessType()) { - this.printManyToOneAnnotationOn(fieldName, relation, pw); - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(this.fullyQualify(relation.referencedEntityName())); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printManyToOneAnnotationOn(String fieldName, ManyToOneRelation relation, EntitySourceWriter pw) { - pw.printAnnotation(JPA.MANY_TO_ONE); - pw.println(); - ForeignKey fk = relation.getForeignKey(); - if (fk.matchesJavaFieldName(fieldName)) { - return; // no JoinColumn annotation needed - } - if (fk.referencesSingleColumnPrimaryKey()) { - pw.printAnnotation(JPA.JOIN_COLUMN); - pw.print("(name=\""); - pw.print(fk.columnPairs().next().getBaseColumn().getName()); - pw.print("\")"); - } else { - if (fk.columnPairsSize() > 1) { - pw.printAnnotation(JPA.JOIN_COLUMNS); - pw.print("({"); - pw.println(); - pw.indent(); - } - this.printJoinColumnAnnotationsOn(fk, pw); - if (fk.columnPairsSize() > 1) { - pw.undent(); - pw.println(); - pw.print("})"); - } - } - pw.println(); - } - - private void printJoinColumnAnnotationsOn(ForeignKey foreignKey, EntitySourceWriter pw) { - for (Iterator stream = foreignKey.columnPairs(); stream.hasNext(); ) { - this.printJoinColumnAnnotationOn(stream.next(), pw); - if (stream.hasNext()) { - pw.println(','); - } - } - } - - private void printJoinColumnAnnotationOn(ForeignKey.ColumnPair columnPair, EntitySourceWriter pw) { - this.printJoinColumnAnnotationOn(columnPair.getBaseColumn().getName(), columnPair.getReferencedColumn().getName(), pw); - } - - /** - * assume that at least one of the two names is not null - */ - private void printJoinColumnAnnotationOn(String baseColumnName, String referencedColumnName, EntitySourceWriter pw) { - pw.printAnnotation(JPA.JOIN_COLUMN); - pw.print('('); - if (baseColumnName != null) { - pw.print("name=\""); - pw.print(baseColumnName); - } - if (referencedColumnName != null) { - if (baseColumnName != null) { - pw.print("\", "); - } - pw.print("referencedColumnName=\""); - pw.print(referencedColumnName); - } - pw.print("\")"); - } - - private void printEntityOneToManyFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) { - this.printEntityOneToManyFieldOn(stream.next(), pw); - } - } - - private void printEntityOneToManyFieldOn(OneToManyRelation relation, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(relation); - if (this.config.fieldAccessType()) { - this.printOneToManyAnnotationOn(fieldName, relation, pw); - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(this.config.getCollectionTypeName()); - pw.print('<'); - pw.printTypeDeclaration(this.fullyQualify(relation.referencedEntityName())); - pw.print('>'); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printOneToManyAnnotationOn(String fieldName, OneToManyRelation relation, EntitySourceWriter pw) { - pw.printAnnotation(JPA.ONE_TO_MANY); - pw.print("(mappedBy=\""); - pw.print(relation.mappedBy()); - pw.print("\")"); - pw.println(); - } - - private void printEntityOwnedManyToManyFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) { - this.printEntityOwnedManyToManyFieldOn(stream.next(), pw); - } - } - - private void printEntityOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(relation); - if (this.config.fieldAccessType()) { - this.printOwnedManyToManyAnnotationOn(fieldName, relation, pw); - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(this.config.getCollectionTypeName()); - pw.print('<'); - pw.printTypeDeclaration(this.fullyQualify(relation.nonOwningEntityName())); - pw.print('>'); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - /** - * I guess you could build a state machine for all this crap, - * but that seems like overkill... - */ - private void printOwnedManyToManyAnnotationOn(String fieldName, ManyToManyRelation relation, EntitySourceWriter pw) { - pw.printAnnotation(JPA.MANY_TO_MANY); - pw.println(); - boolean first = true; - boolean comma = false; - if ( ! relation.joinTableNameIsDefault()) { - if (first) { - first = false; - pw.printAnnotation(JPA.JOIN_TABLE); - pw.print('('); - } - pw.print("name=\""); - pw.print(relation.getJoinTable().name()); - pw.print('\"'); - comma = true; - } - if ( ! relation.joinColumnsIsDefaultFor(fieldName)) { - if (first) { - first = false; - pw.printAnnotation(JPA.JOIN_TABLE); - pw.print('('); - } else if (comma) { - pw.print(','); - } - pw.println(); - pw.indent(); - this.printJoinTableJoinColumnsOn("joinColumns", fieldName, relation.getOwningForeignKey(), pw); - pw.undent(); - comma = true; - } - String inverseFieldName = relation.getNonOwningTable().fieldNameFor(relation); - if ( ! relation.inverseJoinColumnsIsDefaultFor(inverseFieldName)) { - if (first) { - first = false; - pw.printAnnotation(JPA.JOIN_TABLE); - pw.print('('); - } else if (comma) { - pw.print(','); - } - pw.println(); - pw.indent(); - this.printJoinTableJoinColumnsOn("inverseJoinColumns", inverseFieldName, relation.getNonOwningForeignKey(), pw); - pw.undent(); - comma = true; - } - if ( ! first) { - pw.print(')'); - } - pw.println(); - } - - private void printJoinTableJoinColumnsOn(String elementName, String fieldName, ForeignKey foreignKey, EntitySourceWriter pw) { - if (foreignKey.columnPairsSize() != 1) { - this.printJoinTableJoinColumnsOn(elementName, foreignKey, pw); - } else if (foreignKey.getReferencedTable().primaryKeyColumnsSize() != 1) { - // if the referenced table has a composite primary key, neither of the columns can be a default - // since both of the defaults require a single-column primary key - this.printJoinTableJoinColumnsOn(elementName, foreignKey, pw); - } else { - ForeignKey.ColumnPair columnPair = foreignKey.columnPairs().next(); - Column pkColumn = foreignKey.getReferencedTable().primaryKeyColumns().next(); - if (columnPair.getBaseColumn().matchesJavaFieldName(fieldName + "_" + pkColumn.getName())) { - if (columnPair.getReferencedColumn() == pkColumn) { - // we shouldn't get here... - } else { - pw.print(elementName); - pw.print('='); - this.printJoinColumnAnnotationOn(null, columnPair.getReferencedColumn().getName(), pw); - } - } else { - if (columnPair.getReferencedColumn() == pkColumn) { - pw.print(elementName); - pw.print('='); - this.printJoinColumnAnnotationOn(columnPair.getBaseColumn().getName(), null, pw); - } else { - this.printJoinTableJoinColumnsOn(elementName, foreignKey, pw); - } - } - } - } - - private void printJoinTableJoinColumnsOn(String elementName, ForeignKey foreignKey, EntitySourceWriter pw) { - pw.print(elementName); - pw.print('='); - if (foreignKey.columnPairsSize() > 1) { - pw.print('{'); - pw.println(); - pw.indent(); - } - this.printJoinColumnAnnotationsOn(foreignKey, pw); - if (foreignKey.columnPairsSize() > 1) { - pw.undent(); - pw.println(); - pw.print('}'); - pw.println(); - } - } - - private void printEntityNonOwnedManyToManyFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) { - this.printEntityNonOwnedManyToManyFieldOn(stream.next(), pw); - } - } - - private void printEntityNonOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(relation); - if (this.config.fieldAccessType()) { - this.printNonOwnedManyToManyAnnotationOn(fieldName, relation, pw); - } - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(this.config.getCollectionTypeName()); - pw.print('<'); - pw.printTypeDeclaration(this.fullyQualify(relation.owningEntityName())); - pw.print('>'); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - pw.println(); - } - - private void printNonOwnedManyToManyAnnotationOn(String fieldName, ManyToManyRelation relation, EntitySourceWriter pw) { - pw.printAnnotation(JPA.MANY_TO_MANY); - pw.print("(mappedBy=\""); - pw.print(relation.getMappedBy()); - pw.print("\")"); - pw.println(); - } - - private String fullyQualify(String shortClassName) { - String pkg = this.packageName(); - return (pkg.length() == 0) ? shortClassName : pkg + '.' + shortClassName; - } - - private void printSerialVersionUID(EntitySourceWriter pw) { - if (this.config.generateSerialVersionUID()) { - pw.print("private static final long serialVersionUID = 1L;"); - pw.println(); - } - } - - private void printZeroArgumentConstructorOn(String ctorName, String visibility, EntitySourceWriter pw) { - if (this.config.generateDefaultConstructor()) { - pw.printVisibility(visibility); - pw.print(ctorName); - pw.print("() {"); - pw.println(); - pw.indent(); - pw.println("super();"); - pw.undent(); - pw.print('}'); - pw.println(); - pw.println(); - } - } - - private void printEntityPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) { - if ((this.table().primaryKeyColumnsSize() > 1) && this.config.generateEmbeddedIdForCompoundPK()) { - this.printEntityEmbeddedIdPrimaryKeyGetterAndSetterOn(pw); - } else { - this.printEntityReadOnlyPrimaryKeyGettersAndSettersOn(pw); - this.printEntityWritablePrimaryKeyGettersAndSettersOn(pw); - } - } - - private void printEntityEmbeddedIdPrimaryKeyGetterAndSetterOn(EntitySourceWriter pw) { - if (this.config.propertyAccessType()) { - pw.printAnnotation(JPA.EMBEDDED_ID); - pw.println(); - } - pw.printGetterAndSetter(this.genTable.fieldNameForEmbeddedId(), this.entityClassName + ".PK", this.config.methodVisibility()); - } - - private void printEntityReadOnlyPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.readOnlyPrimaryKeyColumns(); stream.hasNext(); ) { - this.printEntityReadOnlyPrimaryKeyGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityReadOnlyPrimaryKeyGetterAndSetterOn(Column column, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(column); - if (this.config.propertyAccessType()) { - pw.printAnnotation(JPA.ID); - pw.println(); - if (column.matchesJavaFieldName(propertyName)) { - this.printReadOnlyColumnAnnotationOn(pw); // no Column name needed - } else { - this.printReadOnlyColumnAnnotationOn(column.getName(), pw); - } - } - - pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility()); - } - - private void printEntityWritablePrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.writablePrimaryKeyColumns(); stream.hasNext(); ) { - this.printEntityWritablePrimaryKeyGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityWritablePrimaryKeyGetterAndSetterOn(Column column, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(column); - if (this.config.propertyAccessType()) { - pw.printAnnotation(JPA.ID); - pw.println(); - if ( ! column.matchesJavaFieldName(propertyName)) { - this.printColumnAnnotationOn(column.getName(), pw); - } - } - - pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility()); - } - - private void printEntityNonPrimaryKeyBasicGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) { - this.printEntityNonPrimaryKeyBasicGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityNonPrimaryKeyBasicGetterAndSetterOn(Column column, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(column); - if (this.config.propertyAccessType()) { - if ( ! column.matchesJavaFieldName(propertyName)) { - this.printColumnAnnotationOn(column.getName(), pw); - } - } - - pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility()); - } - - private void printEntityManyToOneGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) { - this.printEntityManyToOneGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityManyToOneGetterAndSetterOn(ManyToOneRelation relation, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(relation); - if (this.config.propertyAccessType()) { - this.printManyToOneAnnotationOn(propertyName, relation, pw); - } - - String typeDeclaration = this.fullyQualify(relation.referencedEntityName()); - pw.printGetterAndSetter(propertyName, typeDeclaration, this.config.methodVisibility()); - } - - private void printEntityOneToManyGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) { - this.printEntityOneToManyGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityOneToManyGetterAndSetterOn(OneToManyRelation relation, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(relation); - if (this.config.propertyAccessType()) { - this.printOneToManyAnnotationOn(propertyName, relation, pw); - } - - String elementTypeDeclaration = this.fullyQualify(relation.referencedEntityName()); - pw.printCollectionGetterAndSetter(propertyName, this.config.getCollectionTypeName(), elementTypeDeclaration, this.config.methodVisibility()); - } - - private void printEntityOwnedManyToManyGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) { - this.printEntityOwnedManyToManyGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityOwnedManyToManyGetterAndSetterOn(ManyToManyRelation relation, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(relation); - if (this.config.propertyAccessType()) { - this.printOwnedManyToManyAnnotationOn(propertyName, relation, pw); - } - - String elementTypeDeclaration = this.fullyQualify(relation.nonOwningEntityName()); - pw.printCollectionGetterAndSetter(propertyName, this.config.getCollectionTypeName(), elementTypeDeclaration, this.config.methodVisibility()); - } - - private void printEntityNonOwnedManyToManyGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) { - this.printEntityNonOwnedManyToManyGetterAndSetterOn(stream.next(), pw); - } - } - - private void printEntityNonOwnedManyToManyGetterAndSetterOn(ManyToManyRelation relation, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(relation); - if (this.config.propertyAccessType()) { - this.printNonOwnedManyToManyAnnotationOn(propertyName, relation, pw); - } - - String elementTypeDeclaration = this.fullyQualify(relation.owningEntityName()); - pw.printCollectionGetterAndSetter(propertyName, this.config.getCollectionTypeName(), elementTypeDeclaration, this.config.methodVisibility()); - } - - private void printPrimaryKeyClassOn(EntitySourceWriter pw) { - if (this.table().primaryKeyColumnsSize() <= 1) { - return; - } - pw.println(); - if (this.config.generateEmbeddedIdForCompoundPK()) { - pw.printAnnotation(JPA.EMBEDDABLE); - pw.println(); - } - pw.print("public static class PK implements "); - pw.printTypeDeclaration(Serializable.class.getName()); - pw.print(" {"); - pw.println(); - - pw.indent(); - this.printIdFieldsOn(pw); - this.printSerialVersionUID(pw); - pw.println(); - this.printZeroArgumentConstructorOn("PK", "public", pw); - - if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) { - this.printIdGettersAndSettersOn(pw); - } - - this.printEqualsMethodOn("PK", this.table().primaryKeyColumns(), pw); - this.printHashCodeMethodOn(this.table().primaryKeyColumns(), pw); - pw.undent(); - - pw.print('}'); - pw.println(); - pw.println(); - } - - private void printIdFieldsOn(EntitySourceWriter pw) { - for (Iterator stream = this.table().primaryKeyColumns(); stream.hasNext(); ) { - this.printIdFieldOn(stream.next(), pw); - } - } - - private void printIdFieldOn(Column column, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(column); - pw.printVisibility(this.config.fieldVisibility()); - pw.printTypeDeclaration(column.javaTypeDeclaration()); - pw.print(' '); - pw.print(fieldName); - pw.print(';'); - pw.println(); - } - - private void printIdGettersAndSettersOn(EntitySourceWriter pw) { - for (Iterator stream = this.table().primaryKeyColumns(); stream.hasNext(); ) { - this.printIdGetterAndSetterOn(stream.next(), pw); - } - } - - private void printIdGetterAndSetterOn(Column column, EntitySourceWriter pw) { - String propertyName = this.genTable.fieldNameFor(column); - pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility()); - } - - private void printEqualsMethodOn(String className, Iterator columns, EntitySourceWriter pw) { - pw.printAnnotation("java.lang.Override"); - pw.println(); - - pw.println("public boolean equals(Object o) {"); - pw.indent(); - pw.println("if (o == this) {"); - pw.indent(); - pw.println("return true;"); - pw.undent(); - pw.print('}'); - pw.println(); - - pw.print("if ( ! (o instanceof "); - pw.print(className); - pw.print(")) {"); - pw.println(); - pw.indent(); - pw.println("return false;"); - pw.undent(); - pw.print('}'); - pw.println(); - - pw.print(className); - pw.print(" other = ("); - pw.print(className); - pw.print(") o;"); - pw.println(); - - pw.print("return "); - pw.indent(); - while (columns.hasNext()) { - this.printEqualsClauseOn(columns.next(), pw); - if (columns.hasNext()) { - pw.println(); - pw.print("&& "); - } - } - pw.print(';'); - pw.println(); - pw.undent(); - pw.undent(); - pw.print('}'); - pw.println(); - pw.println(); - } - - private void printEqualsClauseOn(Column column, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(column); - JavaType javaType = column.javaType(); - if (javaType.isPrimitive()) { - this.printPrimitiveEqualsClauseOn(fieldName, pw); - } else { - this.printReferenceEqualsClauseOn(fieldName, pw); - } - } - - private void printPrimitiveEqualsClauseOn(String fieldName, EntitySourceWriter pw) { - pw.print("(this."); - pw.print(fieldName); - pw.print(" == other."); - pw.print(fieldName); - pw.print(')'); - } - - private void printReferenceEqualsClauseOn(String fieldName, EntitySourceWriter pw) { - pw.print("this."); - pw.print(fieldName); - pw.print(".equals(other."); - pw.print(fieldName); - pw.print(')'); - } - - private void printHashCodeMethodOn(Iterator columns, EntitySourceWriter pw) { - pw.printAnnotation("java.lang.Override"); - pw.println(); - - pw.println("public int hashCode() {"); - pw.indent(); - pw.print("return "); - pw.indent(); - while (columns.hasNext()) { - this.printHashCodeClauseOn(columns.next(), pw); - if (columns.hasNext()) { - pw.println(); - pw.print("^ "); - } - } - pw.print(';'); - pw.println(); - pw.undent(); - pw.undent(); - pw.print('}'); - pw.println(); - pw.println(); - } - - private void printHashCodeClauseOn(Column column, EntitySourceWriter pw) { - String fieldName = this.genTable.fieldNameFor(column); - JavaType javaType = column.javaType(); - if (javaType.isPrimitive()) { - this.printPrimitiveHashCodeClauseOn(javaType.getElementTypeName(), fieldName, pw); - } else { - this.printReferenceHashCodeClauseOn(fieldName, pw); - } - } - - private void printPrimitiveHashCodeClauseOn(String primitiveName, String fieldName, EntitySourceWriter pw) { - if (primitiveName.equals("int") || primitiveName.equals("short") || primitiveName.equals("byte") || primitiveName.equals("char")) { - pw.print("this."); - pw.print(fieldName); - } else if (primitiveName.equals("long")) { // cribbed from Long#hashCode() - // ((int) (this.value ^ (this.value >>> 32))) - pw.print("((int) (this."); - pw.print(fieldName); - pw.print(" ^ (this."); - pw.print(fieldName); - pw.print(" >>> 32)))"); - } else if (primitiveName.equals("double")) { // cribbed from Double#hashCode() - // ((int) (java.lang.Double.doubleToLongBits(this.value) ^ (java.lang.Double.doubleToLongBits(this.value) >>> 32))) - pw.print("((int) ("); - pw.printTypeDeclaration("java.lang.Double"); - pw.print(".doubleToLongBits(this."); - pw.print(fieldName); - pw.print(") ^ ("); - pw.printTypeDeclaration("java.lang.Double"); - pw.print(".doubleToLongBits(this."); - pw.print(fieldName); - pw.print(") >>> 32)))"); - } else if (primitiveName.equals("float")) { // cribbed from Float#hashCode() - // java.lang.Float.floatToIntBits(this.value) - pw.printTypeDeclaration("java.lang.Float"); - pw.print(".floatToIntBits(this."); - pw.print(fieldName); - pw.print(')'); - } else if (primitiveName.equals("boolean")) { // cribbed from Boolean#hashCode() - // (this.value ? 1231 : 1237) - pw.print("(this."); - pw.print(fieldName); - pw.print(" ? 1231 : 1237)"); - } else { - throw new IllegalArgumentException(primitiveName); - } - } - - private void printReferenceHashCodeClauseOn(String fieldName, EntitySourceWriter pw) { - pw.print("this."); - pw.print(fieldName); - pw.print(".hashCode()"); - } - - private void printPackageAndImportsOn(PrintWriter pw, BodySource bodySource) { - if (this.packageName().length() != 0) { - pw.print("package "); - pw.print(this.packageName()); - pw.print(';'); - pw.println(); - pw.println(); - } - - for (Iterator> stream = bodySource.importEntries(); stream.hasNext(); ) { - Map.Entry entry = stream.next(); - pw.print("import "); - pw.print(entry.getValue()); // package - pw.print('.'); - pw.print(entry.getKey()); // short class name - pw.print(';'); - pw.println(); - } - pw.println(); - } - - - // ********** convenience methods ********** - - private String packageName() { - return this.packageFragment.getElementName(); - } - - private Table table() { - return this.genTable.getTable(); - } - - private String entityName() { - return this.genTable.getEntityName(); - } - - - // ********** writer ********** - - private interface BodySource { - - /** - * return a sorted set of map entries; the key is the short class name, - * the value is the package name - */ - Iterator> importEntries(); - - /** - * return the body source code - */ - String source(); - - /** - * return the length of the body source code - */ - int length(); - - } - - /** - * Extend IndentingPrintWriter with some methods that facilitate building - * entity source code. - */ - private static class EntitySourceWriter extends IndentingPrintWriter implements BodySource { - final String packageName; - final String entityClassName; - // key = short class name; value = package name - private final Map imports = new HashMap(); - - EntitySourceWriter(String packageName, String entityClassName) { - super(new StringWriter(20000)); - this.packageName = packageName; - this.entityClassName = entityClassName; - } - - void printVisibility(String visibilityModifier) { - if (visibilityModifier.length() != 0) { - this.print(visibilityModifier); - this.print(' '); - } - } - - void printAnnotation(String annotationName) { - this.print('@'); - this.printTypeDeclaration(annotationName); - } - - void printTypeDeclaration(String typeDeclaration) { - this.print(this.importedTypeDeclaration(typeDeclaration)); - } - - /** - * Return the specified class's "imported" name. - * The class declaration must be of the form: - * "int" - * "int[]" (not "[I") - * "java.lang.Object" - * "java.lang.Object[]" (not "[Ljava.lang.Object;") - * "java.util.Map.Entry" (not "java.util.Map$Entry") - * "java.util.Map.Entry[][]" (not "[[Ljava.util.Map$Entry;") - */ - private String importedTypeDeclaration(String typeDeclaration) { - if (this.typeDeclarationIsMemberClass(typeDeclaration)) { - // no need for an import, just return the partially-qualified name - return this.memberClassTypeDeclaration(typeDeclaration); - } - int last = typeDeclaration.lastIndexOf('.'); - String pkg = (last == -1) ? "" : typeDeclaration.substring(0, last); - String shortTypeDeclaration = typeDeclaration.substring(last + 1); - String shortElementTypeName = shortTypeDeclaration; - while (shortElementTypeName.endsWith("[]")) { - shortElementTypeName = shortElementTypeName.substring(0, shortElementTypeName.length() - 2); - } - String prev = this.imports.get(shortElementTypeName); - if (prev == null) { - // this is the first class with this short element type name - this.imports.put(shortElementTypeName, pkg); - return shortTypeDeclaration; - } - if (prev.equals(pkg)) { - // this element type has already been imported - return shortTypeDeclaration; - } - // another class with the same short element type name has been - // previously imported, so this one must be used fully-qualified - return typeDeclaration; - } - - /** - * e.g. "foo.bar.Employee.PK" will return true - */ - private boolean typeDeclarationIsMemberClass(String typeDeclaration) { - return (typeDeclaration.length() > this.entityClassName.length()) - && typeDeclaration.startsWith(this.entityClassName) - && (typeDeclaration.charAt(this.entityClassName.length()) == '.'); - } - - /** - * e.g. "foo.bar.Employee.PK" will return "Employee.PK" - * this prevents collisions with other imported classes (e.g. "joo.jar.PK") - */ - private String memberClassTypeDeclaration(String typeDeclaration) { - int index = this.packageName.length(); - if (index != 0) { - index++; // bump past the '.' - } - return typeDeclaration.substring(index); - } - - public Iterator> importEntries() { - return new FilteringIterator>(this.sortedImportEntries()) { - @Override - @SuppressWarnings("unchecked") - protected boolean accept(Object next) { - String pkg = ((Map.Entry) next).getValue(); - if (pkg.equals("") - || pkg.equals("java.lang") - || pkg.equals(EntitySourceWriter.this.packageName)) { - return false; - } - return true; - } - }; - } - - private Iterator> sortedImportEntries() { - TreeSet> sortedImports = new TreeSet>(this.buildImportEntriesComparator()); - sortedImports.addAll(this.imports.entrySet()); - return sortedImports.iterator(); - } - - private Comparator> buildImportEntriesComparator() { - return new Comparator>() { - public int compare(Map.Entry e1, Map.Entry e2) { - Collator collator = Collator.getInstance(); - int pkg = collator.compare(e1.getValue(), e2.getValue()); - return (pkg == 0) ? collator.compare(e1.getKey(), e2.getKey()) : pkg; - } - }; - } - - void printGetterAndSetter(String propertyName, String typeDeclaration, String visibility) { - this.printGetter(propertyName, typeDeclaration, visibility); - this.println(); - this.println(); - - this.printSetter(propertyName, typeDeclaration, visibility); - this.println(); - this.println(); - } - - private void printGetter(String propertyName, String typeDeclaration, String visibility) { - this.printVisibility(visibility); - this.printTypeDeclaration(typeDeclaration); - this.print(' '); - this.print(typeDeclaration.equals("boolean") ? "is" : "get"); - this.print(StringTools.capitalize(propertyName)); - this.print("() {"); - this.println(); - - this.indent(); - this.print("return this."); - this.print(propertyName); - this.print(';'); - this.println(); - this.undent(); - - this.print('}'); - } - - private void printSetter(String propertyName, String typeDeclaration, String visibility) { - this.printVisibility(visibility); - this.print("void set"); - this.print(StringTools.capitalize(propertyName)); - this.print('('); - this.printTypeDeclaration(typeDeclaration); - this.print(' '); - this.print(propertyName); - this.print(") {"); - this.println(); - - this.indent(); - this.print("this."); - this.print(propertyName); - this.print(" = "); - this.print(propertyName); - this.print(';'); - this.println(); - this.undent(); - - this.print('}'); - } - - void printCollectionGetterAndSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) { - this.printCollectionGetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility); - this.println(); - this.println(); - - this.printCollectionSetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility); - this.println(); - this.println(); - } - - private void printCollectionGetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) { - this.printVisibility(visibility); - this.printTypeDeclaration(collectionTypeDeclaration); - this.print('<'); - this.printTypeDeclaration(elementTypeDeclaration); - this.print("> get"); - this.print(StringTools.capitalize(propertyName)); - this.print("() {"); - this.println(); - - this.indent(); - this.print("return this."); - this.print(propertyName); - this.print(';'); - this.println(); - this.undent(); - - this.print('}'); - } - - private void printCollectionSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) { - this.printVisibility(visibility); - this.print("void set"); - this.print(StringTools.capitalize(propertyName)); - this.print('('); - this.printTypeDeclaration(collectionTypeDeclaration); - this.print('<'); - this.printTypeDeclaration(elementTypeDeclaration); - this.print('>'); - this.print(' '); - this.print(propertyName); - this.print(") {"); - this.println(); - - this.indent(); - this.print("this."); - this.print(propertyName); - this.print(" = "); - this.print(propertyName); - this.print(';'); - this.println(); - this.undent(); - - this.print('}'); - } - - public String source() { - return this.out.toString(); - } - - public int length() { - return ((StringWriter) this.out).getBuffer().length(); - } - - } - - - // ********** config ********** - - public static class Config { - private boolean convertToCamelCase = true; - private boolean propertyAccessType = false; // as opposed to "field" - private String collectionTypeName = Set.class.getName(); - private int fieldVisibility = Modifier.PRIVATE; - private int methodVisibility = Modifier.PUBLIC; - private boolean generateGettersAndSetters = true; - private boolean generateDefaultConstructor = true; - private boolean serializable = true; - private boolean generateSerialVersionUID = true; - private boolean generateEmbeddedIdForCompoundPK = true; // as opposed to IdClass - private Map overrideEntityNames = new HashMap(); - - public static final int PRIVATE = 0; - public static final int PACKAGE = 1; - public static final int PROTECTED = 2; - public static final int PUBLIC = 3; - - - public boolean convertToCamelCase() { - return this.convertToCamelCase; - } - public void setConvertToCamelCase(boolean convertToCamelCase) { - this.convertToCamelCase = convertToCamelCase; - } - - public boolean propertyAccessType() { - return this.propertyAccessType; - } - public void setPropertyAccessType(boolean propertyAccessType) { - this.propertyAccessType = propertyAccessType; - } - - public boolean fieldAccessType() { - return ! this.propertyAccessType; - } - public void setFieldAccessType(boolean fieldAccessType) { - this.propertyAccessType = ! fieldAccessType; - } - - public String getCollectionTypeName() { - return this.collectionTypeName; - } - public void setCollectionTypeName(String collectionTypeName) { - this.collectionTypeName = collectionTypeName; - } - - public int getFieldVisibility() { - return this.fieldVisibility; - } - /** entity fields cannot be 'public' */ - public void setFieldVisibility(int fieldVisibility) { - switch (fieldVisibility) { - case PRIVATE: - case PACKAGE: - case PROTECTED: - this.fieldVisibility = fieldVisibility; - break; - default: - throw new IllegalArgumentException("invalid field visibility: " + fieldVisibility); - } - } - String fieldVisibility() { - switch (this.fieldVisibility) { - case PRIVATE: - return "private"; - case PACKAGE: - return ""; - case PROTECTED: - return "protected"; - default: - throw new IllegalStateException("invalid field visibility: " + this.fieldVisibility); - } - } - - public int getMethodVisibility() { - return this.methodVisibility; - } - /** entity properties must be 'public' or 'protected' */ - public void setMethodVisibility(int methodVisibility) { - switch (methodVisibility) { - case PROTECTED: - case PUBLIC: - this.methodVisibility = methodVisibility; - break; - default: - throw new IllegalArgumentException("invalid method visibility: " + methodVisibility); - } - } - String methodVisibility() { - switch (this.methodVisibility) { - case PROTECTED: - return "protected"; - case PUBLIC: - return "public"; - default: - throw new IllegalStateException("invalid method visibility: " + this.methodVisibility); - } - } - - public boolean generateGettersAndSetters() { - return this.generateGettersAndSetters; - } - public void setGenerateGettersAndSetters(boolean generateGettersAndSetters) { - this.generateGettersAndSetters = generateGettersAndSetters; - } - - public boolean generateDefaultConstructor() { - return this.generateDefaultConstructor; - } - public void setGenerateDefaultConstructor(boolean generateDefaultConstructor) { - this.generateDefaultConstructor = generateDefaultConstructor; - } - - public boolean serializable() { - return this.serializable; - } - public void setSerializable(boolean serializable) { - this.serializable = serializable; - } - - public boolean generateSerialVersionUID() { - return this.generateSerialVersionUID; - } - public void setGenerateSerialVersionUID(boolean generateSerialVersionUID) { - this.generateSerialVersionUID = generateSerialVersionUID; - } - - public boolean generateEmbeddedIdForCompoundPK() { - return this.generateEmbeddedIdForCompoundPK; - } - public void setGenerateEmbeddedIdForCompoundPK(boolean generateEmbeddedIdForCompoundPK) { - this.generateEmbeddedIdForCompoundPK = generateEmbeddedIdForCompoundPK; - } - - public boolean generateIdClassForCompoundPK() { - return ! this.generateEmbeddedIdForCompoundPK; - } - public void setGenerateIdClassForCompoundPK(boolean generateIdClassForCompoundPK) { - this.generateEmbeddedIdForCompoundPK = ! generateIdClassForCompoundPK; - } - - /** - * key = table - * value = user-supplied override entity name - */ - public String getOverrideEntityName(Table table) { - return this.overrideEntityNames.get(table); - } - public void setOverrideEntityName(Table table, String overrideEntityName) { - this.overrideEntityNames.put(table, overrideEntityName); - } - public void clearOverrideEntityNames() { - this.overrideEntityNames.clear(); - } - public void setOverrideEntityNames(Map overrideEntityNames) { - this.clearOverrideEntityNames(); - for (Map.Entry entry : overrideEntityNames.entrySet()) { - this.setOverrideEntityName(entry.getKey(), entry.getValue()); - } - } - - } - - - // ********** config ********** - - public static interface OverwriteConfirmer { - /** - * Return whether the entity generator should overwrite the specified - * file. - */ - boolean overwrite(String className); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java deleted file mode 100644 index ee9db7fa8d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -class GenScope { - private final Map genTables = new HashMap(); - - private IProgressMonitor progressMonitor; - - // ********** construction/initialization ********** - - GenScope(Collection tables, EntityGenerator.Config entityConfig, IProgressMonitor progressMonitor) { - super(); - this.initialize(tables, entityConfig, progressMonitor); - } - - private void checkCanceled() { - if (this.progressMonitor.isCanceled()) { - throw new OperationCanceledException(); - } - } - - private void initialize(Collection
    tables, EntityGenerator.Config entityConfig, IProgressMonitor monitor) { - this.progressMonitor = monitor; - this.buildGenTables(tables, entityConfig); - checkCanceled(); - this.configureManyToManyRelations(); - checkCanceled(); - this.configureManyToOneRelations(); - checkCanceled(); - this.configureFieldNames(); - checkCanceled(); - } - - private void buildGenTables(Collection
    tables, EntityGenerator.Config entityConfig) { - int size = tables.size(); - // pass around a growing list of the entity names so we can avoid duplicates - Set entityNames = new HashSet(size); - for (Table table : tables) { - this.buildGenTable(table, entityConfig, entityNames); - this.progressMonitor.worked(40/size); - } - } - - private void buildGenTable(Table table, EntityGenerator.Config entityConfig, Collection entityNames) { - this.genTables.put(table, new GenTable(this, table, entityConfig, entityNames)); - } - - /** - * find all the "join" tables - */ - private void configureManyToManyRelations() { - int tablesSize = CollectionTools.size(this.tables()); - - //first time takes the longest, should we take that into account? - for (Iterator stream = this.tables(); stream.hasNext(); ) { - checkCanceled(); - stream.next().configureManyToManyRelations(); - this.progressMonitor.worked(730/tablesSize); - } - // revert any "join" table that is referenced by another table back to an "entity" table - Set referencedTables = this.buildReferencedTables(); - tablesSize = CollectionTools.size(this.joinTables()); - for (Iterator stream = this.joinTables(); stream.hasNext(); ) { - GenTable joinGenTable = stream.next(); - if (referencedTables.contains(joinGenTable)) { - joinGenTable.clearJoinTableRelation(); - } - this.progressMonitor.worked(40/tablesSize); - } - } - - /** - * find all the many-to-one and one-to-many relations - */ - private void configureManyToOneRelations() { - int tablesSize = CollectionTools.size(this.entityTables()); - for (Iterator stream = this.entityTables(); stream.hasNext(); ) { - stream.next().configureManyToOneRelations(); - this.progressMonitor.worked(50/tablesSize); - } - } - - /** - * determine all the Java field names up-front because we will - * need them for things like 'mappedBy' annotation elements - */ - private void configureFieldNames() { - int tablesSize = CollectionTools.size(this.entityTables()); - for (Iterator stream = this.entityTables(); stream.hasNext(); ) { - stream.next().configureFieldNames(); - this.progressMonitor.worked(50/tablesSize); - } - } - - - // ********** package API ********** - - /** - * return only the gen tables that are suitable for generating - * entities (i.e. exclude the "join" tables) - */ - Iterator entityTables() { - return new FilteringIterator(this.tables()) { - @Override - protected boolean accept(Object next) { - return ! ((GenTable) next).isJoinTable(); - } - }; - } - - int numEntityTables() { - return CollectionTools.size(entityTables()); - } - - /** - * return the gen table corresponding to the specified table - */ - GenTable genTable(Table table) { - return this.genTables.get(table); - } - - - // ********** internal API ********** - - private Iterator tables() { - return this.genTables.values().iterator(); - } - - /** - * return only the "join" gen tables - */ - private Iterator joinTables() { - return new FilteringIterator(this.tables()) { - @Override - protected boolean accept(Object next) { - return ((GenTable) next).isJoinTable(); - } - }; - } - - /** - * build a set of the tables that are referenced by other tables - * in the scope - */ - private Set buildReferencedTables() { - int size = CollectionTools.size(this.tables()); - Set referencedTables = new HashSet(this.genTables.size()); - for (Iterator stream = this.tables(); stream.hasNext(); ) { - stream.next().addReferencedTablesTo(referencedTables); - this.progressMonitor.worked(20/size); - } - return referencedTables; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java deleted file mode 100644 index ea7fd3d3c9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java +++ /dev/null @@ -1,342 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import org.eclipse.jpt.db.internal.Column; -import org.eclipse.jpt.db.internal.ForeignKey; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.NameTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -/** - * associate a table with the various relations that will be used when - * generating the entity - */ -class GenTable { - private final GenScope scope; - private final Table table; - private final EntityGenerator.Config entityConfig; - private final String entityName; - private ManyToManyRelation joinTableRelation; - private Collection ownedManyToManyRelations = new ArrayList(); - private Collection nonOwnedManyToManyRelations = new ArrayList(); - private Collection manyToOneRelations = new ArrayList(); - private Collection oneToManyRelations = new ArrayList(); - private Set foreignKeyColumns = new HashSet(); - - // key=column/relation; value=name - private final Map fieldNames = new HashMap(); - - private static final Object EMBEDDED_ID_VIRTUAL_COLUMN = new Object(); - - - // ********** construction/initialization ********** - - GenTable(GenScope scope, Table table, EntityGenerator.Config entityConfig, Collection entityNames) { - super(); - this.scope = scope; - this.table = table; - this.entityConfig = entityConfig; - this.entityName = this.buildEntityName(entityNames); - } - - private String buildEntityName(Collection entityNames) { - String name = this.table.shortJavaClassName(); - String overrideEntityName = this.entityConfig.getOverrideEntityName(this.table); - if (overrideEntityName == null) { - if (this.entityConfig.convertToCamelCase()) { - name = StringTools.convertUnderscoresToCamelCase(name); - } - } else { - name = overrideEntityName; - } - name = NameTools.uniqueNameForIgnoreCase(name, entityNames); - entityNames.add(name); - return name; - } - - - // ********** package API ********** - - /** - * determine whether the table is a "join" table within the table's scope - */ - void configureManyToManyRelations() { - if (this.table.foreignKeysSize() != 2) { - // the table must have exactly 2 foreign keys - return; - } - for (Iterator stream = this.table.columns(); stream.hasNext(); ) { - if ( ! this.table.foreignKeyColumnsContains(stream.next())) { - // all the table's columns must belong to one (or both) of the 2 foreign keys - return; - } - } - Iterator fKeys = this.table.foreignKeys(); - ForeignKey owningFK = fKeys.next(); - ForeignKey nonOwningFK = fKeys.next(); - GenTable owningTable = this.scope.genTable(owningFK.getReferencedTable()); - GenTable nonOwningTable = this.scope.genTable(nonOwningFK.getReferencedTable()); - if ((owningTable == null) || (nonOwningTable == null)) { - // both tables must be in the scope - return; - } - this.joinTableRelation = new ManyToManyRelation(this, owningFK, owningTable, nonOwningFK, nonOwningTable); - } - - void addReferencedTablesTo(Set referencedTables) { - for (Iterator stream = this.table.foreignKeys(); stream.hasNext(); ) { - ForeignKey fk = stream.next(); - GenTable genTable = this.scope.genTable(fk.getReferencedTable()); - if (genTable != null) { - referencedTables.add(genTable); - } - } - } - - void clearJoinTableRelation() { - this.joinTableRelation.clear(); - this.joinTableRelation = null; - } - - /** - * find "in-scope" foreign keys - */ - void configureManyToOneRelations() { - for (Iterator stream = this.table.foreignKeys(); stream.hasNext(); ) { - ForeignKey fk = stream.next(); - GenTable referencedtable = this.scope.genTable(fk.getReferencedTable()); - if (referencedtable == null) { - continue; // skip to next FK - } - this.manyToOneRelations.add(new ManyToOneRelation(this, fk, referencedtable)); - } - } - - /** - * now that all the relations are in place, we can configure the Java - * field names - */ - void configureFieldNames() { - Set columns = CollectionTools.set(this.table.columns()); - if ((this.table.primaryKeyColumnsSize() > 1) && this.entityConfig.generateEmbeddedIdForCompoundPK()) { - // if we are going to generate an EmbeddedId field, add it to - // 'fieldNames' so we don't collide with it later, when generating - // field names for the columns etc. - this.configureFieldName(EMBEDDED_ID_VIRTUAL_COLUMN, "pk"); - } - this.configureManyToOneFieldNames(columns); - this.configureBasicFieldNames(columns); - this.configureOneToManyFieldNames(); - this.configureOwnedManyToManyFieldNames(); - this.configureNonOwnedManyToManyFieldNames(); - } - - /** - * return the columns that are part of the table's primary key - * but are also part of an "in-scope" foreign key - */ - public Iterator readOnlyPrimaryKeyColumns() { - return new FilteringIterator(this.table.primaryKeyColumns()) { - @Override - protected boolean accept(Object column) { - return GenTable.this.foreignKeyColumnsContains((Column) column); - } - }; - } - - /** - * return the columns that are part of the table's primary key - * but are NOT part of any "in-scope" foreign key - */ - Iterator writablePrimaryKeyColumns() { - return new FilteringIterator(this.table.primaryKeyColumns()) { - @Override - protected boolean accept(Object column) { - return ! GenTable.this.foreignKeyColumnsContains((Column) column); - } - }; - } - - /** - * return the columns that NEITHER part of the table's primary key - * NOR part of any foreign key - */ - public Iterator nonPrimaryKeyBasicColumns() { - return new FilteringIterator(this.table.columns()) { - @Override - protected boolean accept(Object column) { - return ! (GenTable.this.primaryKeyColumnsContains((Column) column) - || GenTable.this.foreignKeyColumnsContains((Column) column)); - } - }; - } - - Table getTable() { - return this.table; - } - - String getEntityName() { - return this.entityName; - } - - boolean isJoinTable() { - return this.joinTableRelation != null; - } - - void addOwnedManyToManyRelation(ManyToManyRelation relation) { - this.ownedManyToManyRelations.add(relation); - } - - void removeOwnedManyToManyRelation(ManyToManyRelation relation) { - this.ownedManyToManyRelations.remove(relation); - } - - void addNonOwnedManyToManyRelation(ManyToManyRelation relation) { - this.nonOwnedManyToManyRelations.add(relation); - } - - void removeNonOwnedManyToManyRelation(ManyToManyRelation relation) { - this.nonOwnedManyToManyRelations.remove(relation); - } - - void addOneToManyRelation(OneToManyRelation relation) { - this.oneToManyRelations.add(relation); - } - - String javaFieldName() { - return this.table.javaFieldName(); - } - - Iterator manyToOneRelations() { - return this.manyToOneRelations.iterator(); - } - - Iterator oneToManyRelations() { - return this.oneToManyRelations.iterator(); - } - - Iterator ownedManyToManyRelations() { - return this.ownedManyToManyRelations.iterator(); - } - - Iterator nonOwnedManyToManyRelations() { - return this.nonOwnedManyToManyRelations.iterator(); - } - - /** - * the key can be a column or relation - */ - private String fieldNameForInternal(Object o) { - return this.fieldNames.get(o); - } - - /** - * this will return null if we don't want an embedded id field - */ - String fieldNameForEmbeddedId() { - return this.fieldNameForInternal(EMBEDDED_ID_VIRTUAL_COLUMN); - } - - String fieldNameFor(Column column) { - return this.fieldNameForInternal(column); - } - - String fieldNameFor(ManyToOneRelation relation) { - return this.fieldNameForInternal(relation); - } - - String fieldNameFor(OneToManyRelation relation) { - return this.fieldNameForInternal(relation); - } - - String fieldNameFor(ManyToManyRelation relation) { - return this.fieldNameForInternal(relation); - } - - String name() { - return this.table.getName(); - } - - - // ********** internal API ********** - - /** - * while we are figuring out the names for the m:1 fields, remove from the - * specified set of columns the columns that are only part of the foreign keys - */ - private void configureManyToOneFieldNames(Set columns) { - for (ManyToOneRelation relation : this.manyToOneRelations) { - CollectionTools.removeAll(columns, relation.getForeignKey().nonPrimaryKeyBaseColumns()); - CollectionTools.addAll(this.foreignKeyColumns, relation.getForeignKey().baseColumns()); - relation.setMappedBy(this.configureFieldName(relation, relation.javaFieldName())); - } - } - - private String configureFieldName(Object o, String fieldName) { - fieldName = this.camelCase(fieldName); - fieldName = NameTools.uniqueNameFor(fieldName, this.fieldNames.values()); - this.fieldNames.put(o, fieldName); - return fieldName; - } - - private String camelCase(String name) { - return this.entityConfig.convertToCamelCase() ? - StringTools.convertUnderscoresToCamelCase(name, false) // false = don't capitalize first letter - : - name; - } - - /** - * build a unique field name for the specified "basic" columns, - * checking for name collisions - */ - private void configureBasicFieldNames(Set columns) { - for (Column column : columns) { - this.configureFieldName(column, column.javaFieldName()); - } - } - - private void configureOneToManyFieldNames() { - for (OneToManyRelation relation : this.oneToManyRelations) { - this.configureFieldName(relation, relation.javaFieldName()); - } - } - - private void configureOwnedManyToManyFieldNames() { - for (ManyToManyRelation relation : this.ownedManyToManyRelations) { - relation.setMappedBy(this.configureFieldName(relation, relation.javaFieldNameFor(this))); - } - } - - private void configureNonOwnedManyToManyFieldNames() { - for (ManyToManyRelation relation : this.nonOwnedManyToManyRelations) { - this.configureFieldName(relation, relation.javaFieldNameFor(this)); - } - } - - boolean foreignKeyColumnsContains(Column column) { - return this.foreignKeyColumns.contains(column); - } - - boolean primaryKeyColumnsContains(Column column) { - return this.table.primaryKeyColumnsContains(column); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java deleted file mode 100644 index d87608715a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -import org.eclipse.jpt.db.internal.ForeignKey; - -/** - * This object is shared by the two gen tables that make up the relation. - * Upon construction, 'mappedBy' will be 'null'. The first gen table to be - * used to generate an entity will fill in 'mappedBy' with the appropriate - * field/property name. - */ -class ManyToManyRelation { - private final GenTable joinTable; - private final ForeignKey owningForeignKey; - private final GenTable owningTable; - private final ForeignKey nonOwningForeignKey; - private final GenTable nonOwningTable; - private String mappedBy; - - - ManyToManyRelation(GenTable joinTable, ForeignKey owningForeignKey, GenTable owningTable, ForeignKey nonOwningForeignKey, GenTable nonOwningTable) { - super(); - this.joinTable = joinTable; - - this.owningForeignKey = owningForeignKey; - this.owningTable = owningTable; - owningTable.addOwnedManyToManyRelation(this); - - this.nonOwningForeignKey = nonOwningForeignKey; - this.nonOwningTable = nonOwningTable; - nonOwningTable.addNonOwnedManyToManyRelation(this); - } - - GenTable getJoinTable() { - return this.joinTable; - } - - ForeignKey getOwningForeignKey() { - return this.owningForeignKey; - } - - GenTable getOwningTable() { - return this.owningTable; - } - - ForeignKey getNonOwningForeignKey() { - return this.nonOwningForeignKey; - } - - GenTable getNonOwningTable() { - return this.nonOwningTable; - } - - private GenTable otherTable(GenTable table) { - return (table == this.owningTable) ? this.nonOwningTable : this.owningTable; - } - - String javaFieldNameFor(GenTable table) { - // TODO i18n? - return this.otherTable(table).javaFieldName() + "_collection"; - } - - void clear() { - this.owningTable.removeOwnedManyToManyRelation(this); - this.nonOwningTable.removeNonOwnedManyToManyRelation(this); - } - - String getMappedBy() { - return this.mappedBy; - } - - void setMappedBy(String mappedBy) { - this.mappedBy = mappedBy; - } - - String owningEntityName() { - return this.owningTable.getEntityName(); - } - - String nonOwningEntityName() { - return this.nonOwningTable.getEntityName(); - } - - boolean joinTableNameIsDefault() { - return this.joinTable.name().equals(this.getOwningTable().name() + "_" + this.getNonOwningTable().name()); - } - - boolean joinColumnsIsDefaultFor(String javaFieldName) { - return this.owningForeignKey.isDefaultFor(javaFieldName); - } - - boolean inverseJoinColumnsIsDefaultFor(String javaFieldName) { - return this.nonOwningForeignKey.isDefaultFor(javaFieldName); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java deleted file mode 100644 index 333018d3e6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -import org.eclipse.jpt.db.internal.ForeignKey; - -class ManyToOneRelation { - private final GenTable baseTable; // the "many" side - private final ForeignKey foreignKey; - private final GenTable referencedTable; // the "one" side - private String mappedBy; - - - ManyToOneRelation(GenTable baseTable, ForeignKey foreignKey, GenTable referencedTable) { - super(); - this.baseTable = baseTable; - this.foreignKey = foreignKey; - this.referencedTable = referencedTable; - referencedTable.addOneToManyRelation(new OneToManyRelation(this)); - } - - GenTable getBaseTable() { - return this.baseTable; - } - - ForeignKey getForeignKey() { - return this.foreignKey; - } - - GenTable getReferencedTable() { - return this.referencedTable; - } - - String javaFieldName() { - return this.foreignKey.javaFieldName(); - } - - String getMappedBy() { - return this.mappedBy; - } - - void setMappedBy(String mappedBy) { - this.mappedBy = mappedBy; - } - - String baseEntityName() { - return this.baseTable.getEntityName(); - } - - String referencedEntityName() { - return this.referencedTable.getEntityName(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java deleted file mode 100644 index 4656d00c12..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -class OneToManyRelation { - private final ManyToOneRelation manyToOneRelation; - - OneToManyRelation(ManyToOneRelation manyToOneRelation) { - super(); - this.manyToOneRelation = manyToOneRelation; - } - - ManyToOneRelation getManyToOneRelation() { - return this.manyToOneRelation; - } - - String javaFieldName() { - // TODO i18n? - return this.manyToOneRelation.getBaseTable().javaFieldName() + "_collection"; - } - - String mappedBy() { - return this.manyToOneRelation.getMappedBy(); - } - - String referencedEntityName() { - return this.manyToOneRelation.baseEntityName(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java deleted file mode 100644 index bce0da3063..0000000000 --- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.gen.internal; - -import java.util.Collection; -import java.util.Iterator; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.gen.internal.EntityGenerator.OverwriteConfirmer; -import org.eclipse.jpt.utility.internal.CollectionTools; - -/** - * This generator will generate a package of entities for a set of tables. - */ -public class PackageGenerator { - private final Config config; - private final EntityGenerator.Config entityConfig; - private final GenScope scope; - private final OverwriteConfirmer overwriteConfirmer; - private final IProgressMonitor monitor; - - - // ********** public API ********** - - public static void generateEntities(Config config, EntityGenerator.Config entityConfig, Collection
    tables, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) { - if ((config == null) || (entityConfig == null) || (tables == null)) { - throw new NullPointerException(); - } - new PackageGenerator(config, entityConfig, tables, overwriteConfirmer, monitor).generateEntities(); - } - - - // ********** construction/initialization ********** - - private PackageGenerator(Config config, EntityGenerator.Config entityConfig, Collection
    tables, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) { - super(); - this.config = config; - this.entityConfig = entityConfig; - this.scope = new GenScope(tables, entityConfig, monitor); - this.overwriteConfirmer = overwriteConfirmer; - this.monitor = monitor; - } - - - // ********** generation ********** - - private void generateEntities() { - int size = CollectionTools.size(this.scope.entityTables()); - for (Iterator stream = this.scope.entityTables(); stream.hasNext(); ) { - checkCanceled(); - this.buildEntity(stream.next()); - this.monitor.worked(50/size); - } - } - - private void checkCanceled() { - if (this.monitor.isCanceled()) { - throw new OperationCanceledException(); - } - } - - - private void buildEntity(GenTable genTable) { - EntityGenerator.generateEntity(this.entityConfig, this.config.getPackageFragment(), genTable, overwriteConfirmer, this.monitor); - } - - - // ********** config ********** - - public static class Config { - private IPackageFragment packageFragment; - - public IPackageFragment getPackageFragment() { - return this.packageFragment; - } - public void setPackageFragment(IPackageFragment packageFragment) { - this.packageFragment = packageFragment; - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/.classpath b/jpa/plugins/org.eclipse.jpt.ui/.classpath deleted file mode 100644 index 5ee7c76127..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.ui/.cvsignore deleted file mode 100644 index ba077a4031..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/jpa/plugins/org.eclipse.jpt.ui/.project b/jpa/plugins/org.eclipse.jpt.ui/.project deleted file mode 100644 index 50ef9e3305..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 8f3899b660..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:11:25 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d909c105d5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:55:01 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 4ed5329386..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,58 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.ui;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.jpt.ui.internal.JptUiPlugin -Bundle-ClassPath: . -Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.draw2d, - org.eclipse.emf.edit.ui, - org.eclipse.jdt.core, - org.eclipse.jdt.ui, - org.eclipse.jem, - org.eclipse.jface.text, - org.eclipse.jpt.core, - org.eclipse.jpt.db, - org.eclipse.jpt.db.ui, - org.eclipse.jpt.gen, - org.eclipse.jpt.utility, - org.eclipse.jst.j2ee.ui, - org.eclipse.ui.ide, - org.eclipse.ui.views.properties.tabbed, - org.eclipse.ui.workbench.texteditor, - org.eclipse.wst.common.frameworks, - org.eclipse.wst.common.frameworks.ui, - org.eclipse.wst.common.modulecore, - org.eclipse.wst.common.project.facet.core, - org.eclipse.wst.common.project.facet.ui, - org.eclipse.wst.sse.ui, - org.eclipse.wst.web.ui -Eclipse-LazyStart: true -Export-Package: org.eclipse.jpt.ui.internal; x-internal:=true, - org.eclipse.jpt.ui.internal.actions; x-internal:=true, - org.eclipse.jpt.ui.internal.details; x-internal:=true, - org.eclipse.jpt.ui.internal.dialogs; x-internal:=true, - org.eclipse.jpt.ui.internal.generic; x-internal:=true, - org.eclipse.jpt.ui.internal.java.details; x-internal:=true, - org.eclipse.jpt.ui.internal.java.mappings.properties; x-internal:=true, - org.eclipse.jpt.ui.internal.java.structure; x-internal:=true, - org.eclipse.jpt.ui.internal.jface; x-internal:=true, - org.eclipse.jpt.ui.internal.mappings; x-internal:=true, - org.eclipse.jpt.ui.internal.mappings.details; x-internal:=true, - org.eclipse.jpt.ui.internal.perspective; x-internal:=true, - org.eclipse.jpt.ui.internal.prefs; x-internal:=true, - org.eclipse.jpt.ui.internal.properties; x-internal:=true, - org.eclipse.jpt.ui.internal.selection; x-internal:=true, - org.eclipse.jpt.ui.internal.structure; x-internal:=true, - org.eclipse.jpt.ui.internal.util; x-internal:=true, - org.eclipse.jpt.ui.internal.views; x-internal:=true, - org.eclipse.jpt.ui.internal.widgets; x-internal:=true, - org.eclipse.jpt.ui.internal.wizards; x-internal:=true, - org.eclipse.jpt.ui.internal.xml; x-internal:=true, - org.eclipse.jpt.ui.internal.xml.details; x-internal:=true, - org.eclipse.jpt.ui.internal.xml.structure; x-internal:=true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/jpa/plugins/org.eclipse.jpt.ui/about.html b/jpa/plugins/org.eclipse.jpt.ui/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/plugins/org.eclipse.jpt.ui/build.properties b/jpa/plugins/org.eclipse.jpt.ui/build.properties deleted file mode 100644 index b1a1c37afa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/build.properties +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2007 Oracle. All rights reserved. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0, which accompanies this distribution -# and is available at http://www.eclipse.org/legal/epl-v10.html. -# -# Contributors: -# Oracle - initial API and implementation -################################################################################ -javacSource = 1.5 -javacTarget = 1.5 -source.. = src/,\ - property_files/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - about.html,\ - icons/,\ - plugin.xml,\ - plugin.properties -jars.compile.order = . diff --git a/jpa/plugins/org.eclipse.jpt.ui/component.xml b/jpa/plugins/org.eclipse.jpt.ui/component.xml deleted file mode 100644 index 36827b6240..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/component.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif deleted file mode 100644 index 633768f35d..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif deleted file mode 100644 index c0ab917511..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif deleted file mode 100644 index 12da8074ae..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif deleted file mode 100644 index 3280138b67..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif deleted file mode 100644 index c0ab917511..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif deleted file mode 100644 index 682c90a589..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif deleted file mode 100644 index a547d743e7..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif deleted file mode 100644 index 8856f78874..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif deleted file mode 100644 index c1c8e210e7..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif deleted file mode 100644 index c2ae66497a..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif deleted file mode 100644 index c349c962e2..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif deleted file mode 100644 index d606f482e2..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif deleted file mode 100644 index a205ec38ab..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif deleted file mode 100644 index 48885b21fe..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif deleted file mode 100644 index 2e1e2b9387..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif deleted file mode 100644 index 8cc37645c0..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif deleted file mode 100644 index 70a9c23541..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif deleted file mode 100644 index 6279478c51..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif deleted file mode 100644 index 1e90027861..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif deleted file mode 100644 index 578ec36aa3..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif deleted file mode 100644 index 9cc45f6945..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif deleted file mode 100644 index d1f616d64f..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif deleted file mode 100644 index cc5d83db20..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif deleted file mode 100644 index 202a8104f4..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif deleted file mode 100644 index 8ce181f606..0000000000 Binary files a/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif and /dev/null differ diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.ui/plugin.properties deleted file mode 100644 index be47f4053a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. All rights reserved. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0, which accompanies this distribution -# and is available at http://www.eclipse.org/legal/epl-v10.html. -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### - -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== -pluginName= Java Persistence API Tools - UI -providerName=Eclipse.org - -JPA_PLATFORM="JPA Platform UI" - - -jpaWizardCategoryName = JPA -newJpaProjectWizardName = JPA Project -newJpaProjectWizardDesc = Create a JPA project - -jpaMenuName = JPA Tools -generateEntities = Generate Entities... -generateDDL = Generate DDL... -synchronizeClasses = Synchronize Classes -addPersistentClass = Add persistent class ... -removePersistentClass = Remove persistent class -addPersistentAttributeToXml = Add persistent attribute to XML -addPersistentAttributeToXmlAndMap = Add persistent attribute to XML ... -removePersistentAttributeFromXml = Remove persistent attribute from XML - -jpaPreferencePage = JPA - -jpaProjectPropertiesPage = JPA - -jpaPerspective = JPA Development -jpaDetails = JPA Details -jpaStructure = JPA Structure - -JpaProposalCategory = JPA Proposals diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.ui/plugin.xml deleted file mode 100644 index 12561ff32a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %newJpaProjectWizardDesc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties deleted file mode 100644 index 1ff880ba95..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties +++ /dev/null @@ -1,79 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. - initial API and implementation -############################################################################### - -AddPersistentAttributeDialog_title=Add Persistent Attribute -AddPersistentAttributeDialog_attributeLabel=Attribute: -AddPersistentAttributeDialog_mappingLabel=Map as: -AddPersistentAttributeDialog_noMappingKeyError=You must specify a mapping type - -AddPersistentClassDialog_title=Add Persistent 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 - -DatabaseReconnectWizardPage_database=Database Settings -DatabaseReconnectWizardPage_databaseConnection=Database Connection -DatabaseReconnectWizardPage_reconnectToDatabase=Reconnect to the database. -DatabaseReconnectWizardPage_connection=Connection: -DatabaseReconnectWizardPage_schema=Schema: -DatabaseReconnectWizardPage_schemaInfo=(Note: Must have active connection to select schema) -DatabaseReconnectWizardPage_addConnectionLink=Add connections... -DatabaseReconnectWizardPage_reconnectLink=Reconnect... - -General_browse=Browse... -General_deselectAll=Deselect All -General_selectAll=Select All - -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 - -GenericPlatformUiDialog_notSupportedMessageTitle=DDL Generation -GenericPlatformUiDialog_notSupportedMessageText=DDL Generation is not supported by the Generic Platform. - -JpaPreferencePage_defaultJpaLib=Default JPA implementation library: -JpaPreferencePage_userLibsLink=Configure user libraries ... -JpaPreferencePage_invalidJpaLib=Invalid Library: Must contain javax.persistence classes. - -JpaStructureView_viewNotAvailable=Structure is not available for the current selection. -JpaStructureView_linkWithEditorText=Link with Editor -JpaStructureView_linkWithEditorDesc=Link with Active Editor -JpaStructureView_linkWithEditorTooltip=Link with Editor - -JpaDetailsView_viewNotAvailable=Details are not available for the current selection. - -NewJpaProjectWizard_title=New JPA Project -NewJpaProjectWizard_firstPage_title=JPA Project -NewJpaProjectWizard_firstPage_description=Configure JPA project settings. - -JpaFacetWizardPage_title=JPA Facet -JpaFacetWizardPage_description=Configure JPA settings. -JpaFacetWizardPage_platformLabel=Platform -JpaFacetWizardPage_connectionLabel=Connection -JpaFacetWizardPage_connectionLink=Add connection ... -JpaFacetWizardPage_jpaImplementationLabel=JPA implementation -JpaFacetWizardPage_userServerLibLabel=Use implementation provided by server runtime -JpaFacetWizardPage_specifyLibLabel=Use implementation library: -JpaFacetWizardPage_jpaPrefsLink=Configure default JPA implementation library ... -JpaFacetWizardPage_userLibsLink=Configure user libraries ... -JpaFacetWizardPage_persistentClassManagementLabel=Persistent class management -JpaFacetWizardPage_discoverClassesButton=Discover annotated classes automatically -JpaFacetWizardPage_listClassesButton=Annotated classes must be listed in persistence.xml -JpaFacetWizardPage_createOrmXmlButton=Create orm.xml - -PersistentAttributePage_mapAs=Map As: - -PersistentTypePage_mapAs=Map As: - -OverwriteConfirmerDialog_title=Overwrite Existing Class -OverwriteConfirmerDialog_text=Overwrite source code for the class ''{0}''? diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties deleted file mode 100644 index d8d63ae59e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties +++ /dev/null @@ -1,185 +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 -############################################################################### - -PersistentTypePage_EntityLabel=Entity -PersistentTypePage_EmbeddableLabel=Embeddable -PersistentTypePage_MappedSuperclassLabel=Mapped Superclass - -PersistentAttributePage_BasicLabel=Basic -PersistentAttributePage_IdLabel=Id -PersistentAttributePage_OneToManyLabel=One to Many -PersistentAttributePage_ManyToOneLabel=Many to One -PersistentAttributePage_ManyToManyLabel=Many to Many -PersistentAttributePage_TransientLabel=Transient -PersistentAttributePage_VersionLabel=Version -PersistentAttributePage_EmbeddedLabel=Embedded -PersistentAttributePage_EmbeddedIdLabel=Embedded Id -PersistentAttributePage_OneToOneLabel=One to One - -EntityComposite_tableDefault=Default ({0}) -EntityComposite_tableNoDefaultSpecified=Default () -EntityComposite_inheritance=Inheritance - -EntityGeneralSection_nameDefaultWithOneParam=Default ({0}) -EntityGeneralSection_nameDefaultEmpty=Default () -EntityGeneralSection_name=Name: - -BasicGeneralSection_name=Name: -BasicGeneralSection_nameDefault=Default ({0}) -BasicGeneralSection_fetchLabel=Fetch: -BasicGeneralSection_optionalLabel=Optional: -BasicGeneralSection_lobLabel=Lob -BasicGeneralSection_temporalLabel=Temporal: -BasicGeneralSection_enumeratedLabel=Enumerated: - -TableChooser_label=Name: -CatalogChooser_label=Catalog: -SchemaChooser_label=Schema: -TableComposite_tableSection=Table: -TableComposite_defaultEmpty=Default () -TableComposite_defaultWithOneParam=Default ({0}) - -ColumnChooser_label=Name: -ColumnTableChooser_label=Table: - -TargetEntityChooser_label=Target Entity: -TargetEntityChooser_defaultEmpty=Default () -TargetEntityChooser_defaultWithOneParam=Default ({0}) -TargetEntityChooser_browse=Browse... - -NonOwningMapping_mappedByLabel=Mapped By: - -JoinTableComposite_add=Add... -JoinTableComposite_defaultEmpty=Default() -JoinTableComposite_defaultWithOneParam=Default ({0}) -JoinTableComposite_edit=Edit... -JoinTableComposite_inverseJoinColumn=Inverse Join Columns - -JoinTableComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1}) -JoinTableComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1} -JoinTableComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1}) -JoinTableComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1}) -JoinTableComposite_mappingBetweenTwoParams={0} -> {1} -JoinTableComposite_joinColumn=Join Columns -JoinTableComposite_name=Name: -JoinTableComposite_remove=Remove -JoinTableComposite_overrideDefaultJoinColumns=Override Default -JoinTableComposite_overrideDefaultInverseJoinColumns=Override Default - -InverseJoinColumnDialog_editInverseJoinColumn=Edit Inverse Join Column -InverseJoinColumnDialog_defaultWithOneParam=Default ({0}) - -JoinColumnDialog_addJoinColumn=Add Join Column -JoinColumnDialog_editJoinColumn=Edit Join Column -JoinColumnDialog_name=Name: -JoinColumnDialog_referencedColumnName=Referenced Column Name: -JoinColumnDialog_defaultWithOneParam=Default ({0}) -JoinColumnDialog_insertable=Insertable: -JoinColumnDialog_updatable=Updatable: -JoinColumnDialog_table=Table: - -MultiRelationshipMappingComposite_general=General -MultiRelationshipMappingComposite_joinTable=Join Table -MultiRelationshipMappingComposite_targetEntity=Target Entity: -MultiRelationshipMappingComposite_cascadeType=Cascade Type: -MultiRelationshipMappingComposite_fetchType=Fetch Type: -MultiRelationshipMappingComposite_mappedBy=Mapped By: - -ColumnComposite_columnSection=Column: -ColumnComposite_defaultWithOneParam=Default ({0}) -ColumnComposite_defaultEmpty=Default () -ColumnComposite_insertable=Insertable: -ColumnComposite_updatable=Updatable: - -JoinColumnComposite_joinColumn=Join Columns -JoinColumnComposite_defaultEmpty=Default() -JoinColumnComposite_name=Name: -JoinColumnComposite_defaultWithOneParam=Default ({0}) -JoinColumnComposite_add=Add... -JoinColumnComposite_edit=Edit... -JoinColumnComposite_mappingBetweenTwoParams={0} -> {1} -JoinColumnComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1}) -JoinColumnComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1}) -JoinColumnComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1} -JoinColumnComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1}) -JoinColumnComposite_remove=Remove -JoinColumnComposite_overrideDefaultJoinColumns=Override Default - -PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns=Override Default -PrimaryKeyJoinColumnsComposite_add=Add... -PrimaryKeyJoinColumnsComposite_edit=Edit... -PrimaryKeyJoinColumnsComposite_remove=Remove -PrimaryKeyJoinColumnsComposite_defaultEmpty=Default() -PrimaryKeyJoinColumnsComposite_defaultWithOneParam=Default ({0}) -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}) - -AttributeOverridesComposite_attributeOverrides=Attribute Overrides -AttributeOverridesComposite_overridDefault=Override Default -OverridesComposite_joinColumn=Join Columns -InheritanceComposite_default=Default ({0}) -InheritanceComposite_strategy=Strategy: -InheritanceComposite_discriminatorValue=Discriminator Value: -InheritanceComposite_discriminatorValueDefaultWithOneParam=Default ({0}) - -DiscriminatorColumnComposite_column=Discriminator Column: -DiscriminatorColumnComposite_discriminatorType=Discriminator Type: -DiscriminatorColumnComposite_defaultEmpty=Default() - -IdMappingComposite_pk_generation=PK Generation -IdMappingComposite_primaryKeyGeneration=Primary Key Generation -IdMappingComposite_tableGenerator=Table Generator -IdMappingComposite_sequenceGenerator=Sequence Generator - -GeneratedValueComposite_generatedValue=Generated Value -GeneratedValueComposite_generatorName=Generator Name: -GeneratedValueComposite_strategy=Strategy: - -SequenceGeneratorComposite_sequenceGenerator=Sequence Generator -SequenceGeneratorComposite_name=Name: -SequenceGeneratorComposite_sequence=Sequence: -SequenceGeneratorComposite_default=Default - -TableGeneratorComposite_name=Name: -TableGeneratorComposite_table=Table: -TableGeneratorComposite_tableGenerator=Table Generator -TableGeneratorComposite_pkColumn=Primary Key Column: -TableGeneratorComposite_valueColumn=Value Column: -TableGeneratorComposite_pkColumnValue=Primary Key Column Value: -TableGeneratorComposite_default=Default - -OrderByComposite_orderByGroup=Order By -OrderByComposite_orderByLabel=Order By: -OrderByComposite_noOrdering=No Ordering -OrderByComposite_primaryKeyOrdering=Primary Key Ordering -OrderByComposite_customOrdering=Custom Ordering - -SecondaryTablesComposite_secondaryTables=Secondary Tables -SecondaryTablesComposite_add=Add... -SecondaryTablesComposite_edit=Edit... -SecondaryTablesComposite_remove=Remove - -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 -EnumComboViewer_default=Default ({0}) -MetaDataCompleteCombo_Default=Default ({0}) -JoinColumnDialog_defaultTrue=Default ({0}) -InheritanceComposite_defaultDiscriminatorType=Default ({0}) -GeneratedValueComposite_default=Default ({0}) diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties deleted file mode 100644 index f581ea4e89..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties +++ /dev/null @@ -1,36 +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 -############################################################################### - -PersistentTypePage_javaClassLabel=Java Class: -PersistentTypePage_MetadataCompleteLabel=Metadata Complete: -PersistentTypePage_AccessLabel=Access: - -PersistenceUnitMetadataSection_SchemaDefault=Default -PersistenceUnitMetadataSection_CatalogDefault=Default - -PersistentAttributePage_javaAttributeLabel=Java Attribute: - -XMLEntityMappingsPage_XmlMappingMetadataCompleteCheckBox=XML Mapping Metadata Complete -XMLEntityMappingsPage_CascadePersistCheckBox=Cascade Persist -XMLEntityMappingsPage_PersistenceUnitSection=Persistence Unit -XMLEntityMappingsPage_SchemaDefault=Default ({0}) -XMLEntityMappingsPage_SchemaNoDefaultSpecified=Default -XMLEntityMappingsPage_CatalogDefault=Default ({0}) -XMLEntityMappingsPage_CatalogNoDefaultSpecified=Default - -XmlSchemaChooser_SchemaChooser=Schema: -XmlCatalogChooser_CatalogChooser=Catalog: - -XmlJavaClassChooser_XmlJavaClassDialog_title=Class Selection -XmlJavaClassChooser_XmlJavaClassDialog_message=Choose a type: - -XmlPackageChooser_PackageDialog_title=Package Selection -XmlPackageChooser_PackageDialog_message=Choose a folder: - diff --git a/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd b/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd deleted file mode 100644 index 92d1085e5e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Extend this extension point and you must also extend the org.eclipse.jpt.core.jpaPlatform - extension point. The ids must match. One jpaPlatform will be chosen per JpaProject. The - possible jpaPlatforms will be displayed to the user as a project property. - - - - - - - The id must match the corresponding org.eclipse.jpt.core.jpaVendor extension id. - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java deleted file mode 100644 index c53e5d88da..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider; -import org.eclipse.jpt.ui.internal.generic.EntitiesGenerator; -import org.eclipse.jpt.ui.internal.java.details.JavaDetailsProvider; -import org.eclipse.jpt.ui.internal.java.structure.JavaStructureProvider; -import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider; -import org.eclipse.jpt.ui.internal.xml.details.XmlDetailsProvider; -import org.eclipse.jpt.ui.internal.xml.structure.XmlStructureProvider; - -public abstract class BaseJpaPlatformUi implements IJpaPlatformUi -{ - private Collection detailsProviders; - private Collection structureProviders; - - protected BaseJpaPlatformUi() { - super(); - } - - // ********** behavior ********** - - public Collection detailsProviders() { - if (this.detailsProviders == null) { - this.detailsProviders = this.buildJpaDetailsProvider(); - } - return this.detailsProviders; - } - - protected Collection buildJpaDetailsProvider() { - Collection detailsProviders = new ArrayList(); - detailsProviders.add(new JavaDetailsProvider()); - detailsProviders.add(new XmlDetailsProvider()); - return detailsProviders; - } - - public Collection structureProviders() { - if (this.structureProviders == null) { - this.structureProviders = this.buildJpaStructureProvider(); - } - return this.structureProviders; - } - - protected Collection buildJpaStructureProvider() { - Collection structureProviders = new ArrayList(); - structureProviders.add(new JavaStructureProvider()); - structureProviders.add(new XmlStructureProvider()); - return structureProviders; - } - - public void generateEntities(IJpaProject project, IStructuredSelection selection) { - - EntitiesGenerator.generate(project, selection); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java deleted file mode 100644 index c7fe124c76..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal; - - -/** - * Help context ids for the Dali JPA UI. - *

    - * This interface contains constants only; it is not intended to be - * implemented. - *

    - * - */ -public interface IJpaHelpContextIds { - - - //ContextID prefix - public static final String PREFIX = JptUiPlugin.PLUGIN_ID + "."; //$NON-NLS-1$ - - //Persistent Type composites - public static final String ENTITY_ACCESS_TYPE = PREFIX + "entity_accessType"; //$NON-NLS-1$ - public static final String ENTITY_ATTRIBUTE_OVERRIDES = PREFIX + "entity_attributeOverrides"; //$NON-NLS-1$ - public static final String ENTITY_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "entity_attributeOverridesColumn"; //$NON-NLS-1$ - public static final String ENTITY_CATALOG = PREFIX + "entity_catalog"; //$NON-NLS-1$ - public static final String ENTITY_INHERITANCE_STRATEGY = PREFIX + "entity_inheritanceStrategy"; //$NON-NLS-1$ - public static final String ENTITY_INHERITANCE_DISCRIMINATOR_TYPE = PREFIX + "entity_inheritanceDiscriminatorType"; //$NON-NLS-1$ - public static final String ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN = PREFIX + "entity_inheritanceDiscriminatorColumn"; //$NON-NLS-1$ - public static final String ENTITY_INHERITANCE_DISCRIMINATOR_VALUE = PREFIX + "entity_inheritanceDiscriminatorValue"; //$NON-NLS-1$ - public static final String ENTITY_NAME = PREFIX + "entity_name"; //$NON-NLS-1$ - public static final String ENTITY_ORM_PACKAGE = PREFIX + "orm_package"; //$NON-NLS-1$ - public static final String ENTITY_ORM_SCHEMA = PREFIX + "orm_schema"; //$NON-NLS-1$ - public static final String ENTITY_ORM_CATALOG = PREFIX + "orm_catalog"; //$NON-NLS-1$ - public static final String ENTITY_ORM_ACCESS = PREFIX + "orm_access"; //$NON-NLS-1$ - public static final String ENTITY_ORM_CASCADE = PREFIX + "orm_cascade"; //$NON-NLS-1$ - public static final String ENTITY_ORM_XML = PREFIX + "orm_xml"; //$NON-NLS-1$ - public static final String ENTITY_SCHEMA = PREFIX + "entity_schema"; //$NON-NLS-1$ - public static final String ENTITY_TABLE = PREFIX + "entity_table"; //$NON-NLS-1$ - - - //Persistent Attribute composites - public static final String MAPPING_CASCADE_TYPE = PREFIX + "mapping_cascadeType"; //$NON-NLS-1$ - public static final String MAPPING_COLUMN = PREFIX + "mapping_column"; //$NON-NLS-1$ - public static final String MAPPING_COLUMN_INSERTABLE = PREFIX + "mapping_columnInsertable"; //$NON-NLS-1$ - public static final String MAPPING_COLUMN_TABLE = PREFIX + "mapping_columnTable"; //$NON-NLS-1$ - public static final String MAPPING_COLUMN_UPDATABLE= PREFIX + "mapping_columnUpdatable"; //$NON-NLS-1$ - public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES = PREFIX + "mapping_embeddedAttributeOverrides";//$NON-NLS-1$ - public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "mapping_embeddedAttributeOverridesColumn";//$NON-NLS-1$ - public static final String MAPPING_ENUMERATED = PREFIX + "mapping_enumerated"; //$NON-NLS-1$ - public static final String MAPPING_FETCH_TYPE = PREFIX + "mapping_fetchType"; //$NON-NLS-1$ - public static final String MAPPING_GENERATED_VALUE_STRATEGY = PREFIX + "mapping_generatedValueStrategy"; //$NON-NLS-1$ - public static final String MAPPING_GENERATED_VALUE_GENERATOR_NAME = PREFIX + "mapping_generatedValueGeneratorName"; //$NON-NLS-1$ - public static final String MAPPING_JOIN_COLUMN_NAME = PREFIX + "mapping_joinColumnName"; //$NON-NLS-1$ - public static final String MAPPING_JOIN_REFERENCED_COLUMN = PREFIX + "mapping_joinReferencedColumn"; //$NON-NLS-1$ - public static final String MAPPING_JOIN_TABLE_NAME = PREFIX + "mapping_joinTableName"; //$NON-NLS-1$ - public static final String MAPPING_JOIN_TABLE_COLUMNS = PREFIX + "mapping_joinTableJoinColumns"; //$NON-NLS-1$ - public static final String MAPPING_JOIN_TABLE_INVERSE_JOIN_COLUMNS = PREFIX + "mapping_joinTableInverseJoinColumns"; //$NON-NLS-1$ - public static final String MAPPING_LOB = PREFIX + "mapping_lob"; //$NON-NLS-1$ - public static final String MAPPING_MAP_AS = PREFIX + "mapping_mapAs"; //$NON-NLS-1$ - public static final String MAPPING_MAPPED_BY = PREFIX + "mapping_mappedBy"; //$NON-NLS-1$ - public static final String MAPPING_OPTIONAL = PREFIX + "mapping_optional"; //$NON-NLS-1$ - public static final String MAPPING_ORDER_BY = PREFIX + "mapping_orderBy"; //$NON-NLS-1$ - public static final String MAPPING_ORDER_BY_NO_ORDERING = PREFIX + "mapping_orderByNoOrdering"; //$NON-NLS-1$ - public static final String MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING = PREFIX + "mapping_orderByPrimaryKeyOrdering"; //$NON-NLS-1$ - public static final String MAPPING_ORDER_BY_CUSTOM_ORDERING = PREFIX + "mapping_orderByCustomOrdering"; //$NON-NLS-1$ - public static final String MAPPING_PRIMARY_KEY_GENERATION = PREFIX + "mapping_primaryKeyGeneration"; //$NON-NLS-1$ - public static final String MAPPING_SEQUENCE_GENERATOR = PREFIX + "mapping_sequenceGenerator"; //$NON-NLS-1$ - public static final String MAPPING_SEQUENCE_GENERATOR_NAME = PREFIX + "mapping_sequenceGeneratorName"; //$NON-NLS-1$ - public static final String MAPPING_SEQUENCE_GENERATOR_SEQUENCE = PREFIX + "mapping_sequenceGeneratorSequence"; //$NON-NLS-1$ - public static final String MAPPING_TABLE_GENERATOR = PREFIX + "mapping_tableGenerator"; //$NON-NLS-1$ - public static final String MAPPING_TABLE_GENERATOR_NAME = PREFIX + "mapping_tableGeneratorName"; //$NON-NLS-1$ - public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN = PREFIX + "mapping_tableGeneratorPrimaryKeyColumn"; //$NON-NLS-1$ - public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE = PREFIX + "mapping_tableGeneratorPrimaryKeyColumnValue"; //$NON-NLS-1$ - public static final String MAPPING_TABLE_GENERATOR_TABLE= PREFIX + "mapping_tableGeneratorTable"; //$NON-NLS-1$ - public static final String MAPPING_TABLE_GENERATOR_VALUE_COLUMN = PREFIX + "mapping_tableGeneratorValueColumn"; //$NON-NLS-1$ - public static final String MAPPING_TARGET_ENTITY = PREFIX + "mapping_targetEntity"; //$NON-NLS-1$ - public static final String MAPPING_TEMPORAL = PREFIX + "mapping_temporal"; //$NON-NLS-1$ - - //Project properties - public static final String PROPERTIES_JAVA_PERSISTENCE = PREFIX + "properties_javaPersistence"; //$NON-NLS-1$ - public static final String PROPERTIES_JAVA_PERSISTENCE_CONNECTION = PREFIX + "properties_javaPersistenceConnection"; //$NON-NLS-1$ - public static final String PROPERTIES_JAVA_PERSISTENCE_SCHEMA = PREFIX + "properties_javaPersistenceSchema"; //$NON-NLS-1$ - - //Dialogs, Wizards - public static final String DIALOG_CREATE_ORM = PREFIX + "dialog_createORM"; //$NON-NLS-1$ - public static final String DIALOG_EDIT_INVERSE_JOIN_COLUNN = PREFIX + "dialog_editInverseJoinColumn"; //$NON-NLS-1$ - public static final String DIALOG_GENERATE_ENTITIES = PREFIX + "dialog_generateEntities"; //$NON-NLS-1$ - public static final String DIALOG_GENERATE_ENTITIES_SOURCE = PREFIX + "dialog_generateEntities_source"; //$NON-NLS-1$ - public static final String DIALOG_GENERATE_ENTITIES_PACKAGE = PREFIX + "dialog_generateEntities_package"; //$NON-NLS-1$ - public static final String DIALOG_GENERATE_ENTITIES_TABLES = PREFIX + "dialog_generateEntities_tables"; //$NON-NLS-1$ - public static final String DIALOG_JPA_FACET = PREFIX + "dialog_JPAFacet"; //$NON-NLS-1$ - public static final String DIALOG_JPA_PLATFORM = PREFIX + "dialog_JPAPlatform"; //$NON-NLS-1$ - public static final String NEW_JPA_PROJECT = PREFIX + "dialog_newJPAProject"; //$NON-NLS-1$ - public static final String NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH = PREFIX + "dialog_addJavaPersistence_classpath"; //$NON-NLS-1$ - public static final String NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE = PREFIX + "dialog_addJavaPersistence_database"; //$NON-NLS-1$ - public static final String NEW_JPA_PROJECT_CONTENT_PAGE_PACKAGING = PREFIX + "dialog_addJavaPersistence_packaging"; //$NON-NLS-1$ - public static final String NEW_JPA_PROJECT_CREATION_PAGE = PREFIX + "dialog_addJavaPersistence"; //$NON-NLS-1$ - - //Other - public static final String PERSISTENCE_OUTLINE = PREFIX + "persistenceOutline"; //$NON-NLS-1$ - - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java deleted file mode 100644 index b7fcb1823e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -import java.util.Collection; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider; -import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider; - -public interface IJpaPlatformUi -{ - Collection structureProviders(); - - Collection detailsProviders(); - - void generateDDL(IJpaProject project, IStructuredSelection selection); - - void generateEntities(IJpaProject project, IStructuredSelection selection); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java deleted file mode 100644 index 78b93731cd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -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.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.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; - -public class JpaCompletionProposalComputer implements IJavaCompletionProposalComputer { - - public JpaCompletionProposalComputer() { - super(); - } - - public void sessionStarted() { - // do nothing - } - - @SuppressWarnings("unchecked") - public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) { - return (context instanceof JavaContentAssistInvocationContext) ? - this.computeCompletionProposals((JavaContentAssistInvocationContext) context) - : - Collections.emptyList(); - } - - private List computeCompletionProposals(JavaContentAssistInvocationContext context) { - try { - return this.computeCompletionProposals_(context); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } - } - - private List computeCompletionProposals_(JavaContentAssistInvocationContext context) throws JavaModelException { - ICompilationUnit cu = context.getCompilationUnit(); - if (cu == null) { - return Collections.emptyList(); - } - - IJpaFile jpaFile = JptCorePlugin.getJpaFile((IFile) cu.getCorrespondingResource()); - if (jpaFile == null) { - return Collections.emptyList(); - } - - JpaCompilationUnit jpaCU = (JpaCompilationUnit) jpaFile.getContent(); - 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 filter = ((prefix == null) ? Filter.Null.instance() : new IgnoreCasePrefixFilter(prefix)); - // the token "start" is the offset of the token's first character - int tokenStart = cc.getTokenStart(); - // the token "end" is the offset of the token's last character (yuk) - int tokenEnd = cc.getTokenEnd(); - -// System.out.println("prefix: " + new String(prefix)); -// System.out.println("token start: " + tokenStart); -// System.out.println("token end: " + tokenEnd); -// String source = cu.getSource(); -// String token = source.substring(tokenStart, 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 + "<="); - - List proposals = new ArrayList(); - for (Iterator stream = jpaCU.candidateValuesFor(context.getInvocationOffset(), filter); stream.hasNext(); ) { - String s = stream.next(); - proposals.add(new CompletionProposal(s, tokenStart, tokenEnd - tokenStart + 1, s.length())); - } - return proposals; - } - - @SuppressWarnings("unchecked") - public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) { - return Collections.EMPTY_LIST; - } - - public String getErrorMessage() { - return null; - } - - public void sessionEnded() { - // do nothing - } - - private static class IgnoreCasePrefixFilter implements Filter { - private final char[] prefix; - IgnoreCasePrefixFilter(char[] prefix) { - super(); - this.prefix = prefix; - } - public boolean accept(String s) { - return StringTools.stringStartsWithIgnoreCase(s.toCharArray(), prefix); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java deleted file mode 100644 index abdd525cf2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -public class JptUiIcons -{ - public static final String JPA_WIZ_BANNER = "full/wizban/jpa_facet_wizban"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java deleted file mode 100644 index cdc142e820..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -import org.eclipse.osgi.util.NLS; - -public class JptUiMessages extends NLS -{ - private static final String BUNDLE_NAME = "jpt_ui"; //$NON-NLS-1$ - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, JptUiMessages.class); - } - - public static String AddPersistentAttributeDialog_title; - - public static String AddPersistentAttributeDialog_attributeLabel; - - public static String AddPersistentAttributeDialog_mappingLabel; - - public static String AddPersistentAttributeDialog_noMappingKeyError; - - public static String AddPersistentClassDialog_title; - - public static String AddPersistentClassDialog_classLabel; - - public static String AddPersistentClassDialog_classDialog_title; - - public static String AddPersistentClassDialog_classDialog_message; - - public static String AddPersistentClassDialog_mappingLabel; - - public static String AddPersistentClassDialog_noClassError; - - public static String AddPersistentClassDialog_duplicateClassWarning; - - public static String AddPersistentClassDialog_classNotFoundWarning; - - public static String AddPersistentClassDialog_noMappingKeyError; - - public static String DatabaseReconnectWizardPage_database; - - public static String DatabaseReconnectWizardPage_databaseConnection; - - public static String DatabaseReconnectWizardPage_reconnectToDatabase; - - public static String DatabaseReconnectWizardPage_connection; - - public static String DatabaseReconnectWizardPage_schema; - - public static String DatabaseReconnectWizardPage_schemaInfo; - - public static String DatabaseReconnectWizardPage_addConnectionLink; - - public static String DatabaseReconnectWizardPage_reconnectLink; - - public static String General_browse; - - public static String General_deselectAll; - - public static String General_selectAll; - - public static String GenerateEntitiesWizard_generateEntities; - - public static String GenerateEntitiesWizardPage_chooseEntityTable; - - public static String GenerateEntitiesWizardPage_generateEntities; - - public static String GenerateEntitiesWizardPage_synchronizeClasses; - - public static String GenerateEntitiesWizardPage_tables; - - public static String GenerateEntitiesWizardPage_tableColumn; - - public static String GenerateEntitiesWizardPage_entityNameColumn; - - public static String GenericPlatformUiDialog_notSupportedMessageTitle; - - public static String GenericPlatformUiDialog_notSupportedMessageText; - - public static String JpaPreferencePage_defaultJpaLib; - - public static String JpaPreferencePage_userLibsLink; - - public static String JpaPreferencePage_invalidJpaLib; - - public static String JpaStructureView_viewNotAvailable; - - public static String JpaStructureView_linkWithEditorText; - - public static String JpaStructureView_linkWithEditorDesc; - - public static String JpaStructureView_linkWithEditorTooltip; - - public static String JpaDetailsView_viewNotAvailable; - - public static String NewJpaProjectWizard_title; - - public static String NewJpaProjectWizard_firstPage_title; - - public static String NewJpaProjectWizard_firstPage_description; - - public static String JpaFacetWizardPage_title; - - public static String JpaFacetWizardPage_description; - - public static String JpaFacetWizardPage_platformLabel; - - public static String JpaFacetWizardPage_connectionLabel; - - public static String JpaFacetWizardPage_connectionLink; - - public static String JpaFacetWizardPage_jpaImplementationLabel; - - public static String JpaFacetWizardPage_userServerLibLabel; - - public static String JpaFacetWizardPage_specifyLibLabel; - - public static String JpaFacetWizardPage_jpaPrefsLink; - - public static String JpaFacetWizardPage_userLibsLink; - - public static String JpaFacetWizardPage_persistentClassManagementLabel; - - public static String JpaFacetWizardPage_discoverClassesButton; - - public static String JpaFacetWizardPage_listClassesButton; - - public static String JpaFacetWizardPage_createOrmXmlButton; - - public static String PersistentAttributePage_mapAs; - - public static String PersistentTypePage_mapAs; - - public static String OverwriteConfirmerDialog_title; - - public static String OverwriteConfirmerDialog_text; - - - private JptUiMessages() { - throw new UnsupportedOperationException(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java deleted file mode 100644 index 77e697c5d8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -public class JptUiPlugin extends AbstractUIPlugin -{ - private static JptUiPlugin INSTANCE; - - /** - * The plug-in identifier of JPA UI support - * (value "org.eclipse.jpt.ui"). - */ - public final static String PLUGIN_ID = "org.eclipse.jpt.ui"; //$NON-NLS-1$ - - /** - * Returns the singleton Plugin - */ - public static JptUiPlugin getPlugin() { - return INSTANCE; - } - - public static void log(IStatus status) { - INSTANCE.getLog().log(status); - } - - public static void log(String msg) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null)); - } - - public static void log(Throwable throwable) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable)); - } - - - public JptUiPlugin() { - super(); - INSTANCE = this; - } - - /** - * This gets a .gif from the icons folder. - */ - public ImageDescriptor getImageDescriptor(String key) { - if (! key.startsWith("icons/")) { - key = "icons/" + key; - } - if (! key.endsWith(".gif")) { - key = key + ".gif"; - } - return imageDescriptorFromPlugin(PLUGIN_ID, key); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java deleted file mode 100644 index ad616f2f12..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java +++ /dev/null @@ -1,156 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal; - -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.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -public class PlatformRegistry -{ - public static final PlatformRegistry INSTANCE = new PlatformRegistry(); - - private static final String EXTENSION_ID = - "jpaPlatform"; //$NON-NLS-1$ - - private static final String EL_PLATFORM = - "jpaPlatform"; //$NON-NLS-1$ - - private static final String AT_ID = - "id"; //$NON-NLS-1$ - - private static final String AT_CLASS = - "class"; //$NON-NLS-1$ - - // key: String jpaPlatform id value: IConfigurationElement class descriptor - private Map jpaPlatforms; - - - /* (non Java doc) - * restrict access - */ - private PlatformRegistry() { - buildJpaPlatforms(); - } - - - private void buildJpaPlatforms() { - this.jpaPlatforms = new HashMap(); - - for (Iterator stream = allConfigElements(); stream.hasNext(); ) { - buildJpaPlatform((IConfigurationElement) stream.next()); - } - } - - private void buildJpaPlatform(IConfigurationElement configElement) { - if (! configElement.getName().equals(EL_PLATFORM)) { - return; - } - - String platformId = configElement.getAttribute(AT_ID); - String platformClass = configElement.getAttribute(AT_CLASS); - - if ((platformId == null) || (platformClass == null)) { - if (platformId == null) { - reportMissingAttribute(configElement, AT_ID); - } - if (platformClass == null) { - reportMissingAttribute(configElement, AT_CLASS); - } - return; - } - - if (jpaPlatforms.containsKey(platformId)) { - IConfigurationElement otherConfigElement = jpaPlatforms.get(platformId); - reportDuplicatePlatform(configElement, otherConfigElement); - } - - jpaPlatforms.put(platformId, configElement); - } - - public IJpaPlatformUi getJpaPlatform(String vendorId) { - IConfigurationElement registeredConfigElement = this.jpaPlatforms.get(vendorId); - - if (registeredConfigElement == null) { - return null; - } - - try { - return (IJpaPlatformUi) registeredConfigElement.createExecutableExtension(AT_CLASS); - } - catch (CoreException ce) { - reportFailedInstantiation(registeredConfigElement); - return null; - } - } - - private Iterator allConfigElements() { - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint extensionPoint = - registry.getExtensionPoint(JptUiPlugin.PLUGIN_ID, EXTENSION_ID); - IExtension[] extensions = extensionPoint.getExtensions(); - - return new CompositeIterator( - new TransformationIterator(CollectionTools.iterator(extensions)) { - @Override - protected Object transform(Object next) { - return CollectionTools.iterator(((IExtension) next).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 - + "\"."; - JptUiPlugin.log(message); - } - - // TODO externalize strings - private void reportDuplicatePlatform( - 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 \"jpaVendor\"."; - JptUiPlugin.log(message); - } - - // TODO externalize strings - private void reportFailedInstantiation(IConfigurationElement configElement) { - String message = - "Could not instantiate the class \"" - + configElement.getAttribute(AT_CLASS) - + "\" for the extension element \"" - + configElement.getName() - + "\" in the plugin \"" - + configElement.getContributor().getName() - + "\"."; - JptUiPlugin.log(message); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java deleted file mode 100644 index f38efd98b4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import java.util.Iterator; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.ui.actions.ActionDelegate; - -public class AddPersistentAttributeToXmlAction extends ActionDelegate -{ - - private ISelection selection; - - @Override - public void selectionChanged(IAction action, ISelection selection) { - super.selectionChanged(action, selection); - this.selection = selection; - } - - @Override - public void run(IAction action) { - if (this.selection instanceof StructuredSelection) { - for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) { - XmlPersistentAttribute xmlPersistentAttribute = i.next(); - xmlPersistentAttribute.setVirtual(false); - } - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java deleted file mode 100644 index d75a96dfe5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.ui.internal.dialogs.AddPersistentAttributeToXmlAndMapDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class AddPersistentAttributeToXmlAndMapAction - implements IObjectActionDelegate -{ - private Shell shell; - - private XmlPersistentAttribute unmappedXmlAttribute; - - - public AddPersistentAttributeToXmlAndMapAction() { - super(); - } - - public void run(IAction action) { - AddPersistentAttributeToXmlAndMapDialog dialog = new AddPersistentAttributeToXmlAndMapDialog(shell, unmappedXmlAttribute); - - dialog.create(); - dialog.setBlockOnOpen(true); - dialog.open(); - } - - public void selectionChanged(IAction action, ISelection selection) { - unmappedXmlAttribute = (XmlPersistentAttribute) ((StructuredSelection) selection).getFirstElement(); - } - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - shell = targetPart.getSite().getShell(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java deleted file mode 100644 index 23b4deba52..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.ui.internal.dialogs.AddPersistentClassDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class AddPersistentClassAction - implements IObjectActionDelegate -{ - private Shell shell; - - private EntityMappingsInternal entityMappings; - - - public AddPersistentClassAction() { - super(); - } - - public void run(IAction action) { - AddPersistentClassDialog dialog = new AddPersistentClassDialog(shell, entityMappings); - - dialog.create(); - dialog.setBlockOnOpen(true); - dialog.open(); - } - - public void selectionChanged(IAction action, ISelection selection) { - entityMappings = (EntityMappingsInternal) ((StructuredSelection) selection).getFirstElement(); - } - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - shell = targetPart.getSite().getShell(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java deleted file mode 100644 index ab7a410188..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.ui.internal.IJpaPlatformUi; -import org.eclipse.jpt.ui.internal.PlatformRegistry; - -/** - * GenerateDDLAction - */ -public class GenerateDDLAction extends ProjectAction { - - public GenerateDDLAction() { - super(); - } - - protected void execute(IJpaProject project) { - String vendorId = project.getPlatform().getId(); - - this.jpaPlatformUI(vendorId).generateDDL(project, this.getCurrentSelection()); - } - - private IJpaPlatformUi jpaPlatformUI(String vendorId) { - return PlatformRegistry.INSTANCE.getJpaPlatform(vendorId); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java deleted file mode 100644 index b12579130a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2007 Oracle. All rights reserved. -* This program and the accompanying materials are made available under the -* terms of the Eclipse Public License v1.0, which accompanies this distribution -* and is available at http://www.eclipse.org/legal/epl-v10.html. -* -* Contributors: -* Oracle - initial API and implementation -*******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.ui.internal.IJpaPlatformUi; -import org.eclipse.jpt.ui.internal.PlatformRegistry; - -/** - * GenerateEntitiesAction - */ -public class GenerateEntitiesAction extends ProjectAction { - public GenerateEntitiesAction() { - super(); - } - - protected void execute(IJpaProject project) { - String vendorId = project.getPlatform().getId(); - - this.jpaPlatformUI(vendorId).generateEntities(project, this.getCurrentSelection()); - } - - private IJpaPlatformUi jpaPlatformUI(String vendorId) { - return PlatformRegistry.INSTANCE.getJpaPlatform(vendorId); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java deleted file mode 100644 index 2e6396f4c1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.ui.IActionFilter; - -public class PersistentAttributeActionFilter - implements IActionFilter -{ - public static final String IS_MAPPED = "isMapped"; - - - public boolean testAttribute(Object target, String name, String value) { - if (! IS_MAPPED.equals(name)) { - return false; - } - - Boolean booleanValue; - if ("true".equals(value)) { - booleanValue = true; - } - else if ("false".equals(value)) { - booleanValue = false; - } - else { - return false; - } - - boolean mapped = ((IPersistentAttribute) target).mappingKey() != IMappingKeys.NULL_ATTRIBUTE_MAPPING_KEY; - return mapped == booleanValue; - } - - - public static final class Factory - implements IAdapterFactory - { - private static final Class[] ADAPTER_TYPES = { IActionFilter.class }; - - public Object getAdapter(final Object adaptable, final Class adapterType ) { - if( adapterType == IActionFilter.class ) { - return new PersistentAttributeActionFilter(); - } else { - return null; - } - } - - public Class[] getAdapterList() { - return ADAPTER_TYPES; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java deleted file mode 100644 index 04e657e6e3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import java.util.Iterator; -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.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.ui.IActionDelegate; -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(); - } - - /** - * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - // do nothing - } - - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - this.currentSelection = selection; - } - - protected IStructuredSelection getCurrentSelection() { - if (this.currentSelection instanceof IStructuredSelection) { - return (IStructuredSelection) this.currentSelection; - } - return null; - } - - /** - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action) { - if (this.currentSelection instanceof IStructuredSelection) { - for (Iterator stream = ((IStructuredSelection) this.currentSelection).iterator(); stream.hasNext(); ) { - this.execute(stream.next()); - } - } - } - - 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 void execute(IProject project) { - IJpaProject jpaProject = JptCorePlugin.getJpaProject(project); - if (jpaProject == null) { - return; - } - this.execute(jpaProject); - } - - protected void execute(IJpaProject project) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java deleted file mode 100644 index 326949e20c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import java.util.Iterator; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.ui.actions.ActionDelegate; - -public class RemovePersistentAttributeFromXmlAction extends ActionDelegate -{ - private ISelection selection; - - @Override - public void selectionChanged(IAction action, ISelection selection) { - super.selectionChanged(action, selection); - this.selection = selection; - } - - @Override - public void run(IAction action) { - if (this.selection instanceof StructuredSelection) { - for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) { - XmlPersistentAttribute xmlPersistentAttribute = i.next(); - XmlPersistentType xmlPersistentType = ((XmlTypeMapping) xmlPersistentAttribute.typeMapping()).getPersistentType(); - xmlPersistentType.getSpecifiedAttributeMappings().remove(xmlPersistentAttribute.getMapping()); - } - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java deleted file mode 100644 index 3d8a55a236..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class RemovePersistentClassAction - implements IObjectActionDelegate -{ - private XmlPersistentType persistentClass; - - - public RemovePersistentClassAction() { - super(); - } - - public void run(IAction action) { - XmlTypeMapping mapping = persistentClass.getMapping(); - ((EntityMappingsInternal) mapping.getEntityMappings()).getTypeMappings().remove(mapping); - } - - public void selectionChanged(IAction action, ISelection selection) { - persistentClass = (XmlPersistentType) ((StructuredSelection) selection).getFirstElement(); - } - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - // do nothing - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java deleted file mode 100644 index 3b4db8ed75..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class SynchronizeClassesAction - implements IObjectActionDelegate -{ - private IFile file; - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - // no-op for now - } - - public void run(IAction action) { - SynchronizeClassesJob job = new SynchronizeClassesJob(file); - job.schedule(); - } - - public void selectionChanged(IAction action, ISelection selection) { - // only one element in actual selection - file = (IFile) ((StructuredSelection) selection).getFirstElement(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java deleted file mode 100644 index e5f57a924a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.jpt.ui.internal.actions; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.ui.IActionFilter; - -public class XmlPersistentAttributeActionFilter - extends PersistentAttributeActionFilter -{ - public static final String IS_VIRTUAL = "isVirtual"; - - - public boolean testAttribute(Object target, String name, String value) { - if (! IS_VIRTUAL.equals(name)) { - return super.testAttribute(target, name, value); - } - - Boolean booleanValue; - if ("true".equals(value)) { - booleanValue = true; - } - else if ("false".equals(value)) { - booleanValue = false; - } - else { - return false; - } - return ((XmlPersistentAttribute) target).isVirtual() == booleanValue; - } - - - public static final class Factory - implements IAdapterFactory - { - private static final Class[] ADAPTER_TYPES = { IActionFilter.class }; - - public Object getAdapter(final Object adaptable, final Class adapterType ) { - if( adapterType == IActionFilter.class ) { - return new XmlPersistentAttributeActionFilter(); - } else { - return null; - } - } - - public Class[] getAdapterList() { - return ADAPTER_TYPES; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java deleted file mode 100644 index 6c3ff8ba80..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public abstract class BaseJpaComposite extends BaseJpaController - implements IJpaComposite -{ - private Composite composite; - - public BaseJpaComposite(Composite parent, int style, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, style, theCommandStack, widgetFactory); - } - - public BaseJpaComposite(Composite parent, CommandStack theCommandStack,TabbedPropertySheetWidgetFactory widgetFactory) { - this(parent, SWT.NULL, theCommandStack, widgetFactory); - } - - @Override - protected void buildWidget(Composite parent, int style) { - super.buildWidget(parent); - this.composite = createComposite(parent, style); - initializeLayout(this.composite); - } - - protected Composite createComposite(Composite parent, int style) { - return this.widgetFactory.createComposite(parent, style); - } - - protected abstract void initializeLayout(Composite composite); - - public Control getControl() { - return this.composite; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java deleted file mode 100644 index e4401eba8a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public abstract class BaseJpaController -{ - protected CommandStack commandStack; - - protected TabbedPropertySheetWidgetFactory widgetFactory; - - //put in the populating flag to stop the circular population of the entity name combo - //populateEntityNameCombo is calling select() which causes entityNameComboModified() to be called - //this sets the name in the model which starts the circle over again. We should probably - //short-circuit this differently, like in the emf model, keep the property change from being fired if - //a change did not actually occur - KFM - private boolean populating; - - - public BaseJpaController(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(); - this.widgetFactory = widgetFactory; - buildWidget(parent); - this.commandStack = theCommandStack; - } - - public BaseJpaController(Composite parent, int style, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(); - this.widgetFactory = widgetFactory; - buildWidget(parent, style); - this.commandStack = theCommandStack; - } - - - /** - * Override this method if using the constructor without the style bit - */ - protected void buildWidget(Composite parent) { - // no op - } - - /** - * Override this method if using the constructor with the style bit - */ - protected void buildWidget(Composite parent, int style) { - // no op - } - - /** - * This method is called from outside when setting the object of interest - */ - public final void populate(EObject obj) { - if (getControl().isDisposed()) { - return; - } - this.populating = true; - disengageListeners(); - doPopulate(obj); - engageListeners(); - this.populating = false; - } - - /** - * This method is called (perhaps internally) when this needs to repopulate - * but the object of interest has not changed - */ - public final void populate() { - if (getControl().isDisposed()) { - return; - } - this.populating = true; - doPopulate(); - this.populating = false; - } - - protected abstract void doPopulate(EObject obj); - - protected abstract void doPopulate(); - - protected abstract void engageListeners(); - - protected abstract void disengageListeners(); - - protected boolean isPopulating() { - return this.populating; - } - - public TabbedPropertySheetWidgetFactory getWidgetFactory() { - return this.widgetFactory; - } - - public void dispose() { - disengageListeners(); - } - - public abstract Control getControl(); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java deleted file mode 100644 index d57e13f02a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.forms.widgets.ScrolledForm; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public abstract class BaseJpaDetailsPage extends BaseJpaComposite - implements IJpaDetailsPage -{ - private Composite control; - - public BaseJpaDetailsPage( - Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - } - - public BaseJpaDetailsPage( - Composite parent, int style, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, style, theCommandStack, widgetFactory); - } - - @Override - //using this to get a Scroll bar on the JpaDetailsView - protected Composite createComposite(Composite parent, int style) { - ScrolledForm scrolledForm = this.widgetFactory.createScrolledForm(parent); - //Nesting another composite because combos on the ScrolledForm didn't have a border - scrolledForm.getBody().setLayout(new FillLayout()); - Composite composite = super.createComposite(scrolledForm.getBody(), style); - this.control = scrolledForm; - return composite; - } - - public final void populate(IJpaContentNode contentNode) { - super.populate(contentNode); - } - - @Override - protected final void doPopulate(EObject obj) { - doPopulate((IJpaContentNode) obj); - } - - protected abstract void doPopulate(IJpaContentNode contentNode); - - - @Override - public Control getControl() { - return this.control; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java deleted file mode 100644 index bd09fed9d7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.swt.widgets.Control; - - -public interface IJpaComposite { - - void populate(E model); - - Control getControl(); - - void dispose(); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java deleted file mode 100644 index ae78d2fc38..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.swt.widgets.Control; - -public interface IJpaDetailsPage -{ - Control getControl(); - - /** - * Set the content for the page and populate widgets - */ - void populate(IJpaContentNode contentNode); - - - /** - * Perform any other disposal needed - */ - void dispose(); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java deleted file mode 100644 index aab2f6f721..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public interface IJpaDetailsProvider -{ - - String fileContentType(); - - /** - * Build a properties page given the parent Composite and the - * content node id. - * It is legal to set the layout for the given Composite. - */ - IJpaDetailsPage buildDetailsPage(Composite parentComposite, Object contentNodeId, TabbedPropertySheetWidgetFactory widgetFactory); - - void dispose(); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java deleted file mode 100644 index 80c583ba2c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Versant. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Versant. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.part.PageBook; - -/** - * A wrapper for a PageBook with convenience methods. - */ -public class PageBookManager extends PageBook { - - private Map pageRecords; - private Object active; - private PageBook pageBook; - private Composite defaultComposite; - - /** - * A PageBookManager is a wrapper for a PageBook. It provides - * convenience methods to add, remove, activate and inactive pages in the internal PageBook. - * If a page gets deactivated, the manager activates a default page. - * - * @param parent The parent composite to this manager - * @param aDefaultLabel The label on the the default page. - */ - public PageBookManager(Composite parent, String aDefaultLabel) { - super(parent, SWT.NULL); - this.setLayout(new FillLayout()); - this.pageRecords = new HashMap(); - this.pageBook = new PageBook(this, SWT.NONE); - this.defaultComposite = new DefaultComposite(pageBook, aDefaultLabel); - this.pageBook.showPage(this.defaultComposite); - } - - /** - * @param anObj Activates (flips to top in the PageBook) the associated Composite - * for the given Object. Activates the DefaultComposite if there is no association - * for the given Object. - * @return Return false if there is no Composite association to the given Object or - * the associated Composite is already active. - */ - public boolean activate(Object anObj) { - if(anObj != null && !anObj.equals(this.active) && this.pageRecords.containsKey(anObj)) { - Composite composite = (Composite) this.pageRecords.get(anObj); - this.pageBook.showPage(composite); - this.active = anObj; - return true; - } else if((anObj == null || !anObj.equals(this.active)) && !this.pageRecords.containsKey(anObj)) { - this.pageBook.showPage(this.defaultComposite); - this.active = null; - } - return false; - } - - /** - * @param anObj - * @return Returns true if the associated Composite has been deactivated. - * Returns false if there is no Composite for the given Object - * or the Composite is already inactive. - */ - public boolean deactivate(Object anObj) { - if(anObj.equals(this.active)) { - this.pageBook.showPage(this.defaultComposite); - this.active = null; - return true; - } else { - return false; - } - } - - /** - * Associates the specified Object with the specified Composite - * in this PageBookManager. - * If this manager previously contained a mapping for the Object, the old - * Composite is replaced by the specified Composite. - * - * @param anObj Object with which the specified Composite is to be associated. - * @param aComposite Composite to be associated with the specified Object. - * - * @return previous Composite associated with specified Object, - * or null if there was no mapping for Object. - */ - public Composite put(Object anObj, Composite aComposite) { - Composite composite = (Composite) this.pageRecords.put(anObj, aComposite); - this.activate(anObj); - return composite; - } - - /** - * Removes the mapping for this Object from this pagebookmanager if it is present. - * - * @param anObj Object whose mapping is to be removed from this PageBookManager. - * @return previous Composite associated with specified Object. - */ - public Composite remove(Object anObj) { - if(anObj.equals(this.active)) { - this.active = null; - this.pageBook.showPage(this.defaultComposite); - } - return (Composite) this.pageRecords.remove(anObj); - } - - /** - * @param anObj whose presence in this map is to be tested - * @return true if this PageBookManager contains a mapping for the - * given Object. False otherwise. - */ - public boolean contains(Object anObj) { - return this.pageRecords.containsKey(anObj); - } - - public Composite get(Object key) { - return (Composite) pageRecords.get(key); - } - - /** - * @return The currently active composite - */ - public Composite getActive() { - if(this.active == null) { - return this.defaultComposite; - } else { - return (Composite) this.pageRecords.get(this.active); - } - } - - /** - * @return The internal PageBook of this PageBookManager. - * Composites which should work with this manager needs to be created - * with this Composite as their parent composite. - */ - public Composite getComposite() { - return this.pageBook; - } - - // a default composite which is show if the active composite - // gets deactivated - private class DefaultComposite extends Composite { - public DefaultComposite(Composite aParent, String aDefaultLabel) { - super(aParent, SWT.NONE); - setLayout(new FillLayout(SWT.VERTICAL)); - Label label = new Label(this, SWT.LEFT); - label.setText(aDefaultLabel); - } - } - - public void dispose() { - super.dispose(); - Collection composites = this.pageRecords.values(); - for (Iterator i = composites.iterator(); i.hasNext(); ) { - ((Composite) i.next()).dispose(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java deleted file mode 100644 index fb2a312eef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java +++ /dev/null @@ -1,397 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.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.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.BasicMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.DefaultBasicMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.DefaultEmbeddedMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedIdMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.IdMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToManyMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToOneMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.NullAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToManyMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToOneMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.TransientMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.VersionMappingUiProvider; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage -{ - private IPersistentAttribute attribute; - private IAttributeMapping attributeMapping; - private Adapter persistentAttributeListener; - private Adapter attributeMappingListener; - - private String currentMappingKey; - - private CComboViewer mappingCombo; - - private Map> mappingComposites; - protected PageBook mappingPageBook; - private IJpaComposite currentMappingComposite; - - /** - * These IAtttributeMappingUiProviders will be used as elements in the attributeMapping combo - * The first element in the combo will be one of the defaultAttributemappingUiProviders or - * if none of those apply the nullAttriubteMappingUiProvider will be used. The rest of the elements - * will be the attributeMappingUiProviders. The defaultAttributeMappingUiProvider is - * determined by matching its key with the key of the current attriubteMapping. - */ - private Collection attributeMappingUiProviders; - private Collection defaultAttributeMappingUiProviders; - private IAttributeMappingUiProvider nullAttributeMappingUiProvider; - - public PersistentAttributeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NONE, new BasicCommandStack(), widgetFactory); - persistentAttributeListener = buildAttributeListener(); - attributeMappingListener = buildAttributeMappingListener(); - mappingComposites = new HashMap>(); - this.attributeMappingUiProviders = buildAttributeMappingUiProviders(); - this.defaultAttributeMappingUiProviders = buildDefaultAttributeMappingUiProviders(); - this.nullAttributeMappingUiProvider = buildNullAttributeMappingUiProvider(); - } - - protected IAttributeMappingUiProvider buildNullAttributeMappingUiProvider() { - return NullAttributeMappingUiProvider.instance(); - } - - protected Collection buildAttributeMappingUiProviders() { - Collection providers = new ArrayList(); - providers.add(BasicMappingUiProvider.instance()); - providers.add(EmbeddedMappingUiProvider.instance()); - providers.add(EmbeddedIdMappingUiProvider.instance()); - providers.add(IdMappingUiProvider.instance()); - providers.add(ManyToManyMappingUiProvider.instance()); - providers.add(ManyToOneMappingUiProvider.instance()); - providers.add(OneToManyMappingUiProvider.instance()); - providers.add(OneToOneMappingUiProvider.instance()); - providers.add(TransientMappingUiProvider.instance()); - providers.add(VersionMappingUiProvider.instance()); - return providers; - } - - protected Collection attributeMappingUiProviders() { - return this.attributeMappingUiProviders; - } - - protected Collection buildDefaultAttributeMappingUiProviders() { - Collection providers = new ArrayList(); - providers.add(DefaultBasicMappingUiProvider.instance()); - providers.add(DefaultEmbeddedMappingUiProvider.instance()); - return providers; - } - - protected Collection defaultAttributeMappingUiProviders() { - return this.defaultAttributeMappingUiProviders; - } - - private IAttributeMappingUiProvider attributeMappingUiProvider(String key) { - for (IAttributeMappingUiProvider provider : attributeMappingUiProviders()) { - if (provider.key() == key) { - return provider; - } - } - return this.nullAttributeMappingUiProvider; - } - private IAttributeMappingUiProvider defaultAttributeMappingUiProvider(String key) { - for (IAttributeMappingUiProvider provider : defaultAttributeMappingUiProviders()) { - if (provider.key() == key) { - return provider; - } - } - return this.nullAttributeMappingUiProvider; - } - - private Adapter buildAttributeListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - persistentAttributeChanged(notification); - } - }; - } - - void persistentAttributeChanged(Notification notification) { - switch (notification.getFeatureID(IPersistentAttribute.class)) { - case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING: - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - break; - } - } - - private Adapter buildAttributeMappingListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - attributeMappingChanged(notification); - } - }; - } - - void attributeMappingChanged(Notification notification) { -// switch (notification.getFeatureID(IAttributeMapping.class)) { -// case JpaCorePackage.IATTRIBUTE_MAPPING__DEFAULT: -// Display.getDefault().asyncExec( -// new Runnable() { -// public void run() { -// populate(); -// } -// }); -// break; -// } - } - - protected Label buildMappingLabel(Composite parent) { - return getWidgetFactory().createLabel(parent, JptUiMessages.PersistentAttributePage_mapAs); - } - - protected CComboViewer buildMappingCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - mappingCombo = new CComboViewer(combo); - mappingCombo.setContentProvider(buildContentProvider()); - mappingCombo.setLabelProvider(buildLabelProvider()); - mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - mappingChanged(event); - } - }); - return mappingCombo; - } - - private IContentProvider buildContentProvider() { - return new IStructuredContentProvider() { - public void dispose() { - // do nothing - } - - public Object[] getElements(Object inputElement) { - if (inputElement == null) { - return new Object[]{}; - } - return uiProvidersFor((IPersistentAttribute) inputElement); - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - }; - } - - protected IAttributeMappingUiProvider[] uiProvidersFor(IPersistentAttribute persistentAttribute) { - IAttributeMappingUiProvider[] providers = new IAttributeMappingUiProvider[attributeMappingUiProviders().size() +1]; - providers[0] = this.nullAttributeMappingUiProvider; - for (IAttributeMappingUiProvider uiProvider : defaultAttributeMappingUiProviders()) { - if (uiProvider.key() == persistentAttribute.defaultMappingKey()) { - providers[0] = uiProvider; - break; - } - } - int i = 1; - for (IAttributeMappingUiProvider uiProvider : attributeMappingUiProviders()) { - providers[i++] = uiProvider; - } - return providers; - } - - private IBaseLabelProvider buildLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - return ((IAttributeMappingUiProvider) element).label(); - } - }; - } - - protected PageBook buildMappingPageBook(Composite parent) { - mappingPageBook = new PageBook(parent, SWT.NONE); - return mappingPageBook; - } - - protected IJpaComposite buildMappingComposite(PageBook pageBook, String key) { - if (this.attributeMapping == null || this.attributeMapping.isDefault()) { - return defaultAttributeMappingUiProvider(key).buildAttributeMappingComposite(pageBook, this.commandStack, getWidgetFactory()); - } - - return attributeMappingUiProvider(key).buildAttributeMappingComposite(pageBook, this.commandStack, getWidgetFactory()); - } - - void mappingChanged(SelectionChangedEvent event) { - if (isPopulating()) { - return; - } - if (event.getSelection() instanceof StructuredSelection) { - IAttributeMappingUiProvider provider = (IAttributeMappingUiProvider) ((StructuredSelection) event.getSelection()).getFirstElement(); - String key = (this.defaultAttributeMappingUiProviders().contains(provider) ? null : provider.key()); - attribute.setSpecifiedMappingKey(key); - } - } - - @Override - protected void doPopulate(IJpaContentNode persistentAttributeNode) { - attribute = (IPersistentAttribute) persistentAttributeNode; - populateMappingComboAndPage(); - } - - @Override - protected void doPopulate() { - populateMappingComboAndPage(); - } - - @Override - protected void engageListeners() { - if (attribute != null) { - attribute.eAdapters().add(persistentAttributeListener); - if (attributeMapping != null) { - attributeMapping.eAdapters().add(attributeMappingListener); - } - } - } - - @Override - protected void disengageListeners() { - if (attribute != null) { - attribute.eAdapters().remove(persistentAttributeListener); - if (attributeMapping != null) { - attributeMapping.eAdapters().remove(attributeMappingListener); - } - } - } - - private void populateMappingComboAndPage() { - if (attribute == null) { - attributeMapping = null; - currentMappingKey = null; - mappingCombo.setInput(null); - mappingCombo.setSelection(StructuredSelection.EMPTY); - - if (currentMappingComposite != null) { - currentMappingComposite.populate(null); - currentMappingComposite = null; - } - - return; - } - attributeMapping = attribute.getMapping(); - setComboData(attribute.candidateMappingKeys()); - - populateMappingPage(attributeMapping == null ? null : attributeMapping.getKey()); - } - - private void populateMappingPage(String mappingKey) { - if (currentMappingComposite != null) { - if (mappingKey == currentMappingKey) { - if (currentMappingComposite != null) { - currentMappingComposite.populate(attributeMapping); - return; - } - } - else { - currentMappingComposite.populate(null); - // don't return - } - } - - currentMappingKey = mappingKey; - - IJpaComposite composite = mappingCompositeFor(mappingKey); - mappingPageBook.showPage(composite.getControl()); - - currentMappingComposite = composite; - currentMappingComposite.populate(attributeMapping); - } - - private void setComboData(Iterator availableMappingKeys) { - if (attribute != mappingCombo.getInput()) { - mappingCombo.setInput(attribute); - } - if (attributeMapping == null || attributeMapping.isDefault()) { - mappingCombo.setSelection(new StructuredSelection(mappingCombo.getElementAt(0))); - } - else { - IAttributeMappingUiProvider provider = attributeMappingUiProvider(attribute.mappingKey()); - if (provider != null && ! provider.equals(((StructuredSelection) mappingCombo.getSelection()).getFirstElement())) { - mappingCombo.setSelection(new StructuredSelection(provider)); - } - } - } - - private IJpaComposite mappingCompositeFor(String key) { - IJpaComposite composite = mappingComposites.get(key); - if (composite != null) { - return composite; - } - - composite = buildMappingComposite(mappingPageBook, key); - - if (composite != null) { - mappingComposites.put(key, composite); - } - - return composite; - } - -//TODO focus?? -// public boolean setFocus() { -// super.setFocus(); -// return mappingCombo.getCombo().setFocus(); -// } - - @Override - public void dispose() { - disengageListeners(); - for (Iterator> stream = mappingComposites.values().iterator(); stream.hasNext(); ) { - stream.next().dispose(); - } - super.dispose(); - } - - public IPersistentAttribute getAttribute() { - return attribute; - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java deleted file mode 100644 index bd8353b923..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java +++ /dev/null @@ -1,292 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.details; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.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.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddableUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EntityUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.MappedSuperclassUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.NullTypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public abstract class PersistentTypeDetailsPage extends BaseJpaDetailsPage -{ - private IPersistentType persistentType; - private Adapter persistentTypeListener; - - private String currentMappingKey; - - private CComboViewer typeMappingCombo; - - /** - * A Map of mapping Composites of type IPersistenceComposite that is keyed on IConfigurationElement - */ - private Map composites; - - protected PageBook typeMappingPageBook; - - private IJpaComposite visibleMappingComposite; - - private Collection typeMappingUiProviders; - - public PersistentTypeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NONE, new BasicCommandStack(), widgetFactory); - this.persistentTypeListener = buildPersistentTypeListener(); - this.composites = new HashMap(); - this.typeMappingUiProviders = buildTypeMappingUiProviders(); - } - - protected Collection buildTypeMappingUiProviders() { - Collection typeMappingUiProviders = new ArrayList(); - typeMappingUiProviders.add(new NullTypeMappingUiProvider()); - typeMappingUiProviders.add(new EntityUiProvider()); - typeMappingUiProviders.add(new MappedSuperclassUiProvider()); - typeMappingUiProviders.add(new EmbeddableUiProvider()); - return typeMappingUiProviders; - } - - private Adapter buildPersistentTypeListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - persistentTypeChanged(notification); - } - }; - } - - private void persistentTypeChanged(Notification notification) { - switch (notification.getFeatureID(IPersistentType.class)) { - case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY: - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - break; - } - } - - protected Label buildTypeMappingLabel(Composite parent) { - return getWidgetFactory().createLabel(parent, JptUiMessages.PersistentTypePage_mapAs); - } - - protected CComboViewer buildTypeMappingCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - typeMappingCombo = new CComboViewer(combo); - typeMappingCombo.setContentProvider(buildContentProvider()); - typeMappingCombo.setLabelProvider(buildLabelProvider()); - typeMappingCombo.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - typeMappingChanged(event); - } - }); - return typeMappingCombo; - } - - private IContentProvider buildContentProvider() { - return new IStructuredContentProvider() { - public void dispose() { - // do nothing - } - - public Object[] getElements(Object inputElement) { - return (persistentType == null) ? - new String[] {}: - PersistentTypeDetailsPage.this.typeMappingUiProviders.toArray(); - } - - public void inputChanged( - Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - }; - } - private IBaseLabelProvider buildLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - return ((ITypeMappingUiProvider) element).label(); - } - }; - } - - protected PageBook buildTypeMappingPageBook(Composite parent) { - typeMappingPageBook = new PageBook(parent, SWT.NONE); - return typeMappingPageBook; - } - - private IJpaProject getJpaProject() { - return getPersistentType().getJpaProject(); - } - - private ITypeMappingUiProvider typeMappingUiProvider(String key) { - for (ITypeMappingUiProvider provider : this.typeMappingUiProviders) { - if (provider.key() == key) { - return provider; - } - } - throw new IllegalArgumentException("unsupported type mapping UI provider key: " + key); - } - - private void typeMappingChanged(SelectionChangedEvent event) { - if (isPopulating()) { - return; - } - if (event.getSelection() instanceof StructuredSelection) { - ITypeMappingUiProvider provider = (ITypeMappingUiProvider) ((StructuredSelection) event.getSelection()).getFirstElement(); - persistentType.setMappingKey(provider.key()); - } - } - - @Override - protected void doPopulate(IJpaContentNode persistentTypeNode) { - persistentType = (IPersistentType) persistentTypeNode; - populateMappingComboAndPage(); - } - - @Override - protected void doPopulate() { - populateMappingComboAndPage(); - } - - protected void engageListeners() { - if (persistentType != null) { - persistentType.eAdapters().add(persistentTypeListener); - } - } - - protected void disengageListeners() { - if (persistentType != null) { - persistentType.eAdapters().remove(persistentTypeListener); - } - } - - private void populateMappingComboAndPage() { - if (persistentType == null) { - currentMappingKey = null; - typeMappingCombo.setInput(null); - typeMappingCombo.setSelection(StructuredSelection.EMPTY); - - if (visibleMappingComposite != null) { - visibleMappingComposite.populate(null); - visibleMappingComposite = null; - } - - return; - } - - String mappingKey = persistentType.getMapping().getKey(); - setComboData(mappingKey, persistentType.candidateMappingKeys()); - - populateMappingPage(mappingKey); - } - - private void populateMappingPage(String mappingKey) { - if (visibleMappingComposite != null) { - if (mappingKey == currentMappingKey) { - if (visibleMappingComposite != null) { - visibleMappingComposite.populate(persistentType.getMapping()); - return; - } - } - else { - visibleMappingComposite.populate(null); - // don't return - } - } - - currentMappingKey = mappingKey; - - IJpaComposite mappingComposite = mappingCompositeFor(mappingKey); - typeMappingPageBook.showPage(mappingComposite.getControl()); - - visibleMappingComposite = mappingComposite; - visibleMappingComposite.populate(persistentType.getMapping()); - } - - private void setComboData(String mappingKey, Iterator availableMappingKeys) { - if (persistentType != typeMappingCombo.getInput()) { - typeMappingCombo.setInput(persistentType); - } - - ITypeMappingUiProvider provider = typeMappingUiProvider(mappingKey); - if (! provider.equals(((StructuredSelection) typeMappingCombo.getSelection()).getFirstElement())) { - typeMappingCombo.setSelection(new StructuredSelection(provider)); - } - } - - private IJpaComposite mappingCompositeFor(String key) { - IJpaComposite mappingComposite = (IJpaComposite) composites.get(key); - if (mappingComposite != null) { - return mappingComposite; - } - - mappingComposite = buildMappingComposite(typeMappingPageBook, key); - - if (mappingComposite != null) { - composites.put(key, mappingComposite); - } - - return mappingComposite; - } - - protected IJpaComposite buildMappingComposite(PageBook pageBook, String key) { - //TODO what about null composite? - return typeMappingUiProvider(key).buildPersistentTypeMappingComposite(pageBook, this.commandStack, getWidgetFactory()); -// return new NullComposite(pageBook, commandStack); - } - -//TODO focus?? -// public boolean setFocus() { -// super.setFocus(); -// return typeMappingCombo.getCombo().setFocus(); -// } - - public void dispose() { - disengageListeners(); - for (Iterator i = composites.values().iterator(); i.hasNext(); ) { - ((IJpaComposite) i.next()).dispose(); - } - super.dispose(); - } - - public IPersistentType getPersistentType() { - return persistentType; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java deleted file mode 100644 index 21c7550bda..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java +++ /dev/null @@ -1,193 +0,0 @@ -package org.eclipse.jpt.ui.internal.dialogs; - -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.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.BasicMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedIdMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.IdMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToManyMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToOneMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToManyMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToOneMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.TransientMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.VersionMappingUiProvider; -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; - -public class AddPersistentAttributeToXmlAndMapDialog extends StatusDialog -{ - private XmlPersistentAttribute unmappedPersistentAttribute; - - private Label attributeLabel; - - private Text attributeText; - - private Label mappingLabel; - - private ComboViewer mappingCombo; - - - public AddPersistentAttributeToXmlAndMapDialog(Shell parentShell, XmlPersistentAttribute unmappedPersistentAttribute) { - super(parentShell); - this.unmappedPersistentAttribute = unmappedPersistentAttribute; - setTitle(JptUiMessages.AddPersistentAttributeDialog_title); - } - - 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()); - - attributeLabel = 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); - - mappingLabel = createLabel(composite, 1, JptUiMessages.AddPersistentClassDialog_mappingLabel); - - mappingCombo = new ComboViewer(createCombo(composite, 1)); - mappingCombo.setContentProvider( - new IStructuredContentProvider() { - public void dispose() {} - - public Object[] getElements(Object inputElement) { - return new Object[] { - BasicMappingUiProvider.instance(), - IdMappingUiProvider.instance(), - VersionMappingUiProvider.instance(), - OneToOneMappingUiProvider.instance(), - OneToManyMappingUiProvider.instance(), - ManyToOneMappingUiProvider.instance(), - ManyToManyMappingUiProvider.instance(), - EmbeddedMappingUiProvider.instance(), - EmbeddedIdMappingUiProvider.instance(), - TransientMappingUiProvider.instance() - }; - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} - }); - mappingCombo.setLabelProvider( - new LabelProvider() { - @Override - public String getText(Object element) { - return ((IAttributeMappingUiProvider) element).label(); - } - }); - mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - validate(); - } - }); - mappingCombo.setInput("FOO"); - 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; - } - - 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; - } - - private IJpaProject getJpaProject() { - return unmappedPersistentAttribute.getJpaProject(); - } - - public String getAttributeName() { - return attributeText.getText(); - } - - public String getMappingKey() { - StructuredSelection selection = (StructuredSelection) mappingCombo.getSelection(); - return (selection.isEmpty()) ? null : ((IAttributeMappingUiProvider) selection.getFirstElement()).key(); - } - - private void validate() { -// if (entityMappings.containsPersistentType(type)) { -// updateStatus( -// new Status( -// IStatus.WARNING, JptUiPlugin.PLUGIN_ID, -// JptUiMessages.AddPersistentClassDialog_duplicateClassWarning)); -// return; -// } -// - String mappingKey = getMappingKey(); - if (mappingKey == null) { - updateStatus( - new Status( - IStatus.ERROR, JptUiPlugin.PLUGIN_ID, - JptUiMessages.AddPersistentAttributeDialog_noMappingKeyError)); - return; - } - - updateStatus(Status.OK_STATUS); - } - - @Override - protected void okPressed() { - unmappedPersistentAttribute.setSpecifiedMappingKey(getMappingKey()); - unmappedPersistentAttribute.setVirtual(false); - super.okPressed(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java deleted file mode 100644 index 1bd955bb30..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java +++ /dev/null @@ -1,279 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.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.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.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.jface.window.Window; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddableUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EntityUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.MappedSuperclassUiProvider; -import org.eclipse.jpt.utility.internal.StringTools; -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 EntityMappingsInternal entityMappings; - - private Label classLabel; - - private Text classText; - - private Button classBrowseButton; - - private Label mappingLabel; - - private ComboViewer mappingCombo; - - - public AddPersistentClassDialog(Shell parentShell, EntityMappingsInternal entityMappings) { - super(parentShell); - this.entityMappings = entityMappings; - setTitle(JptUiMessages.AddPersistentClassDialog_title); - } - - 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)); - - classLabel = createLabel(composite, 2, JptUiMessages.AddPersistentClassDialog_classLabel); - - classText = createText(composite, 1); - classText.addModifyListener( - new ModifyListener() { - public void modifyText(ModifyEvent e) { - validate(); - } - } - ); - - classBrowseButton = createButton(composite, 1, JptUiMessages.General_browse); - 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); - } - }); - - mappingLabel = createLabel(composite, 2, JptUiMessages.AddPersistentClassDialog_mappingLabel); - - mappingCombo = new ComboViewer(createCombo(composite, 2)); - mappingCombo.setContentProvider( - new IStructuredContentProvider() { - public void dispose() {} - - public Object[] getElements(Object inputElement) { - return new Object[] { - new MappedSuperclassUiProvider(), - new EntityUiProvider(), - new EmbeddableUiProvider() - }; - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} - }); - mappingCombo.setLabelProvider( - new LabelProvider() { - @Override - public String getText(Object element) { - return ((ITypeMappingUiProvider) element).label(); - } - }); - mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - validate(); - } - }); - mappingCombo.setInput("FOO"); - 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, 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 Button createButton(Composite container, int span, String text) { - Button button = new Button(container, SWT.NONE); - button.setText(text); - GridData gd = new GridData(); - gd.horizontalSpan = span; - button.setLayoutData(gd); - return button; - } - - 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 IJpaProject getJpaProject() { - return entityMappings.getJpaProject(); - } - - public String getClassName() { - return classText.getText(); - } - - public String getMappingKey() { - StructuredSelection selection = (StructuredSelection) mappingCombo.getSelection(); - return (selection.isEmpty()) ? null : ((ITypeMappingUiProvider) selection.getFirstElement()).key(); - } - - 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) { - JptUiPlugin.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, JptUiPlugin.PLUGIN_ID, - JptUiMessages.AddPersistentClassDialog_noClassError)); - return; - } - - IType type; - try { - type = getJpaProject().getJavaProject().findType(className); - } - catch (JavaModelException jme) { - type = null; - } - - if (type == null) { - updateStatus( - new Status( - IStatus.WARNING, JptUiPlugin.PLUGIN_ID, - JptUiMessages.AddPersistentClassDialog_classNotFoundWarning)); - return; - } - - if (entityMappings.containsPersistentType(type)) { - updateStatus( - new Status( - IStatus.WARNING, JptUiPlugin.PLUGIN_ID, - JptUiMessages.AddPersistentClassDialog_duplicateClassWarning)); - return; - } - - String mappingKey = getMappingKey(); - if (mappingKey == null) { - updateStatus( - new Status( - IStatus.ERROR, JptUiPlugin.PLUGIN_ID, - JptUiMessages.AddPersistentClassDialog_noMappingKeyError)); - return; - } - - updateStatus(Status.OK_STATUS); - } - - @Override - protected void okPressed() { - entityMappings.addMapping(getClassName(), getMappingKey()); - super.okPressed(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java deleted file mode 100644 index 05fe71c01b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2007 Oracle. All rights reserved. -* This program and the accompanying materials are made available under the -* terms of the Eclipse Public License v1.0, which accompanies this distribution -* and is available at http://www.eclipse.org/legal/epl-v10.html. -* -* Contributors: -* Oracle - initial API and implementation -*******************************************************************************/ -package org.eclipse.jpt.ui.internal.generic; - -import java.util.Collection; - -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob; -import org.eclipse.jpt.gen.internal.EntityGenerator; -import org.eclipse.jpt.gen.internal.PackageGenerator; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.wizards.GenerateEntitiesWizard; -import org.eclipse.osgi.util.NLS; -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.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -/** - * EntitiesGenerator - */ -public class EntitiesGenerator -{ - private IJpaProject project; - private IStructuredSelection selection; - - // ********** constructors ********** - - static public void generate( IJpaProject project, IStructuredSelection selection) { - if(project == null) { - throw new NullPointerException(); - } - new EntitiesGenerator( project, selection).generate(); - } - - public EntitiesGenerator() { - super(); - } - - private EntitiesGenerator( IJpaProject project, IStructuredSelection selection) { - super(); - this.project = project; - this.selection = selection; - } - - // ********** behavior ********** - - protected void generate() { - GenerateEntitiesWizard wizard = new GenerateEntitiesWizard(this.project, this.selection); - - WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard); - dialog.create(); - int returnCode = dialog.open(); - if (returnCode == Window.OK) { - IWorkspaceRunnable runnable = new GenerateEntitiesRunnable( - wizard.getPackageGeneratorConfig(), - wizard.getEntityGeneratorConfig(), - wizard.getSelectedTables(), - wizard.synchronizePersistenceXml(), - project, - new OverwriteConfirmer(this.getCurrentShell()) - ); - try { - // TODO pass in real ProgressMonitor - ResourcesPlugin.getWorkspace().run(runnable, new NullProgressMonitor()); - } catch (CoreException ex) { - throw new RuntimeException(ex); - } - } - } - - private Shell getCurrentShell() { - return Display.getCurrent().getActiveShell(); - } - - // ********** runnable ********** - - static class GenerateEntitiesRunnable implements IWorkspaceRunnable { - private final PackageGenerator.Config packageConfig; - private final EntityGenerator.Config entityConfig; - private final Collection selectedTables; - private final boolean synchronizePersistenceXml; - private final EntityGenerator.OverwriteConfirmer overwriteConfirmer; - private final IJpaProject project; - - GenerateEntitiesRunnable( - PackageGenerator.Config packageConfig, - EntityGenerator.Config entityConfig, - Collection selectedTables, - boolean synchronizePersistenceXml, - IJpaProject project, - EntityGenerator.OverwriteConfirmer overwriteConfirmer - ) { - super(); - this.packageConfig = packageConfig; - this.entityConfig = entityConfig; - this.selectedTables = selectedTables; - this.synchronizePersistenceXml = synchronizePersistenceXml; - this.overwriteConfirmer = overwriteConfirmer; - this.project = project; - } - - public void run(IProgressMonitor monitor) throws CoreException { - monitor.beginTask("", 1000); - try { - PackageGenerator.generateEntities(this.packageConfig, this.entityConfig, this.selectedTables, this.overwriteConfirmer, monitor); - if (synchronizePersistenceXml) { - // we currently only support *one* persistence.xml file per project - IJpaFile resource = project.getPlatform().validPersistenceXmlFiles().next(); - if (resource != null) { - SynchronizeClassesJob job = new SynchronizeClassesJob(resource.getFile()); - job.schedule(); - } - } - } catch (OperationCanceledException ex) { - // fall through and tell monitor we are done - } - monitor.done(); - } - - } - - // ********** overwrite confirmer ********** - - static class OverwriteConfirmer implements EntityGenerator.OverwriteConfirmer { - private Shell shell; - private boolean overwriteAll = false; - private boolean skipAll = false; - - OverwriteConfirmer(Shell shell) { - super(); - this.shell = shell; - } - - public boolean overwrite(String className) { - if (this.overwriteAll) { - return true; - } - if (this.skipAll) { - return false; - } - return this.promptUser(className); - } - - private boolean promptUser(String className) { - OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.shell, className); - if (dialog.open() == Window.CANCEL) { - throw new OperationCanceledException(); - } - if (dialog.yes()) { - return true; - } else if (dialog.yesToAll()) { - this.overwriteAll = true; - return true; - } else if (dialog.no()) { - return false; - } else if (dialog.noToAll()) { - this.skipAll = true; - return false; - } - throw new IllegalStateException(); - } - - } - - // ********** dialog ********** - - static class OverwriteConfirmerDialog extends Dialog { - private final String className; - private boolean yes = false; - private boolean yesToAll = false; - private boolean no = false; - private boolean noToAll = false; - - OverwriteConfirmerDialog(Shell parent, String className) { - super(parent); - this.className = className; - } - - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(JptUiMessages.OverwriteConfirmerDialog_title); - } - - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - GridLayout gridLayout = (GridLayout) composite.getLayout(); - gridLayout.numColumns = 2; - - Label text = new Label(composite, SWT.LEFT); - text.setText(NLS.bind(JptUiMessages.OverwriteConfirmerDialog_text, this.className)); - text.setLayoutData(new GridData()); - - return composite; - } - - 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); - } - - 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; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java deleted file mode 100644 index 0189ea62ad..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.generic; - -import java.text.MessageFormat; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.ui.internal.BaseJpaPlatformUi; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -public class GenericPlatformUi extends BaseJpaPlatformUi -{ - public GenericPlatformUi() { - super(); - } - - public void generateDDL(IJpaProject project, IStructuredSelection selection) { - this.displayNotSupportedMessage(JptUiMessages.GenericPlatformUiDialog_notSupportedMessageTitle, JptUiMessages.GenericPlatformUiDialog_notSupportedMessageText); - } - - protected void displayNotSupportedMessage(String title, String message) { - String formattedMessage = MessageFormat.format( message, (Object [])(new String [] { message})); - Shell currentShell = Display.getCurrent().getActiveShell(); - MessageDialog.openInformation(currentShell, title, formattedMessage); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java deleted file mode 100644 index 4276feb345..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - - -public interface IAttributeMappingUiProvider -{ - /** - * A unique string that corresponds to the key of a MappingProvider in the core - * (IJavaAttributeMappingProvider and/or IXmlAttributeMappingProvider) - */ - String key(); - - /** - * A label to be displayed to the label as an option in the mapping type combo box - * @return - */ - String label(); - - /** - * The IJpaComposite that correponds to this mapping type. This will be displayed - * by the PersistentAttributeDetailsPage 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 parent - * @param commandStack - * @param widgetFactory - * @return - */ - IJpaComposite buildAttributeMappingComposite( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory); - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java deleted file mode 100644 index d614a57bf6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public interface ITypeMappingUiProvider -{ - /** - * A unique string that corresponds to the key of a MappingProvider in the core - */ - String key(); - - /** - * A label to be displayed to the label as an option in the mapping type combo box - * @return - */ - String label(); - - /** - * The IJpaComposite that correponds to this mapping type. This will be displayed - * by the PersistentTypeDetailsPage 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 parent - * @param commandStack - * @param widgetFactory - * @return - */ - IJpaComposite buildPersistentTypeMappingComposite( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory); - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java deleted file mode 100644 index 314f1c505c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.details; - -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jpt.core.internal.content.java.IJavaContentNodes; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsPage; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class JavaDetailsProvider - implements IJpaDetailsProvider -{ - public JavaDetailsProvider() { - super(); - } - - public String fileContentType() { - return JavaCore.JAVA_SOURCE_CONTENT_TYPE; - } - - public IJpaDetailsPage buildDetailsPage( - Composite parentComposite, Object contentNodeId, TabbedPropertySheetWidgetFactory widgetFactory) { - if (contentNodeId.equals(IJavaContentNodes.PERSISTENT_TYPE_ID)) { - return new JavaPersistentTypeDetailsPage(parentComposite, widgetFactory); - } - else if (contentNodeId.equals(IJavaContentNodes.PERSISTENT_ATTRIBUTE_ID)) { - return new JavaPersistentAttributeDetailsPage(parentComposite, widgetFactory); - } - - return null; - } - - public void dispose() { - // no op ... for now - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java deleted file mode 100644 index b249b9b1f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.details; - -import org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -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.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class JavaPersistentAttributeDetailsPage - extends PersistentAttributeDetailsPage -{ - public JavaPersistentAttributeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - composite.setLayout(new GridLayout(2, false)); - - GridData gridData; - - buildMappingLabel(composite); - - CComboViewer mappingCombo = buildMappingCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - mappingCombo.getCombo().setLayoutData(gridData); - - PageBook book = buildMappingPageBook(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - book.setLayoutData(gridData); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java deleted file mode 100644 index 9b2d2735d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.details; - -import org.eclipse.jpt.ui.internal.details.PersistentTypeDetailsPage; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -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.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class JavaPersistentTypeDetailsPage extends - PersistentTypeDetailsPage -{ - - public JavaPersistentTypeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout gridLayout = new GridLayout(); - gridLayout.numColumns = 2; - composite.setLayout(gridLayout); - - buildTypeMappingLabel(composite); - - CComboViewer typeMappingCombo = buildTypeMappingCombo(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - typeMappingCombo.getCombo().setLayoutData(gridData); - - PageBook typeMappingPageBook = buildTypeMappingPageBook(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - typeMappingPageBook.setLayoutData(gridData); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java deleted file mode 100644 index 72af6c56ed..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.BasicComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class BasicMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final BasicMappingUiProvider INSTANCE = new BasicMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private BasicMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_BasicLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new BasicComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java deleted file mode 100644 index c01c35db5f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.BasicComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class DefaultBasicMappingUiProvider - implements IAttributeMappingUiProvider -{ - // singleton - private static final DefaultBasicMappingUiProvider INSTANCE = new DefaultBasicMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private DefaultBasicMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return "Default (" + JptUiMappingsMessages.PersistentAttributePage_BasicLabel + ")"; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new BasicComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java deleted file mode 100644 index 57c4932b9a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class DefaultEmbeddedMappingUiProvider - implements IAttributeMappingUiProvider -{ - // singleton - private static final DefaultEmbeddedMappingUiProvider INSTANCE = new DefaultEmbeddedMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private DefaultEmbeddedMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return "Default (" + JptUiMappingsMessages.PersistentAttributePage_EmbeddedLabel + ")"; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EmbeddedComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java deleted file mode 100644 index ca4a97ead2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EmbeddableComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddableUiProvider implements ITypeMappingUiProvider -{ - public String key() { - return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentTypePage_EmbeddableLabel; - } - - public IJpaComposite buildPersistentTypeMappingComposite( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EmbeddableComposite(parent, commandStack, widgetFactory); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java deleted file mode 100644 index fb49af2125..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedIdComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddedIdMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final EmbeddedIdMappingUiProvider INSTANCE = new EmbeddedIdMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private EmbeddedIdMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_EmbeddedIdLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EmbeddedIdComposite(parent, commandStack, widgetFactory); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java deleted file mode 100644 index 4da937b273..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddedMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final EmbeddedMappingUiProvider INSTANCE = new EmbeddedMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private EmbeddedMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_EmbeddedLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EmbeddedComposite(parent, commandStack, widgetFactory); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java deleted file mode 100644 index 80d489a6ec..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EntityComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EntityUiProvider implements ITypeMappingUiProvider -{ - public String key() { - return IMappingKeys.ENTITY_TYPE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentTypePage_EntityLabel; - } - - public IJpaComposite buildPersistentTypeMappingComposite( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EntityComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java deleted file mode 100644 index 199b0fbb64..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.IdComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class IdMappingUiProvider - implements IAttributeMappingUiProvider -{ - // singleton - private static final IdMappingUiProvider INSTANCE = new IdMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private IdMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_IdLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new IdComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java deleted file mode 100644 index 8515d35dd0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.ManyToManyComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class ManyToManyMappingUiProvider - implements IAttributeMappingUiProvider -{ - // singleton - private static final ManyToManyMappingUiProvider INSTANCE = new ManyToManyMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private ManyToManyMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_ManyToManyLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new ManyToManyComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java deleted file mode 100644 index c81832c397..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.ManyToOneComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class ManyToOneMappingUiProvider - implements IAttributeMappingUiProvider -{ - // singleton - private static final ManyToOneMappingUiProvider INSTANCE = new ManyToOneMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private ManyToOneMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_ManyToOneLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new ManyToOneComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java deleted file mode 100644 index aa7147685f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.MappedSuperclassComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class MappedSuperclassUiProvider implements ITypeMappingUiProvider -{ - public String key() { - return IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentTypePage_MappedSuperclassLabel; - } - - public IJpaComposite buildPersistentTypeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new MappedSuperclassComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java deleted file mode 100644 index 1c160473b6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class NullAttributeMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final NullAttributeMappingUiProvider INSTANCE = new NullAttributeMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private NullAttributeMappingUiProvider() { - super(); - } - - - public String key() { - return null; - } - - public String label() { - return ""; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new NullComposite(parent); - } - - - public static class NullComposite extends Composite - implements IJpaComposite - { - NullComposite(Composite parent) { - super(parent, SWT.NONE); - } - - public void populate(EObject model) { - // no op - } - - @Override - public void dispose() { - super.dispose(); - } - public Control getControl() { - return this; - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java deleted file mode 100644 index b435bd597f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class NullTypeMappingUiProvider implements ITypeMappingUiProvider -{ - public String key() { - return null; - } - - public String label() { - return ""; - } - - public IJpaComposite buildPersistentTypeMappingComposite( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new NullComposite(parent); - } - - - public static class NullComposite extends Composite - implements IJpaComposite - { - private Composite composite; - NullComposite(Composite parent) { - super(parent, SWT.NONE); - this.composite = new Composite(parent, SWT.NONE); - } - - public void populate(EObject model) { - // no op - } - - @Override - public void dispose() { - super.dispose(); - } - - public Control getControl() { - return this.composite; - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java deleted file mode 100644 index bb130bc567..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.OneToManyComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class OneToManyMappingUiProvider - implements IAttributeMappingUiProvider -{ - // singleton - private static final OneToManyMappingUiProvider INSTANCE = new OneToManyMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private OneToManyMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_OneToManyLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new OneToManyComposite(parent, commandStack, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java deleted file mode 100644 index 27fa225229..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.OneToOneComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class OneToOneMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final OneToOneMappingUiProvider INSTANCE = new OneToOneMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private OneToOneMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_OneToOneLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new OneToOneComposite(parent, commandStack, widgetFactory); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java deleted file mode 100644 index c8b48119d8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.TransientComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class TransientMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final TransientMappingUiProvider INSTANCE = new TransientMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private TransientMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_TransientLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new TransientComposite(parent, commandStack, widgetFactory); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java deleted file mode 100644 index 75f14dfaf4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.mappings.properties; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.core.internal.IMappingKeys; -import org.eclipse.jpt.ui.internal.details.IJpaComposite; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.VersionComposite; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class VersionMappingUiProvider - implements IAttributeMappingUiProvider -{ - - // singleton - private static final VersionMappingUiProvider INSTANCE = new VersionMappingUiProvider(); - - /** - * Return the singleton. - */ - public static IAttributeMappingUiProvider instance() { - return INSTANCE; - } - - /** - * Ensure non-instantiability. - */ - private VersionMappingUiProvider() { - super(); - } - - public String key() { - return IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY; - } - - public String label() { - return JptUiMappingsMessages.PersistentAttributePage_VersionLabel; - } - - public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new VersionComposite(parent, commandStack, widgetFactory); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java deleted file mode 100644 index e643328908..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.structure; - -import java.util.Collection; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; - -public class JavaCompilationUnitItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public JavaCompilationUnitItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JpaJavaPackage.Literals.JPA_COMPILATION_UNIT__TYPES); - } - return childrenFeatures; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java deleted file mode 100644 index 902c83233e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.structure; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages; - -public class JavaPersistentAttributeItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public JavaPersistentAttributeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - @Override - public Object getImage(Object object) { - IAttributeMapping mapping = ((IPersistentAttribute) object).getMapping(); - - if (mapping instanceof IBasic) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.BASIC); - } - else if (mapping instanceof IId) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.ID); - } - else if (mapping instanceof IVersion) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.VERSION); - } - else if (mapping instanceof IEmbedded) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED); - } - else if (mapping instanceof IEmbeddedId) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED_ID); - } - else if (mapping instanceof IOneToOne) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_ONE); - } - else if (mapping instanceof IOneToMany) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_MANY); - } - else if (mapping instanceof IManyToOne) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_ONE); - } - else if (mapping instanceof IManyToMany) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_MANY); - } - else if (mapping instanceof ITransient) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.TRANSIENT); - } - else { - return JptUiMappingsImages.getImage(JptUiMappingsImages.NULL_ATTRIBUTE_MAPPING); - } - } - - @Override - public String getText(Object object) { - return ((IPersistentAttribute) object).getName(); - } - - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(IPersistentAttribute.class)) { - case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING: - fireNotifyChanged(new ViewerNotification(notification, notification - .getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java deleted file mode 100644 index c1cd5bb875..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.structure; - -import java.util.Collection; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages; - -public class JavaPersistentTypeItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public JavaPersistentTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - - @Override - protected Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JpaJavaPackage.Literals.JAVA_PERSISTENT_TYPE__ATTRIBUTES); - } - return childrenFeatures; - } - - @Override - public Object getImage(Object object) { - ITypeMapping mapping = ((IPersistentType) object).getMapping(); - - - if (mapping instanceof IEntity) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.ENTITY); - } - else if (mapping instanceof IEmbeddable) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDABLE); - } - else if (mapping instanceof IMappedSuperclass) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.MAPPED_SUPERCLASS); - } - else { - return null; - } - } - - @Override - public String getText(Object object) { - IType type = ((IPersistentType) object).findJdtType(); - return (type == null) ? "" : type.getElementName(); - } - - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaPersistentType.class)) { - case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY: - fireNotifyChanged( - new ViewerNotification( - notification, notification.getNotifier(), false, true)); - return; - - case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES: - fireNotifyChanged( - new ViewerNotification( - notification, notification.getNotifier(), true, false)); - return; - } - - super.notifyChanged(notification); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java deleted file mode 100644 index a1af28c175..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.structure; - -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider; - -public class JavaStructureProvider implements IJpaStructureProvider -{ - public String fileContentType() { - return JavaCore.JAVA_SOURCE_CONTENT_TYPE; - } - - public ITreeContentProvider buildContentProvider() { - return new AdapterFactoryContentProvider(new JpaCoreJavaItemProviderAdapterFactory()); - } - - public ILabelProvider buildLabelProvider() { - return new AdapterFactoryLabelProvider(new JpaCoreJavaItemProviderAdapterFactory()); - } - - public void dispose() { - // TODO Auto-generated method stub - - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java deleted file mode 100644 index 730853482c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.java.structure; - -import java.util.ArrayList; -import java.util.Collection; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jpt.core.internal.content.java.util.JpaJavaAdapterFactory; - -/** - * This is the factory that is used to provide the interfaces needed to support Viewers. - * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. - * The adapters also support Eclipse property sheets. - * Note that most of the adapters are shared among multiple instances. - */ -public class JpaCoreJavaItemProviderAdapterFactory - extends JpaJavaAdapterFactory - implements ComposeableAdapterFactory, - IChangeNotifier, - IDisposable -{ - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - - - public JpaCoreJavaItemProviderAdapterFactory() { - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemLabelProvider.class); - } - - - protected JavaCompilationUnitItemProvider javaCompilationUnitItemProvider; - - public Adapter createJpaCompilationUnitAdapter() { - if (javaCompilationUnitItemProvider == null) { - javaCompilationUnitItemProvider = new JavaCompilationUnitItemProvider(this); - } - - return javaCompilationUnitItemProvider; - } - - protected JavaPersistentTypeItemProvider javaPersistentTypeItemProvider; - - public Adapter createJavaPersistentTypeAdapter() { - if (javaPersistentTypeItemProvider == null) { - javaPersistentTypeItemProvider = new JavaPersistentTypeItemProvider(this); - } - - return javaPersistentTypeItemProvider; - } - - protected JavaPersistentAttributeItemProvider javaPersistentAttributeItemProvider; - - public Adapter createJavaPersistentAttributeAdapter() { - if (javaPersistentAttributeItemProvider == null) { - javaPersistentAttributeItemProvider = new JavaPersistentAttributeItemProvider( - this); - } - - return javaPersistentAttributeItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? - this : - parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory( - ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - */ - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) - || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This disposes all of the item providers created by this factory. - */ - public void dispose() { - if (javaCompilationUnitItemProvider != null) { - javaCompilationUnitItemProvider.dispose(); - } - if (javaPersistentTypeItemProvider != null) { - javaPersistentTypeItemProvider.dispose(); - } - if (javaPersistentAttributeItemProvider != null) { - javaPersistentAttributeItemProvider.dispose(); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java deleted file mode 100644 index 7fb66541d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.jface; - -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.swt.graphics.Image; - -public class NullLabelProvider - implements ILabelProvider -{ - public static NullLabelProvider INSTANCE = new NullLabelProvider(); - - - private NullLabelProvider() { - super(); - } - - - public Image getImage(Object element) { - return null; - } - - public String getText(Object element) { - return null; - } - - public void addListener(ILabelProviderListener listener) {} - - public void dispose() {} - - public boolean isLabelProperty(Object element, String property) { - return false; - } - - public void removeListener(ILabelProviderListener listener) {} -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java deleted file mode 100644 index 864a29b08f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.jface; - -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; - -public class NullTreeContentProvider - implements ITreeContentProvider -{ - public static NullTreeContentProvider INSTANCE = new NullTreeContentProvider(); - - - private NullTreeContentProvider() { - super(); - } - - - public Object[] getChildren(Object parentElement) { - return new Object[0]; - } - - public Object getParent(Object element) { - return null; - } - - public boolean hasChildren(Object element) { - return false; - } - - public Object[] getElements(Object inputElement) { - return new Object[0]; - } - - public void dispose() {} - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java deleted file mode 100644 index 7acab93e34..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings; - -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.swt.graphics.Image; - -public class JptUiMappingsImages -{ - public final static String BASIC = "full/obj16/basic"; - - public final static String EMBEDDABLE = "full/obj16/embeddable"; - - public final static String EMBEDDED = "full/obj16/embedded"; - - public final static String EMBEDDED_ID = "full/obj16/embedded-id"; - - public final static String ENTITY = "full/obj16/entity"; - - public final static String ENTITY_MAPPINGS = "full/obj16/entity-mappings"; - - public final static String ID = "full/obj16/id"; - - public final static String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping"; - - public final static String MANY_TO_MANY = "full/obj16/many-to-many"; - - public final static String MANY_TO_ONE = "full/obj16/many-to-one"; - - public final static String MAPPED_SUPERCLASS = "full/obj16/mapped-superclass"; - - public final static String NULL_TYPE_MAPPING = "full/obj16/null-type-mapping"; - - public final static String ONE_TO_MANY = "full/obj16/one-to-many"; - - public final static String ONE_TO_ONE = "full/obj16/one-to-one"; - - public final static String TEMPORAL = "full/obj16/temporal"; - - public final static String TRANSIENT = "full/obj16/transient"; - - public final static String VERSION = "full/obj16/version"; - - - public static Image getImage(String imageLocator) { - return JptUiPlugin.getPlugin().getImageDescriptor(imageLocator).createImage(); - } - - - private JptUiMappingsImages() { - throw new UnsupportedOperationException(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java deleted file mode 100644 index 03380e75d7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings; - -import org.eclipse.osgi.util.NLS; - -public class JptUiMappingsMessages extends NLS -{ - private static final String BUNDLE_NAME = "jpt_ui_mappings"; //$NON-NLS-1$ - - public static String PersistentTypePage_EntityLabel; - public static String PersistentTypePage_EmbeddableLabel; - public static String PersistentTypePage_MappedSuperclassLabel; - - public static String PersistentAttributePage_BasicLabel; - public static String PersistentAttributePage_TransientLabel; - public static String PersistentAttributePage_IdLabel; - public static String PersistentAttributePage_OneToManyLabel; - public static String PersistentAttributePage_ManyToOneLabel; - public static String PersistentAttributePage_ManyToManyLabel; - public static String PersistentAttributePage_VersionLabel; - public static String PersistentAttributePage_EmbeddedLabel; - public static String PersistentAttributePage_EmbeddedIdLabel; - public static String PersistentAttributePage_OneToOneLabel; - - - public static String EntityGeneralSection_nameDefaultWithOneParam; - public static String EntityGeneralSection_nameDefaultEmpty; - public static String EntityGeneralSection_name; - - public static String BasicGeneralSection_name; - public static String BasicGeneralSection_nameDefault; - public static String BasicGeneralSection_fetchLabel; - public static String BasicGeneralSection_optionalLabel; - public static String BasicGeneralSection_lobLabel; - public static String BasicGeneralSection_temporalLabel; - public static String BasicGeneralSection_enumeratedLabel; - - public static String EntityComposite_tableDefault; - public static String EntityComposite_tableNoDefaultSpecified; - public static String EntityComposite_inheritance; - public static String TableComposite_tableSection; - public static String TableComposite_defaultEmpty; - public static String TableComposite_defaultWithOneParam; - - public static String TableChooser_label; - public static String CatalogChooser_label; - public static String SchemaChooser_label; - - public static String ColumnChooser_label; - public static String ColumnTableChooser_label; - - public static String TargetEntityChooser_label; - public static String TargetEntityChooser_defaultEmpty; - public static String TargetEntityChooser_defaultWithOneParam; - public static String TargetEntityChooser_browse; - - public static String NonOwningMapping_mappedByLabel; - - public static String JoinTableComposite_add; - public static String JoinTableComposite_defaultEmpty; - public static String JoinTableComposite_defaultWithOneParam; - public static String JoinTableComposite_edit; - public static String JoinTableComposite_inverseJoinColumn; - public static String JoinTableComposite_joinColumn; - public static String JoinTableComposite_mappingBetweenTwoParams; - public static String JoinTableComposite_mappingBetweenTwoParamsDefault; - public static String JoinTableComposite_mappingBetweenTwoParamsBothDefault; - public static String JoinTableComposite_mappingBetweenTwoParamsFirstDefault; - public static String JoinTableComposite_mappingBetweenTwoParamsSecDefault; - public static String JoinTableComposite_name; - public static String JoinTableComposite_remove; - public static String JoinTableComposite_overrideDefaultJoinColumns; - public static String JoinTableComposite_overrideDefaultInverseJoinColumns; - - public static String JoinColumnDialog_addJoinColumn; - public static String JoinColumnDialog_editJoinColumn; - public static String JoinColumnDialog_name; - public static String JoinColumnDialog_insertable; - public static String JoinColumnDialog_updatable; - public static String JoinColumnDialog_defaultWithOneParam; - public static String JoinColumnDialog_referencedColumnName; - public static String JoinColumnDialog_table; - - public static String InverseJoinColumnDialog_defaultWithOneParam; - public static String InverseJoinColumnDialog_editInverseJoinColumn; - - - 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 ColumnComposite_columnSection; - public static String ColumnComposite_defaultWithOneParam; - public static String ColumnComposite_defaultEmpty; - public static String ColumnComposite_insertable; - public static String ColumnComposite_updatable; - - public static String JoinColumnComposite_defaultEmpty; - public static String JoinColumnComposite_defaultWithOneParam; - public static String JoinColumnComposite_joinColumn; - public static String JoinColumnComposite_name; - public static String JoinColumnComposite_add; - public static String JoinColumnComposite_edit; - public static String JoinColumnComposite_mappingBetweenTwoParams; - public static String JoinColumnComposite_mappingBetweenTwoParamsDefault; - public static String JoinColumnComposite_mappingBetweenTwoParamsBothDefault; - public static String JoinColumnComposite_mappingBetweenTwoParamsFirstDefault; - public static String JoinColumnComposite_mappingBetweenTwoParamsSecDefault; - public static String JoinColumnComposite_remove; - public static String JoinColumnComposite_overrideDefaultJoinColumns; - - public static String PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns; - public static String PrimaryKeyJoinColumnsComposite_add; - public static String PrimaryKeyJoinColumnsComposite_edit; - public static String PrimaryKeyJoinColumnsComposite_remove; - public static String PrimaryKeyJoinColumnsComposite_defaultEmpty; - public static String PrimaryKeyJoinColumnsComposite_defaultWithOneParam; - public static String PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn; - public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams; - public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault; - public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault; - public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault; - public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault; - - public static String AttributeOverridesComposite_attributeOverrides; - public static String AttributeOverridesComposite_overridDefault; - public static String OverridesComposite_joinColumn; - - public static String InheritanceComposite_default; - public static String InheritanceComposite_strategy; - public static String InheritanceComposite_discriminatorValue; - public static String InheritanceComposite_discriminatorValueDefaultWithOneParam; - - public static String DiscriminatorColumnComposite_defaultEmpty; - public static String DiscriminatorColumnComposite_column; - public static String DiscriminatorColumnComposite_discriminatorType; - - public static String GeneratedValueComposite_generatedValue; - public static String GeneratedValueComposite_generatorName; - public static String GeneratedValueComposite_strategy; - - public static String TableGeneratorComposite_default; - public static String TableGeneratorComposite_name; - public static String TableGeneratorComposite_pkColumn; - public static String TableGeneratorComposite_pkColumnValue; - public static String TableGeneratorComposite_table; - public static String TableGeneratorComposite_tableGenerator; - public static String TableGeneratorComposite_valueColumn; - - public static String SequenceGeneratorComposite_sequenceGenerator; - public static String SequenceGeneratorComposite_name; - public static String SequenceGeneratorComposite_sequence; - public static String SequenceGeneratorComposite_default; - - public static String IdMappingComposite_pk_generation; - public static String IdMappingComposite_primaryKeyGeneration; - public static String IdMappingComposite_tableGenerator; - public static String IdMappingComposite_sequenceGenerator; - - public static String OrderByComposite_orderByGroup; - public static String OrderByComposite_noOrdering; - public static String OrderByComposite_primaryKeyOrdering; - public static String OrderByComposite_customOrdering; - public static String OrderByComposite_orderByLabel; - - public static String SecondaryTablesComposite_secondaryTables; - public static String SecondaryTablesComposite_add; - public static String SecondaryTablesComposite_edit; - public static String SecondaryTablesComposite_remove; - - public static String SecondaryTableDialog_editSecondaryTable; - public static String SecondaryTableDialog_name; - public static String SecondaryTableDialog_catalog; - public static String SecondaryTableDialog_schema; - public static String SecondaryTableDialog_defaultSchema; - public static String SecondaryTableDialog_defaultCatalog; - - public static String AccessTypeCombo_default; - public static String EnumComboViewer_default; - public static String MetaDataCompleteCombo_Default; - public static String JoinColumnDialog_defaultTrue; - public static String InheritanceComposite_defaultDiscriminatorType; - public static String GeneratedValueComposite_default; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, JptUiMappingsMessages.class); - } - - private JptUiMappingsMessages() { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java deleted file mode 100644 index 2435c30c6f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java +++ /dev/null @@ -1,183 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -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.ui.PlatformUI; - -//if there is only 1 joinColumn and the user is editing it, they should be -//able to define defaults. otherwise, we probably shouldn't allow it. -public abstract class AbstractJoinColumnDialog extends Dialog { - - //if creating a new JoinColumn, this will be null, - //specify the JoinColumnOwner instead in the appropriate construtor - private E joinColumn; - - private Combo nameCombo; - private Combo referencedColumnNameCombo; - - private boolean defaultNameSelected; - private String selectedName; - private boolean defaultReferencedColumnNameSelected; - private String selectedReferencedColumnName; - - AbstractJoinColumnDialog(Shell parent) { - super(parent); - } - - AbstractJoinColumnDialog(Shell parent, E joinColumn) { - super(parent); - this.joinColumn = joinColumn; - } - - protected String getAddTitle() { - return JptUiMappingsMessages.JoinColumnDialog_addJoinColumn; - } - - protected String getEditTitle() { - return JptUiMappingsMessages.JoinColumnDialog_editJoinColumn; - } - - protected Control createDialogArea(Composite parent) { - if (this.joinColumn == null) { - getShell().setText(getAddTitle()); - } - else { - getShell().setText(getEditTitle()); - } - Composite composite = (Composite) super.createDialogArea(parent); - GridLayout gridLayout = (GridLayout) composite.getLayout(); - gridLayout.numColumns = 2; - - Label nameLabel = new Label(composite, SWT.LEFT); - nameLabel.setText(JptUiMappingsMessages.JoinColumnDialog_name); - GridData gridData = new GridData(); - nameLabel.setLayoutData(gridData); - - this.nameCombo = new Combo(composite, SWT.LEFT); - gridData = new GridData(); - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.nameCombo.setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.nameCombo, IJpaHelpContextIds.MAPPING_JOIN_COLUMN_NAME); - populateNameCombo(); - - Label referencedColumnNameLabel = new Label(composite, SWT.LEFT); - referencedColumnNameLabel.setText(JptUiMappingsMessages.JoinColumnDialog_referencedColumnName); - gridData = new GridData(); - referencedColumnNameLabel.setLayoutData(gridData); - - this.referencedColumnNameCombo = new Combo(composite, SWT.LEFT); - gridData = new GridData(); - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.referencedColumnNameCombo.setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.referencedColumnNameCombo, IJpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN); - populateReferencedNameCombo(); - - return composite; - } - - protected void populateNameCombo() { - this.nameCombo.removeAll(); - if (getJoinColumn() != null) { - this.nameCombo.add(NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultName())); - } - Table table = getNameTable(); - if (table != null) { - for (Iterator i = table.columnNames(); i.hasNext(); ) { - this.nameCombo.add((String) i.next()); - } - } - if (getJoinColumn() != null) { - if (getJoinColumn().getSpecifiedName() != null) { - this.nameCombo.setText(getJoinColumn().getSpecifiedName()); - } - else { - this.nameCombo.select(0); - } - } - } - - protected Combo getNameCombo() { - return this.nameCombo; - } - - protected Combo getReferencedColumnNameCombo() { - return this.referencedColumnNameCombo; - } - - protected abstract Table getNameTable(); - - protected abstract Table getReferencedNameTable(); - - protected void populateReferencedNameCombo() { - if (getJoinColumn() != null) { - this.referencedColumnNameCombo.add(NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultReferencedColumnName())); - } - Table referencedNameTable = getReferencedNameTable(); - if (referencedNameTable != null) { - for (Iterator i = referencedNameTable.columnNames(); i.hasNext(); ) { - this.referencedColumnNameCombo.add((String) i.next()); - } - } - if (getJoinColumn() != null) { - if (getJoinColumn().getSpecifiedReferencedColumnName() != null) { - this.referencedColumnNameCombo.setText(getJoinColumn().getSpecifiedReferencedColumnName()); - } - else { - this.referencedColumnNameCombo.select(0); - } - } - } - - protected E getJoinColumn() { - return this.joinColumn; - } - - protected boolean isDefaultNameSelected() { - return this.defaultNameSelected; - } - - protected String getSelectedName() { - return this.selectedName; - } - - protected boolean isDefaultReferencedColumnNameSelected() { - return this.defaultReferencedColumnNameSelected; - } - - protected String getReferencedColumnName() { - return this.selectedReferencedColumnName; - } - - public boolean close() { - this.defaultNameSelected = this.nameCombo.getSelectionIndex() == 0; - this.selectedName = this.nameCombo.getText(); - this.defaultReferencedColumnNameSelected = this.referencedColumnNameCombo.getSelectionIndex() == 0; - this.selectedReferencedColumnName = this.referencedColumnNameCombo.getText(); - return super.close(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java deleted file mode 100644 index 3a2542b73e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java +++ /dev/null @@ -1,357 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.EnumType; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -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.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class BasicComposite extends BaseJpaComposite -{ - private IBasic basic; - - private ColumnComposite columnComposite; - - private EnumComboViewer fetchTypeComboViewer; - private EnumComboViewer optionalComboViewer; - private LobCheckBox lobCheckBox; - private EnumComboViewer temporalTypeViewer; - private EnumComboViewer enumeratedTypeViewer; - - public BasicComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - } - - private Control buildGeneralComposite(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - this.columnComposite = new ColumnComposite(generalComposite, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.columnComposite.getControl().setLayoutData(gridData); - - CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory()); - this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.fetchTypeComboViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE); - - CommonWidgets.buildOptionalLabel(generalComposite, getWidgetFactory()); - this.optionalComboViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.optionalComboViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(optionalComboViewer.getControl(), IJpaHelpContextIds.MAPPING_OPTIONAL); - - CommonWidgets.buildTemporalLabel(generalComposite, getWidgetFactory()); - this.temporalTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.temporalTypeViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(temporalTypeViewer.getControl(), IJpaHelpContextIds.MAPPING_TEMPORAL); - - CommonWidgets.buildEnumeratedLabel(generalComposite, getWidgetFactory()); - this.enumeratedTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.enumeratedTypeViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(enumeratedTypeViewer.getControl(), IJpaHelpContextIds.MAPPING_ENUMERATED); - - this.lobCheckBox = buildLobCheckBox(generalComposite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.lobCheckBox.getControl().setLayoutData(gridData); - helpSystem.setHelp(lobCheckBox.getControl(), IJpaHelpContextIds.MAPPING_LOB); - - return generalComposite; - } - - private LobCheckBox buildLobCheckBox(Composite parent) { - return new LobCheckBox(parent, this.commandStack, getWidgetFactory()); - } - - public void doPopulate(EObject obj) { - this.basic = (IBasic) obj; - if (this.basic != null) { - this.columnComposite.populate(this.basic.getColumn()); - } - else { - this.columnComposite.populate(null); - } - this.fetchTypeComboViewer.populate(new FetchHolder(this.basic)); - this.optionalComboViewer.populate(new OptionalHolder(this.basic)); - this.lobCheckBox.populate(this.basic); - this.temporalTypeViewer.populate(new TemporalTypeHolder(this.basic)); - this.enumeratedTypeViewer.populate(new EnumeratedTypeHolder(this.basic)); - } - - public void doPopulate() { - this.columnComposite.populate(); - this.fetchTypeComboViewer.populate(); - this.optionalComboViewer.populate(); - this.lobCheckBox.populate(); - this.temporalTypeViewer.populate(); - this.enumeratedTypeViewer.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.columnComposite.dispose(); - this.fetchTypeComboViewer.dispose(); - this.optionalComboViewer.dispose(); - this.lobCheckBox.dispose(); - this.temporalTypeViewer.dispose(); - this.enumeratedTypeViewer.dispose(); - super.dispose(); - } - - protected IBasic getBasic() { - return this.basic; - } - - private class FetchHolder extends EObjectImpl implements EnumHolder { - - private IBasic basic; - - FetchHolder(IBasic basic) { - super(); - this.basic = basic; - } - - public Object get() { - return this.basic.getFetch(); - } - - public void set(Object enumSetting) { - this.basic.setFetch((DefaultEagerFetchType) enumSetting); - - } - - public Class featureClass() { - return IBasic.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IBASIC__FETCH; - } - - public EObject wrappedObject() { - return this.basic; - } - - public Object[] enumValues() { - return DefaultEagerFetchType.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultEagerFetchType.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "Eager"; - } - } - - - private class OptionalHolder extends EObjectImpl implements EnumHolder { - - private IBasic basic; - - OptionalHolder(IBasic basic) { - super(); - this.basic = basic; - } - - public Object get() { - return this.basic.getOptional(); - } - - public void set(Object enumSetting) { - this.basic.setOptional((DefaultTrueBoolean) enumSetting); - } - - public Class featureClass() { - return IBasic.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IBASIC__OPTIONAL; - } - - public EObject wrappedObject() { - return this.basic; - } - - public Object[] enumValues() { - return DefaultTrueBoolean.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultTrueBoolean.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "True"; - } - - } - - - private class TemporalTypeHolder extends EObjectImpl implements EnumHolder { - - private IBasic basic; - - TemporalTypeHolder(IBasic basic) { - super(); - this.basic = basic; - } - - public Object get() { - return this.basic.getTemporal(); - } - - public void set(Object enumSetting) { - this.basic.setTemporal((TemporalType) enumSetting); - } - - public Class featureClass() { - return IBasic.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IBASIC__TEMPORAL; - } - - public EObject wrappedObject() { - return this.basic; - } - - public Object[] enumValues() { - return TemporalType.VALUES.toArray(); - } - - /** - * TemporalType has no Default, return null - */ - public Object defaultValue() { - return null; - } - - /** - * TemporalType has no Default, return null - */ - public String defaultString() { - return null; - } - } - - private class EnumeratedTypeHolder extends EObjectImpl implements EnumHolder { - - private IBasic basic; - - EnumeratedTypeHolder(IBasic basic) { - super(); - this.basic = basic; - } - - public Object get() { - return this.basic.getEnumerated(); - } - - public void set(Object enumSetting) { - this.basic.setEnumerated((EnumType) enumSetting); - } - - public Class featureClass() { - return IBasic.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IBASIC__ENUMERATED; - } - - public EObject wrappedObject() { - return this.basic; - } - - public Object[] enumValues() { - return EnumType.VALUES.toArray(); - } - - public Object defaultValue() { - return EnumType.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "Ordinal"; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java deleted file mode 100644 index a2eb0eb160..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java +++ /dev/null @@ -1,378 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.ICascade; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class CascadeComposite extends BaseJpaComposite -{ - private IRelationshipMapping relationshipMapping; - private ICascade cascade; - - private Adapter relationshipMappingListener; - private Adapter cascadeListener; - - - private Button allCheckBox; - private Button persistCheckBox; - private Button mergeCheckBox; - private Button removeCheckBox; - private Button refreshCheckBox; - - public CascadeComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.relationshipMappingListener = buildRelationshipMappingListener(); - this.cascadeListener = buildCascadeListener(); - } - - private Adapter buildRelationshipMappingListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - relationshipMappingChanged(notification); - } - }; - } - - private Adapter buildCascadeListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - cascadeChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - composite.setLayout(new FillLayout()); - - Group cascadeGroup = getWidgetFactory().createGroup(composite, "Cascade"); - GridLayout layout = new GridLayout(5, false); - cascadeGroup.setLayout(layout); - - GridData gridData; - - this.allCheckBox = createAllCheckBox(cascadeGroup); - gridData = new GridData(); - this.allCheckBox.setLayoutData(gridData); - - this.persistCheckBox = createPersistCheckBox(cascadeGroup); - gridData = new GridData(); - this.persistCheckBox.setLayoutData(gridData); - - this.mergeCheckBox = createMergeCheckBox(cascadeGroup); - gridData = new GridData(); - this.mergeCheckBox.setLayoutData(gridData); - - this.removeCheckBox = createRemoveCheckBox(cascadeGroup); - gridData = new GridData(); - this.removeCheckBox.setLayoutData(gridData); - - this.refreshCheckBox = createRefreshCheckBox(cascadeGroup); - gridData = new GridData(); - this.refreshCheckBox.setLayoutData(gridData); - } - - private Button createAllCheckBox(Composite composite) { - Button button = getWidgetFactory().createButton(composite, "All", SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - CascadeComposite.this.allSelected(e); - } - public void widgetSelected(SelectionEvent e) { - CascadeComposite.this.allSelected(e); - } - }); - return button; - } - - protected void allSelected(SelectionEvent e) { - boolean setSelection = initializeCascade(); - if (setSelection) { - this.cascade.setAll(this.allCheckBox.getSelection()); - } - } - - private boolean initializeCascade() { - if (allCheckBoxesFalse() && this.cascade != null) { - disengageCascadeListener(); - this.relationshipMapping.setCascade(null); - return false; - } - if (this.cascade == null) { - this.cascade = this.relationshipMapping.createCascade(); - this.relationshipMapping.setCascade(this.cascade); - engageCascadeListener(); - } - return true; - } - - private Button createPersistCheckBox(Composite composite) { - Button button = getWidgetFactory().createButton(composite, "Persist", SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - CascadeComposite.this.persistSelected(e); - } - public void widgetSelected(SelectionEvent e) { - CascadeComposite.this.persistSelected(e); - } - }); - return button; - } - - protected void persistSelected(SelectionEvent e) { - boolean setSelection = initializeCascade(); - if (setSelection) { - this.cascade.setPersist(this.persistCheckBox.getSelection()); - } - } - - private Button createMergeCheckBox(Composite composite) { - Button button = getWidgetFactory().createButton(composite, "Merge", SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - CascadeComposite.this.mergeSelected(e); - } - public void widgetSelected(SelectionEvent e) { - CascadeComposite.this.mergeSelected(e); - } - }); - return button; - } - - protected void mergeSelected(SelectionEvent e) { - boolean setSelection = initializeCascade(); - if (setSelection) { - this.cascade.setMerge(this.mergeCheckBox.getSelection()); - } - } - - private Button createRemoveCheckBox(Composite composite) { - Button button = getWidgetFactory().createButton(composite, "Remove", SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - CascadeComposite.this.removeSelected(e); - } - public void widgetSelected(SelectionEvent e) { - CascadeComposite.this.removeSelected(e); - } - }); - return button; - } - - protected void removeSelected(SelectionEvent e) { - boolean setSelection = initializeCascade(); - if (setSelection) { - this.cascade.setRemove(this.removeCheckBox.getSelection()); - } - } - - private Button createRefreshCheckBox(Composite composite) { - Button button = getWidgetFactory().createButton(composite, "Refresh", SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - CascadeComposite.this.refreshSelected(e); - } - public void widgetSelected(SelectionEvent e) { - CascadeComposite.this.refreshSelected(e); - } - }); - return button; - } - - protected void refreshSelected(SelectionEvent e) { - boolean setSelection = initializeCascade(); - if (setSelection) { - this.cascade.setRefresh(this.refreshCheckBox.getSelection()); - } - } - - private boolean allCheckBoxesFalse() { - return !(this.allCheckBox.getSelection() - || this.persistCheckBox.getSelection() - || this.mergeCheckBox.getSelection() - || this.removeCheckBox.getSelection() - || this.refreshCheckBox.getSelection()); - - - } - - private void relationshipMappingChanged(Notification notification) { - if (notification.getFeatureID(IRelationshipMapping.class) == - JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - if (CascadeComposite.this.cascade != null) { - disengageCascadeListener(); - } - CascadeComposite.this.cascade = CascadeComposite.this.relationshipMapping.getCascade(); - populateCascade(); - - if (CascadeComposite.this.cascade != null) { - engageCascadeListener(); - } - } - }); - } - } - - private void cascadeChanged(final Notification notification) { - switch (notification.getFeatureID(ICascade.class)) { - case JpaCoreMappingsPackage.ICASCADE__ALL : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CascadeComposite.this.allCheckBox.setSelection(notification.getNewBooleanValue()); - } - }); - break; - case JpaCoreMappingsPackage.ICASCADE__PERSIST : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CascadeComposite.this.persistCheckBox.setSelection(notification.getNewBooleanValue()); - } - }); - break; - case JpaCoreMappingsPackage.ICASCADE__MERGE : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CascadeComposite.this.mergeCheckBox.setSelection(notification.getNewBooleanValue()); - } - }); - break; - case JpaCoreMappingsPackage.ICASCADE__REMOVE : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CascadeComposite.this.removeCheckBox.setSelection(notification.getNewBooleanValue()); - } - }); - break; - case JpaCoreMappingsPackage.ICASCADE__REFRESH : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CascadeComposite.this.refreshCheckBox.setSelection(notification.getNewBooleanValue()); - } - }); - break; - default : - break; - } - if (notification.getFeatureID(ICascade.class) == - JpaCoreMappingsPackage.ICASCADE__ALL) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CascadeComposite.this.allCheckBox.setSelection(notification.getNewBooleanValue()); - } - }); - } - - } - - - public void doPopulate(EObject obj) { - this.relationshipMapping = (IRelationshipMapping) obj; - - if (this.relationshipMapping != null) { - this.cascade = this.relationshipMapping.getCascade(); - populateCascade(); - } - } - - private void populateCascade() { - if (this.cascade != null) { - this.allCheckBox.setSelection(this.cascade.isAll()); - this.persistCheckBox.setSelection(this.cascade.isPersist()); - this.mergeCheckBox.setSelection(this.cascade.isMerge()); - this.removeCheckBox.setSelection(this.cascade.isRemove()); - this.refreshCheckBox.setSelection(this.cascade.isRefresh()); - } - else { - this.allCheckBox.setSelection(false); - this.persistCheckBox.setSelection(false); - this.mergeCheckBox.setSelection(false); - this.removeCheckBox.setSelection(false); - this.refreshCheckBox.setSelection(false); - } - } - - public void doPopulate() { - } - - protected void engageListeners() { - if (this.relationshipMapping != null) { - this.relationshipMapping.eAdapters().add(this.relationshipMappingListener); - if (this.cascade != null) { - engageCascadeListener(); - } - } - } - - protected void engageCascadeListener() { - this.cascade.eAdapters().add(this.cascadeListener); - } - - protected void disengageCascadeListener() { - this.cascade.eAdapters().remove(this.cascadeListener); - } - - protected void disengageListeners() { - if (this.relationshipMapping != null) { - this.relationshipMapping.eAdapters().remove(this.relationshipMappingListener); - if (this.cascade != null) { - disengageCascadeListener(); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java deleted file mode 100644 index c51d015c88..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java +++ /dev/null @@ -1,304 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class CatalogCombo extends BaseJpaController -{ - private ITable table; - - private Adapter listener; - - /** - * Caching the connectionProfile so we can remove the listener. If the - * cached table object has been removed from the model then we no longer - * have access to the parent and cannot find the connectionProfile - */ - private ConnectionProfile connectionProfile; - - private ConnectionListener connectionListener; - - private CCombo combo; - - public CatalogCombo(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - this.listener = this.buildTableListener(); - this.connectionListener = this.buildConnectionListener(); - } - - private Adapter buildTableListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - CatalogCombo.this.catalogChanged(notification); - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public void closed(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CatalogCombo.this.populateCatalogCombo(); - } - }); - } - - public void modified(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CatalogCombo.this.populateCatalogCombo(); - } - }); - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void opened(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CatalogCombo.this.populateCatalogCombo(); - } - }); - } - - public void databaseChanged(Connection connection, final Database database) { - getControl().getDisplay().asyncExec(new Runnable() { - public void run() { - if (database == CatalogCombo.this.getDatabase()) { - if (!getControl().isDisposed()) { - CatalogCombo.this.populateCatalogCombo(); - } - } - } - }); - } - - public void schemaChanged(Connection connection, final Schema schema) { - // not interested to this event. - } - - public void tableChanged(Connection connection, final Table table) { - // not interested to this event. - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - this.combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty); - this.combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String catalogText = ((CCombo) e.getSource()).getText(); - if (catalogText.equals("")) { //$NON-NLS-1$ - catalogText = null; - if (CatalogCombo.this.table.getSpecifiedCatalog() == null || CatalogCombo.this.table.getSpecifiedCatalog().equals("")) { //$NON-NLS-1$ - return; - } - } - if (catalogText != null && combo.getItemCount() > 0 && catalogText.equals(combo.getItem(0))) { - catalogText = null; - } - if (CatalogCombo.this.table.getSpecifiedCatalog() == null && catalogText != null) { - CatalogCombo.this.setSpecifiedCatalog(catalogText); - } - if (CatalogCombo.this.table.getSpecifiedCatalog() != null && !CatalogCombo.this.table.getSpecifiedCatalog().equals(catalogText)) { - CatalogCombo.this.setSpecifiedCatalog(catalogText); - } - } - }); - } - - private void setSpecifiedCatalog(String catalogName) { - this.table.setSpecifiedCatalog(catalogName); - this.getConnectionProfile().setCatalogName(catalogName); - } - - protected void catalogChanged(Notification notification) { - if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CatalogCombo.this.populateCatalogName(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - CatalogCombo.this.populateDefaultCatalogName(); - } - }); - } - } - - public void doPopulate(EObject obj) { - this.table = (ITable) obj; - if (this.table != null) { - this.populateCatalogCombo(); - } - else { - this.connectionProfile = null; - } - } - - public void doPopulate() { - this.populateCatalogCombo(); - } - - protected Database getDatabase() { - return this.getConnectionProfile().getDatabase(); - } - - private ConnectionProfile getConnectionProfile() { - if (this.connectionProfile == null) { - this.connectionProfile = this.table.getJpaProject().connectionProfile(); - } - return this.connectionProfile; - } - - private void populateCatalogCombo() { - if (this.table == null) { - return; - } - this.populateDefaultCatalogName(); - if (this.getConnectionProfile().isConnected()) { - this.combo.remove(1, this.combo.getItemCount() - 1); - Database database = this.getDatabase(); - if (database != null) { - Iterator catalogs = database.catalogNames(); - for (Iterator stream = CollectionTools.sort(catalogs); stream.hasNext();) { - this.combo.add(stream.next()); - } - } - } - else { - this.combo.remove(1, this.combo.getItemCount() - 1); - } - this.populateCatalogName(); - } - - protected void populateDefaultCatalogName() { - // String defaultCatalogName = this.table.getDefaultCatalog(); // - // DefaultCatalog cannot be initialized if DB not online - String defaultCatalogName = this.getDatabase().getDefaultCatalogName(); // TOREVIEW - int selectionIndex = combo.getSelectionIndex(); - combo.setItem(0, NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultCatalogName)); - if (selectionIndex == 0) { - combo.clearSelection(); - combo.select(0); - } - } - - protected void populateCatalogName() { - if (this.table == null) { - return; - } - String catalogName = this.table.getSpecifiedCatalog(); - // String defaultCatalogName = this.table.getDefaultCatalog(); // - // DefaultCatalog cannot be initialized if DB not online - String defaultCatalogName = this.getDatabase().getDefaultCatalogName(); // TOREVIEW - if (!StringTools.stringIsEmpty(catalogName)) { - if (!this.combo.getText().equals(catalogName)) { - this.combo.setText(catalogName); - } - } - else { - if (!this.combo.getText().equals(NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultCatalogName))) { - this.combo.select(0); - } - } - } - - public CCombo getCombo() { - return this.combo; - } - - @Override - public Control getControl() { - return getCombo(); - } - - @Override - protected void disengageListeners() { - if (this.table != null) { - this.removeConnectionListener(); - this.table.eAdapters().remove(this.listener); - } - } - - @Override - protected void engageListeners() { - if (this.table != null) { - this.table.eAdapters().add(this.listener); - this.addConnectionListener(); - } - } - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java deleted file mode 100644 index 7502f7981f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java +++ /dev/null @@ -1,567 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -//TODO repopulate this panel based on the Entity table changing -public class ColumnComposite extends BaseJpaComposite -{ - - private IColumn column; - - private Adapter columnListener; - private ConnectionListener connectionListener; - - protected CCombo columnCombo; - protected CCombo tableCombo; - protected EnumComboViewer insertableComboViewer; - protected EnumComboViewer updatableComboViewer; - - private ConnectionProfile connectionProfile; - - public ColumnComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.columnListener = buildColumnListener(); - this.connectionListener = buildConnectionListener(); - } - - private Adapter buildColumnListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - columnChanged(notification); - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public void closed(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - ColumnComposite.this.populateColumnCombo(); - } - }); - } - - public void modified(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - ColumnComposite.this.populateColumnCombo(); - } - }); - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void opened(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - ColumnComposite.this.populateColumnCombo(); - } - }); - } - - public void databaseChanged(Connection connection, final Database database) { - return; - } - - public void schemaChanged(Connection connection, final Schema schema) { - return; - } - - public void tableChanged(Connection connection, final Table table) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if(table == getDbTable()) { - if (!getControl().isDisposed()) { - ColumnComposite.this.populateColumnCombo(); - } - } - } - }); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - composite.setLayout(layout); - - Group columnGroup = getWidgetFactory().createGroup(composite, JptUiMappingsMessages.ColumnComposite_columnSection); - layout = new GridLayout(); - layout.marginHeight = 0; - columnGroup.setLayout(layout); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - columnGroup.setLayoutData(gridData); - - //created this composite because combos as direct children of a Group do not have a border, no clue why - Composite intermediaryComposite = getWidgetFactory().createComposite(columnGroup); - layout = new GridLayout(2, false); - layout.marginWidth = 0; - intermediaryComposite.setLayout(layout); - - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - intermediaryComposite.setLayoutData(gridData); - - - CommonWidgets.buildColumnLabel(intermediaryComposite, getWidgetFactory()); - - this.columnCombo = buildColumnCombo(intermediaryComposite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.columnCombo.setLayoutData(gridData); - helpSystem.setHelp(columnCombo, IJpaHelpContextIds.MAPPING_COLUMN); - - - CommonWidgets.buildColumnTableLabel(intermediaryComposite, getWidgetFactory()); - - this.tableCombo = buildTableCombo(intermediaryComposite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.tableCombo.setLayoutData(gridData); - helpSystem.setHelp(tableCombo, IJpaHelpContextIds.MAPPING_COLUMN_TABLE); - - getWidgetFactory().createLabel(intermediaryComposite, JptUiMappingsMessages.ColumnComposite_insertable); - - this.insertableComboViewer = new EnumComboViewer(intermediaryComposite, this.commandStack, getWidgetFactory()); - this.insertableComboViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); - helpSystem.setHelp(this.insertableComboViewer.getControl(), IJpaHelpContextIds.MAPPING_COLUMN_INSERTABLE); - - getWidgetFactory().createLabel(intermediaryComposite, JptUiMappingsMessages.ColumnComposite_updatable); - - this.updatableComboViewer = new EnumComboViewer(intermediaryComposite, this.commandStack, getWidgetFactory()); - this.updatableComboViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); - helpSystem.setHelp(this.updatableComboViewer.getControl(), IJpaHelpContextIds.MAPPING_COLUMN_UPDATABLE); - } - - - private CCombo buildColumnCombo(Composite parent) { - final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty); - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String columnText = ((CCombo) e.getSource()).getText(); - if (columnText.equals("")) { //$NON-NLS-1$ - columnText = null; - if (column.getSpecifiedName() == null || column.getSpecifiedName().equals("")) { //$NON-NLS-1$ - return; - } - } - - if (columnText != null && combo.getItemCount() > 0 && columnText.equals(combo.getItem(0))) { - columnText = null; - } - - if (column.getSpecifiedName() == null && columnText != null) { - column.setSpecifiedName(columnText); - } - if (column.getSpecifiedName() != null && !column.getSpecifiedName().equals(columnText)) { - column.setSpecifiedName(columnText); - } - } - }); - return combo; - } - - private CCombo buildTableCombo(Composite parent) { - final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty); - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String tableText = ((CCombo) e.getSource()).getText(); - if (tableText.equals("")) { //$NON-NLS-1$ - tableText = null; - if (column.getSpecifiedTable() == null || column.getSpecifiedTable().equals("")) { //$NON-NLS-1$ - return; - } - } - - if (tableText != null && combo.getItemCount() > 0 && tableText.equals(combo.getItem(0))) { - tableText = null; - } - - if (column.getSpecifiedTable() == null && tableText != null) { - column.setSpecifiedTable(tableText); - } - if (column.getSpecifiedTable() != null && !column.getSpecifiedTable().equals(tableText)) { - column.setSpecifiedTable(tableText); - } - } - }); - return combo; - - } - - protected void columnChanged(Notification notification) { - if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed() || isPopulating()) { - return; - } - populateColumnName(); - } - }); - } - else if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateDefaultColumnName(); - } - }); - } - else if (notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateDefaultColumnTable(); - populateColumnCombo(); - } - }); - } - else if (notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateColumnTable(); - populateColumnCombo(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.column != null) { - this.column.eAdapters().add(this.columnListener); - this.addConnectionListener(); - } - } - - @Override - protected void disengageListeners() { - if (this.column != null) { - this.removeConnectionListener(); - this.column.eAdapters().remove(this.columnListener); - } - } - - private ConnectionProfile getConnectionProfile() { - if (this.connectionProfile == null) { - this.connectionProfile = this.column.getJpaProject().connectionProfile(); - } - return this.connectionProfile; - } - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } - - private Table getDbTable() { - return this.column.dbTable(); - } - - private void populateColumnCombo() { - //TODO don't do instanceof check here - check on Table, or isRoot check on Entity - //this.tableCombo.setEnabled(!(this.table instanceof SingleTableInheritanceChildTableImpl)); - populateDefaultColumnName(); - - if (this.getConnectionProfile().isConnected()) { - this.columnCombo.remove(1, this.columnCombo.getItemCount()-1); - Table table = getDbTable(); - if (table != null) { - for (Iterator i = CollectionTools.sort(CollectionTools.list(table.columnNames())).iterator(); i.hasNext();) { - this.columnCombo.add((String) i.next()); - } - } - } - else { - this.columnCombo.remove(1, this.columnCombo.getItemCount()-1); - } - populateColumnName(); - } - - protected void populateDefaultColumnName() { - String defaultTableName = column.getDefaultName(); - int selectionIndex = columnCombo.getSelectionIndex(); - columnCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName)); - if (selectionIndex == 0) { - //combo text does not update when switching between 2 mappings of the same type - //that both have a default column name. clear the selection and then set it again - columnCombo.clearSelection(); - columnCombo.select(0); - } - } - - protected void populateColumnName() { - String specifiedColumnName = this.column.getSpecifiedName(); - if (specifiedColumnName != null) { - if (!this.columnCombo.getText().equals(specifiedColumnName)) { - this.columnCombo.setText(specifiedColumnName); - } - } - else { - String defaultColumnName = this.column.getDefaultName(); - if (!this.columnCombo.getText().equals(NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultColumnName))) { - this.columnCombo.select(0); - } - } - } - - private void populateTableCombo() { - //TODO don't do instanceof check here - check on Table, or isRoot check on Entity - //this.tableCombo.setEnabled(!(this.table instanceof SingleTableInheritanceChildTableImpl)); - populateDefaultColumnTable(); - this.tableCombo.remove(1, this.tableCombo.getItemCount()-1); - - if (this.column != null) { - for (Iterator i = this.column.getOwner().getTypeMapping().associatedTableNamesIncludingInherited(); i.hasNext(); ) { - this.tableCombo.add((String) i.next()); - } - } - populateColumnTable(); - } - - protected void populateDefaultColumnTable() { - String defaultTableName = column.getDefaultTable(); - int selectionIndex = tableCombo.getSelectionIndex(); - tableCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName)); - if (selectionIndex == 0) { - //combo text does not update when switching between 2 mappings of the same type - //that both have a default column name. clear the selection and then set it again - tableCombo.clearSelection(); - tableCombo.select(0); - } - } - - protected void populateColumnTable() { - String tableName = this.column.getSpecifiedTable(); - String defaultTableName = this.column.getDefaultTable(); - if (tableName != null) { - if (!this.tableCombo.getText().equals(tableName)) { - this.tableCombo.setText(tableName); - } - } - else { - if (!this.tableCombo.getText().equals(NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName))) { - this.tableCombo.select(0); - } - } - } - - public void doPopulate(EObject obj) { - this.column = (IColumn) obj; - if (this.column != null) { - populateColumnCombo(); - populateTableCombo(); - } - this.insertableComboViewer.populate(new InsertableHolder(this.column)); - this.updatableComboViewer.populate(new UpdatableHolder(this.column)); - } - - public void doPopulate() { - if (this.column != null) { - populateColumnCombo(); - populateTableCombo(); - } - else { - this.connectionProfile = null; - } - this.insertableComboViewer.populate(); - this.updatableComboViewer.populate(); - } - - protected void enableWidgets(boolean enabled) { - this.columnCombo.setEnabled(enabled); - this.tableCombo.setEnabled(enabled); - this.insertableComboViewer.getControl().setEnabled(enabled); - this.updatableComboViewer.getControl().setEnabled(enabled); - } - - @Override - public void dispose() { - this.insertableComboViewer.dispose(); - this.updatableComboViewer.dispose(); - super.dispose(); - } - - private class InsertableHolder extends EObjectImpl implements EnumHolder { - - private IAbstractColumn column; - - InsertableHolder(IAbstractColumn column) { - super(); - this.column = column; - } - - public Object get() { - return this.column.getInsertable(); - } - - public void set(Object enumSetting) { - this.column.setInsertable((DefaultTrueBoolean) enumSetting); - - } - - public Class featureClass() { - return IAbstractColumn.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__INSERTABLE; - } - - public EObject wrappedObject() { - return this.column; - } - - public Object[] enumValues() { - return DefaultTrueBoolean.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultTrueBoolean.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "True"; - } - } - - private class UpdatableHolder extends EObjectImpl implements EnumHolder { - - private IAbstractColumn column; - - UpdatableHolder(IAbstractColumn column) { - super(); - this.column = column; - } - - public Object get() { - return this.column.getUpdatable(); - } - - public void set(Object enumSetting) { - this.column.setUpdatable((DefaultTrueBoolean) enumSetting); - - } - - public Class featureClass() { - return IAbstractColumn.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__UPDATABLE; - } - - public EObject wrappedObject() { - return this.column; - } - - public Object[] enumValues() { - return DefaultTrueBoolean.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultTrueBoolean.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "True"; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java deleted file mode 100644 index 43e66643fd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java +++ /dev/null @@ -1,260 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType; -import org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType; -import org.eclipse.jpt.core.internal.mappings.EnumType; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IColumn; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class CommonWidgets -{ - public static Label buildEntityNameLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.EntityGeneralSection_name); - } - - public static EntityNameCombo buildEntityNameCombo( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EntityNameCombo(parent, commandStack, widgetFactory); - } - - public static Label buildTableLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.TableChooser_label); - } - - public static Label buildCatalogLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.CatalogChooser_label); - } - - public static Label buildSchemaLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.SchemaChooser_label); - } - - public static StringWithDefaultChooser buildStringWithDefaultChooser( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new StringWithDefaultChooser(parent, commandStack, widgetFactory); - } - - - public static Label buildFetchLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_fetchLabel); - } - - public static Label buildTargetEntityLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.TargetEntityChooser_label); - } - - public static Label buildOptionalLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_optionalLabel); - } - - public static Label buildTemporalLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_temporalLabel); - } - - public static Label buildEnumeratedLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_enumeratedLabel); - } - - public static Label buildMappedByLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.NonOwningMapping_mappedByLabel); - } - - public static EnumComboViewer buildFetchTypeComboViewer( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EnumComboViewer(parent, commandStack, widgetFactory); - } - - public static EnumComboViewer buildEnumComboViewer( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new EnumComboViewer(parent, commandStack, widgetFactory); - } - - public static EnumHolder buildMultiRelationshipMappingFetchEnumHolder(IMultiRelationshipMapping mapping) { - return new FetchHolder(mapping); - } - - public static EnumHolder buildSingleRelationshipMappingFetchEnumHolder(ISingleRelationshipMapping mapping) { - return new SingleRelationshipMappingFetchHolder(mapping); - } - - public static Label buildColumnLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.ColumnChooser_label); - } - - public static Label buildColumnTableLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiMappingsMessages.ColumnTableChooser_label); - } - - public static ColumnTableHolder buildColumnTableHolder(IColumn column) { - return new ColumnTableHolder(column); - } - - public static TargetEntityChooser buildTargetEntityChooser(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new TargetEntityChooser(parent, commandStack, widgetFactory); - } - private static class FetchHolder extends EObjectImpl implements EnumHolder { - - private IMultiRelationshipMapping mapping; - - FetchHolder(IMultiRelationshipMapping mapping) { - super(); - this.mapping = mapping; - } - - public Object get() { - return this.mapping.getFetch(); - } - - public void set(Object enumSetting) { - this.mapping.setFetch((DefaultLazyFetchType) enumSetting); - - } - - public Class featureClass() { - return IMultiRelationshipMapping.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; - } - - public EObject wrappedObject() { - return this.mapping; - } - - public Object[] enumValues() { - return DefaultLazyFetchType.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultLazyFetchType.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "Lazy"; - } - } - - private static class SingleRelationshipMappingFetchHolder extends EObjectImpl implements EnumHolder { - - private ISingleRelationshipMapping mapping; - - SingleRelationshipMappingFetchHolder(ISingleRelationshipMapping mapping) { - super(); - this.mapping = mapping; - } - - public Object get() { - return this.mapping.getFetch(); - } - - public void set(Object enumSetting) { - this.mapping.setFetch((DefaultEagerFetchType) enumSetting); - - } - - public Class featureClass() { - return ISingleRelationshipMapping.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH; - } - - public EObject wrappedObject() { - return this.mapping; - } - - public Object[] enumValues() { - return DefaultEagerFetchType.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultEagerFetchType.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "Eager"; - } - } - private static abstract class ColumnHolder extends EObjectImpl implements StringHolder { - private IAbstractColumn column; - - ColumnHolder(IAbstractColumn column) { - super(); - this.column = column; - } - - public Class featureClass() { - return IAbstractColumn.class; - } - - public boolean supportsDefault() { - return true; - } - - public EObject wrappedObject() { - return this.column; - } - - protected IAbstractColumn getColumn() { - return this.column; - } - } - - public static class ColumnTableHolder extends ColumnHolder implements StringHolder { - - ColumnTableHolder(IAbstractColumn column) { - super(column); - } - - public int featureId() { - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE; - } - - public int defaultFeatureId() { - return JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE; - } - - public String defaultItem() { - String defaultName = getColumn().getDefaultTable(); - if (defaultName != null) { - return NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultName); - } - return JptUiMappingsMessages.ColumnComposite_defaultEmpty; - } - - public String getString() { - return getColumn().getSpecifiedTable(); - } - - public void setString(String newName) { - getColumn().setSpecifiedTable(newName); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java deleted file mode 100644 index 2c98eb093f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddableComposite extends BaseJpaComposite -{ - private IEmbeddable embeddable; - private Adapter mappedSuperclassListener; - - private CommandStack commandStack; - - - public EmbeddableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.mappedSuperclassListener = buildMappedSuperclassListener(); - } - - private Adapter buildMappedSuperclassListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - mappedSuperclassChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - composite.setLayout(new FillLayout(SWT.VERTICAL)); - -// Label accessTypeLabel = new Label(composite, SWT.LEFT); -// accessTypeLabel.setText(DaliUiMessages.MappedSuperclassComposite_accessType); -// this.accessTypeComboViewer = buildAccessTypeCombo(composite); -// //eventually this will be enabled if editing xml instead of java -// this.accessTypeComboViewer.getCombo().setEnabled(false); -// GridData gridData = new GridData(); -// gridData.horizontalAlignment = GridData.FILL; -// gridData.grabExcessHorizontalSpace = true; -// this.accessTypeComboViewer.getCombo().setLayoutData(gridData); -// PlatformUI.getWorkbench().getHelpSystem().setHelp(this.accessTypeComboViewer.getCombo(), IDaliHelpContextIds.ENTITY_ACCESS_TYPE); - - } - -// private ComboViewer buildAccessTypeCombo(Composite parent) { -// ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY); -// viewer.add(AccessType.VALUES.toArray()); -// viewer.addSelectionChangedListener(new ISelectionChangedListener() { -// public void selectionChanged(SelectionChangedEvent event) { -// if (populating) { -// return; -// } -// if (event.getSelection() instanceof StructuredSelection) { -// StructuredSelection selection = (StructuredSelection) event.getSelection(); -// editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, persistentType, OrmPackage.eINSTANCE.getPersistentType_AccessType(), selection.getFirstElement())); -// } -// } -// }); -// return viewer; -// } - - @Override - protected void doPopulate(EObject model) { - this.embeddable = (IEmbeddable) model; - } - - @Override - protected void doPopulate() { - - } - - - protected void engageListeners() { -// this.persistentTypeItemProvider.addListener(getPersistentTypeListener()); -// this.persistentType.eAdapters().add(this.persistentTypeItemProvider); - } - - protected void disengageListeners() { -// if (this.persistentType != null){ -// this.persistentType.eAdapters().remove(this.persistentTypeItemProvider); -// this.persistentTypeItemProvider.removeListener(getPersistentTypeListener()); -// } - } - - private void mappedSuperclassChanged(Notification notification) { - - } - -// private INotifyChangedListener getPersistentTypeListener() { -// if (this.persistentTypeListener == null) { -// this.persistentTypeListener = new INotifyChangedListener() { -// public void notifyChanged(Notification notification) { -// if (notification.getFeatureID(PersistentType.class) == OrmPackage.PERSISTENT_TYPE__ACCESS_TYPE) { -// final AccessType accessType = (AccessType) notification.getNewValue(); -// Display.getDefault().syncExec(new Runnable() { -// public void run() { -// if (((StructuredSelection) accessTypeComboViewer.getSelection()).getFirstElement() != accessType) { -// accessTypeComboViewer.setSelection(new StructuredSelection(accessType)); -// } -// } -// }); -// } -// } -// }; -// } -// return this.persistentTypeListener; -// } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java deleted file mode 100644 index d0da0632d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java +++ /dev/null @@ -1,338 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -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.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddedAttributeOverridesComposite extends BaseJpaComposite -{ - private ListViewer listViewer; - - private IEmbedded embedded; - private Adapter embeddedListener; - - private IAttributeOverride attributeOverride; - private Adapter attributeOverrideListener; - - protected ColumnComposite columnComposite; - - private Button overrideDefaultButton; - - public EmbeddedAttributeOverridesComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.embeddedListener = buildEmbeddedListener(); - this.attributeOverrideListener = buildAttributeOverrideListener(); - } - - private Adapter buildEmbeddedListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - embeddedChanged(notification); - } - }; - } - - private Adapter buildAttributeOverrideListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - attributeOverrideChanged(notification); - } - }; - } - - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - Group attributeOverridesGroup = getWidgetFactory().createGroup( - composite, JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides); - attributeOverridesGroup.setLayout(new GridLayout(2, true)); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - attributeOverridesGroup.setLayoutData(gridData); - - this.listViewer = buildAttributeOverridesListViewer(attributeOverridesGroup); - gridData = new GridData(); - gridData.verticalSpan = 2; - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - this.listViewer.getList().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.listViewer.getList(), IJpaHelpContextIds.MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES); - - this.overrideDefaultButton = getWidgetFactory().createButton(attributeOverridesGroup, "Override Default", SWT.CHECK); - this.overrideDefaultButton.addSelectionListener(buildOverrideDefaultSelectionListener()); - gridData = new GridData(); - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.overrideDefaultButton.setLayoutData(gridData); - - - this.columnComposite = new ColumnComposite(attributeOverridesGroup, commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.columnComposite.getControl().setLayoutData(gridData); - - } - - private SelectionListener buildOverrideDefaultSelectionListener() { - return new SelectionListener(){ - - public void widgetSelected(SelectionEvent e) { - overrideDefaultButtonSelected(e); - } - - public void widgetDefaultSelected(SelectionEvent e) { - overrideDefaultButtonSelected(e); - } - }; - } - - private void overrideDefaultButtonSelected(SelectionEvent e) { - boolean selection = this.overrideDefaultButton.getSelection(); - if (selection) { - int index = this.embedded.getSpecifiedAttributeOverrides().size(); - IAttributeOverride attributeOverride = this.embedded.createAttributeOverride(index); - this.embedded.getSpecifiedAttributeOverrides().add(attributeOverride); - attributeOverride.setName(this.attributeOverride.getName()); - attributeOverride.getColumn().setSpecifiedName(this.attributeOverride.getColumn().getName()); - } - else { - this.embedded.getSpecifiedAttributeOverrides().remove(this.attributeOverride); - } - } - - - private ListViewer buildAttributeOverridesListViewer(Composite parent) { - ListViewer listViewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER); - listViewer.setLabelProvider(buildAttributeOverridesLabelProvider()); - listViewer.setContentProvider(buildAttributeOverridesContentProvider()); - - listViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - attributeOverridesListSelectionChanged(event); - } - }); - - return listViewer; - } - - protected void attributeOverridesListSelectionChanged(SelectionChangedEvent event) { - if (((StructuredSelection) event.getSelection()).isEmpty()) { - this.columnComposite.populate(null); - this.columnComposite.enableWidgets(false); - this.overrideDefaultButton.setSelection(false); - this.overrideDefaultButton.setEnabled(false); - } - else { - this.attributeOverride = getSelectedAttributeOverride(); - boolean specifiedOverride = this.embedded.getSpecifiedAttributeOverrides().contains(this.attributeOverride); - this.overrideDefaultButton.setSelection(specifiedOverride); - this.columnComposite.populate(this.attributeOverride.getColumn()); - this.columnComposite.enableWidgets(specifiedOverride); - this.overrideDefaultButton.setEnabled(true); - } - } - - private ILabelProvider buildAttributeOverridesLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - //TODO also display column name somehow - return ((IAttributeOverride) element).getName(); - } - }; - } - - - private IContentProvider buildAttributeOverridesContentProvider() { - return new IStructuredContentProvider() { - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - public void dispose() { - } - - public Object[] getElements(Object inputElement) { - return ((IEmbedded) inputElement).getAttributeOverrides().toArray(); - } - }; - } - - private IAttributeOverride getSelectedAttributeOverride() { - return (IAttributeOverride) ((StructuredSelection) this.listViewer.getSelection()).getFirstElement(); - } - - - public void doPopulate(EObject obj) { - this.embedded = (IEmbedded) obj; - if (this.embedded == null) { - this.attributeOverride = null; - this.columnComposite.populate(null); - this.listViewer.setInput(null); - return; - } - - if (this.listViewer.getInput() != this.embedded) { - this.listViewer.setInput(this.embedded); - } - if (!this.embedded.getAttributeOverrides().isEmpty()) { - if (this.listViewer.getSelection().isEmpty()) { - IAttributeOverride attributeOverride = this.embedded.getAttributeOverrides().get(0); - this.listViewer.setSelection(new StructuredSelection(attributeOverride)); - } - else { - this.columnComposite.enableWidgets(true); - this.columnComposite.populate(((IAttributeOverride)((StructuredSelection) this.listViewer.getSelection()).getFirstElement()).getColumn()); - } - } - else { - this.columnComposite.populate(null); - this.columnComposite.enableWidgets(false); - } - } - - @Override - protected void doPopulate() { - this.columnComposite.doPopulate(); - } - - @Override - protected void engageListeners() { - if (this.embedded != null) { - this.embedded.eAdapters().add(this.embeddedListener); - for (IAttributeOverride attributeOverride : this.embedded.getAttributeOverrides()) { - attributeOverride.eAdapters().add(this.attributeOverrideListener); - } - } - } - - @Override - protected void disengageListeners() { - if (this.embedded != null) { - this.embedded.eAdapters().remove(this.embeddedListener); - for (IAttributeOverride attributeOverride : this.embedded.getAttributeOverrides()) { - attributeOverride.eAdapters().remove(this.attributeOverrideListener); - } - } - } - - - protected void embeddedChanged(Notification notification) { - switch (notification.getFeatureID(IEmbedded.class)) { - case JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES : - case JpaCoreMappingsPackage.IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES : - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (listViewer.getList().isDisposed()) { - return; - } - listViewer.refresh(); - columnComposite.enableWidgets(!listViewer.getSelection().isEmpty()); - if (listViewer.getSelection().isEmpty()) { - columnComposite.populate(null); - } - } - }); - if (notification.getEventType() == Notification.ADD) { - ((IAttributeOverride) notification.getNewValue()).eAdapters().add(this.attributeOverrideListener); - final Object newValue = notification.getNewValue(); - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (listViewer.getList().isDisposed()) { - return; - } - listViewer.setSelection(new StructuredSelection(newValue)); - } - }); - } - else if (notification.getEventType() == Notification.ADD_MANY) { - List addedList = (List) notification.getNewValue(); - for (Iterator i = addedList.iterator(); i.hasNext(); ) { - IAttributeOverride override = i.next(); - override.eAdapters().add(this.attributeOverrideListener); - } - } - else if (notification.getEventType() == Notification.REMOVE) { - ((IAttributeOverride) notification.getOldValue()).eAdapters().remove(this.attributeOverrideListener); - } - else if (notification.getEventType() == Notification.REMOVE_MANY) { - List removedList = (List) notification.getOldValue(); - for (Iterator i = removedList.iterator(); i.hasNext(); ) { - IAttributeOverride override = i.next(); - override.eAdapters().remove(this.attributeOverrideListener); - } - } - break; - default : - break; - } - } - - protected void attributeOverrideChanged(Notification notification) { - switch (notification.getFeatureID(IAttributeOverride.class)) { - case JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE__NAME : - final IAttributeOverride attributeOverride = (IAttributeOverride) notification.getNotifier(); - Display.getDefault().asyncExec(new Runnable() { - public void run() { - listViewer.refresh(attributeOverride); - } - }); - break; - default : - break; - } - } - - public void dispose() { - this.columnComposite.dispose(); - super.dispose(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java deleted file mode 100644 index 734a9c8676..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -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.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddedComposite extends BaseJpaComposite -{ - private IEmbedded embedded; - - private EmbeddedAttributeOverridesComposite attributeOverridesComposite; - - public EmbeddedComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout(layout); - - GridData gridData; - - this.attributeOverridesComposite = new EmbeddedAttributeOverridesComposite(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.attributeOverridesComposite.getControl().setLayoutData(gridData); - } - - - public void doPopulate(EObject obj) { - this.embedded = (IEmbedded) obj; - this.attributeOverridesComposite.populate(obj); - } - - public void doPopulate() { - this.attributeOverridesComposite.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.attributeOverridesComposite.dispose(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java deleted file mode 100644 index 13111065c2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EmbeddedIdComposite extends BaseJpaComposite -{ - public EmbeddedIdComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - - } - - - public void doPopulate(EObject obj) { - } - - public void doPopulate() { - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java deleted file mode 100644 index 7ddf3c99e7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java +++ /dev/null @@ -1,339 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INamedQuery; -import org.eclipse.jpt.core.internal.mappings.IQueryHint; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder; -import org.eclipse.osgi.util.NLS; -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.ui.PlatformUI; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EntityComposite extends BaseJpaComposite -{ - private IEntity entity; - - private EntityNameCombo entityNameCombo; - - private TableComposite tableComposite; - private InheritanceComposite inheritanceComposite; - private SecondaryTablesComposite secondaryTablesComposite; - private OverridesComposite attributeOverridesComposite; - - public EntityComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - Control attributeOverridesControl = buildAttributeOverridesComposite(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - attributeOverridesControl.setLayoutData(gridData); - - Control secondaryTablesControl = buildSecondaryTablesComposite(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - secondaryTablesControl.setLayoutData(gridData); - - Control inheritanceControl = buildInheritanceComposite(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - inheritanceControl.setLayoutData(gridData); - } - - private Control buildGeneralComposite(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - CommonWidgets.buildEntityNameLabel(generalComposite, getWidgetFactory()); - - this.entityNameCombo = - CommonWidgets.buildEntityNameCombo(generalComposite, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.entityNameCombo.getCombo().setLayoutData(gridData); - helpSystem.setHelp(entityNameCombo.getCombo(), IJpaHelpContextIds.ENTITY_NAME); - - - this.tableComposite = new TableComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.tableComposite.getControl().setLayoutData(gridData); - - return generalComposite; - } - - private Control buildSecondaryTablesComposite(Composite composite) { - Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - section.setText(JptUiMappingsMessages.SecondaryTablesComposite_secondaryTables); - - Composite client = getWidgetFactory().createComposite(section); - section.setClient(client); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - client.setLayout(layout); - - this.secondaryTablesComposite = new SecondaryTablesComposite(client, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.secondaryTablesComposite.getControl().setLayoutData(gridData); - - return section; - } - - private Control buildInheritanceComposite(Composite composite) { - Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - section.setText(JptUiMappingsMessages.EntityComposite_inheritance); - - Composite inheritanceClient = getWidgetFactory().createComposite(section); - section.setClient(inheritanceClient); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - inheritanceClient.setLayout(layout); - - this.inheritanceComposite = new InheritanceComposite(inheritanceClient, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.inheritanceComposite.getControl().setLayoutData(gridData); - - return section; - } - - private Control buildAttributeOverridesComposite(Composite composite) { - Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - section.setText(JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides); - //section.setExpanded(true); //not going to expand this for now, it causes the scroll bar not to appear - Composite client = getWidgetFactory().createComposite(section); - section.setClient(client); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - client.setLayout(layout); - - this.attributeOverridesComposite = new OverridesComposite(client, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.attributeOverridesComposite.getControl().setLayoutData(gridData); - - return section; - } - - //TODO talk to JavaEditor people about what we can do to hook in TabbedProperties for the JavaEditor - - public void doPopulate(EObject obj) { - this.entity = (IEntity) obj; - this.entityNameCombo.populate(obj); - this.attributeOverridesComposite.populate(obj); - this.secondaryTablesComposite.populate(obj); - this.inheritanceComposite.populate(obj); - if (this.entity != null) { - this.tableComposite.populate(this.entity.getTable()); - } - else { - this.tableComposite.populate(null); - } - } - - public void doPopulate() { - this.entityNameCombo.populate(); - this.tableComposite.populate(); - this.attributeOverridesComposite.populate(); - this.secondaryTablesComposite.populate(); - this.inheritanceComposite.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.entityNameCombo.dispose(); - this.tableComposite.dispose(); - this.attributeOverridesComposite.dispose(); - this.secondaryTablesComposite.dispose(); - this.inheritanceComposite.dispose(); - super.dispose(); - } - - protected IEntity getEntity() { - return this.entity; - } - - - private abstract class TableHolder extends EObjectImpl implements StringHolder { - private ITable table; - - TableHolder(ITable table) { - super(); - this.table = table; - } - - public Class featureClass() { - return ITable.class; - } - - public boolean supportsDefault() { - return true; - } - - public EObject wrappedObject() { - return this.table; - } - - public ITable getTable() { - return this.table; - } - } - - private class TableNameHolder extends TableHolder implements StringHolder { - - TableNameHolder(ITable table) { - super(table); - } - - public int featureId() { - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME; - } - - public int defaultFeatureId() { - return JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME; - } - - public String defaultItem() { - String defaultName = getTable().getDefaultName(); - if (defaultName != null) { - return NLS.bind(JptUiMappingsMessages.EntityComposite_tableDefault, defaultName); - } - return JptUiMappingsMessages.EntityComposite_tableNoDefaultSpecified; - } - - public String getString() { - return getTable().getSpecifiedName(); - } - - public void setString(String newName) { - getTable().setSpecifiedName(newName); - } - } - - private class TableCatalogHolder extends TableHolder implements StringHolder { - - TableCatalogHolder(ITable table) { - super(table); - } - - public int featureId() { - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG; - } - - public int defaultFeatureId() { - return JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG; - } - - public String defaultItem() { - String defaultCatalog = getTable().getDefaultCatalog(); - if (defaultCatalog != null) { - return NLS.bind(JptUiMappingsMessages.EntityComposite_tableDefault, defaultCatalog); - } - return JptUiMappingsMessages.EntityComposite_tableNoDefaultSpecified; - } - - public String getString() { - return getTable().getSpecifiedCatalog(); - } - - public void setString(String newName) { - getTable().setSpecifiedCatalog(newName); - } - } - - private class TableSchemaHolder extends TableHolder implements StringHolder { - - TableSchemaHolder(ITable table) { - super(table); - } - - public int featureId() { - return JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA; - } - - public int defaultFeatureId() { - return JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA; - } - - public String defaultItem() { - String defaultSchema = getTable().getDefaultSchema(); - if (defaultSchema != null) { - return NLS.bind(JptUiMappingsMessages.EntityComposite_tableDefault, defaultSchema); - } - return JptUiMappingsMessages.EntityComposite_tableNoDefaultSpecified; - } - - public String getString() { - return getTable().getSpecifiedSchema(); - } - - public void setString(String newName) { - getTable().setSpecifiedSchema(newName); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java deleted file mode 100644 index 8fe0ffcf4c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Arrays; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -// TODO get Default updating appropriately based on Entity name default - -public class EntityNameCombo extends BaseJpaController -{ - private IEntity entity; - private Adapter entityListener; - - private CCombo combo; - - - public EntityNameCombo(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, commandStack, widgetFactory); - buildEntityListener(); - } - - - private void buildEntityListener() { - entityListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - entityChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - combo = this.widgetFactory.createCCombo(parent, SWT.FLAT); - combo.addModifyListener( - new ModifyListener() { - public void modifyText(ModifyEvent e) { - comboModified(e); - } - }); - } - - private void comboModified(ModifyEvent e) { - if (isPopulating()) { - return; - } - - String text = ((CCombo) e.getSource()).getText(); - if (text.equals(combo.getItem(0))) { - text = null; - } - - entity.setSpecifiedName(text); - - // TODO Does this need to be done? - //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text)); - } - - private void entityChanged(Notification notification) { - switch (notification.getFeatureID(IEntity.class)) { - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - break; - case JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME : - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - break; - } - } - - @Override - protected void engageListeners() { - if (entity != null) { - entity.eAdapters().add(entityListener); - } - } - - @Override - protected void disengageListeners() { - if (entity != null) { - entity.eAdapters().remove(entityListener); - } - } - - @Override - public void doPopulate(EObject obj) { - entity = (IEntity) obj; - populateCombo(); - } - - @Override - protected void doPopulate() { - populateCombo(); - } - - private void populateCombo() { - if (entity == null) { - combo.clearSelection(); - combo.setItems(new String[] {}); - return; - } - - String defaultItem = NLS.bind(JptUiMappingsMessages.EntityGeneralSection_nameDefaultWithOneParam, entity.getDefaultName()); - String specifiedName = entity.getSpecifiedName(); - - if (specifiedName == null) { - setComboData(defaultItem, new String[] {defaultItem}); - } - else { - setComboData(specifiedName, new String[] {defaultItem}); - } - } - - private void setComboData(String text, String[] items) { - if (! Arrays.equals(items, combo.getItems())) { - combo.setItems(items); - } - - if (! text.equals(combo.getText())) { - combo.setText(text); - } - } - - public CCombo getCombo() { - return combo; - } - - @Override - public Control getControl() { - return getCombo(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java deleted file mode 100644 index 2cf6b61dd3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java +++ /dev/null @@ -1,207 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class EnumComboViewer extends BaseJpaController -{ - private EnumHolder enumHolder; - private Adapter enumListener; - - private CComboViewer comboViewer; - - - public EnumComboViewer(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildListener(); - } - - - private void buildListener() { - this.enumListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - modelChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - this.comboViewer = new CComboViewer(combo); - this.comboViewer.setLabelProvider(buildLabelProvider()); - this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - EnumComboViewer.this.selectionChanged(event.getSelection()); - } - }); - } - protected IBaseLabelProvider buildLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == enumHolder.defaultValue()) { - return NLS.bind(JptUiMappingsMessages.EnumComboViewer_default, enumHolder.defaultString()); - } - return super.getText(element); - } - }; - } - - void selectionChanged(ISelection sel) { - if (sel instanceof IStructuredSelection) { - Object selection = ((IStructuredSelection) sel).getFirstElement(); - if ( ! this.enumHolder.get().equals(selection)) { - this.enumHolder.set(selection); -// this.editingDomain.getCommandStack().execute( -// SetCommand.create( -// this.editingDomain, -// this.basicMapping, -// OrmPackage.eINSTANCE.getBasicMapping_Optional(), -// optional -// ) -// ); - } - } - } - - private void modelChanged(Notification notification) { - if (notification.getFeatureID(this.enumHolder.featureClass()) == - this.enumHolder.featureId()) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.enumHolder != null && this.enumHolder.wrappedObject() != null) { - this.enumHolder.wrappedObject().eAdapters().add(this.enumListener); - } - } - - @Override - protected void disengageListeners() { - if (this.enumHolder != null && this.enumHolder.wrappedObject() != null) { - this.enumHolder.wrappedObject().eAdapters().remove(this.enumListener); - } - } - - public final void populate(EnumHolder enumHolder) { - super.populate(enumHolder); - } - - @Override - public void doPopulate(EObject obj) { - this.enumHolder = (EnumHolder) obj; - populateCombo(); - } - - @Override - protected void doPopulate() { - populateCombo(); - } - - private void populateCombo() { - this.comboViewer.getCombo().removeAll(); - if (this.enumHolder.wrappedObject() == null) { - return; - } - - this.comboViewer.add(this.enumHolder.enumValues()); - - Object modelSetting = this.enumHolder.get(); - - if (((IStructuredSelection) this.comboViewer.getSelection()).getFirstElement() != modelSetting) { - this.comboViewer.setSelection(new StructuredSelection(modelSetting)); - } - } - - - @Override - public Control getControl() { - return this.comboViewer.getCombo(); - } - - - /** - * An interface to wrap an object that supports accessType - * An object of this type must be passed in to populate(EObject) - */ - public static interface EnumHolder extends EObject { - /** - * Return the num setting from the wrapped object - * @return - */ - Object get(); - - /** - * Set the enum setting on the wrapped object - * @param fetch - */ - void set(Object enumSetting); - - /** - * Return the Class of the wrapped object - * @return - */ - Class featureClass(); - - /** - * Return the feature id of enum setting on the wrapped object - * @return - */ - int featureId(); - - /** - * The wrapped EObject that the enum setting is stored on - * @return - */ - EObject wrappedObject(); - - Object[] enumValues(); - - /** - * Return the Default Enumerator object - */ - Object defaultValue(); - - /** - * Return the String to be displayed to the user - * Deafult ([defaultString()]) - */ - String defaultString(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java deleted file mode 100644 index c13c5f7954..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java +++ /dev/null @@ -1,288 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.mappings.GenerationType; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.platform.IGeneratorRepository; -import org.eclipse.jpt.core.internal.platform.NullGeneratorRepository; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class GeneratedValueComposite extends BaseJpaComposite -{ - private IId id; - private IGeneratedValue generatedValue; - private Adapter generatedValueListener; - - private CComboViewer strategyComboViewer; - - private CCombo generatorNameCombo; - - protected boolean populating; - - public GeneratedValueComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.generatedValueListener = buildGeneratedValueListener(); - } - - private Adapter buildGeneratedValueListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - generatedValueChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - composite.setLayout(layout); - - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.GeneratedValueComposite_strategy); - - this.strategyComboViewer = buildStrategyComboViewer(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.strategyComboViewer.getCombo().setLayoutData(gridData); - helpSystem.setHelp(this.strategyComboViewer.getCombo(), IJpaHelpContextIds.MAPPING_GENERATED_VALUE_STRATEGY); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.GeneratedValueComposite_generatorName); - - this.generatorNameCombo = buildGeneratorNameCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.generatorNameCombo.setLayoutData(gridData); - helpSystem.setHelp(this.generatorNameCombo, IJpaHelpContextIds.MAPPING_GENERATED_VALUE_GENERATOR_NAME); - - // TODO - // buildGeneratorNameSelectionButton( this); - } - - private CComboViewer buildStrategyComboViewer(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - CComboViewer viewer = new CComboViewer(combo); - viewer.setLabelProvider(buildStrategyLabelProvider()); - viewer.add(GenerationType.VALUES.toArray()); - viewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - if (populating) { - return; - } - if (event.getSelection() instanceof StructuredSelection) { - StructuredSelection selection = (StructuredSelection) event.getSelection(); - GenerationType selectedType = (GenerationType) selection.getFirstElement(); - if (generatedValue == null) { - createGeneratedValue(); - } - if (!generatedValue.getStrategy().equals(selectedType)) { - generatedValue.setStrategy(selectedType); - } - } - } - }); - return viewer; - } - - private IBaseLabelProvider buildStrategyLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == GenerationType.DEFAULT) { - //TODO need to move this to the model, don't want hardcoded String - return NLS.bind(JptUiMappingsMessages.GeneratedValueComposite_default, "Auto"); - } - return super.getText(element); - } - }; - } - - - protected CCombo buildGeneratorNameCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty); - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String generatorName = ((CCombo) e.getSource()).getText(); - - if (generatorName.equals("")) { //$NON-NLS-1$ - if (generatedValue.getGenerator() == null || generatedValue.getGenerator().equals("")) { - return; - } - generatorName = null; - } - if (generatedValue == null) { - createGeneratedValue(); - } - generatedValue.setGenerator(generatorName); - } - }); - return combo; - } - - private void createGeneratedValue() { - IGeneratedValue generatedValue = this.id.createGeneratedValue(); - this.id.setGeneratedValue(generatedValue); - } - - - protected void generatedValueChanged(Notification notification) { - if (notification.getFeatureID(IGeneratedValue.class) == JpaCoreMappingsPackage.IGENERATED_VALUE__STRATEGY) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - if (selectedStrategy() != generatedValue.getStrategy()) { - strategyComboViewer.setSelection(new StructuredSelection(generatedValue.getStrategy())); - } - } - }); - } - else if (notification.getFeatureID(IGeneratedValue.class) == JpaCoreMappingsPackage.IGENERATED_VALUE__GENERATOR) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateGeneratorName(); - } - }); - } - } - - @Override - protected void doPopulate(EObject obj) { - this.id = (IId) obj; - if (this.id == null) { - this.generatedValue= null; - } - else { - this.generatedValue = this.id.getGeneratedValue(); - } - if (this.generatedValue == null) { - this.strategyComboViewer.getCombo().deselectAll(); - this.generatorNameCombo.setText(""); - this.populating = false; - return; - } - populateStrategyCombo(); - populateGeneratorNameCombo(); - } - - @Override - protected void doPopulate() { - - } - - protected void engageListeners() { - if (this.generatedValue != null) { - this.generatedValue.eAdapters().add(this.generatedValueListener); - } - } - - protected void disengageListeners() { - if (this.generatedValue != null) { - this.generatedValue.eAdapters().remove(this.generatedValueListener); - } - } - - private IGeneratorRepository getGeneratorRepository() { - return NullGeneratorRepository.instance(); //this.id.getJpaProject().getPlatform().generatorRepository(this.id.typeMapping().getPersistentType()); - } - - private void populateGeneratorNameCombo() { - this.generatorNameCombo.removeAll(); - for (Iterator i = getGeneratorRepository().generatorNames(); i.hasNext(); ){ - this.generatorNameCombo.add(i.next()); - } - - populateGeneratorName(); - } - private void populateGeneratorName() { - String generatorName = this.generatedValue.getGenerator(); - if (generatorName == null || generatorName.equals("")) { - this.generatorNameCombo.setText(""); - } - else if (!this.generatorNameCombo.getText().equals(generatorName)) { - this.generatorNameCombo.setText(generatorName); - } - } - - private void populateStrategyCombo() { - GenerationType selectedType = selectedStrategy(); - GenerationType strategy = this.generatedValue.getStrategy(); - if (strategy == GenerationType.AUTO) { - if (selectedType != GenerationType.AUTO) { - this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.AUTO)); - } - } - else if (strategy == GenerationType.SEQUENCE) { - if (selectedType != GenerationType.SEQUENCE) { - this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.SEQUENCE)); - } - } - else if (strategy == GenerationType.IDENTITY) { - if (selectedType != GenerationType.IDENTITY) { - this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.IDENTITY)); - } - } - else if (strategy == GenerationType.TABLE) { - if (selectedType != GenerationType.TABLE) { - this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.TABLE)); - } - } - else { - if (selectedType != GenerationType.DEFAULT) { - this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.DEFAULT)); - } - } - // TODO first initialization - } - - private GenerationType selectedStrategy() { - return (GenerationType) ((StructuredSelection) this.strategyComboViewer.getSelection()).getFirstElement(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java deleted file mode 100644 index a9f0227daf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IGenerator; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -/** - * GeneratorComposite - */ -public abstract class GeneratorComposite extends BaseJpaComposite -{ - private IId id; - private E generator; - private Adapter generatorListener; - - protected Text nameTextWidget; - - public GeneratorComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.generatorListener = buildGeneratorListner(); - } - - private Adapter buildGeneratorListner() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - generatorChanged(notification); - } - }; - } - - /** - * Builds the Generator specifiedName viewer. - * - * @param parent - * @return - */ - protected Text buildNameText(Composite parent) { - final Text text = getWidgetFactory().createText(parent, null); - text.addModifyListener(new ModifyListener() { - public void modifyText(org.eclipse.swt.events.ModifyEvent e) { - if (isPopulating()) { - return; - } - - String name = text.getText(); - if (name.equals("")) { //$NON-NLS-1$ - if (getGenerator().getName() == null) { - return; - } - name = null; - } - IGenerator generator = getGenerator(); - if (generator == null) { - generator = createGenerator(); - } - generator.setName(name); - } - }); - return text; - } - - protected abstract E createGenerator(); - - @Override - protected void doPopulate(EObject obj) { - this.id = (IId) obj; - if (this.id == null) { - this.generator = null; - return; - } - this.generator = generator(this.id); - if (this.generator == null) { - clear(); - return; - } - populateNameViewer(); - return; - } - - @Override - protected void doPopulate() { - populateNameViewer(); - } - - protected void engageListeners() { - if (this.generator != null) { - this.generator.eAdapters().add(this.generatorListener); - } - } - - protected void disengageListeners() { - if (this.generator != null) { - this.generator.eAdapters().remove(this.generatorListener); - } - } - - protected abstract E generator(IId id); - - protected IId idMapping() { - return this.id; - } - - protected void generatorChanged(Notification notification) { - if (notification.getFeatureID(IGenerator.class) == JpaCoreMappingsPackage.IGENERATOR__NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - if (nameTextWidget.getText() == null || !nameTextWidget.getText().equals(getGenerator().getName())) { - if (getGenerator().getName() == null) { - clearNameViewer(); - } - else { - nameTextWidget.setText(getGenerator().getName()); - } - } - } - }); - } - } - - private void populateNameViewer() { - String name = this.getGenerator().getName(); - if (name != null) { - if (!this.nameTextWidget.getText().equals(name)) { - this.nameTextWidget.setText(name); - } - } - else { - this.clearNameViewer(); - } - } - - protected E getGenerator() { - return this.generator; - } - - protected void clear() { - this.clearNameViewer(); - } - - protected void clearNameViewer() { - this.nameTextWidget.setText(""); //$NON-NLS-1$ - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java deleted file mode 100644 index b71d4cfffe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java +++ /dev/null @@ -1,459 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.IGeneratedValue; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -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.ui.PlatformUI; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class IdComposite extends BaseJpaComposite -{ - private IId id; - private Adapter idListener; - - private ColumnComposite columnComposite; - - private EnumComboViewer temporalTypeViewer; - - private Section pkGenerationSection; - private Button primaryKeyGenerationCheckBox; - private GeneratedValueComposite generatedValueComposite; - - private Section tableGenSection; - private Button tableGeneratorCheckBox; - private TableGeneratorComposite tableGeneratorComposite; - - private Section sequenceGenSection; - private Button sequenceGeneratorCheckBox; - private SequenceGeneratorComposite sequenceGeneratorComposite; - - - public IdComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.idListener = buildIdListener(); - } - - private Adapter buildIdListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - idMappingChanged(notification); - } - }; - } - void idMappingChanged(Notification notification) { - switch (notification.getFeatureID(IId.class)) { - case JpaCoreMappingsPackage.IID__TABLE_GENERATOR : - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - IdComposite.this.populateTableGeneratorComposite(); - } - }); - break; - case JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR : - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - IdComposite.this.populateSequenceGeneratorComposite(); - } - }); - break; - case JpaCoreMappingsPackage.IID__GENERATED_VALUE : - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - IdComposite.this.populateGeneratedValueComposite(); - } - }); - break; - } - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - Control generationControl = buildGenerationComposite(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generationControl.setLayoutData(gridData); - } - - private Control buildGeneralComposite(Composite composite) { - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - this.columnComposite = new ColumnComposite(generalComposite, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.columnComposite.getControl().setLayoutData(gridData); - - CommonWidgets.buildTemporalLabel(generalComposite, getWidgetFactory()); - this.temporalTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.temporalTypeViewer.getControl().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(temporalTypeViewer.getControl(), IJpaHelpContextIds.MAPPING_TEMPORAL); - - return generalComposite; - } - - private Control buildGenerationComposite(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - this.pkGenerationSection = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - this.pkGenerationSection.setText(JptUiMappingsMessages.IdMappingComposite_primaryKeyGeneration); - - Composite generationClient = getWidgetFactory().createComposite(this.pkGenerationSection); - this.pkGenerationSection.setClient(generationClient); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - generationClient.setLayout(layout); - - this.primaryKeyGenerationCheckBox = buildPrimaryKeyGenerationCheckBox(generationClient); - GridData gridData = new GridData(); - this.primaryKeyGenerationCheckBox.setLayoutData(gridData); - helpSystem.setHelp(primaryKeyGenerationCheckBox, IJpaHelpContextIds.MAPPING_PRIMARY_KEY_GENERATION); - - this.generatedValueComposite = new GeneratedValueComposite(generationClient, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalIndent = 20; - this.generatedValueComposite.getControl().setLayoutData(gridData); - - this.tableGenSection = getWidgetFactory().createSection(generationClient, SWT.FLAT | ExpandableComposite.TWISTIE); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.tableGenSection.setLayoutData(gridData); - - this.tableGenSection.setText(JptUiMappingsMessages.IdMappingComposite_tableGenerator); - - Composite tableGenClient = getWidgetFactory().createComposite(this.tableGenSection); - this.tableGenSection.setClient(tableGenClient); - - layout = new GridLayout(); - layout.marginWidth = 0; - tableGenClient.setLayout(layout); - - this.tableGeneratorCheckBox = buildTableGeneratorCheckBox(tableGenClient); - gridData = new GridData(); - this.tableGeneratorCheckBox.setLayoutData(gridData); - helpSystem.setHelp(tableGeneratorCheckBox, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR); - - this.tableGeneratorComposite = new TableGeneratorComposite(tableGenClient, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalIndent = 20; - this.tableGeneratorComposite.getControl().setLayoutData(gridData); - - - - this.sequenceGenSection = getWidgetFactory().createSection(generationClient, SWT.FLAT | ExpandableComposite.TWISTIE); - this.sequenceGenSection.setText(JptUiMappingsMessages.IdMappingComposite_sequenceGenerator); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.sequenceGenSection.setLayoutData(gridData); - - Composite sequenceGenClient = getWidgetFactory().createComposite(this.sequenceGenSection); - this.sequenceGenSection.setClient(sequenceGenClient); - - layout = new GridLayout(); - layout.marginWidth = 0; - sequenceGenClient.setLayout(layout); - - this.sequenceGeneratorCheckBox = buildSequenceGeneratorCheckBox(sequenceGenClient); - gridData = new GridData(); - this.sequenceGeneratorCheckBox.setLayoutData(gridData); - helpSystem.setHelp(sequenceGeneratorCheckBox, IJpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR); - - this.sequenceGeneratorComposite = new SequenceGeneratorComposite(sequenceGenClient, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalIndent = 20; - this.sequenceGeneratorComposite.getControl().setLayoutData(gridData); - - return this.pkGenerationSection; - } - - private Button buildPrimaryKeyGenerationCheckBox(Composite parent) { - Button button = getWidgetFactory().createButton(parent,JptUiMappingsMessages.IdMappingComposite_primaryKeyGeneration, SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // ignore - } - - public void widgetSelected(SelectionEvent e) { - IdComposite.this.primaryKeyGenerationCheckBoxClicked(e); - } - }); - return button; - } - - void primaryKeyGenerationCheckBoxClicked(SelectionEvent e) { - boolean mappingHasGeneratedValue = this.id.getGeneratedValue() != null; - boolean checked = this.primaryKeyGenerationCheckBox.getSelection(); - if (checked == mappingHasGeneratedValue) { - return; - } - IGeneratedValue generatedValue = null; - if (checked) { - generatedValue = this.id.createGeneratedValue(); - } - this.id.setGeneratedValue(generatedValue); - } - - private Button buildTableGeneratorCheckBox(Composite parent) { - Button button = getWidgetFactory().createButton(parent,JptUiMappingsMessages.IdMappingComposite_tableGenerator, SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // ignore - } - - public void widgetSelected(SelectionEvent e) { - IdComposite.this.tableGeneratorCheckBoxClicked(e); - } - }); - return button; - } - - void tableGeneratorCheckBoxClicked(SelectionEvent e) { - boolean mappingHasTableGenerator = this.id.getTableGenerator() != null; - boolean checked = this.tableGeneratorCheckBox.getSelection(); - if (checked == mappingHasTableGenerator) { - return; - } - ITableGenerator tableGenerator = null; - if (checked) { - tableGenerator = this.id.createTableGenerator(); - } - this.id.setTableGenerator(tableGenerator); - if (checked) { - IGeneratedValue generatedValue = this.id.getGeneratedValue(); - if (generatedValue != null && generatedValue.getGenerator() != null) { - tableGenerator.setName(generatedValue.getGenerator()); - } - } - } - - private Button buildSequenceGeneratorCheckBox(Composite parent) { - Button button = getWidgetFactory().createButton(parent,JptUiMappingsMessages.IdMappingComposite_sequenceGenerator, SWT.CHECK); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // ignore - } - - public void widgetSelected(SelectionEvent e) { - IdComposite.this.sequenceGeneratorCheckBoxClicked(e); - } - }); - return button; - } - - void sequenceGeneratorCheckBoxClicked(SelectionEvent e) { - boolean mappingHasSequenceGenerator = this.id.getSequenceGenerator() != null; - boolean checked = this.sequenceGeneratorCheckBox.getSelection(); - if (checked == mappingHasSequenceGenerator) { - return; - } - ISequenceGenerator sequenceGenerator = null; - if (checked) { - sequenceGenerator = this.id.createSequenceGenerator(); - } - this.id.setSequenceGenerator(sequenceGenerator); - if (checked) { - IGeneratedValue generatedValue = this.id.getGeneratedValue(); - if (generatedValue != null && generatedValue.getGenerator() != null) { - sequenceGenerator.setName(generatedValue.getGenerator()); - } - } - } - - - - public void doPopulate(EObject obj) { - this.id = (IId) obj; - if (this.id != null) { - this.columnComposite.populate(this.id.getColumn()); - } - else { - this.columnComposite.populate(null); - this.generatedValueComposite.populate(null); - this.tableGeneratorComposite.populate(null); - this.sequenceGeneratorComposite.populate(null); - return; - } - this.pkGenerationSection.setExpanded(true); - this.temporalTypeViewer.populate(new TemporalTypeHolder(this.id)); - populateGeneratedValueComposite(); - populateSequenceGeneratorComposite(); - populateTableGeneratorComposite(); - } - - public void doPopulate() { - this.columnComposite.populate(); - this.temporalTypeViewer.populate(); - this.generatedValueComposite.populate(); - this.tableGeneratorComposite.populate(); - this.sequenceGeneratorComposite.populate(); - } - - private void populateTableGeneratorComposite() { - this.tableGeneratorComposite.populate(this.id); - boolean tableGeneratorExists = this.id.getTableGenerator() != null; - this.tableGeneratorCheckBox.setSelection(tableGeneratorExists); - if (tableGeneratorExists) { - this.tableGenSection.setExpanded(true); - } - } - - private void populateSequenceGeneratorComposite() { - this.sequenceGeneratorComposite.populate(this.id); - boolean sequenceGeneratorExists = this.id.getSequenceGenerator() != null; - this.sequenceGeneratorCheckBox.setSelection(sequenceGeneratorExists); - if (sequenceGeneratorExists) { - this.sequenceGenSection.setExpanded(true); - } - } - - private void populateGeneratedValueComposite() { - this.generatedValueComposite.populate(this.id); - this.primaryKeyGenerationCheckBox.setSelection(this.id.getGeneratedValue() != null); - } - - - protected void engageListeners() { - if (this.id !=null) { - this.id.eAdapters().add(this.idListener); - } - } - - protected void disengageListeners() { - if (this.id !=null) { - this.id.eAdapters().remove(this.idListener); - } - } - - @Override - public void dispose() { - this.columnComposite.dispose(); - this.temporalTypeViewer.dispose(); - this.generatedValueComposite.dispose(); - this.tableGeneratorComposite.dispose(); - this.sequenceGeneratorComposite.dispose(); - super.dispose(); - } - - protected IId getId() { - return this.id; - } - - private class TemporalTypeHolder extends EObjectImpl implements EnumHolder { - - private IId id; - - TemporalTypeHolder(IId id) { - super(); - this.id = id; - } - - public Object get() { - return this.id.getTemporal(); - } - - public void set(Object enumSetting) { - this.id.setTemporal((TemporalType) enumSetting); - } - - public Class featureClass() { - return IId.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IID__TEMPORAL; - } - - public EObject wrappedObject() { - return this.id; - } - - public Object[] enumValues() { - return TemporalType.VALUES.toArray(); - } - - /** - * TemporalType has no Default, return null - */ - public Object defaultValue() { - return null; - } - - /** - * TemporalType has no Default, return null - */ - public String defaultString() { - return null; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java deleted file mode 100644 index deb61540bc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java +++ /dev/null @@ -1,620 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.mappings.DiscriminatorType; -import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class InheritanceComposite extends BaseJpaComposite { - - private IEntity entity; - private IDiscriminatorColumn discriminatorColumn; - private final Adapter entityListener; - private final Adapter discriminatorColumnListener; - - private CComboViewer strategyViewer; - private CCombo columnCombo; - private CComboViewer discriminatorTypeViewer; - private CCombo discriminatorValueCombo; - - private ConnectionListener connectionListener; - - private ConnectionProfile connectionProfile; - - - private PrimaryKeyJoinColumnsComposite pkJoinColumnsComposite; - - public InheritanceComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.entityListener = buildEntityListener(); - this.discriminatorColumnListener = buildDiscriminatorColumnListener(); - this.connectionListener = buildConnectionListener(); - } - - private Adapter buildEntityListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - entityChanged(notification); - } - }; - } - - private Adapter buildDiscriminatorColumnListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - discriminatorColumnChanged(notification); - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public void closed(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - InheritanceComposite.this.populateColumnCombo(); - } - }); - } - - public void modified(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - InheritanceComposite.this.populateColumnCombo(); - } - }); - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void opened(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - InheritanceComposite.this.populateColumnCombo(); - } - }); - } - - public void databaseChanged(Connection connection, final Database database) { - return; - } - - public void schemaChanged(Connection connection, final Schema schema) { - return; - } - - public void tableChanged(Connection connection, final Table table) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if(table == getDbTable()) { - if (!getControl().isDisposed()) { - InheritanceComposite.this.populateColumnCombo(); - } - } - } - }); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - GridData gridData; - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.InheritanceComposite_strategy); - - this.strategyViewer = buildStrategyCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.strategyViewer.getCombo().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.strategyViewer.getCombo(), IJpaHelpContextIds.ENTITY_INHERITANCE_STRATEGY); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.DiscriminatorColumnComposite_column); - - this.columnCombo = buildColumnCombo(composite); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.columnCombo.setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.columnCombo, IJpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.DiscriminatorColumnComposite_discriminatorType); - - this.discriminatorTypeViewer = buildDiscriminatorTypeCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.discriminatorTypeViewer.getCombo().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.discriminatorTypeViewer.getCombo(), IJpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_TYPE); - - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.InheritanceComposite_discriminatorValue); - - this.discriminatorValueCombo = buildDiscriminatorValueCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.discriminatorValueCombo.setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.discriminatorValueCombo, IJpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE); - - this.pkJoinColumnsComposite = new PrimaryKeyJoinColumnsComposite(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 2; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessVerticalSpace = true; - this.pkJoinColumnsComposite.getControl().setLayoutData(gridData); - } - - private CComboViewer buildStrategyCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - CComboViewer strategyViewer = new CComboViewer(combo); - strategyViewer.setLabelProvider(buildStrategyLabelProvider()); - strategyViewer.add(InheritanceType.VALUES.toArray()); - strategyViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - InheritanceComposite.this.strategySelectionChanged(event.getSelection()); - } - }); - - return strategyViewer; - } - - private IBaseLabelProvider buildStrategyLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == InheritanceType.DEFAULT) { - //TODO need to move this to the model, don't want hardcoded String - return NLS.bind(JptUiMappingsMessages.InheritanceComposite_default, "Single Table"); - } - return super.getText(element); - } - }; - } - - void strategySelectionChanged(ISelection selection) { - if (selection instanceof IStructuredSelection) { - InheritanceType inheritanceType = (InheritanceType) ((IStructuredSelection) selection).getFirstElement(); - if ( ! this.entity.getInheritanceStrategy().equals(inheritanceType)) { - this.entity.setInheritanceStrategy(inheritanceType); - } - } - } - - private CCombo buildColumnCombo(Composite parent) { - final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty); - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String tableText = ((CCombo) e.getSource()).getText(); - if (tableText.equals("")) { //$NON-NLS-1$ - tableText = null; - if (discriminatorColumn.getSpecifiedName() == null || discriminatorColumn.getSpecifiedName().equals("")) { //$NON-NLS-1$ - return; - } - } - - if (tableText != null && combo.getItemCount() > 0 && tableText.equals(combo.getItem(0))) { - tableText = null; - } - - if (discriminatorColumn.getSpecifiedName() == null && tableText != null) { - discriminatorColumn.setSpecifiedName(tableText); - } - if (discriminatorColumn.getSpecifiedName() != null && !discriminatorColumn.getSpecifiedName().equals(tableText)) { - discriminatorColumn.setSpecifiedName(tableText); - } - } - }); - return combo; - - } - - private CComboViewer buildDiscriminatorTypeCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - CComboViewer discriminatorTypeViewer = new CComboViewer(combo); - discriminatorTypeViewer.setLabelProvider(buildDiscriminatorTypeLabelProvider()); - discriminatorTypeViewer.add(DiscriminatorType.VALUES.toArray()); - - discriminatorTypeViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - InheritanceComposite.this.discriminatorTypeSelectionChanged(event.getSelection()); - } - }); - - return discriminatorTypeViewer; - } - - private IBaseLabelProvider buildDiscriminatorTypeLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == DiscriminatorType.DEFAULT) { - //TODO need to move this to the model, don't want hardcoded String - return NLS.bind(JptUiMappingsMessages.InheritanceComposite_defaultDiscriminatorType, "String"); - } - return super.getText(element); - } - }; - } - - void discriminatorTypeSelectionChanged(ISelection selection) { - if (selection instanceof IStructuredSelection) { - DiscriminatorType discriminatorType = (DiscriminatorType) ((IStructuredSelection) selection).getFirstElement(); - if ( ! this.discriminatorColumn.getDiscriminatorType().equals(discriminatorType)) { - this.discriminatorColumn.setDiscriminatorType(discriminatorType); - } - } - } - - private CCombo buildDiscriminatorValueCombo(Composite parent) { - final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String discriminatorValue = entity.getSpecifiedDiscriminatorValue(); - String value = ((CCombo) e.getSource()).getText(); - if (value.equals("")) { //$NON-NLS-1$ - value = null; - if (discriminatorValue == null || discriminatorValue.equals("")) { //$NON-NLS-1$ - return; - } - } - - if (value != null && combo.getItemCount() > 0 && value.equals(combo.getItem(0))) { - value = null; - } - - if (discriminatorValue == null || !discriminatorValue.equals(value)) { - entity.setSpecifiedDiscriminatorValue(value); - } - } - }); - return combo; - } - - public void doPopulate(EObject obj) { - this.entity = (IEntity) obj; - if (this.entity != null) { - this.discriminatorColumn = this.entity.getDiscriminatorColumn(); - populateColumnCombo(); - popuplateDiscriminatorTypeComboViewer(); - populateStrategyComboViewer(); - populateDiscriminatorValueCombo(); - this.pkJoinColumnsComposite.populate(this.entity); - } - else { - this.discriminatorColumn = null; - this.connectionProfile = null; - } - } - - public void doPopulate() { - if (this.entity != null) { - populateColumnCombo(); -// popuplateStrategyComboViewer(); -// popuplateDiscriminatorValueCombo(); - } - } - - @Override - protected void engageListeners() { - if (this.entity != null) { - this.entity.eAdapters().add(this.entityListener); - this.discriminatorColumn.eAdapters().add(this.discriminatorColumnListener); - this.addConnectionListener(); - } - } - - @Override - protected void disengageListeners() { - if (this.entity != null) { - this.entity.eAdapters().remove(this.entityListener); - this.removeConnectionListener(); - this.discriminatorColumn.eAdapters().remove(this.discriminatorColumnListener); - } - } - - private ConnectionProfile getConnectionProfile() { - if(this.connectionProfile == null) { - this.connectionProfile = this.entity.getJpaProject().connectionProfile(); - } - return this.connectionProfile; - } - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } - - private Table getDbTable() { - return this.entity.primaryDbTable(); - } - - private void populateColumnCombo() { - //TODO don't do instanceof check here - check on Table, or isRoot check on Entity - //this.tableCombo.setEnabled(!(this.table instanceof SingleTableInheritanceChildTableImpl)); - populateDefaultColumnName(); - - if (this.getConnectionProfile().isConnected()) { - this.columnCombo.remove(1, this.columnCombo.getItemCount()-1); - Table table = getDbTable(); - if (table != null) { - for (Iterator i = CollectionTools.sort(CollectionTools.list(table.columnNames())).iterator(); i.hasNext();) { - this.columnCombo.add((String) i.next()); - } - } - } - else { - this.columnCombo.remove(1, this.columnCombo.getItemCount()-1); - } - populateColumnName(); - } - - protected void populateDefaultColumnName() { - String defaultTableName = discriminatorColumn.getDefaultName(); - int selectionIndex = columnCombo.getSelectionIndex(); - columnCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName)); - if (selectionIndex == 0) { - //combo text does not update when switching between 2 mappings of the same type - //that both have a default column name. clear the selection and then set it again - columnCombo.clearSelection(); - columnCombo.select(0); - } - } - - protected void populateColumnName() { - String tableName = this.discriminatorColumn.getSpecifiedName(); - String defaultName = this.discriminatorColumn.getDefaultName(); - if (tableName != null) { - if (!this.columnCombo.getText().equals(tableName)) { - this.columnCombo.setText(tableName); - } - } - else { - if (!this.columnCombo.getText().equals(NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultName))) { - this.columnCombo.select(0); - } - } - } - - private void popuplateDiscriminatorTypeComboViewer() { - if (this.discriminatorColumn.getDiscriminatorType() == DiscriminatorType.DEFAULT) { - if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.DEFAULT) { - this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.DEFAULT)); - } - } - else if (this.discriminatorColumn.getDiscriminatorType() == DiscriminatorType.CHAR) { - if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.CHAR) { - this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.CHAR)); - } - } - else if (this.discriminatorColumn.getDiscriminatorType() == DiscriminatorType.INTEGER) { - if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.INTEGER) { - this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.INTEGER)); - } - } - else { - if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.STRING) { - this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.STRING)); - } - } - } - - private void populateStrategyComboViewer() { - if (this.entity.getInheritanceStrategy() == InheritanceType.DEFAULT) { - if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.DEFAULT) { - this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.DEFAULT)); - } - } - else if (this.entity.getInheritanceStrategy() == InheritanceType.JOINED) { - if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.JOINED) { - this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.JOINED)); - } - } - else if (this.entity.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) { - if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.SINGLE_TABLE) { - this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.SINGLE_TABLE)); - } - } - else { - if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.TABLE_PER_CLASS) { - this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.TABLE_PER_CLASS)); - } - } - } - - private void populateDiscriminatorValueCombo() { - String specifiedValue = this.entity.getSpecifiedDiscriminatorValue(); - String defaultValue = this.entity.getDefaultDiscriminatorValue(); - - if (this.entity.discriminatorValueIsAllowed()) { - this.discriminatorValueCombo.setEnabled(true); - if (this.discriminatorValueCombo.getItemCount() == 0) { - this.discriminatorValueCombo.add(JptUiMappingsMessages.DiscriminatorColumnComposite_defaultEmpty); - } - if (defaultValue != null) { - this.discriminatorValueCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultValue)); - } - else { - this.discriminatorValueCombo.setItem(0, JptUiMappingsMessages.DiscriminatorColumnComposite_defaultEmpty); - } - } - else { - this.discriminatorValueCombo.setEnabled(false); - if (this.discriminatorValueCombo.getItemCount() == 1) { - this.discriminatorValueCombo.setText(""); - this.discriminatorValueCombo.removeAll(); - } - } - - if (specifiedValue != null) { - if (!this.discriminatorValueCombo.getText().equals(specifiedValue)) { - this.discriminatorValueCombo.setText(specifiedValue); - } - } - else { - //combo text does not update when switching between 2 entities that both have a default discriminator value. - //clear the selection and then set it again - this.discriminatorValueCombo.clearSelection(); - this.discriminatorValueCombo.select(0); - } - } - - private void entityChanged(Notification notification) { - if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - InheritanceType inheritanceType = entity.getInheritanceStrategy(); - if (((StructuredSelection) strategyViewer.getSelection()).getFirstElement() != inheritanceType) { - strategyViewer.setSelection(new StructuredSelection(inheritanceType)); - } - } - }); - } - else if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - String discriminatorValue = entity.getSpecifiedDiscriminatorValue(); - if (discriminatorValueCombo.getText() == null || !discriminatorValueCombo.getText().equals(discriminatorValue)) { - if (discriminatorValue == null) { - discriminatorValueCombo.select(0); - } - else { - discriminatorValueCombo.setText(discriminatorValue); - } - } - } - }); - } - else if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateDiscriminatorValueCombo(); - } - }); - } - } - - protected void discriminatorColumnChanged(Notification notification) { - if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateColumnName(); - } - }); - } - else if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateDefaultColumnName(); - } - }); - } - - else if (notification.getFeatureID(IDiscriminatorColumn.class) == JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - DiscriminatorType discriminatorType = discriminatorColumn.getDiscriminatorType(); - if (((StructuredSelection) discriminatorTypeViewer.getSelection()).getFirstElement() != discriminatorType) { - discriminatorTypeViewer.setSelection(new StructuredSelection(discriminatorType)); - } - } - }); - } - } - - public void dispose() { - this.pkJoinColumnsComposite.dispose(); - super.dispose(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java deleted file mode 100644 index 4d45d3732b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Shell; - -public class InverseJoinColumnDialog extends JoinColumnInJoinTableDialog { - - InverseJoinColumnDialog(Shell parent, IJoinTable joinTable) { - super(parent, joinTable); - } - - InverseJoinColumnDialog(Shell parent, IJoinColumn joinColumn) { - super(parent, joinColumn); - } - - protected String getTitle() { - return JptUiMappingsMessages.InverseJoinColumnDialog_editInverseJoinColumn; - } - - protected void populateNameCombo() { - if (getJoinTable() == null) { - return; - } - if (getJoinColumn() != null) { - getNameCombo().add(NLS.bind(JptUiMappingsMessages.InverseJoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultName())); - } - Table joinDBTable = getJoinTable().dbTable(); - if (joinDBTable != null) { - for (Iterator i = joinDBTable.columnNames(); i.hasNext(); ) { - getNameCombo().add((String) i.next()); - } - } - if (getJoinColumn() != null && getJoinColumn().getSpecifiedName() != null) { - getNameCombo().setText(getJoinColumn().getSpecifiedName()); - } - else { - getNameCombo().select(0); - } - } - - protected void populateReferencedNameCombo() { - if (getJoinTable() == null) { - return; - } - if (getJoinColumn() != null) { - getReferencedColumnNameCombo().add(NLS.bind(JptUiMappingsMessages.InverseJoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultReferencedColumnName())); - } - IMultiRelationshipMapping multiRelationshipMapping = (IMultiRelationshipMapping) getJoinTable().eContainer(); - IEntity targetEntity = multiRelationshipMapping.getResolvedTargetEntity(); - if (targetEntity != null) { - Table referencedDbTable = targetEntity.primaryDbTable(); - if (referencedDbTable != null) { - for (Iterator i = referencedDbTable.columnNames(); i.hasNext(); ) { - getReferencedColumnNameCombo().add((String) i.next()); - } - } - } - if (getJoinColumn() != null && getJoinColumn().getSpecifiedReferencedColumnName() != null) { - getReferencedColumnNameCombo().setText(getJoinColumn().getSpecifiedReferencedColumnName()); - } - else { - getReferencedColumnNameCombo().select(0); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java deleted file mode 100644 index 98b52e4fc1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java +++ /dev/null @@ -1,428 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -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.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.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.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class JoinColumnComposite - extends BaseJpaComposite -{ - private ISingleRelationshipMapping singleRelationshipMapping; - private final Adapter singleRelationshipMappingListener; - private final Adapter joinColumnListener; - - - private Group joinColumnsGroup; - Button overrideDefaultJoinColumnsCheckBox; - ListViewer joinColumnsListViewer; - private Button joinColumnsRemoveButton; - private Button joinColumnsEditButton; - - - - public JoinColumnComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.singleRelationshipMappingListener = buildSingleRelationshipMappingListener(); - this.joinColumnListener = buildJoinColumnListener(); - } - - - private Adapter buildSingleRelationshipMappingListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - singleRelationshipMappingChanged(notification); - } - }; - } - - private Adapter buildJoinColumnListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - joinColumnChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - this.overrideDefaultJoinColumnsCheckBox = - getWidgetFactory().createButton( - composite, - JptUiMappingsMessages.JoinColumnComposite_overrideDefaultJoinColumns, - SWT.CHECK); - this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - if (JoinColumnComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) { - IJoinColumn defaultJoinColumn = JoinColumnComposite.this.singleRelationshipMapping.getDefaultJoinColumns().get(0); - String columnName = defaultJoinColumn.getDefaultName(); - String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName(); - - IJoinColumn joinColumn = JoinColumnComposite.this.singleRelationshipMapping.createJoinColumn(0); - JoinColumnComposite.this.singleRelationshipMapping.getSpecifiedJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(columnName); - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } else { - JoinColumnComposite.this.singleRelationshipMapping.getSpecifiedJoinColumns().clear(); - } - } - }); - - this.joinColumnsGroup = - getWidgetFactory().createGroup( - composite, - JptUiMappingsMessages.JoinColumnComposite_joinColumn); - this.joinColumnsGroup.setLayout(new GridLayout(2, false)); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.joinColumnsGroup.setLayoutData(gridData); - - this.joinColumnsListViewer = new ListViewer(this.joinColumnsGroup, SWT.BORDER | SWT.MULTI); - this.joinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider()); - this.joinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.verticalSpan = 3; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.joinColumnsListViewer.getList().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.joinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS); - - Button addJoinColumnButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinColumnComposite_add, SWT.NONE); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - addJoinColumnButton.setLayoutData(gridData); - addJoinColumnButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void widgetSelected(SelectionEvent e) { - addJoinColumn(); - } - }); - - this.joinColumnsEditButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinColumnComposite_edit, SWT.NONE); - this.joinColumnsEditButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void widgetSelected(SelectionEvent e) { - editJoinColumn(); - } - }); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.joinColumnsEditButton.setLayoutData(gridData); - - this.joinColumnsRemoveButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinColumnComposite_remove, SWT.NONE); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.BEGINNING; - this.joinColumnsRemoveButton.setLayoutData(gridData); - this.joinColumnsRemoveButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void widgetSelected(SelectionEvent e) { - removeJoinColumn(); - } - }); - - this.joinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updateEnablement(); - } - }); - - } - private IContentProvider buildJoinColumnsListContentProvider() { - return new IStructuredContentProvider(){ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - public void dispose() { - // do nothing - } - public Object[] getElements(Object inputElement) { - return ((ISingleRelationshipMapping) inputElement).getJoinColumns().toArray(); - } - }; - } - - private ILabelProvider buildJoinColumnsListLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - IJoinColumn joinColumn = (IJoinColumn) element; - return (JoinColumnComposite.this.singleRelationshipMapping.getSpecifiedJoinColumns().size() == 0) ? - buildDefaultJoinColumnLabel(joinColumn) - : - buildJoinColumnLabel(joinColumn); - } - }; - } - - String buildDefaultJoinColumnLabel(IJoinColumn joinColumn) { - return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - - String buildJoinColumnLabel(IJoinColumn joinColumn) { - if (joinColumn.getSpecifiedName() == null) { - if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName()); - } - return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else { - return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - } - - protected void joinColumnChanged(Notification notification) { - if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME - || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME - || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE - || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - joinColumnsListViewer.refresh(); - } - }); - } - } - - void addJoinColumn() { - JoinColumnDialog dialog = new JoinColumnInRelationshipMappingDialog(this.getControl().getShell(), this.singleRelationshipMapping); - this.addJoinColumnFromDialog(dialog); - } - - private void addJoinColumnFromDialog(JoinColumnDialog dialog) { - if (dialog.open() != Window.OK) { - return; - } - int index = this.singleRelationshipMapping.getJoinColumns().size(); - IJoinColumn joinColumn = this.singleRelationshipMapping.createJoinColumn(index); - this.singleRelationshipMapping.getSpecifiedJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(dialog.getSelectedName()); - joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName()); - if (!dialog.isDefaultTableSelected()) { - //not checking this for name and referenced column name because there is no - //default option when you are adding a second join column. There is always - //at least 1 join column (the default) - joinColumn.setSpecifiedTable(dialog.getSelectedTable()); - } - } - - void editJoinColumn() { - IJoinColumn joinColumn = getSelectedJoinColumn(); - JoinColumnDialog dialog = new JoinColumnInRelationshipMappingDialog(this.getControl().getShell(), joinColumn); - editJoinColumnFromDialog(dialog, joinColumn); - } - - private IJoinColumn getSelectedJoinColumn() { - return (IJoinColumn) ((StructuredSelection) this.joinColumnsListViewer.getSelection()).getFirstElement(); - } - - private void editJoinColumnFromDialog(JoinColumnDialog dialog, IJoinColumn joinColumn) { - if (dialog.open() == Window.OK) { - editJoinColumnDialogOkd(dialog, joinColumn); - } - } - - private void editJoinColumnDialogOkd(JoinColumnDialog dialog, IJoinColumn joinColumn) { - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - String table = dialog.getSelectedTable(); - - if (dialog.isDefaultNameSelected()) { - if (joinColumn.getSpecifiedName() != null) { - joinColumn.setSpecifiedName(null); - } - } - else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){ - joinColumn.setSpecifiedName(name); - } - if (dialog.isDefaultReferencedColumnNameSelected()) { - if (joinColumn.getSpecifiedReferencedColumnName() != null) { - joinColumn.setSpecifiedReferencedColumnName(null); - } - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){ - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - - if (dialog.isDefaultTableSelected()) { - if (joinColumn.getSpecifiedTable() != null) { - joinColumn.setSpecifiedTable(null); - } - } - else if (joinColumn.getSpecifiedTable() == null || !joinColumn.getSpecifiedTable().equals(table)){ - joinColumn.setSpecifiedTable(table); - } - - DefaultTrueBoolean insertable = dialog.getInsertable(); - if (joinColumn.getInsertable() != insertable) { - joinColumn.setInsertable(insertable); - } - - DefaultTrueBoolean updatable = dialog.getUpdatable(); - if (joinColumn.getUpdatable() != updatable) { - joinColumn.setUpdatable(updatable); - } - } - - void removeJoinColumn() { - ISelection selection = this.joinColumnsListViewer.getSelection(); - if (selection instanceof StructuredSelection) { - for (Iterator stream = ((StructuredSelection) selection).iterator(); stream.hasNext(); ) { - this.singleRelationshipMapping.getJoinColumns().remove(stream.next()); - } - } - } - - protected void singleRelationshipMappingChanged(Notification notification) { - if (notification.getFeatureID(ISingleRelationshipMapping.class) == JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - JoinColumnComposite.this.joinColumnsListViewer.refresh(); - JoinColumnComposite.this.overrideDefaultJoinColumnsCheckBox.setSelection(singleRelationshipMapping.containsSpecifiedJoinColumns()); - JoinColumnComposite.this.updateEnablement(); - } - }); - if (notification.getEventType() == Notification.ADD) { - ((IJoinColumn) notification.getNewValue()).eAdapters().add(this.joinColumnListener); - } - else if (notification.getEventType() == Notification.REMOVE) { - ((IJoinColumn) notification.getOldValue()).eAdapters().remove(this.joinColumnListener); - } - } - } - - private void enableGroup(Group group, boolean enabled) { - group.setEnabled(enabled); - for (int i = 0; i < group.getChildren().length; i++) { - group.getChildren()[i].setEnabled(enabled); - } - } - - - - protected void engageListeners() { - if (this.singleRelationshipMapping != null) { - this.singleRelationshipMapping.eAdapters().add(this.singleRelationshipMappingListener); - for (Iterator i = this.singleRelationshipMapping.getJoinColumns().iterator(); i.hasNext(); ) { - ((IJoinColumn) i.next()).eAdapters().add(this.joinColumnListener); - } - } - } - - protected void disengageListeners() { - if (this.singleRelationshipMapping != null) { - for (Iterator i = this.singleRelationshipMapping.getJoinColumns().iterator(); i.hasNext(); ) { - ((IJoinColumn) i.next()).eAdapters().remove(this.joinColumnListener); - } - this.singleRelationshipMapping.eAdapters().remove(this.singleRelationshipMappingListener); - } - } - - public void doPopulate(EObject obj) { - this.singleRelationshipMapping = (ISingleRelationshipMapping) obj; - if (this.singleRelationshipMapping == null) { - this.joinColumnsListViewer.setInput(null); - return; - } - - this.joinColumnsListViewer.setInput(this.singleRelationshipMapping); - - - updateEnablement(); - this.overrideDefaultJoinColumnsCheckBox.setSelection(this.singleRelationshipMapping.containsSpecifiedJoinColumns()); - } - - @Override - protected void doPopulate() { - this.joinColumnsListViewer.setInput(this.singleRelationshipMapping); - } - - void updateEnablement() { - boolean groupEnabledState = this.singleRelationshipMapping.containsSpecifiedJoinColumns(); - enableGroup(this.joinColumnsGroup, groupEnabledState); - - this.joinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.joinColumnsListViewer.getSelection()).isEmpty()); - this.joinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.joinColumnsListViewer.getSelection()).size() == 1); - } - - public void dispose() { - disengageListeners(); - super.dispose(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java deleted file mode 100644 index e36b19e9d2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java +++ /dev/null @@ -1,209 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.jface.viewers.ComboViewer; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -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.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; - -public abstract class JoinColumnDialog extends AbstractJoinColumnDialog { - - private Combo tableCombo; - private ComboViewer insertableComboViewer; - private ComboViewer updatableComboViewer; - - private boolean defaultTableSelected; - private String selectedTable; - private DefaultTrueBoolean insertable; - private DefaultTrueBoolean updatable; - - JoinColumnDialog(Shell parent) { - super(parent); - } - - JoinColumnDialog(Shell parent, IJoinColumn joinColumn) { - super(parent, joinColumn); - } - - protected Control createDialogArea(Composite parent) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - Composite composite = (Composite) super.createDialogArea(parent); - - Label tableLabel = new Label(composite, SWT.LEFT); - tableLabel.setText(JptUiMappingsMessages.JoinColumnDialog_table); - GridData gridData = new GridData(); - tableLabel.setLayoutData(gridData); - - this.tableCombo = new Combo(composite, SWT.LEFT); - this.tableCombo.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - populateNameCombo(); - } - public void widgetDefaultSelected(SelectionEvent e) { - populateNameCombo(); - } - }); - gridData = new GridData(); - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.tableCombo.setLayoutData(gridData); - //PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableCombo, IJpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN); - populateTableCombo(); - - Label insertableLabel = new Label(composite, SWT.LEFT); - insertableLabel.setText(JptUiMappingsMessages.JoinColumnDialog_insertable); - insertableLabel.setLayoutData(new GridData()); - - this.insertableComboViewer = this.buildInsertableComboViewer(composite); - this.insertableComboViewer.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); - helpSystem.setHelp(this.insertableComboViewer.getCombo(), IJpaHelpContextIds.MAPPING_COLUMN_INSERTABLE); - - Label updatableLabel = new Label(composite, SWT.LEFT); - updatableLabel.setText(JptUiMappingsMessages.JoinColumnDialog_updatable); - updatableLabel.setLayoutData(new GridData()); - - this.updatableComboViewer = this.buildUpdatableComboViewer(composite); - this.updatableComboViewer.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); - helpSystem.setHelp(this.updatableComboViewer.getCombo(), IJpaHelpContextIds.MAPPING_COLUMN_UPDATABLE); - - return composite; - } - - private ComboViewer buildInsertableComboViewer(Composite parent) { - ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY); - viewer.setLabelProvider(buildDefaultTrueLabelProvider()); - viewer.add(DefaultTrueBoolean.VALUES.toArray()); - - DefaultTrueBoolean sel = (this.joinColumn() == null) ? DefaultTrueBoolean.DEFAULT : this.joinColumn().getInsertable(); - viewer.setSelection(new StructuredSelection(sel)); - return viewer; - } - - private IBaseLabelProvider buildDefaultTrueLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == DefaultTrueBoolean.DEFAULT) { - //TODO need to move this to the model, don't want hardcoded String - return NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultTrue, "True"); - } - return super.getText(element); - } - }; - } - - private ComboViewer buildUpdatableComboViewer(Composite parent) { - ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY); - viewer.setLabelProvider(buildDefaultTrueLabelProvider()); - viewer.add(DefaultTrueBoolean.VALUES.toArray()); - DefaultTrueBoolean sel = (this.joinColumn() == null) ? DefaultTrueBoolean.DEFAULT : this.joinColumn().getUpdatable(); - viewer.setSelection(new StructuredSelection(sel)); - return viewer; - } - - protected void populateTableCombo() { - this.tableCombo.add(NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam, defaultTableName())); - Schema schema = this.getSchema(); - if (schema != null) { - Iterator tables = schema.tableNames(); - for (Iterator stream = CollectionTools.sort( tables); stream.hasNext(); ) { - this.tableCombo.add(stream.next()); - } - } - if (specifiedTableName() != null) { - this.tableCombo.setText(specifiedTableName()); - } - else { - this.tableCombo.select(0); - } - } - - protected abstract String defaultTableName(); - - protected String specifiedTableName() { - if (getJoinColumn() != null) { - return getJoinColumn().getSpecifiedTable(); - } - return null; - } - - protected String tableName() { - if (this.tableCombo != null) { - if (this.tableCombo.getSelectionIndex() == 0) { - return defaultTableName(); - } - return this.tableCombo.getText(); - } - return (this.specifiedTableName() == null) ? defaultTableName() : this.specifiedTableName(); - } - - protected abstract Schema getSchema(); - - private IJoinColumn joinColumn() { - return this.getJoinColumn(); - } - - protected boolean isDefaultTableSelected() { - return this.defaultTableSelected; - } - - public String getSelectedTable() { - return this.selectedTable; - } - - public DefaultTrueBoolean getInsertable() { - return this.insertable; - } - - public DefaultTrueBoolean getUpdatable() { - return this.updatable; - } - - public boolean close() { - this.defaultTableSelected = this.tableCombo.getSelectionIndex() == 0; - this.selectedTable = this.tableCombo.getText(); - - ISelection selection = this.insertableComboViewer.getSelection(); - if (selection instanceof IStructuredSelection) { - this.insertable = (DefaultTrueBoolean) ((IStructuredSelection) selection).getFirstElement(); - } - - selection = this.updatableComboViewer.getSelection(); - if (selection instanceof IStructuredSelection) { - this.updatable = (DefaultTrueBoolean) ((IStructuredSelection) selection).getFirstElement(); - } - - return super.close(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java deleted file mode 100644 index c324a95b34..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.jpt.core.internal.IAttributeMapping; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.swt.widgets.Shell; - -public class JoinColumnInAssociationOverrideDialog extends JoinColumnDialog { - - private IAssociationOverride associationOverride; - - JoinColumnInAssociationOverrideDialog(Shell parent, IAssociationOverride associationOverride) { - super(parent); - this.associationOverride = associationOverride; - } - - JoinColumnInAssociationOverrideDialog(Shell parent, IJoinColumn joinColumn) { - super(parent, joinColumn); - this.associationOverride = (IAssociationOverride) joinColumn.eContainer(); - } - - protected Schema getSchema() { - return this.associationOverride.typeMapping().dbSchema(); - } - - protected String defaultTableName() { - if (getJoinColumn() != null) { - return getJoinColumn().getDefaultTable(); - } - return this.associationOverride.typeMapping().getTableName(); - } - - protected Table getNameTable() { - return this.associationOverride.typeMapping().primaryDbTable(); - } - - protected Table getReferencedNameTable() { - IAttributeMapping attributeMapping = this.associationOverride.getOwner().attributeMapping(this.associationOverride.getName()); - if (attributeMapping == null || !(attributeMapping instanceof IRelationshipMapping)) { - return null; - } - IEntity targetEntity = ((IRelationshipMapping) attributeMapping).getResolvedTargetEntity(); - if (targetEntity != null) { - return targetEntity.primaryDbTable(); - } - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java deleted file mode 100644 index 5a8a7479c2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.swt.widgets.Shell; - -//if there is only 1 joinColumn and the user is editing it, they should be -//able to define defaults. otherwise, we probably shouldn't allow it. -public class JoinColumnInJoinTableDialog extends AbstractJoinColumnDialog { - - private IJoinTable joinTable; - - JoinColumnInJoinTableDialog(Shell parent, IJoinTable joinTable) { - super(parent); - this.joinTable = joinTable; - } - - JoinColumnInJoinTableDialog(Shell parent, IJoinColumn joinColumn) { - super(parent, joinColumn); - this.joinTable = (IJoinTable) joinColumn.eContainer(); - } - protected IJoinTable getJoinTable() { - return this.joinTable; - } - - protected Table getNameTable() { - return getJoinTable().dbTable(); - } - - protected Table getReferencedNameTable() { - IMultiRelationshipMapping multiRelationshipMapping = (IMultiRelationshipMapping) getJoinTable().eContainer(); - return multiRelationshipMapping.typeMapping().primaryDbTable(); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java deleted file mode 100644 index e60a047663..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.swt.widgets.Shell; - -public class JoinColumnInRelationshipMappingDialog extends JoinColumnDialog { - - private ISingleRelationshipMapping singleRelationshipMapping; - - JoinColumnInRelationshipMappingDialog(Shell parent, ISingleRelationshipMapping singleRelationshipMapping) { - super(parent); - this.singleRelationshipMapping = singleRelationshipMapping; - } - - JoinColumnInRelationshipMappingDialog(Shell parent, IJoinColumn joinColumn) { - super(parent, joinColumn); - this.singleRelationshipMapping = (ISingleRelationshipMapping) joinColumn.eContainer(); - } - - protected String defaultTableName() { - if (getJoinColumn() != null) { - return getJoinColumn().getDefaultTable(); - } - return this.singleRelationshipMapping.typeMapping().getTableName(); - } - - protected Schema getSchema() { - return this.singleRelationshipMapping.typeMapping().dbSchema(); - } - - protected Table getNameTable() { - Schema schema = this.getSchema(); - return (schema == null) ? null : schema.tableNamed(tableName()); - } - - protected Table getReferencedNameTable() { - IEntity targetEntity = this.singleRelationshipMapping.getResolvedTargetEntity(); - if (targetEntity != null) { - return targetEntity.primaryDbTable(); - } - return null; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java deleted file mode 100644 index 886e200383..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jpt.core.internal.mappings.IAbstractColumn; -import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.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.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class JoinColumnsComposite extends BaseJpaComposite -{ - - private Owner owner; - private final Adapter joinColumnsOwnerListener; - - private ListViewer joinColumnsListViewer; - - private final Adapter joinColumnListener; - - private Group joinColumnsGroup; - private Button joinColumnsAddButton; - private Button joinColumnsRemoveButton; - private Button joinColumnsEditButton; - - - public JoinColumnsComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory, String groupTitle) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.joinColumnsOwnerListener = buildJoinColumnsOwnerListener(); - this.joinColumnListener = buildJoinColumnListener(); - this.joinColumnsGroup.setText(groupTitle); - } - - private Adapter buildJoinColumnsOwnerListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - joinColumnsOwnerChanged(notification); - } - }; - } - - private Adapter buildJoinColumnListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - joinColumnChanged(notification, joinColumnsListViewer); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - this.joinColumnsGroup = - getWidgetFactory().createGroup( - composite, - ""); - this.joinColumnsGroup.setLayout(new GridLayout(2, false)); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.joinColumnsGroup.setLayoutData(gridData); - - this.joinColumnsListViewer = new ListViewer(this.joinColumnsGroup, SWT.BORDER | SWT.MULTI); - this.joinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider()); - this.joinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.verticalSpan = 3; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.joinColumnsListViewer.getList().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.joinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS); - - this.joinColumnsAddButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinTableComposite_add, SWT.NONE); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.joinColumnsAddButton.setLayoutData(gridData); - this.joinColumnsAddButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void widgetSelected(SelectionEvent e) { - owner.addJoinColumn(); - } - }); - - this.joinColumnsEditButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinTableComposite_edit, SWT.NONE); - this.joinColumnsEditButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void widgetSelected(SelectionEvent e) { - editJoinColumn(); - } - }); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.joinColumnsEditButton.setLayoutData(gridData); - - this.joinColumnsRemoveButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinTableComposite_remove, SWT.NONE); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.BEGINNING; - this.joinColumnsRemoveButton.setLayoutData(gridData); - this.joinColumnsRemoveButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void widgetSelected(SelectionEvent e) { - removeJoinColumn(); - } - }); - - this.joinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updateJoinColumnsEnablement(); - } - }); - } - - private IContentProvider buildJoinColumnsListContentProvider() { - return new IStructuredContentProvider(){ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - public void dispose() { - - } - - public Object[] getElements(Object inputElement) { - return ((Owner) inputElement).getJoinColumns().toArray(); - } - }; - } - - private ILabelProvider buildJoinColumnsListLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - IJoinColumn joinColumn = (IJoinColumn) element; - return (JoinColumnsComposite.this.owner.containsSpecifiedJoinColumns()) ? - buildJoinColumnLabel(joinColumn) - : - buildDefaultJoinColumnLabel(joinColumn); - } - }; - } - - private String buildDefaultJoinColumnLabel(IJoinColumn joinColumn) { - return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - - private String buildJoinColumnLabel(IJoinColumn joinColumn) { - if (joinColumn.getSpecifiedName() == null) { - if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName()); - } - return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else { - return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - } - - void editJoinColumn() { - this.owner.editJoinColumn(getSelectedJoinColumn()); - } - - void removeJoinColumn() { - ISelection selection = this.joinColumnsListViewer.getSelection(); - if (selection instanceof StructuredSelection) { - for (Iterator stream = ((StructuredSelection) selection).iterator(); stream.hasNext(); ) { - this.owner.getJoinColumns().remove(stream.next()); - } - } - } - - private IJoinColumn getSelectedJoinColumn() { - return (IJoinColumn) ((StructuredSelection) this.joinColumnsListViewer.getSelection()).getFirstElement(); - } - - protected void joinColumnsOwnerChanged(Notification notification) { - if (notification.getFeatureID(owner.owningFeatureClass()) == owner.specifiedJoinColumnsFeatureId()) { - if (notification.getEventType() == Notification.ADD) { - ((IJoinColumn) notification.getNewValue()).eAdapters().add(this.joinColumnListener); - } - else if (notification.getEventType() == Notification.REMOVE) { - ((IJoinColumn) notification.getOldValue()).eAdapters().remove(this.joinColumnListener); - } - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - joinColumnsListViewer.refresh(); - updateJoinColumnsEnablement(); - } - }); - } - } - - private void enableGroup(Group group, boolean enabled) { - group.setEnabled(enabled); - for (int i = 0; i < group.getChildren().length; i++) { - group.getChildren()[i].setEnabled(enabled); - } - } - protected void joinColumnChanged(Notification notification, final ListViewer listViewer) { - if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME - || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME - || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE - || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - listViewer.refresh(); - } - }); - } - } - - protected void engageListeners() { - if (this.owner != null) { - this.owner.getEObject().eAdapters().add(this.joinColumnsOwnerListener); - for (IJoinColumn joinColumn : this.owner.getJoinColumns()) { - joinColumn.eAdapters().add(this.joinColumnListener); - } - } - } - - protected void disengageListeners() { - if (this.owner != null) { - for (IJoinColumn joinColumn : this.owner.getJoinColumns()) { - joinColumn.eAdapters().remove(this.joinColumnListener); - } - this.owner.getEObject().eAdapters().remove(this.joinColumnsOwnerListener); - } - } - - public void doPopulate(EObject obj) { - this.owner = (Owner) obj; - if (this.owner == null) { - this.joinColumnsListViewer.setInput(null); - return; - } - - this.joinColumnsListViewer.setInput(this.owner); - - updateEnablement(); - } - - @Override - protected void doPopulate() { - } - - private void updateEnablement() { - updateJoinColumnsEnablement(); - } - - void updateJoinColumnsEnablement() { - boolean groupEnabledState = this.owner.containsSpecifiedJoinColumns(); - enableGroup(this.joinColumnsGroup, groupEnabledState); - - this.joinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.joinColumnsListViewer.getSelection()).isEmpty()); - this.joinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.joinColumnsListViewer.getSelection()).size() == 1); - } - - protected void enableWidgets(boolean enabled) { - enableGroup(this.joinColumnsGroup, enabled); - this.joinColumnsAddButton.setEnabled(enabled); - this.joinColumnsEditButton.setEnabled(enabled); - this.joinColumnsRemoveButton.setEnabled(enabled); - this.joinColumnsListViewer.getList().setEnabled(enabled); - } - - public interface Owner { - int specifiedJoinColumnsFeatureId(); - - Class owningFeatureClass(); - - EObject getEObject(); - - boolean containsSpecifiedJoinColumns(); - - List getJoinColumns(); - - List getSpecifiedJoinColumns(); - - IJoinColumn createJoinColumn(int index); - - void addJoinColumn(); - - void editJoinColumn(IJoinColumn joinColumn); - } - -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java deleted file mode 100644 index f5fd60c608..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java +++ /dev/null @@ -1,473 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.List; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.window.Window; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IJoinTable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.JoinColumnsComposite.Owner; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.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.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class JoinTableComposite extends BaseJpaComposite -{ - - private IJoinTable joinTable; - private final Adapter joinTableListener; - - protected TableCombo tableCombo; - - private ConnectionProfile connectionProfile; - private ConnectionListener connectionListener; - - private Button overrideDefaultJoinColumnsCheckBox; - private JoinColumnsComposite joinColumnsComposite; - - private Button overrideDefaultInverseJoinColumnsCheckBox; - private JoinColumnsComposite inverseJoinColumnsComposite; - - public JoinTableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.joinTableListener = buildJoinTableListener(); - this.connectionListener = buildConnectionListener(); - } - - private Adapter buildJoinTableListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - joinTableChanged(notification); - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public void closed(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - JoinTableComposite.this.tableCombo.populate(); - } - }); - } - - public void modified(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - JoinTableComposite.this.tableCombo.populate(); - } - }); - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void opened(Connection connection) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - JoinTableComposite.this.tableCombo.populate(); - } - }); - } - - public void databaseChanged(Connection connection, final Database database) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if(database == JoinTableComposite.this.tableCombo.getDatabase()) { - if (!getControl().isDisposed()) { - JoinTableComposite.this.tableCombo.populate(); - } - } - } - }); - } - - public void schemaChanged(Connection connection, final Schema schema) { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if(schema == JoinTableComposite.this.tableCombo.getTableSchema()) { - if (!getControl().isDisposed()) { - JoinTableComposite.this.tableCombo.populate(); - } - } - } - }); - } - - public void tableChanged(Connection connection, final Table table) { - // not interested to this event. - } - }; - } - - private ConnectionProfile getConnectionProfile() { - if(this.connectionProfile == null) { - IJpaProject jpaProject = this.joinTable.getJpaProject(); - this.connectionProfile = jpaProject.connectionProfile(); - } - return this.connectionProfile; - } - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.JoinTableComposite_name); - - this.tableCombo = new TableCombo(composite, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.tableCombo.getCombo().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableCombo.getCombo(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_NAME); - - this.overrideDefaultJoinColumnsCheckBox = - getWidgetFactory().createButton( - composite, - JptUiMappingsMessages.JoinTableComposite_overrideDefaultJoinColumns, - SWT.CHECK); - this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - if (JoinTableComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) { - IJoinColumn defaultJoinColumn = JoinTableComposite.this.joinTable.getDefaultJoinColumns().get(0); - String columnName = defaultJoinColumn.getDefaultName(); - String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName(); - IJoinColumn joinColumn = JoinTableComposite.this.joinTable.createJoinColumn(0); - JoinTableComposite.this.joinTable.getSpecifiedJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(columnName); - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } else { - JoinTableComposite.this.joinTable.getSpecifiedJoinColumns().clear(); - } - } - }); - - this.joinColumnsComposite = new JoinColumnsComposite(composite, this.commandStack, getWidgetFactory(), JptUiMappingsMessages.JoinTableComposite_joinColumn); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.joinColumnsComposite.getControl().setLayoutData(gridData); - - this.overrideDefaultInverseJoinColumnsCheckBox = getWidgetFactory().createButton(composite, JptUiMappingsMessages.JoinTableComposite_overrideDefaultInverseJoinColumns, SWT.CHECK); - this.overrideDefaultInverseJoinColumnsCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - if (JoinTableComposite.this.overrideDefaultInverseJoinColumnsCheckBox.getSelection()) { - IJoinColumn defaultJoinColumn = JoinTableComposite.this.joinTable.getDefaultInverseJoinColumns().get(0); - String columnName = defaultJoinColumn.getDefaultName(); - String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName(); - IJoinColumn joinColumn = JoinTableComposite.this.joinTable.createInverseJoinColumn(0); - JoinTableComposite.this.joinTable.getSpecifiedInverseJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(columnName); - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } else { - JoinTableComposite.this.joinTable.getSpecifiedInverseJoinColumns().clear(); - } - } - }); - this.inverseJoinColumnsComposite = new JoinColumnsComposite(composite, this.commandStack, getWidgetFactory(), JptUiMappingsMessages.JoinTableComposite_inverseJoinColumn); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.inverseJoinColumnsComposite.getControl().setLayoutData(gridData); - } - - void addJoinColumn() { - JoinColumnInJoinTableDialog dialog = new JoinColumnInJoinTableDialog(this.getControl().getShell(), this.joinTable); - this.addJoinColumnFromDialog(dialog); - } - - private void addJoinColumnFromDialog(JoinColumnInJoinTableDialog dialog) { - if (dialog.open() != Window.OK) { - return; - } - int index = this.joinTable.getJoinColumns().size(); - IJoinColumn joinColumn = this.joinTable.createJoinColumn(index); - this.joinTable.getSpecifiedJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(dialog.getSelectedName()); - joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName()); - } - - void addInverseJoinColumn() { - InverseJoinColumnDialog dialog = new InverseJoinColumnDialog(this.getControl().getShell(), this.joinTable); - this.addInverseJoinColumnFromDialog(dialog); - } - - private void addInverseJoinColumnFromDialog(InverseJoinColumnDialog dialog) { - if (dialog.open() != Window.OK) { - return; - } - int index = this.joinTable.getInverseJoinColumns().size(); - IJoinColumn joinColumn = this.joinTable.createInverseJoinColumn(index); - this.joinTable.getSpecifiedInverseJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(dialog.getSelectedName()); - joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName()); - } - - void editJoinColumn(IJoinColumn joinColumn) { - JoinColumnInJoinTableDialog dialog = new JoinColumnInJoinTableDialog(this.getControl().getShell(), joinColumn); - editJoinColumnFromDialog(dialog, joinColumn); - } - - private void editJoinColumnFromDialog(JoinColumnInJoinTableDialog dialog, IJoinColumn joinColumn) { - if (dialog.open() == Window.OK) { - editJoinColumnDialogOkd(dialog, joinColumn); - } - } - - private void editJoinColumnDialogOkd(JoinColumnInJoinTableDialog dialog, IJoinColumn joinColumn) { - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - - if (dialog.isDefaultNameSelected()) { - if (joinColumn.getSpecifiedName() != null) { - joinColumn.setSpecifiedName(null); - } - } - else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){ - joinColumn.setSpecifiedName(name); - } - - if (dialog.isDefaultReferencedColumnNameSelected()) { - if (joinColumn.getSpecifiedReferencedColumnName() != null) { - joinColumn.setSpecifiedReferencedColumnName(null); - } - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){ - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - - - void editInverseJoinColumn(IJoinColumn joinColumn) { - InverseJoinColumnDialog dialog = new InverseJoinColumnDialog(getControl().getShell(), joinColumn); - editJoinColumnFromDialog(dialog, joinColumn); - } - - protected void joinTableChanged(Notification notification) { - if (notification.getFeatureID(IJoinTable.class) == JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - overrideDefaultJoinColumnsCheckBox.setSelection(joinTable.containsSpecifiedJoinColumns()); - } - }); - } - else if (notification.getFeatureID(IJoinTable.class) == JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS) { - - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - overrideDefaultInverseJoinColumnsCheckBox.setSelection(joinTable.containsSpecifiedInverseJoinColumns()); - } - }); - } - } - - protected void engageListeners() { - if (this.joinTable != null) { - this.joinTable.eAdapters().add(this.joinTableListener); - this.addConnectionListener(); - } - } - - protected void disengageListeners() { - if (this.joinTable != null) { - this.joinTable.eAdapters().remove(this.joinTableListener); - this.removeConnectionListener(); - } - } - - public void doPopulate(EObject obj) { - this.joinTable = (IJoinTable) obj; - if (this.joinTable == null) { - this.joinColumnsComposite.populate(null); - this.inverseJoinColumnsComposite.populate(null); - this.connectionProfile = null; - return; - } - - this.tableCombo.populate(this.joinTable); - this.joinColumnsComposite.populate(new JoinColumnsOwner(this.joinTable)); - this.inverseJoinColumnsComposite.populate(new InverseJoinColumnsOwner(this.joinTable)); - - this.overrideDefaultJoinColumnsCheckBox.setSelection(this.joinTable.containsSpecifiedJoinColumns()); - this.overrideDefaultInverseJoinColumnsCheckBox.setSelection(this.joinTable.containsSpecifiedInverseJoinColumns()); - } - - @Override - protected void doPopulate() { - this.tableCombo.populate(); - this.joinColumnsComposite.populate(); - this.inverseJoinColumnsComposite.populate(); - } - - @Override - public void dispose() { - this.tableCombo.dispose(); - this.joinColumnsComposite.dispose(); - this.inverseJoinColumnsComposite.dispose(); - super.dispose(); - } - - private class JoinColumnsOwner extends JpaEObject implements Owner { - - private IJoinTable joinTable; - - public JoinColumnsOwner(IJoinTable joinTable) { - super(); - this.joinTable = joinTable; - } - - public void addJoinColumn() { - JoinTableComposite.this.addJoinColumn(); - } - - public boolean containsSpecifiedJoinColumns() { - return this.joinTable.containsSpecifiedJoinColumns(); - } - - public IJoinColumn createJoinColumn(int index) { - return this.joinTable.createJoinColumn(index); - } - - public List getJoinColumns() { - return this.joinTable.getJoinColumns(); - } - - public List getSpecifiedJoinColumns() { - return this.joinTable.getSpecifiedJoinColumns(); - } - - public int specifiedJoinColumnsFeatureId() { - return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS; - } - - public Class owningFeatureClass() { - return IJoinTable.class; - } - - public void editJoinColumn(IJoinColumn joinColumn) { - JoinTableComposite.this.editJoinColumn(joinColumn); - } - - public EObject getEObject() { - return this.joinTable; - } - } - - private class InverseJoinColumnsOwner extends JpaEObject implements Owner { - - private IJoinTable joinTable; - - public InverseJoinColumnsOwner(IJoinTable joinTable) { - super(); - this.joinTable = joinTable; - } - - public void addJoinColumn() { - JoinTableComposite.this.addInverseJoinColumn(); - } - - public boolean containsSpecifiedJoinColumns() { - return this.joinTable.containsSpecifiedInverseJoinColumns(); - } - - public IJoinColumn createJoinColumn(int index) { - return this.joinTable.createJoinColumn(index); - } - - public List getJoinColumns() { - return this.joinTable.getInverseJoinColumns(); - } - - public List getSpecifiedJoinColumns() { - return this.joinTable.getSpecifiedInverseJoinColumns(); - } - - public int specifiedJoinColumnsFeatureId() { - return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS; - } - - public Class owningFeatureClass() { - return IJoinTable.class; - } - - public void editJoinColumn(IJoinColumn joinColumn) { - JoinTableComposite.this.editInverseJoinColumn(joinColumn); - } - - public EObject getEObject() { - return this.joinTable; - } - } - -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java deleted file mode 100644 index a81944a32b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -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.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class LobCheckBox extends BaseJpaController -{ - private IBasic basicMapping; - private Adapter basicMappingListener; - - private Button button; - - - public LobCheckBox(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildBasicMappingListener(); - } - - private void buildBasicMappingListener() { - this.basicMappingListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - bsaicMappingChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.button = getWidgetFactory().createButton( - parent, - JptUiMappingsMessages.BasicGeneralSection_lobLabel, - SWT.CHECK); - - this.button.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent event) { - LobCheckBox.this.lobSelectionChanged(); - } - - public void widgetDefaultSelected(SelectionEvent e) { - LobCheckBox.this.lobSelectionChanged(); - } - }); - } - - void lobSelectionChanged() { - boolean lob = this.button.getSelection(); - if (this.basicMapping.isLob() != lob) { - this.basicMapping.setLob(lob); - } - } - - private void bsaicMappingChanged(Notification notification) { - if (notification.getFeatureID(IBasic.class) == - JpaCoreMappingsPackage.IBASIC__LOB) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.basicMapping != null) { - this.basicMapping.eAdapters().add(this.basicMappingListener); - } - } - - @Override - protected void disengageListeners() { - if (this.basicMapping != null) { - this.basicMapping.eAdapters().remove(this.basicMappingListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.basicMapping = (IBasic) obj; - populateButton(); - } - - @Override - protected void doPopulate() { - populateButton(); - } - - private void populateButton() { - boolean lob = false; - if (this.basicMapping != null) { - lob = this.basicMapping.isLob(); - } - - if (this.button.getSelection() != lob) { - this.button.setSelection(lob); - } - } - - - @Override - public Control getControl() { - return this.button; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java deleted file mode 100644 index 1853ebab4a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java +++ /dev/null @@ -1,184 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -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.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class ManyToManyComposite extends BaseJpaComposite -{ - private IManyToMany manyToMany; - - private TargetEntityChooser targetEntityChooser; - - private EnumComboViewer fetchTypeComboViewer; - - private MappedByCombo mappedByCombo; - - private CascadeComposite cascadeComposite; - - private OrderingComposite orderingComposite; - - private JoinTableComposite joinTableComposite; - - - public ManyToManyComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - Control joinTableControl = buildJoinTableControl(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - joinTableControl.setLayoutData(gridData); - } - - private Control buildGeneralComposite(Composite composite) { -// IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.targetEntityChooser.getControl().setLayoutData(gridData); - - - CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory()); - this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.fetchTypeComboViewer.getControl().setLayoutData(gridData); - - - CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory()); - this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.mappedByCombo.getControl().setLayoutData(gridData); - - this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 3; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.cascadeComposite.getControl().setLayoutData(gridData); - - - this.orderingComposite = new OrderingComposite(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 3; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.orderingComposite.getControl().setLayoutData(gridData); - - return generalComposite; - } - - private Control buildJoinTableControl(Composite composite) { - Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - section.setText(JptUiMappingsMessages.MultiRelationshipMappingComposite_joinTable); - - Composite joinTableClient = getWidgetFactory().createComposite(section); - section.setClient(joinTableClient); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - joinTableClient.setLayout(layout); - - this.joinTableComposite = new JoinTableComposite(joinTableClient, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.joinTableComposite.getControl().setLayoutData(gridData); - - return section; - } - - public void doPopulate(EObject obj) { - this.manyToMany = (IManyToMany) obj; - this.targetEntityChooser.populate(this.manyToMany); - this.fetchTypeComboViewer.populate(CommonWidgets.buildMultiRelationshipMappingFetchEnumHolder(this.manyToMany)); - this.mappedByCombo.populate(this.manyToMany); - this.cascadeComposite.populate(this.manyToMany); - if (this.manyToMany != null) { - this.joinTableComposite.populate(this.manyToMany.getJoinTable()); - this.orderingComposite.populate(this.manyToMany); - } - else { - this.joinTableComposite.populate(null); - this.orderingComposite.populate(null); - } - } - - public void doPopulate() { - this.targetEntityChooser.populate(); - this.fetchTypeComboViewer.populate(); - this.mappedByCombo.populate(); - this.cascadeComposite.populate(); - this.joinTableComposite.populate(); - this.orderingComposite.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.targetEntityChooser.dispose(); - this.fetchTypeComboViewer.dispose(); - this.mappedByCombo.dispose(); - this.cascadeComposite.dispose(); - this.joinTableComposite.dispose(); - this.orderingComposite.dispose(); - super.dispose(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java deleted file mode 100644 index 135529349a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -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.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class ManyToOneComposite extends BaseJpaComposite -{ - private IManyToOne manyToOne; - - private TargetEntityChooser targetEntityChooser; - - private EnumComboViewer fetchTypeComboViewer; - - private EnumComboViewer optionalComboViewer; - - private OrderingComposite orderByComposite; - - private CascadeComposite cascadeComposite; - - private JoinColumnComposite joinColumnComposite; - - public ManyToOneComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - } - - private Control buildGeneralComposite(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.targetEntityChooser.getControl().setLayoutData(gridData); - helpSystem.setHelp(targetEntityChooser.getControl(), IJpaHelpContextIds.MAPPING_TARGET_ENTITY); - - CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory()); - this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.fetchTypeComboViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE); - - CommonWidgets.buildOptionalLabel(generalComposite, getWidgetFactory()); - this.optionalComboViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.optionalComboViewer.getControl().setLayoutData(gridData); - - this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 3; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.cascadeComposite.getControl().setLayoutData(gridData); - - this.joinColumnComposite = new JoinColumnComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.joinColumnComposite.getControl().setLayoutData(gridData); - - return generalComposite; - } - - public void doPopulate(EObject obj) { - this.manyToOne = (IManyToOne) obj; - this.targetEntityChooser.populate(this.manyToOne); - this.fetchTypeComboViewer.populate(CommonWidgets.buildSingleRelationshipMappingFetchEnumHolder(this.manyToOne)); - this.optionalComboViewer.populate(new OptionalHolder(this.manyToOne)); - this.cascadeComposite.populate(this.manyToOne); - this.joinColumnComposite.populate(this.manyToOne); - } - - public void doPopulate() { - this.targetEntityChooser.populate(); - this.fetchTypeComboViewer.populate(); - this.optionalComboViewer.populate(); - this.cascadeComposite.populate(); - this.joinColumnComposite.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.targetEntityChooser.dispose(); - this.fetchTypeComboViewer.dispose(); - this.optionalComboViewer.dispose(); - this.cascadeComposite.dispose(); - this.joinColumnComposite.dispose(); - super.dispose(); - } - - private class OptionalHolder extends EObjectImpl implements EnumHolder { - - private IManyToOne manyToOne; - - OptionalHolder(IManyToOne manyToOne) { - super(); - this.manyToOne = manyToOne; - } - - public Object get() { - return this.manyToOne.getOptional(); - } - - public void set(Object enumSetting) { - this.manyToOne.setOptional((DefaultTrueBoolean) enumSetting); - } - - public Class featureClass() { - return IManyToOne.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IMANY_TO_ONE__OPTIONAL; - } - - public EObject wrappedObject() { - return this.manyToOne; - } - - public Object[] enumValues() { - return DefaultTrueBoolean.VALUES.toArray(); - } - public Object defaultValue() { - return DefaultTrueBoolean.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "True"; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java deleted file mode 100644 index b0993475ca..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class MappedByCombo extends BaseJpaController -{ - private INonOwningMapping nonOwningMapping; - private Adapter nonOwningMappingListener; - - private CCombo combo; - - public MappedByCombo(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, commandStack, widgetFactory); - this.nonOwningMappingListener = buildListener(); - } - - private Adapter buildListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - nonOwningMappingChanged(notification); - } - }; - } - @Override - protected void buildWidget(Composite parent) { - this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - PlatformUI.getWorkbench().getHelpSystem().setHelp(combo,IJpaHelpContextIds.MAPPING_MAPPED_BY); - this.combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String mappedBy = ((CCombo) e.getSource()).getText(); - if (mappedBy.equals("")) { //$NON-NLS-1$ - mappedBy = null; - if (getNonOwningMapping().getMappedBy() == null || getNonOwningMapping().getMappedBy().equals("")) { //$NON-NLS-1$ - return; - } - } - if (getNonOwningMapping().getMappedBy() == null || !getNonOwningMapping().getMappedBy().equals(mappedBy)) { - getNonOwningMapping().setMappedBy(mappedBy); - } - } - }); - } - - private INonOwningMapping getNonOwningMapping() { - return this.nonOwningMapping; - } - - @Override - protected void doPopulate(EObject obj) { - this.nonOwningMapping = (INonOwningMapping) obj; - - if (this.nonOwningMapping == null) { - return; - } - - populateCombo(); - } - - private void populateCombo() { - populateChoices(); - populateMappedByText(); - } - - private void populateChoices() { - if (this.combo.getItemCount() > 0) { - this.combo.removeAll(); - } - for (Iterator i = this.nonOwningMapping.candidateMappedByAttributeNames(); i.hasNext(); ) { - this.combo.add(i.next()); - } - } - - private void populateMappedByText() { - String mappedBy = this.nonOwningMapping.getMappedBy(); - if (mappedBy != null) { - if (!this.combo.getText().equals(mappedBy)) { - this.combo.setText(mappedBy); - } - } - } - - @Override - protected void doPopulate() { - } - - @Override - protected void engageListeners() { - if (this.nonOwningMapping != null) { - this.nonOwningMapping.eAdapters().add(this.nonOwningMappingListener); - } - } - - @Override - protected void disengageListeners() { - if (this.nonOwningMapping != null) { - this.nonOwningMapping.eAdapters().remove(this.nonOwningMappingListener); - } - } - - protected void nonOwningMappingChanged(Notification notification) { - if (notification.getFeatureID(INonOwningMapping.class) == JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateMappedByText(); - } - }); - } - else if (notification.getFeatureID(IRelationshipMapping.class) == JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateChoices(); - } - }); - } - } - - @Override - public Control getControl() { - return this.combo; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java deleted file mode 100644 index 7d21ec76e8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class MappedSuperclassComposite extends BaseJpaComposite -{ - private IMappedSuperclass mappedSuperclass; - private Adapter mappedSuperclassListener; - - private CommandStack commandStack; - - - public MappedSuperclassComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.mappedSuperclassListener = buildMappedSuperclassListener(); - } - - private Adapter buildMappedSuperclassListener() { - return new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - mappedSuperclassChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - composite.setLayout(new FillLayout(SWT.VERTICAL)); - -// Label accessTypeLabel = new Label(composite, SWT.LEFT); -// accessTypeLabel.setText(DaliUiMessages.MappedSuperclassComposite_accessType); -// this.accessTypeComboViewer = buildAccessTypeCombo(composite); -// //eventually this will be enabled if editing xml instead of java -// this.accessTypeComboViewer.getCombo().setEnabled(false); -// GridData gridData = new GridData(); -// gridData.horizontalAlignment = GridData.FILL; -// gridData.grabExcessHorizontalSpace = true; -// this.accessTypeComboViewer.getCombo().setLayoutData(gridData); -// PlatformUI.getWorkbench().getHelpSystem().setHelp(this.accessTypeComboViewer.getCombo(), IDaliHelpContextIds.ENTITY_ACCESS_TYPE); - - } - -// private ComboViewer buildAccessTypeCombo(Composite parent) { -// ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY); -// viewer.add(AccessType.VALUES.toArray()); -// viewer.addSelectionChangedListener(new ISelectionChangedListener() { -// public void selectionChanged(SelectionChangedEvent event) { -// if (populating) { -// return; -// } -// if (event.getSelection() instanceof StructuredSelection) { -// StructuredSelection selection = (StructuredSelection) event.getSelection(); -// editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, persistentType, OrmPackage.eINSTANCE.getPersistentType_AccessType(), selection.getFirstElement())); -// } -// } -// }); -// return viewer; -// } - - @Override - protected void doPopulate(EObject model) { - this.mappedSuperclass = (IMappedSuperclass) model; - } - - @Override - protected void doPopulate() { - - } - - - protected void engageListeners() { -// this.persistentTypeItemProvider.addListener(getPersistentTypeListener()); -// this.persistentType.eAdapters().add(this.persistentTypeItemProvider); - } - - protected void disengageListeners() { -// if (this.persistentType != null){ -// this.persistentType.eAdapters().remove(this.persistentTypeItemProvider); -// this.persistentTypeItemProvider.removeListener(getPersistentTypeListener()); -// } - } - - private void mappedSuperclassChanged(Notification notification) { - - } - -// private INotifyChangedListener getPersistentTypeListener() { -// if (this.persistentTypeListener == null) { -// this.persistentTypeListener = new INotifyChangedListener() { -// public void notifyChanged(Notification notification) { -// if (notification.getFeatureID(PersistentType.class) == OrmPackage.PERSISTENT_TYPE__ACCESS_TYPE) { -// final AccessType accessType = (AccessType) notification.getNewValue(); -// Display.getDefault().syncExec(new Runnable() { -// public void run() { -// if (((StructuredSelection) accessTypeComboViewer.getSelection()).getFirstElement() != accessType) { -// accessTypeComboViewer.setSelection(new StructuredSelection(accessType)); -// } -// } -// }); -// } -// } -// }; -// } -// return this.persistentTypeListener; -// } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java deleted file mode 100644 index 113173f266..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -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.ui.PlatformUI; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class OneToManyComposite extends BaseJpaComposite -{ - private IOneToMany oneToMany; - - private EnumComboViewer fetchTypeComboViewer; - - private TargetEntityChooser targetEntityChooser; - - private MappedByCombo mappedByCombo; - - private CascadeComposite cascadeComposite; - - private OrderingComposite orderingComposite; - - private JoinTableComposite joinTableComposite; - - public OneToManyComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralControl(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - Control joinTableControl = buildJoinTableControl(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - joinTableControl.setLayoutData(gridData); - } - - private Control buildGeneralControl(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - GridData gridData; - - this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.targetEntityChooser.getControl().setLayoutData(gridData); - - CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory()); - this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.fetchTypeComboViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(this.fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE); - - CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory()); - this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.mappedByCombo.getControl().setLayoutData(gridData); - helpSystem.setHelp(this.mappedByCombo.getControl(), IJpaHelpContextIds.MAPPING_MAPPED_BY); - - this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 3; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.cascadeComposite.getControl().setLayoutData(gridData); - - this.orderingComposite = new OrderingComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 3; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.orderingComposite.getControl().setLayoutData(gridData); - - - return generalComposite; - } - - private Control buildJoinTableControl(Composite composite) { - Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - section.setText(JptUiMappingsMessages.MultiRelationshipMappingComposite_joinTable); - - Composite joinTableClient = getWidgetFactory().createComposite(section); - section.setClient(joinTableClient); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - joinTableClient.setLayout(layout); - - this.joinTableComposite = new JoinTableComposite(joinTableClient, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.joinTableComposite.getControl().setLayoutData(gridData); - - return section; - } - - public void doPopulate(EObject obj) { - this.oneToMany = (IOneToMany) obj; - this.fetchTypeComboViewer.populate(CommonWidgets.buildMultiRelationshipMappingFetchEnumHolder(this.oneToMany)); - this.targetEntityChooser.populate(this.oneToMany); - this.mappedByCombo.populate(this.oneToMany); - this.cascadeComposite.populate(this.oneToMany); - if (this.oneToMany != null) { - this.joinTableComposite.populate(this.oneToMany.getJoinTable()); - this.orderingComposite.populate(this.oneToMany); - } - else { - this.joinTableComposite.populate(null); - this.orderingComposite.populate(null); - } - } - - public void doPopulate() { - this.fetchTypeComboViewer.populate(); - this.targetEntityChooser.populate(); - this.mappedByCombo.populate(); - this.cascadeComposite.populate(); - this.joinTableComposite.populate(); - this.orderingComposite.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.fetchTypeComboViewer.dispose(); - this.targetEntityChooser.dispose(); - this.mappedByCombo.dispose(); - this.cascadeComposite.dispose(); - this.joinTableComposite.dispose(); - this.orderingComposite.dispose(); - super.dispose(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java deleted file mode 100644 index 73969770de..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java +++ /dev/null @@ -1,206 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -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.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class OneToOneComposite extends BaseJpaComposite -{ - private IOneToOne oneToOne; - - private TargetEntityChooser targetEntityChooser; - - private EnumComboViewer fetchTypeComboViewer; - - private MappedByCombo mappedByCombo; - - private EnumComboViewer optionalComboViewer; - - private CascadeComposite cascadeComposite; - - private JoinColumnComposite joinColumnComposite; - - public OneToOneComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - private IOneToOne getOneToOne() { - return this.oneToOne; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - } - - private Control buildGeneralComposite(Composite composite) { -// IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.targetEntityChooser.getControl().setLayoutData(gridData); - - - CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory()); - this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.fetchTypeComboViewer.getControl().setLayoutData(gridData); - - CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory()); - this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.mappedByCombo.getControl().setLayoutData(gridData); - - CommonWidgets.buildOptionalLabel(generalComposite, getWidgetFactory()); - this.optionalComboViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.optionalComboViewer.getControl().setLayoutData(gridData); - - this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalSpan = 3; - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.cascadeComposite.getControl().setLayoutData(gridData); - - this.joinColumnComposite = new JoinColumnComposite(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.joinColumnComposite.getControl().setLayoutData(gridData); - - return generalComposite; - } - - public void doPopulate(EObject obj) { - this.oneToOne = (IOneToOne) obj; - this.targetEntityChooser.populate(this.oneToOne); - this.fetchTypeComboViewer.populate(CommonWidgets.buildSingleRelationshipMappingFetchEnumHolder(this.oneToOne)); - this.mappedByCombo.populate(this.oneToOne); - this.optionalComboViewer.populate(new OptionalHolder(this.oneToOne)); - this.cascadeComposite.populate(this.oneToOne); - this.joinColumnComposite.populate(this.oneToOne); - } - - public void doPopulate() { - this.targetEntityChooser.populate(); - this.fetchTypeComboViewer.populate(); - this.mappedByCombo.populate(); - this.optionalComboViewer.populate(); - this.cascadeComposite.populate(); - this.joinColumnComposite.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.targetEntityChooser.dispose(); - this.fetchTypeComboViewer.dispose(); - this.mappedByCombo.dispose(); - this.optionalComboViewer.dispose(); - this.cascadeComposite.dispose(); - this.joinColumnComposite.dispose(); - super.dispose(); - } - - private class OptionalHolder extends EObjectImpl implements EnumHolder { - - private IOneToOne oneToOne; - - OptionalHolder(IOneToOne oneToOne) { - super(); - this.oneToOne = oneToOne; - } - - public Object get() { - return this.oneToOne.getOptional(); - } - - public void set(Object enumSetting) { - this.oneToOne.setOptional((DefaultTrueBoolean) enumSetting); - } - - public Class featureClass() { - return IOneToOne.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IONE_TO_ONE__OPTIONAL; - } - - public EObject wrappedObject() { - return this.oneToOne; - } - - public Object[] enumValues() { - return DefaultTrueBoolean.VALUES.toArray(); - } - - public Object defaultValue() { - return DefaultTrueBoolean.DEFAULT; - } - - public String defaultString() { - //TODO move this out of the UI into the model - return "True"; - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java deleted file mode 100644 index 95b1bc6284..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.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.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.ITextListener; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.TextEvent; -import org.eclipse.jface.text.TextViewer; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -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.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -/** - * - */ -public class OrderingComposite extends BaseJpaComposite { - - private IMultiRelationshipMapping mapping; - private Adapter mappingListener; - - private Button noOrderingRadioButton; - private Button primaryKeyOrderingRadioButton; - private Button customOrderingRadioButton; - - private ITextViewer orderingTextViewer; - - // short circuit flag for user typing - private boolean updatingCustomOrderBy = false; - - - public OrderingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, commandStack, widgetFactory); - this.mappingListener = buildMappingListener(); - } - - private Adapter buildMappingListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - mappingChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout(layout); - - Group orderByGroup = getWidgetFactory().createGroup(composite, JptUiMappingsMessages.OrderByComposite_orderByGroup); - orderByGroup.setLayout(new GridLayout(1, false)); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - orderByGroup.setLayoutData(gridData); - helpSystem.setHelp(orderByGroup, IJpaHelpContextIds.MAPPING_ORDER_BY); - - - this.noOrderingRadioButton = buildNoOrderingRadioButton(orderByGroup); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.noOrderingRadioButton.setLayoutData(gridData); -// helpSystem().setHelp(this.noOrderingRadioButton, IJpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING); - - - this.primaryKeyOrderingRadioButton = buildPrimaryKeyOrderingRadioButton(orderByGroup); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.primaryKeyOrderingRadioButton.setLayoutData(gridData); -// helpSystem().setHelp(this.primaryKeyOrderingRadioButton, IJpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING); - - this.customOrderingRadioButton = buildCustomOrderingRadioButton(orderByGroup); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.customOrderingRadioButton.setLayoutData(gridData); -// helpSystem().setHelp(this.customOrderingRadioButton, IJpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING); - - - this.orderingTextViewer = buildOrderByTestViewer(orderByGroup); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalIndent = 15; - this.orderingTextViewer.getTextWidget().setLayoutData(gridData); - helpSystem.setHelp(this.orderingTextViewer.getTextWidget(), IJpaHelpContextIds.MAPPING_ORDER_BY); - } - - private Button buildNoOrderingRadioButton(Composite parent) { - Button button = getWidgetFactory().createButton( - parent, - JptUiMappingsMessages.OrderByComposite_noOrdering, - SWT.RADIO); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // ignore - } - public void widgetSelected(SelectionEvent e) { - OrderingComposite.this.noOrderingRadioButtonSelected(e); - } - }); - - return button; - } - - void noOrderingRadioButtonSelected(SelectionEvent e) { - if (!((Button) e.widget).getSelection()) { - //ignore case where radio button is deselected - return; - } - if (this.mapping.isNoOrdering()) { - return; - } - this.mapping.setNoOrdering(); - } - - private Button buildPrimaryKeyOrderingRadioButton(Composite parent) { - Button button = getWidgetFactory().createButton( - parent, - JptUiMappingsMessages.OrderByComposite_primaryKeyOrdering, - SWT.RADIO); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // ignore - } - public void widgetSelected(SelectionEvent e) { - OrderingComposite.this.primaryKeyOrderingRadioButtonSelected(e); - } - }); - return button; - } - - void primaryKeyOrderingRadioButtonSelected(SelectionEvent e) { - if (!((Button) e.widget).getSelection()) { - //ignore case where radio button is deselected - return; - } - if (! this.mapping.isOrderByPk()) { - this.mapping.setOrderByPk(); - } - setTextViewerEnabled(false); - } - - private Button buildCustomOrderingRadioButton(Composite parent) { - Button button = getWidgetFactory().createButton( - parent, - JptUiMappingsMessages.OrderByComposite_customOrdering, - SWT.RADIO); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // ignore - } - public void widgetSelected(SelectionEvent e) { - OrderingComposite.this.customOrderingRadioButtonSelected(e); - } - }); - - return button; - } - - void customOrderingRadioButtonSelected(SelectionEvent e) { - if (!((Button) e.widget).getSelection()) { - //ignore case where radio button is deselected - return; - } - setTextViewerEnabled(true); - } - - private ITextViewer buildOrderByTestViewer(Composite parent) { - final TextViewer textViewer = new TextViewer(parent, SWT.SINGLE | SWT.BORDER); - textViewer.setDocument(new Document()); - textViewer.addTextListener(new ITextListener() { - public void textChanged(TextEvent event) { - orderingTextViewerChanged(); - } - }); - return textViewer; - } - - private void orderingTextViewerChanged() { - if (isPopulating()) { - return; - } - String orderByValue = this.orderingTextViewer.getDocument().get(); - if (orderByValue.equals(this.mapping.getOrderBy())) { - return; - } - - this.updatingCustomOrderBy = true; - this.mapping.setOrderBy(orderByValue); - } - - private void setTextViewerEnabled(boolean enabled) { - this.orderingTextViewer.setEditable(enabled); - this.orderingTextViewer.getTextWidget().setEnabled(enabled); - } - - private void mappingChanged(Notification notification) { - if (notification.getFeatureID(IMultiRelationshipMapping.class) == JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void doPopulate(EObject obj) { - this.mapping = (IMultiRelationshipMapping) obj; - if (this.mapping == null) { - return; - } - populateOrderingRadioButtons(); - } - - @Override - protected void doPopulate() { - populateOrderingRadioButtons(); - } - - @Override - protected void engageListeners() { - if (this.mapping != null) { - this.mapping.eAdapters().add(this.mappingListener); - } - } - - @Override - protected void disengageListeners() { - if (this.mapping != null) { - this.mapping.eAdapters().remove(this.mappingListener); - } - } - - private void populateOrderingRadioButtons() { - // short circuit if user is typing - if (updatingCustomOrderBy) { - updatingCustomOrderBy = false; - return; - } - - if (this.mapping.isNoOrdering()) { - this.primaryKeyOrderingRadioButton.setSelection(false); - this.customOrderingRadioButton.setSelection(false); - this.noOrderingRadioButton.setSelection(true); - if (! "".equals(this.orderingTextViewer.getDocument().get())) { - this.orderingTextViewer.getDocument().set(""); - } - } - else if (this.mapping.isOrderByPk()) { - this.customOrderingRadioButton.setSelection(false); - this.noOrderingRadioButton.setSelection(false); - this.primaryKeyOrderingRadioButton.setSelection(true); -// String value = this.ordering.getValue(); -// if (value != null && !value.equals(this.orderingTextViewer.getDocument().get())) { -// this.orderingTextViewer.getDocument().set(value); -// } -// else { - if (!"".equals(this.orderingTextViewer.getDocument().get())) { - this.orderingTextViewer.getDocument().set(""); - } -// } - } - else if (this.mapping.isCustomOrdering()) { - this.noOrderingRadioButton.setSelection(false); - this.primaryKeyOrderingRadioButton.setSelection(false); - this.customOrderingRadioButton.setSelection(true); - String value = this.mapping.getOrderBy(); - if (value != null && !value.equals(this.orderingTextViewer.getDocument().get())) { - this.orderingTextViewer.getDocument().set(value); - } - } - - setTextViewerEnabled(this.mapping.isCustomOrdering()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java deleted file mode 100644 index 986aab26e1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java +++ /dev/null @@ -1,501 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.List; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -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.core.internal.JpaEObject; -import org.eclipse.jpt.core.internal.mappings.IAssociationOverride; -import org.eclipse.jpt.core.internal.mappings.IAttributeOverride; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IOverride; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.mappings.details.JoinColumnsComposite.Owner; -import org.eclipse.jpt.utility.internal.CollectionTools; -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.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class OverridesComposite extends BaseJpaComposite -{ - private ListViewer listViewer; - - private IEntity entity; - private Adapter entityListener; - - private IOverride selectedOverride; - private Adapter overrideListener; - - protected PageBook overridePageBook; - - protected ColumnComposite columnComposite; - protected JoinColumnsComposite joinColumnsComposite; - - private Button overrideDefaultButton; - - public OverridesComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.entityListener = buildEntityListener(); - this.overrideListener = buildOverrideListener(); - } - - private Adapter buildEntityListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - entityChanged(notification); - } - }; - } - - private Adapter buildOverrideListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - overrideChanged(notification); - } - }; - } - - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - Group attributeOverridesGroup = getWidgetFactory().createGroup( - composite, JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides); - attributeOverridesGroup.setLayout(new GridLayout(2, true)); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - attributeOverridesGroup.setLayoutData(gridData); - - this.listViewer = buildAttributeOverridesListViewer(attributeOverridesGroup); - gridData = new GridData(); - gridData.verticalSpan = 2; - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - this.listViewer.getList().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.listViewer.getList(), IJpaHelpContextIds.ENTITY_ATTRIBUTE_OVERRIDES); - - this.overrideDefaultButton = - getWidgetFactory().createButton( - attributeOverridesGroup, - JptUiMappingsMessages.AttributeOverridesComposite_overridDefault, - SWT.CHECK); - this.overrideDefaultButton.addSelectionListener(buildOverrideDefaultSelectionListener()); - gridData = new GridData(); - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.overrideDefaultButton.setLayoutData(gridData); - - - this.overridePageBook = buildOverridePageBook(attributeOverridesGroup); - gridData = new GridData(); - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.overridePageBook.setLayoutData(gridData); - - this.joinColumnsComposite = new JoinColumnsComposite(this.overridePageBook, this.commandStack, getWidgetFactory(), JptUiMappingsMessages.OverridesComposite_joinColumn); - this.columnComposite = new ColumnComposite(this.overridePageBook, this.commandStack, getWidgetFactory()); - this.overridePageBook.showPage(this.joinColumnsComposite.getControl()); - } - - protected PageBook buildOverridePageBook(Composite parent) { - return new PageBook(parent, SWT.NONE); - } - - private SelectionListener buildOverrideDefaultSelectionListener() { - return new SelectionListener(){ - - public void widgetSelected(SelectionEvent e) { - overrideDefaultButtonSelected(e); - } - - public void widgetDefaultSelected(SelectionEvent e) { - overrideDefaultButtonSelected(e); - } - }; - } - - private void overrideDefaultButtonSelected(SelectionEvent e) { - boolean selection = this.overrideDefaultButton.getSelection(); - if (selection) { - if (getSelectedOverride() instanceof IAttributeOverride) { - int index = this.entity.getSpecifiedAttributeOverrides().size(); - IAttributeOverride attributeOverride = this.entity.createAttributeOverride(index); - this.entity.getSpecifiedAttributeOverrides().add(attributeOverride); - attributeOverride.setName(this.selectedOverride.getName()); - attributeOverride.getColumn().setSpecifiedName(((IAttributeOverride) this.selectedOverride).getColumn().getName()); - } - else { - int index = this.entity.getSpecifiedAssociationOverrides().size(); - IAssociationOverride associationOverride = this.entity.createAssociationOverride(index); - String name = this.selectedOverride.getName(); - this.entity.getSpecifiedAssociationOverrides().add(associationOverride); - associationOverride.setName(name); - //attributeOverride.getColumn().setSpecifiedName(this.attributeOverride.getColumn().getName()); - } - } - else { - if (getSelectedOverride() instanceof IAttributeOverride) { - this.entity.getSpecifiedAttributeOverrides().remove(this.selectedOverride); - } - else { - this.entity.getSpecifiedAssociationOverrides().remove(this.selectedOverride); - } - } - } - - - private ListViewer buildAttributeOverridesListViewer(Composite parent) { - ListViewer listViewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER); - listViewer.setLabelProvider(buildAttributeOverridesLabelProvider()); - listViewer.setContentProvider(buildAttributeOverridesContentProvider()); - - listViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - overridesListSelectionChanged(event); - } - }); - - return listViewer; - } - - protected void overridesListSelectionChanged(SelectionChangedEvent event) { - if (((StructuredSelection) event.getSelection()).isEmpty()) { - this.columnComposite.populate(null); - this.columnComposite.enableWidgets(false); - this.overrideDefaultButton.setSelection(false); - this.overrideDefaultButton.setEnabled(false); - } - else { - this.selectedOverride = getSelectedOverride(); - if (this.selectedOverride instanceof IAttributeOverride) { - boolean specifiedOverride = this.entity.getSpecifiedAttributeOverrides().contains(this.selectedOverride); - this.overrideDefaultButton.setSelection(specifiedOverride); - this.overridePageBook.showPage(this.columnComposite.getControl()); - this.columnComposite.populate(((IAttributeOverride) this.selectedOverride).getColumn()); - this.columnComposite.enableWidgets(specifiedOverride); - this.overrideDefaultButton.setEnabled(true); - } - else { - boolean specifiedOverride = this.entity.getSpecifiedAssociationOverrides().contains(this.selectedOverride); - this.overrideDefaultButton.setSelection(specifiedOverride); - this.overridePageBook.showPage(this.joinColumnsComposite.getControl()); - this.joinColumnsComposite.populate(new JoinColumnsOwner((IAssociationOverride) getSelectedOverride())); - this.joinColumnsComposite.enableWidgets(specifiedOverride); - this.overrideDefaultButton.setEnabled(true); - } - } - } - - private ILabelProvider buildAttributeOverridesLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - //TODO also display column name somehow - return ((IOverride) element).getName(); - } - }; - } - - - private IContentProvider buildAttributeOverridesContentProvider() { - return new IStructuredContentProvider() { - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - public void dispose() { - } - - public Object[] getElements(Object inputElement) { - IEntity entity = (IEntity) inputElement; - return CollectionTools.addAll( - entity.getAttributeOverrides().toArray(new IOverride[entity.getAttributeOverrides().size()]), - entity.getAssociationOverrides()); - } - }; - } - - private IOverride getSelectedOverride() { - return (IOverride) ((StructuredSelection) this.listViewer.getSelection()).getFirstElement(); - } - - - public void doPopulate(EObject obj) { - this.entity = (IEntity) obj; - if (this.entity == null) { - this.selectedOverride = null; - this.columnComposite.populate(null); - this.joinColumnsComposite.populate(null); - this.listViewer.setInput(null); - return; - } - - if (this.listViewer.getInput() != entity) { - this.listViewer.setInput(entity); - } - if (!this.entity.getAttributeOverrides().isEmpty()) { - if (this.listViewer.getSelection().isEmpty()) { - IOverride override = this.entity.getAttributeOverrides().get(0); - this.listViewer.setSelection(new StructuredSelection(override)); - } - else { - Object selection = ((StructuredSelection) this.listViewer.getSelection()).getFirstElement(); - if (selection instanceof IAttributeOverride) { - this.overridePageBook.showPage(this.columnComposite.getControl()); - this.columnComposite.enableWidgets(true); - this.columnComposite.populate(((IAttributeOverride) selection).getColumn()); - } - else { - this.overridePageBook.showPage(this.joinColumnsComposite.getControl()); - this.joinColumnsComposite.enableWidgets(true); - this.joinColumnsComposite.populate(new JoinColumnsOwner((IAssociationOverride) selection)); - } - } - } - else { - this.columnComposite.populate(null); - this.columnComposite.enableWidgets(false); - } - } - - @Override - protected void doPopulate() { - this.columnComposite.doPopulate(); - this.joinColumnsComposite.doPopulate(); - } - - @Override - protected void engageListeners() { - if (this.entity != null) { - this.entity.eAdapters().add(this.entityListener); - for (IOverride attributeOverride : this.entity.getAttributeOverrides()) { - attributeOverride.eAdapters().add(this.overrideListener); - } - for (IOverride attributeOverride : this.entity.getAssociationOverrides()) { - attributeOverride.eAdapters().add(this.overrideListener); - } - } - } - - @Override - protected void disengageListeners() { - if (this.entity != null) { - this.entity.eAdapters().remove(this.entityListener); - for (IOverride attributeOverride : this.entity.getAttributeOverrides()) { - attributeOverride.eAdapters().remove(this.overrideListener); - } - for (IOverride attributeOverride : this.entity.getAssociationOverrides()) { - attributeOverride.eAdapters().remove(this.overrideListener); - } - } - } - - - protected void entityChanged(Notification notification) { - switch (notification.getFeatureID(IEntity.class)) { - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES : - case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES : - case JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES : - case JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES : - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (listViewer.getList().isDisposed()) { - return; - } - listViewer.refresh(); - } - }); - - if (notification.getEventType() == Notification.ADD) { - ((IOverride) notification.getNewValue()).eAdapters().add(this.overrideListener); - final Object newValue = notification.getNewValue(); - ((IOverride) newValue).eAdapters().add(this.overrideListener); - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (listViewer.getList().isDisposed()) { - return; - } - listViewer.setSelection(new StructuredSelection(newValue)); - } - }); - } - else if (notification.getEventType() == Notification.ADD_MANY) { - List addedList = (List) notification.getNewValue(); - for (IOverride override : addedList) { - override.eAdapters().add(this.overrideListener); - } - } - else if (notification.getEventType() == Notification.REMOVE) { - ((IOverride) notification.getOldValue()).eAdapters().remove(this.overrideListener); - } - else if (notification.getEventType() == Notification.REMOVE_MANY) { - List removedList = (List) notification.getOldValue(); - for (IOverride override : removedList) { - override.eAdapters().remove(this.overrideListener); - } - } - break; - } - } - - protected void overrideChanged(Notification notification) { - switch (notification.getFeatureID(IOverride.class)) { - case JpaCoreMappingsPackage.IOVERRIDE__NAME : - final IOverride override = (IOverride) notification.getNotifier(); - Display.getDefault().asyncExec(new Runnable() { - public void run() { - OverridesComposite.this.listViewer.update(override, null); - } - }); - break; - default : - break; - } - } - - public void dispose() { - this.columnComposite.dispose(); - this.joinColumnsComposite.dispose(); - super.dispose(); - } - - - void addJoinColumn() { - JoinColumnInAssociationOverrideDialog dialog = new JoinColumnInAssociationOverrideDialog(this.getControl().getShell(), (IAssociationOverride) getSelectedOverride()); - this.addJoinColumnFromDialog(dialog); - } - - private void addJoinColumnFromDialog(JoinColumnInAssociationOverrideDialog dialog) { - if (dialog.open() != Window.OK) { - return; - } - int index = ((IAssociationOverride) getSelectedOverride()).getJoinColumns().size(); - IJoinColumn joinColumn = ((IAssociationOverride) getSelectedOverride()).createJoinColumn(index); - ((IAssociationOverride) getSelectedOverride()).getSpecifiedJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(dialog.getSelectedName()); - joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName()); - } - - void editJoinColumn(IJoinColumn joinColumn) { - JoinColumnInAssociationOverrideDialog dialog = new JoinColumnInAssociationOverrideDialog(this.getControl().getShell(), joinColumn); - editJoinColumnFromDialog(dialog, joinColumn); - } - - private void editJoinColumnFromDialog(JoinColumnInAssociationOverrideDialog dialog, IJoinColumn joinColumn) { - if (dialog.open() == Window.OK) { - editJoinColumnDialogOkd(dialog, joinColumn); - } - } - - private void editJoinColumnDialogOkd(JoinColumnInAssociationOverrideDialog dialog, IJoinColumn joinColumn) { - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - - if (dialog.isDefaultNameSelected()) { - if (joinColumn.getSpecifiedName() != null) { - joinColumn.setSpecifiedName(null); - } - } - else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){ - joinColumn.setSpecifiedName(name); - } - - if (dialog.isDefaultReferencedColumnNameSelected()) { - if (joinColumn.getSpecifiedReferencedColumnName() != null) { - joinColumn.setSpecifiedReferencedColumnName(null); - } - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){ - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - - private class JoinColumnsOwner extends JpaEObject implements Owner { - - IAssociationOverride associationOverride; - - public JoinColumnsOwner(IAssociationOverride associationOverride) { - super(); - this.associationOverride = associationOverride; - } - - public void addJoinColumn() { - OverridesComposite.this.addJoinColumn(); - } - - public boolean containsSpecifiedJoinColumns() { - return this.associationOverride.containsSpecifiedJoinColumns(); - } - - public IJoinColumn createJoinColumn(int index) { - return this.associationOverride.createJoinColumn(index); - } - - public List getJoinColumns() { - return this.associationOverride.getJoinColumns(); - } - - public List getSpecifiedJoinColumns() { - return this.associationOverride.getSpecifiedJoinColumns(); - } - - public int specifiedJoinColumnsFeatureId() { - return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS; - } - - public Class owningFeatureClass() { - return IAssociationOverride.class; - } - - public void editJoinColumn(IJoinColumn joinColumn) { - OverridesComposite.this.editJoinColumn(joinColumn); - } - - public EObject getEObject() { - return this.associationOverride; - } - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java deleted file mode 100644 index f7aa9653e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.swt.widgets.Shell; - -public class PrimaryKeyJoinColumnDialog extends AbstractJoinColumnDialog { - - private IEntity entity; - - PrimaryKeyJoinColumnDialog(Shell parent, IEntity entity) { - super(parent); - this.entity = entity; - } - - PrimaryKeyJoinColumnDialog(Shell parent, IPrimaryKeyJoinColumn joinColumn) { - super(parent, joinColumn); - this.entity = (IEntity) joinColumn.eContainer(); - } - - protected Table getNameTable() { - return this.entity.primaryDbTable(); - } - - protected Table getReferencedNameTable() { - return this.entity.parentEntity().primaryDbTable(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java deleted file mode 100644 index 51a220df88..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.swt.widgets.Shell; - -public class PrimaryKeyJoinColumnInSecondaryTableDialog extends AbstractJoinColumnDialog { - - private ISecondaryTable secondaryTable; - - PrimaryKeyJoinColumnInSecondaryTableDialog(Shell parent, ISecondaryTable secondaryTable) { - super(parent); - this.secondaryTable = secondaryTable; - } - - PrimaryKeyJoinColumnInSecondaryTableDialog(Shell parent, IPrimaryKeyJoinColumn joinColumn) { - super(parent, joinColumn); - this.secondaryTable = (ISecondaryTable) joinColumn.eContainer(); - } - - protected Table getNameTable() { - return this.secondaryTable.dbTable(); - } - - protected Table getReferencedNameTable() { - return this.secondaryTable.typeMapping().primaryDbTable(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java deleted file mode 100644 index d7a75243b8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java +++ /dev/null @@ -1,399 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -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.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.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.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class PrimaryKeyJoinColumnsComposite extends BaseJpaComposite -{ - private IEntity entity; - private final Adapter entityListener; - private final Adapter pkJoinColumnListener; - - ListViewer pkJoinColumnsListViewer; - - private Group pkJoinColumnsGroup; - Button overrideDefaultJoinColumnsCheckBox; - private Button pkJoinColumnsRemoveButton; - private Button pkJoinColumnsEditButton; - - - public PrimaryKeyJoinColumnsComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.entityListener = buildEntityListener(); - this.pkJoinColumnListener = buildPkJoinColumnListener(); - } - - private Adapter buildEntityListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - entityChanged(notification); - } - }; - } - - private Adapter buildPkJoinColumnListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - pkJoinColumnChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - GridData gridData = new GridData(); - this.overrideDefaultJoinColumnsCheckBox = getWidgetFactory().createButton( - composite, - JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns, - SWT.CHECK); - this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - if (PrimaryKeyJoinColumnsComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) { - IPrimaryKeyJoinColumn defaultJoinColumn = PrimaryKeyJoinColumnsComposite.this.entity.getDefaultPrimaryKeyJoinColumns().get(0); - String columnName = defaultJoinColumn.getDefaultName(); - String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName(); - - IPrimaryKeyJoinColumn pkJoinColumn = PrimaryKeyJoinColumnsComposite.this.entity.createPrimaryKeyJoinColumn(0); - PrimaryKeyJoinColumnsComposite.this.entity.getSpecifiedPrimaryKeyJoinColumns().add(pkJoinColumn); - pkJoinColumn.setSpecifiedName(columnName); - pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } else { - PrimaryKeyJoinColumnsComposite.this.entity.getSpecifiedPrimaryKeyJoinColumns().clear(); - } - } - }); - - this.pkJoinColumnsGroup = - getWidgetFactory().createGroup( - composite, - JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn); - this.pkJoinColumnsGroup.setLayout(new GridLayout(2, false)); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.pkJoinColumnsGroup.setLayoutData(gridData); - - this.pkJoinColumnsListViewer = new ListViewer(this.pkJoinColumnsGroup, SWT.BORDER | SWT.MULTI); - this.pkJoinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider()); - this.pkJoinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.verticalSpan = 3; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.pkJoinColumnsListViewer.getList().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.pkJoinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS); - - Button addJoinColumnButton = new Button(this.pkJoinColumnsGroup, SWT.NONE); - addJoinColumnButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_add); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - addJoinColumnButton.setLayoutData(gridData); - addJoinColumnButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - addPrimaryKeyJoinColumn(); - } - }); - - this.pkJoinColumnsEditButton = new Button(this.pkJoinColumnsGroup, SWT.NONE); - this.pkJoinColumnsEditButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_edit); - this.pkJoinColumnsEditButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - editPrimaryKeyJoinColumn(); - } - }); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.pkJoinColumnsEditButton.setLayoutData(gridData); - - this.pkJoinColumnsRemoveButton = new Button(this.pkJoinColumnsGroup, SWT.NONE); - this.pkJoinColumnsRemoveButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_remove); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.BEGINNING; - this.pkJoinColumnsRemoveButton.setLayoutData(gridData); - this.pkJoinColumnsRemoveButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - removePrimaryKeyJoinColumn(); - } - }); - - this.pkJoinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updatePrimaryKeyJoinColumnsEnablement(); - } - }); - } - - private IContentProvider buildJoinColumnsListContentProvider() { - return new IStructuredContentProvider(){ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - - public void dispose() { - // do nothing - } - - public Object[] getElements(Object inputElement) { - return ((IEntity) inputElement).getPrimaryKeyJoinColumns().toArray(); - } - }; - } - - private ILabelProvider buildJoinColumnsListLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - IPrimaryKeyJoinColumn joinColumn = (IPrimaryKeyJoinColumn) element; - return (PrimaryKeyJoinColumnsComposite.this.entity.containsSpecifiedPrimaryKeyJoinColumns()) ? - buildJoinColumnLabel(joinColumn) - : - buildDefaultJoinColumnLabel(joinColumn); - } - }; - } - - String buildDefaultJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - - String buildJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) { - if (joinColumn.getSpecifiedName() == null) { - if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName()); - } - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - } - - - void addPrimaryKeyJoinColumn() { - PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(this.getControl().getShell(), this.entity); - addJoinColumnFromDialog(dialog); - } - - private void addJoinColumnFromDialog(PrimaryKeyJoinColumnDialog dialog) { - if (dialog.open() == Window.OK) { - int index = this.entity.getSpecifiedPrimaryKeyJoinColumns().size(); - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - IPrimaryKeyJoinColumn joinColumn = this.entity.createPrimaryKeyJoinColumn(index); - this.entity.getSpecifiedPrimaryKeyJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(name); - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - - private IPrimaryKeyJoinColumn getSelectedJoinColumn() { - return (IPrimaryKeyJoinColumn) ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).getFirstElement(); - } - - void editPrimaryKeyJoinColumn() { - IPrimaryKeyJoinColumn joinColumn = getSelectedJoinColumn(); - PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(this.getControl().getShell(), joinColumn); - editJoinColumnFromDialog(dialog, joinColumn); - } - - private void editJoinColumnFromDialog(PrimaryKeyJoinColumnDialog dialog, IPrimaryKeyJoinColumn joinColumn) { - if (dialog.open() == Window.OK) { - editJoinColumnDialogOkd(dialog, joinColumn); - } - } - - private void editJoinColumnDialogOkd(PrimaryKeyJoinColumnDialog dialog, IPrimaryKeyJoinColumn joinColumn) { - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - - if (dialog.isDefaultNameSelected()) { - if (joinColumn.getSpecifiedName() != null) { - joinColumn.setSpecifiedName(null); - } - } - else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){ - joinColumn.setSpecifiedName(name); - } - - if (dialog.isDefaultReferencedColumnNameSelected()) { - if (joinColumn.getSpecifiedReferencedColumnName() != null) { - joinColumn.setSpecifiedReferencedColumnName(null); - } - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){ - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - - void removePrimaryKeyJoinColumn() { - ISelection selection = this.pkJoinColumnsListViewer.getSelection(); - if (selection instanceof StructuredSelection) { - for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) { - this.entity.getPrimaryKeyJoinColumns().remove(i.next()); - } - } - } - - void updatePrimaryKeyJoinColumnsEnablement() { - boolean groupEnabledState = this.entity.containsSpecifiedPrimaryKeyJoinColumns(); - enableGroup(this.pkJoinColumnsGroup, groupEnabledState); - - this.pkJoinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).isEmpty()); - this.pkJoinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).size() == 1); - } - - private void enableGroup(Group group, boolean enabled) { - group.setEnabled(enabled); - for (int i = 0; i < group.getChildren().length; i++) { - group.getChildren()[i].setEnabled(enabled); - } - } - - - public void doPopulate(EObject obj) { - this.entity = (IEntity) obj; - if (this.entity == null) { - this.pkJoinColumnsListViewer.setInput(null); - return; - } - - this.pkJoinColumnsListViewer.setInput(this.entity); - - - updatePrimaryKeyJoinColumnsEnablement(); - this.overrideDefaultJoinColumnsCheckBox.setSelection(this.entity.containsSpecifiedPrimaryKeyJoinColumns()); - } - - @Override - protected void doPopulate() { - } - - protected void engageListeners() { - if (this.entity != null) { - this.entity.eAdapters().add(this.entityListener); - for (IPrimaryKeyJoinColumn pkJoinColumn : this.entity.getPrimaryKeyJoinColumns()) { - pkJoinColumn.eAdapters().add(this.pkJoinColumnListener); - } - //this.addConnectionListener(); - } - } - - protected void disengageListeners() { - if (this.entity != null) { - //this.removeConnectionListener(); - for (IPrimaryKeyJoinColumn pkJoinColumn : this.entity.getPrimaryKeyJoinColumns()) { - pkJoinColumn.eAdapters().remove(this.pkJoinColumnListener); - } - this.entity.eAdapters().remove(this.entityListener); - } - } - - protected void entityChanged(Notification notification) { - if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS) { - if (notification.getEventType() == Notification.ADD) { - ((IPrimaryKeyJoinColumn) notification.getNewValue()).eAdapters().add(this.pkJoinColumnListener); - } - else if (notification.getEventType() == Notification.REMOVE) { - ((IPrimaryKeyJoinColumn) notification.getOldValue()).eAdapters().remove(this.pkJoinColumnListener); - } - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - pkJoinColumnsListViewer.refresh(); - overrideDefaultJoinColumnsCheckBox.setSelection(entity.containsSpecifiedPrimaryKeyJoinColumns()); - updatePrimaryKeyJoinColumnsEnablement(); - } - }); - } - } - - protected void pkJoinColumnChanged(Notification notification) { - if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME - || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - pkJoinColumnsListViewer.refresh(); - } - }); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java deleted file mode 100644 index 3afc54702d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java +++ /dev/null @@ -1,407 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -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.core.internal.mappings.IAbstractJoinColumn; -import org.eclipse.jpt.core.internal.mappings.INamedColumn; -import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.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.ui.PlatformUI; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class PrimaryKeyJoinColumnsInSecondaryTableComposite extends BaseJpaComposite -{ - private ISecondaryTable secondaryTable; - private final Adapter secondaryTableListener; - private final Adapter pkJoinColumnListener; - - ListViewer pkJoinColumnsListViewer; - - private Group pkJoinColumnsGroup; - Button overrideDefaultJoinColumnsCheckBox; - private Button pkJoinColumnsAddButton; - private Button pkJoinColumnsRemoveButton; - private Button pkJoinColumnsEditButton; - - - public PrimaryKeyJoinColumnsInSecondaryTableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.secondaryTableListener = buildSecondaryTableListener(); - this.pkJoinColumnListener = buildPkJoinColumnListener(); - } - - private Adapter buildSecondaryTableListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - secondaryTableChanged(notification); - } - }; - } - - private Adapter buildPkJoinColumnListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - pkJoinColumnChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - GridData gridData = new GridData(); - this.overrideDefaultJoinColumnsCheckBox = getWidgetFactory().createButton( - composite, - JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns, - SWT.CHECK); - this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - if (PrimaryKeyJoinColumnsInSecondaryTableComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) { - IPrimaryKeyJoinColumn defaultJoinColumn = PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.getDefaultPrimaryKeyJoinColumns().get(0); - String columnName = defaultJoinColumn.getDefaultName(); - String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName(); - - IPrimaryKeyJoinColumn pkJoinColumn = PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.createPrimaryKeyJoinColumn(0); - PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().add(pkJoinColumn); - pkJoinColumn.setSpecifiedName(columnName); - pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } else { - PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().clear(); - } - } - }); - - this.pkJoinColumnsGroup = - getWidgetFactory().createGroup( - composite, - JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn); - this.pkJoinColumnsGroup.setLayout(new GridLayout(2, false)); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - this.pkJoinColumnsGroup.setLayoutData(gridData); - - this.pkJoinColumnsListViewer = new ListViewer(this.pkJoinColumnsGroup, SWT.BORDER | SWT.MULTI); - this.pkJoinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider()); - this.pkJoinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.verticalSpan = 3; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.pkJoinColumnsListViewer.getList().setLayoutData(gridData); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.pkJoinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS); - - this.pkJoinColumnsAddButton = new Button(this.pkJoinColumnsGroup, SWT.NONE); - this.pkJoinColumnsAddButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_add); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.pkJoinColumnsAddButton.setLayoutData(gridData); - this.pkJoinColumnsAddButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - addPrimaryKeyJoinColumn(); - } - }); - - this.pkJoinColumnsEditButton = new Button(this.pkJoinColumnsGroup, SWT.NONE); - this.pkJoinColumnsEditButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_edit); - this.pkJoinColumnsEditButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - editPrimaryKeyJoinColumn(); - } - }); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.pkJoinColumnsEditButton.setLayoutData(gridData); - - this.pkJoinColumnsRemoveButton = new Button(this.pkJoinColumnsGroup, SWT.NONE); - this.pkJoinColumnsRemoveButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_remove); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.BEGINNING; - this.pkJoinColumnsRemoveButton.setLayoutData(gridData); - this.pkJoinColumnsRemoveButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - removePrimaryKeyJoinColumn(); - } - }); - - this.pkJoinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updatePrimaryKeyJoinColumnsEnablement(); - } - }); - } - - private IContentProvider buildJoinColumnsListContentProvider() { - return new IStructuredContentProvider(){ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - - public void dispose() { - // do nothing - } - - public Object[] getElements(Object inputElement) { - return ((ISecondaryTable) inputElement).getPrimaryKeyJoinColumns().toArray(); - } - }; - } - - private ILabelProvider buildJoinColumnsListLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - IPrimaryKeyJoinColumn joinColumn = (IPrimaryKeyJoinColumn) element; - return (PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.containsSpecifiedPrimaryKeyJoinColumns()) ? - buildJoinColumnLabel(joinColumn) - : - buildDefaultJoinColumnLabel(joinColumn); - } - }; - } - - String buildDefaultJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - - String buildJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) { - if (joinColumn.getSpecifiedName() == null) { - if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName()); - } - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null) { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - else { - return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName()); - } - } - - - void addPrimaryKeyJoinColumn() { - PrimaryKeyJoinColumnInSecondaryTableDialog dialog = new PrimaryKeyJoinColumnInSecondaryTableDialog(this.getControl().getShell(), this.secondaryTable); - addJoinColumnFromDialog(dialog); - } - - private void addJoinColumnFromDialog(PrimaryKeyJoinColumnInSecondaryTableDialog dialog) { - if (dialog.open() == Window.OK) { - int index = this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().size(); - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - IPrimaryKeyJoinColumn joinColumn = this.secondaryTable.createPrimaryKeyJoinColumn(index); - this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().add(joinColumn); - joinColumn.setSpecifiedName(name); - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - - private IPrimaryKeyJoinColumn getSelectedJoinColumn() { - return (IPrimaryKeyJoinColumn) ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).getFirstElement(); - } - - void editPrimaryKeyJoinColumn() { - IPrimaryKeyJoinColumn joinColumn = getSelectedJoinColumn(); - PrimaryKeyJoinColumnInSecondaryTableDialog dialog = new PrimaryKeyJoinColumnInSecondaryTableDialog(this.getControl().getShell(), joinColumn); - editJoinColumnFromDialog(dialog, joinColumn); - } - - private void editJoinColumnFromDialog(PrimaryKeyJoinColumnInSecondaryTableDialog dialog, IPrimaryKeyJoinColumn joinColumn) { - if (dialog.open() == Window.OK) { - editJoinColumnDialogOkd(dialog, joinColumn); - } - } - - private void editJoinColumnDialogOkd(PrimaryKeyJoinColumnInSecondaryTableDialog dialog, IPrimaryKeyJoinColumn joinColumn) { - String name = dialog.getSelectedName(); - String referencedColumnName = dialog.getReferencedColumnName(); - - if (dialog.isDefaultNameSelected()) { - if (joinColumn.getSpecifiedName() != null) { - joinColumn.setSpecifiedName(null); - } - } - else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){ - joinColumn.setSpecifiedName(name); - } - - if (dialog.isDefaultReferencedColumnNameSelected()) { - if (joinColumn.getSpecifiedReferencedColumnName() != null) { - joinColumn.setSpecifiedReferencedColumnName(null); - } - } - else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){ - joinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - - void removePrimaryKeyJoinColumn() { - ISelection selection = this.pkJoinColumnsListViewer.getSelection(); - if (selection instanceof StructuredSelection) { - for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) { - this.secondaryTable.getPrimaryKeyJoinColumns().remove(i.next()); - } - } - } - - void updatePrimaryKeyJoinColumnsEnablement() { - boolean groupEnabledState = this.secondaryTable.containsSpecifiedPrimaryKeyJoinColumns(); - enableGroup(this.pkJoinColumnsGroup, groupEnabledState); - - this.pkJoinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).isEmpty()); - this.pkJoinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).size() == 1); - } - - private void enableGroup(Group group, boolean enabled) { - group.setEnabled(enabled); - for (int i = 0; i < group.getChildren().length; i++) { - group.getChildren()[i].setEnabled(enabled); - } - } - - - public void doPopulate(EObject obj) { - this.secondaryTable = (ISecondaryTable) obj; - if (this.secondaryTable == null) { - this.pkJoinColumnsListViewer.setInput(null); - return; - } - - this.pkJoinColumnsListViewer.setInput(this.secondaryTable); - - - updatePrimaryKeyJoinColumnsEnablement(); - this.overrideDefaultJoinColumnsCheckBox.setSelection(this.secondaryTable.containsSpecifiedPrimaryKeyJoinColumns()); - } - - @Override - protected void doPopulate() { - } - - protected void engageListeners() { - if (this.secondaryTable != null) { - this.secondaryTable.eAdapters().add(this.secondaryTableListener); - for (IPrimaryKeyJoinColumn pkJoinColumn : this.secondaryTable.getPrimaryKeyJoinColumns()) { - pkJoinColumn.eAdapters().add(this.pkJoinColumnListener); - } - } - } - - protected void disengageListeners() { - if (this.secondaryTable != null) { - for (IPrimaryKeyJoinColumn pkJoinColumn : this.secondaryTable.getPrimaryKeyJoinColumns()) { - pkJoinColumn.eAdapters().remove(this.pkJoinColumnListener); - } - this.secondaryTable.eAdapters().remove(this.secondaryTableListener); - } - } - - protected void secondaryTableChanged(Notification notification) { - if (notification.getFeatureID(ISecondaryTable.class) == JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS) { - if (notification.getEventType() == Notification.ADD) { - ((IPrimaryKeyJoinColumn) notification.getNewValue()).eAdapters().add(this.pkJoinColumnListener); - } - else if (notification.getEventType() == Notification.REMOVE) { - ((IPrimaryKeyJoinColumn) notification.getOldValue()).eAdapters().remove(this.pkJoinColumnListener); - } - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - pkJoinColumnsListViewer.refresh(); - overrideDefaultJoinColumnsCheckBox.setSelection(secondaryTable.containsSpecifiedPrimaryKeyJoinColumns()); - updatePrimaryKeyJoinColumnsEnablement(); - } - }); - } - } - - protected void pkJoinColumnChanged(Notification notification) { - if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME - || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME - || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - pkJoinColumnsListViewer.refresh(); - } - }); - } - } - - protected void enableWidgets(boolean enabled) { - this.pkJoinColumnsListViewer.getControl().setEnabled(enabled); - this.overrideDefaultJoinColumnsCheckBox.setEnabled(enabled); - this.pkJoinColumnsEditButton.setEnabled(enabled); - this.pkJoinColumnsRemoveButton.setEnabled(enabled); - this.pkJoinColumnsAddButton.setEnabled(enabled); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java deleted file mode 100644 index 9655c2202a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java +++ /dev/null @@ -1,327 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class SchemaCombo extends BaseJpaController -{ - private ITable table; - - private Adapter listener; - - /** - * Caching the connectionProfile so we can remove the listener. If the - * cached table object has been removed from the model then we no longer - * have access to the parent and cannot find the connectionProfile - */ - private ConnectionProfile connectionProfile; - - private ConnectionListener connectionListener; - - private CCombo combo; - - public SchemaCombo(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - this.listener = this.buildTableListener(); - this.connectionListener = this.buildConnectionListener(); - } - - private Adapter buildTableListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - SchemaCombo.this.schemaChanged(notification); - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public void closed(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateShemaCombo(); - } - }); - } - - public void modified(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateShemaCombo(); - } - }); - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void opened(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateShemaCombo(); - } - }); - } - - public void databaseChanged(Connection connection, final Database database) { - getControl().getDisplay().asyncExec(new Runnable() { - public void run() { - if (database == SchemaCombo.this.getDatabase()) { - if (!getControl().isDisposed()) { - SchemaCombo.this.populateShemaCombo(); - } - } - } - }); - } - - public void schemaChanged(Connection connection, final Schema schema) { - getControl().getDisplay().asyncExec(new Runnable() { - public void run() { - if (schema == SchemaCombo.this.getTableSchema()) { - if (!getControl().isDisposed()) { - SchemaCombo.this.populateShemaCombo(); - } - } - } - }); - } - - public void tableChanged(Connection connection, final Table table) { - // not interested to this event. - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - this.combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty); - this.combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String schemaText = ((CCombo) e.getSource()).getText(); - if (schemaText.equals("")) { //$NON-NLS-1$ - schemaText = null; - if (SchemaCombo.this.table.getSpecifiedSchema() == null || SchemaCombo.this.table.getSpecifiedSchema().equals("")) { //$NON-NLS-1$ - return; - } - } - if (schemaText != null && combo.getItemCount() > 0 && schemaText.equals(combo.getItem(0))) { - schemaText = null; - } - if (SchemaCombo.this.table.getSpecifiedSchema() == null && schemaText != null) { - SchemaCombo.this.table.setSpecifiedSchema(schemaText); - } - if (SchemaCombo.this.table.getSpecifiedSchema() != null && !SchemaCombo.this.table.getSpecifiedSchema().equals(schemaText)) { - SchemaCombo.this.table.setSpecifiedSchema(schemaText); - } - } - }); - } - - protected void schemaChanged(Notification notification) { - if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateSchemaName(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateDefaultSchemaName(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateShemaCombo(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - SchemaCombo.this.populateShemaCombo(); - } - }); - } - } - - public void doPopulate(EObject obj) { - this.table = (ITable) obj; - if (this.table != null) { - this.populateShemaCombo(); - } - else { - this.connectionProfile = null; - } - } - - public void doPopulate() { - this.populateShemaCombo(); - } - - protected Database getDatabase() { - return this.getConnectionProfile().getDatabase(); - } - - private ConnectionProfile getConnectionProfile() { - if (this.connectionProfile == null) { - this.connectionProfile = this.table.getJpaProject().connectionProfile(); - } - return this.connectionProfile; - } - - private void populateShemaCombo() { - if (this.table == null) { - return; - } - this.populateDefaultSchemaName(); - if (this.getConnectionProfile().isConnected()) { - this.combo.remove(1, this.combo.getItemCount() - 1); - Database database = this.getDatabase(); - if (database != null) { - Iterator schemata = database.schemaNames(); - for (Iterator stream = CollectionTools.sort(schemata); stream.hasNext();) { - this.combo.add(stream.next()); - } - } - } - else { - this.combo.remove(1, this.combo.getItemCount() - 1); - } - this.populateSchemaName(); - } - - protected void populateDefaultSchemaName() { - String defaultSchemaName = this.table.getDefaultSchema(); - int selectionIndex = combo.getSelectionIndex(); - combo.setItem(0, NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultSchemaName)); - if (selectionIndex == 0) { - combo.clearSelection(); - combo.select(0); - } - } - - protected void populateSchemaName() { - if (this.table == null) { - return; - } - String schemaName = this.table.getSpecifiedSchema(); - String defaultSchemaName = this.table.getDefaultSchema(); - if (!StringTools.stringIsEmpty(schemaName)) { - if (!this.combo.getText().equals(schemaName)) { - this.combo.setText(schemaName); - } - } - else { - if (!this.combo.getText().equals(NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultSchemaName))) { - this.combo.select(0); - } - } - } - - public CCombo getCombo() { - return this.combo; - } - - @Override - public Control getControl() { - return getCombo(); - } - - protected Schema getTableSchema() { - return this.getConnectionProfile().getDatabase().schemaNamed(table.getSchema()); - } - - @Override - protected void disengageListeners() { - if (this.table != null) { - this.removeConnectionListener(); - this.table.eAdapters().remove(this.listener); - } - } - - @Override - protected void engageListeners() { - if (this.table != null) { - this.table.eAdapters().add(this.listener); - this.addConnectionListener(); - } - } - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java deleted file mode 100644 index 14be07b492..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java +++ /dev/null @@ -1,247 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.osgi.util.NLS; -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; - -public class SecondaryTableDialog extends Dialog { - - //if creating a new JoinColumn, this will be null, - //specify the JoinColumnOwner instead in the appropriate construtor - private ISecondaryTable secondaryTable; - private IEntity entity; - - protected Combo nameCombo; - protected Combo catalogCombo; - protected Combo schemaCombo; - - private String selectedName; - private String selectedSchema; - private String selectedCatalog; - - private boolean defaultSchemaSelected; - private boolean defaultCatalogSelected; - - SecondaryTableDialog(Shell parent, IEntity entity) { - super(parent); - this.entity = entity; - } - - SecondaryTableDialog(Shell parent, ISecondaryTable secondaryTable, IEntity entity) { - super(parent); - this.secondaryTable = secondaryTable; - this.entity = entity; - } - - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(getTitle()); - } - - protected String getTitle() { - return JptUiMappingsMessages.SecondaryTableDialog_editSecondaryTable; - } - - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - GridLayout gridLayout = (GridLayout) composite.getLayout(); - gridLayout.numColumns = 2; - - Label nameLabel = new Label(composite, SWT.LEFT); - nameLabel.setText(JptUiMappingsMessages.SecondaryTableDialog_name); - GridData gridData = new GridData(); - nameLabel.setLayoutData(gridData); - - this.nameCombo = new Combo(composite, SWT.LEFT); - gridData = new GridData(); - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = SWT.FILL; - this.nameCombo.setLayoutData(gridData); - populateNameCombo(); - - Label catalogLabel = new Label(composite, SWT.LEFT); - catalogLabel.setText(JptUiMappingsMessages.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); - populateCatalogCombo(); - - Label schemaLabel = new Label(composite, SWT.LEFT); - schemaLabel.setText(JptUiMappingsMessages.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); - populateSchemaCombo(); - - return composite; - } - - protected Database getDatabase() { - return this.getConnectionProfile().getDatabase(); - } - - private ConnectionProfile getConnectionProfile() { - IJpaProject project = (this.secondaryTable == null) ? this.entity.getJpaProject() : this.secondaryTable.getJpaProject(); - return project.connectionProfile(); - } - - protected Schema getTableSchema() { - Database database = this.getDatabase(); - if (database != null) { - if (this.secondaryTable != null) { - return database.schemaNamed(this.secondaryTable.getSchema()); - } - return database.schemaNamed(this.entity.getTable().getSchema()); - } - return null; - } - - protected void populateNameCombo() { - Schema schema = this.getTableSchema(); - if (schema != null) { - Iterator tables = schema.tableNames(); - for (Iterator stream = CollectionTools.sort( tables); stream.hasNext(); ) { - this.nameCombo.add(stream.next()); - } - } - - if (getSecondaryTable() != null) { - if (getSecondaryTable().getSpecifiedName() != null) { - this.nameCombo.setText(getSecondaryTable().getSpecifiedName()); - } - } - } - - protected void populateSchemaCombo() { - if (getSecondaryTable() != null) { - this.schemaCombo.add(NLS.bind(JptUiMappingsMessages.SecondaryTableDialog_defaultSchema, getSecondaryTable().getDefaultSchema())); - } - - Database database = this.getDatabase(); - - if (database != null) { - Iterator schemata = database.schemaNames(); - for (Iterator stream = CollectionTools.sort(schemata); stream.hasNext(); ) { - this.schemaCombo.add(stream.next()); - } - } - - if (getSecondaryTable() != null) { - if (getSecondaryTable().getSpecifiedSchema() != null) { - this.schemaCombo.setText(getSecondaryTable().getSpecifiedSchema()); - } - else { - this.schemaCombo.select(0); - } - } - } - - protected void populateCatalogCombo() { - if (getSecondaryTable() != null) { - this.catalogCombo.add(NLS.bind(JptUiMappingsMessages.SecondaryTableDialog_defaultCatalog, getSecondaryTable().getDefaultCatalog())); - } - Database database = this.getDatabase(); - - if (database != null) { - Iterator catalogs = database.catalogNames(); - for (Iterator stream = CollectionTools.sort(catalogs); stream.hasNext(); ) { - this.catalogCombo.add(stream.next()); - } - } - - if (getSecondaryTable() != null) { - if (getSecondaryTable().getSpecifiedCatalog() != null) { - this.catalogCombo.setText(getSecondaryTable().getSpecifiedCatalog()); - } - else { - this.catalogCombo.select(0); - } - } - } - - protected Combo getNameCombo() { - return this.nameCombo; - } - - protected Combo getSchemaCombo() { - return this.schemaCombo; - } - - protected Combo getCatalogCombo() { - return this.catalogCombo; - } - - protected ISecondaryTable getSecondaryTable() { - return this.secondaryTable; - } - - - protected String getSelectedName() { - return this.selectedName; - } - - protected String getSelectedCatalog() { - return this.selectedCatalog; - } - - protected String getSelectedSchema() { - return this.selectedSchema; - } - - protected boolean isDefaultSchemaSelected() { - return this.defaultSchemaSelected; - } - - protected boolean isDefaultCatalogSelected() { - return this.defaultCatalogSelected; - } - - public boolean close() { - this.selectedName = this.nameCombo.getText(); - this.selectedSchema = this.schemaCombo.getText(); - if (this.selectedSchema.equals("")) { - this.selectedSchema = null; - } - this.selectedCatalog = this.catalogCombo.getText(); - if (this.selectedCatalog.equals("")) { - this.selectedCatalog = null; - } - this.defaultSchemaSelected = this.schemaCombo.getSelectionIndex() == 0; - this.defaultCatalogSelected = this.catalogCombo.getSelectionIndex() == 0; - return super.close(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java deleted file mode 100644 index 2ff149d987..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java +++ /dev/null @@ -1,382 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.ListViewer; -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.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.ISecondaryTable; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -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.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -//TODO handle xml, how to handle virtual secondaryTables, adding them to xml, are they overriden, etc?? -public class SecondaryTablesComposite extends BaseJpaComposite -{ - private IEntity entity; - private final Adapter entityListener; - private final Adapter secondaryTableListener; - - ListViewer secondaryTablesListViewer; - - private Button addButton; - private Button editButton; - private Button removeButton; - - private PrimaryKeyJoinColumnsInSecondaryTableComposite pkJoinColumnsComposite; - - public SecondaryTablesComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - this.entityListener = buildEntityListener(); - this.secondaryTableListener = buildSecondaryTableListener(); - } - - private Adapter buildEntityListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - entityChanged(notification); - } - }; - } - - private Adapter buildSecondaryTableListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - seoncaryTableChanged(notification); - } - }; - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - composite.setLayout(layout); - - GridData gridData = new GridData(); - - Composite secondaryTablesComposite = new Composite(composite, SWT.NONE); - layout = new GridLayout(3, false); - layout.marginWidth = 0; - secondaryTablesComposite.setLayout(layout); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - secondaryTablesComposite.setLayoutData(gridData); - - this.secondaryTablesListViewer = buildSecondaryTablesListViewer(secondaryTablesComposite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.horizontalSpan = 3; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.secondaryTablesListViewer.getList().setLayoutData(gridData); - //PlatformUI.getWorkbench().getHelpSystem().setHelp(this.secondaryTablesListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS); - - Composite buttonsComposite = new Composite(secondaryTablesComposite, SWT.NONE); - layout = new GridLayout(3, false); - layout.marginWidth = 0; - buttonsComposite.setLayout(layout); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.END; - buttonsComposite.setLayoutData(gridData); - - this.addButton = new Button(buttonsComposite, SWT.NONE); - this.addButton.setText(JptUiMappingsMessages.SecondaryTablesComposite_add); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.addButton.setLayoutData(gridData); - this.addButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - addSecondaryTable(); - } - }); - - this.editButton = new Button(buttonsComposite, SWT.NONE); - this.editButton.setText(JptUiMappingsMessages.SecondaryTablesComposite_edit); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - this.editButton.setLayoutData(gridData); - this.editButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - editSecondaryTable(); - } - }); - - this.removeButton = new Button(buttonsComposite, SWT.NONE); - this.removeButton.setText(JptUiMappingsMessages.SecondaryTablesComposite_remove); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.BEGINNING; - this.removeButton.setLayoutData(gridData); - this.removeButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - removeSecondaryTable(); - } - }); - - this.pkJoinColumnsComposite = new PrimaryKeyJoinColumnsInSecondaryTableComposite(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - this.pkJoinColumnsComposite.getControl().setLayoutData(gridData); - } - - private ListViewer buildSecondaryTablesListViewer(Composite parent) { - ListViewer listViewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER); - listViewer.setLabelProvider(buildSecondaryTablesListLabelProvider()); - listViewer.setContentProvider(buildSecondaryTablesListContentProvider()); - - listViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updateEnablement(); - secondaryTablesListSelectionChanged(event); - } - }); - - return listViewer; - } - - protected void secondaryTablesListSelectionChanged(SelectionChangedEvent event) { - if (((StructuredSelection) event.getSelection()).isEmpty()) { - this.pkJoinColumnsComposite.populate(null); - this.pkJoinColumnsComposite.enableWidgets(false); - } - else { - ISecondaryTable selectedSecondaryTable = getSelectedSecondaryTable(); - this.pkJoinColumnsComposite.populate(selectedSecondaryTable); - this.pkJoinColumnsComposite.enableWidgets(true); - } - } - - private IContentProvider buildSecondaryTablesListContentProvider() { - return new IStructuredContentProvider(){ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - - public void dispose() { - // do nothing - } - - public Object[] getElements(Object inputElement) { - return ((IEntity) inputElement).getSecondaryTables().toArray(); - } - }; - } - - private ILabelProvider buildSecondaryTablesListLabelProvider() { - return new LabelProvider() { - public String getText(Object element) { - //TODO display a qualified name instead - ISecondaryTable secondaryTable = (ISecondaryTable) element; - return secondaryTable.getName(); - } - }; - } - - void addSecondaryTable() { - SecondaryTableDialog dialog = new SecondaryTableDialog(this.getControl().getShell(), this.entity); - addSecondaryTableFromDialog(dialog); - } - - private void addSecondaryTableFromDialog(SecondaryTableDialog dialog) { - if (dialog.open() == Window.OK) { - int index = this.entity.getSpecifiedSecondaryTables().size(); - String name = dialog.getSelectedName(); - String catalog = dialog.getSelectedCatalog(); - String schema = dialog.getSelectedSchema(); - ISecondaryTable secondaryTable = this.entity.createSecondaryTable(index); - this.entity.getSpecifiedSecondaryTables().add(secondaryTable); - secondaryTable.setSpecifiedName(name); - secondaryTable.setSpecifiedCatalog(catalog); - secondaryTable.setSpecifiedSchema(schema); - - this.secondaryTablesListViewer.setSelection(new StructuredSelection(secondaryTable)); - } - } - - void editSecondaryTable() { - ISecondaryTable secondaryTable = getSelectedSecondaryTable(); - SecondaryTableDialog dialog = new SecondaryTableDialog(this.getControl().getShell(), secondaryTable, this.entity); - editSecondaryTableFromDialog(dialog, secondaryTable); - } - - private void editSecondaryTableFromDialog(SecondaryTableDialog dialog, ISecondaryTable secondaryTable) { - if (dialog.open() == Window.OK) { - editSecondaryTableDialogOkd(dialog, secondaryTable); - } - } - - private void editSecondaryTableDialogOkd(SecondaryTableDialog dialog, ISecondaryTable secondaryTable) { - String name = dialog.getSelectedName(); - String catalog = dialog.getSelectedCatalog(); - String schema = dialog.getSelectedSchema(); - - if (secondaryTable.getSpecifiedName() == null || !secondaryTable.getSpecifiedName().equals(name)){ - secondaryTable.setSpecifiedName(name); - } - - if (dialog.isDefaultCatalogSelected()) { - if (secondaryTable.getSpecifiedCatalog() != null) { - secondaryTable.setSpecifiedCatalog(null); - } - } - else if (secondaryTable.getSpecifiedCatalog() == null || !secondaryTable.getSpecifiedCatalog().equals(catalog)){ - secondaryTable.setSpecifiedCatalog(catalog); - } - - if (dialog.isDefaultSchemaSelected()) { - if (secondaryTable.getSpecifiedSchema() != null) { - secondaryTable.setSpecifiedSchema(null); - } - } - else if (secondaryTable.getSpecifiedSchema() == null || !secondaryTable.getSpecifiedSchema().equals(schema)){ - secondaryTable.setSpecifiedSchema(schema); - } - } - - private ISecondaryTable getSelectedSecondaryTable() { - return (ISecondaryTable) ((StructuredSelection) this.secondaryTablesListViewer.getSelection()).getFirstElement(); - } - - - void removeSecondaryTable() { - ISelection selection = this.secondaryTablesListViewer.getSelection(); - if (selection instanceof StructuredSelection) { - for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) { - this.entity.getSpecifiedSecondaryTables().remove(i.next()); - } - } - } - - void updateEnablement() { - this.editButton.setEnabled(!((StructuredSelection) this.secondaryTablesListViewer.getSelection()).isEmpty()); - this.removeButton.setEnabled(!((StructuredSelection) this.secondaryTablesListViewer.getSelection()).isEmpty()); - } - - public void doPopulate(EObject obj) { - this.entity = (IEntity) obj; - if (this.entity == null) { - this.secondaryTablesListViewer.setInput(null); - return; - } - - this.secondaryTablesListViewer.setInput(this.entity); - if (!this.entity.getSecondaryTables().isEmpty()) { - this.secondaryTablesListViewer.setSelection(new StructuredSelection(this.entity.getSecondaryTables().get(0))); - } - else { - this.secondaryTablesListViewer.setSelection(null); - } - updateEnablement(); - } - - @Override - protected void doPopulate() { - } - - protected void engageListeners() { - if (this.entity != null) { - this.entity.eAdapters().add(this.entityListener); - for (ISecondaryTable secondaryTable : this.entity.getSecondaryTables()) { - secondaryTable.eAdapters().add(this.secondaryTableListener); - } - } - } - - protected void disengageListeners() { - if (this.entity != null) { - for (ISecondaryTable secondaryTable : this.entity.getSecondaryTables()) { - secondaryTable.eAdapters().remove(this.secondaryTableListener); - } - this.entity.eAdapters().remove(this.entityListener); - } - } - - protected void entityChanged(Notification notification) { - if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES) { - if (notification.getEventType() == Notification.ADD) { - ((ISecondaryTable) notification.getNewValue()).eAdapters().add(this.secondaryTableListener); - } - else if (notification.getEventType() == Notification.REMOVE) { - ((ISecondaryTable) notification.getOldValue()).eAdapters().remove(this.secondaryTableListener); - } - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - secondaryTablesListViewer.refresh(); - updateEnablement(); - } - }); - } - } - - protected void seoncaryTableChanged(Notification notification) { - if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME - || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG - || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA - || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG - || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - secondaryTablesListViewer.refresh(); - } - }); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java deleted file mode 100644 index 9be54c3668..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java +++ /dev/null @@ -1,185 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -/** - * SequenceGeneratorComposite - */ -public class SequenceGeneratorComposite extends GeneratorComposite -{ - private CCombo sequenceNameCombo; - - private ModifyListener sequenceNameComboListener; - - private ConnectionProfile connectionProfile; - - public SequenceGeneratorComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, commandStack, widgetFactory); - } - - protected ISequenceGenerator createGenerator() { - ISequenceGenerator sequenceGenerator = idMapping().createSequenceGenerator(); - idMapping().setSequenceGenerator(sequenceGenerator); - return sequenceGenerator; - } - - protected ISequenceGenerator generator(IId idMapping) { - return idMapping.getSequenceGenerator(); - } - - @Override - protected void initializeLayout(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - GridLayout layout = new GridLayout(2, false); - composite.setLayout(layout); - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.SequenceGeneratorComposite_name); - - this.nameTextWidget = buildNameText(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.nameTextWidget.setLayoutData(gridData); - helpSystem.setHelp(this.nameTextWidget, IJpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_NAME); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.SequenceGeneratorComposite_sequence); - - this.sequenceNameCombo = buildSequenceNameCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.sequenceNameCombo.setLayoutData(gridData); - helpSystem.setHelp(sequenceNameCombo, IJpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SEQUENCE); - } - - private CCombo buildSequenceNameCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(""); //$NON-NLS-1$ - combo.select(0); - combo.addModifyListener(getSequenceNameListener()); - return combo; - } - - private ModifyListener getSequenceNameListener() { - if (this.sequenceNameComboListener == null) { - this.sequenceNameComboListener = new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String text = ((CCombo) e.getSource()).getText(); - if (text != null && sequenceNameCombo.getItemCount() > 0 && text.equals(sequenceNameCombo.getItem(0))) { - text = null; - } - ISequenceGenerator generator = getGenerator(); - if (generator == null) { - generator = createGenerator(); - } - generator.setSpecifiedSequenceName(text); - } - }; - } - return this.sequenceNameComboListener; - } - - protected void generatorChanged(Notification notification) { - super.generatorChanged(notification); - if (notification.getFeatureID(ISequenceGenerator.class) == JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - String sequenceName = getGenerator().getSpecifiedSequenceName(); - if (sequenceName == null) { - sequenceNameCombo.select(0); - } - else if (!sequenceNameCombo.getText().equals(sequenceName)) { - sequenceNameCombo.setText(sequenceName); - } - } - }); - } - } - - @Override - protected void doPopulate(EObject obj) { - super.doPopulate(obj); - if (obj == null) { - return; - } - populateSequenceNameCombo(); - } - - @Override - protected void doPopulate() { - populateSequenceNameCombo(); - } - - private ConnectionProfile getConnectionProfile() { - if(this.connectionProfile == null) { - IJpaProject jpaProject = getGenerator().getJpaProject(); - this.connectionProfile = jpaProject.connectionProfile(); - } - return this.connectionProfile; - } - - private void populateSequenceNameCombo() { - if (this.getGenerator() == null) { - return; - } - this.sequenceNameCombo.setItem(0, JptUiMappingsMessages.SequenceGeneratorComposite_default); - if (this.getConnectionProfile().isConnected()) { -// this.sequenceNameCombo.remove(1, this.sequenceNameCombo.getItemCount() - 1); -// Schema schema = getConnectionProfile().getDatabase().schemaNamed(getGenerator().getJpaProject().getSchemaName()); -// if (schema != null) { -// for (Iterator stream = CollectionTools.sort(schema.sequenceNames()); stream.hasNext();) { -// this.sequenceNameCombo.add((String) stream.next()); -// } -// } - } - String sequenceName = this.getGenerator().getSpecifiedSequenceName(); - if (sequenceName != null) { - if (!this.sequenceNameCombo.getText().equals(sequenceName)) { - this.sequenceNameCombo.setText(sequenceName); - } - } - else { - this.sequenceNameCombo.select(0); - } - } - - protected void clear() { - super.clear(); - this.sequenceNameCombo.select(0); - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java deleted file mode 100644 index 57c7624201..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java +++ /dev/null @@ -1,274 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.IContentProvider; -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.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class StringWithDefaultChooser extends BaseJpaController -{ - private StringHolder stringHolder; - private Adapter stringHolderListener; - - private CComboViewer comboViewer; - - private static final String DEFAULT = "default"; - - - public StringWithDefaultChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildStringHolderListener(); - } - - - private void buildStringHolderListener() { - this.stringHolderListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - stringHolderChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - this.comboViewer = new CComboViewer(combo); - this.comboViewer.setContentProvider(buildContentProvider()); - this.comboViewer.setLabelProvider(buildLabelProvider()); - - this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - StringWithDefaultChooser.this.selectionChanged(event.getSelection()); - } - }); - - combo.addModifyListener( - new ModifyListener() { - public void modifyText(ModifyEvent e) { - comboModified(e); - } - }); - } - - private IContentProvider buildContentProvider() { - return new IStructuredContentProvider(){ - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - public void dispose() { - } - - public Object[] getElements(Object inputElement) { - return new String[] {DEFAULT}; - } - }; - } - - - private IBaseLabelProvider buildLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == DEFAULT && stringHolder.wrappedObject() != null) { - return stringHolder.defaultItem(); - } - return super.getText(element); - } - }; - } - void selectionChanged(ISelection sel) { - if (isPopulating()) { - return; - } - - if (sel instanceof IStructuredSelection) { - String selection = (String) ((IStructuredSelection) sel).getFirstElement(); - if (this.comboViewer.getCombo().getSelectionIndex() == 0) { - selection = null; - } - if (this.stringHolder.getString() == null) { - if (selection != null) { - this.stringHolder.setString(selection); - } - } - else if (!this.stringHolder.getString().equals(selection)) { - this.stringHolder.setString(selection); - } - } - } - - private void comboModified(ModifyEvent e) { - if (isPopulating()) { - return; - } - CCombo combo = (CCombo) e.getSource(); - combo.getSelectionIndex(); - String text = combo.getText(); - - if (text != null && combo.getItemCount() > 0 && text.equals(combo.getItem(0))) { - text = null; - } - if (this.stringHolder.getString() != text) { - this.stringHolder.setString(text); - } - } - - private void stringHolderChanged(Notification notification) { - if (notification.getFeatureID(this.stringHolder.featureClass()) == - this.stringHolder.featureId()) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getCombo().isDisposed()) { - return; - } - populate(); - } - }); - } - else if (this.stringHolder.supportsDefault()) { - if (notification.getFeatureID(this.stringHolder.featureClass()) == - this.stringHolder.defaultFeatureId()) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - if (getCombo().isDisposed()) { - return; - } - populate(); - } - }); - - } - } - } - - @Override - protected void engageListeners() { - if (this.stringHolder != null && this.stringHolder.wrappedObject() != null) { - this.stringHolder.wrappedObject().eAdapters().add(this.stringHolderListener); - } - } - - @Override - protected void disengageListeners() { - if (this.stringHolder != null && this.stringHolder.wrappedObject() != null) { - this.stringHolder.wrappedObject().eAdapters().remove(this.stringHolderListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.stringHolder = (StringHolder) obj; - this.comboViewer.setInput(this.stringHolder); - populateCombo(); - } - - @Override - protected void doPopulate() { - populateCombo(); - } - - private void populateCombo() { - if (this.stringHolder.wrappedObject() == null) { - this.comboViewer.setSelection(StructuredSelection.EMPTY); - return; - } - this.comboViewer.update(this.comboViewer.getElementAt(0), null); - - String string = this.stringHolder.getString(); - if (string == null) { - if (((StructuredSelection) this.comboViewer.getSelection()).getFirstElement() == DEFAULT) { - this.comboViewer.refresh(); - } - else { - this.comboViewer.setSelection(new StructuredSelection(DEFAULT)); - } - } - else { - if (!this.comboViewer.getCombo().getText().equals(string)) { - this.comboViewer.getCombo().setText(string); - } - } - } - - public CCombo getCombo() { - return this.comboViewer.getCombo(); - } - - @Override - public Control getControl() { - return getCombo(); - } - /** - * An interface to wrap an object that supports a string with a default setting - * An object of this type must be passed in to populate(EObject) - */ - public static interface StringHolder extends EObject { - /** - * Return the string setting from the wrapped object - * @return - */ - String getString(); - - /** - * Set the string setting on the wrapped object - * @param string - */ - void setString(String string); - - /** - * Return the Class of the wrapped object - * @return - */ - Class featureClass(); - - /** - * Return the feature id of string setting on the wrapped object - * @return - */ - int featureId(); - - boolean supportsDefault(); - - int defaultFeatureId(); - - /** - * The wrapped EObject that the enum setting is stored on - * @return - */ - EObject wrappedObject(); - - String defaultItem(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java deleted file mode 100644 index 3304743c00..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java +++ /dev/null @@ -1,338 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class TableCombo extends BaseJpaController -{ - private ITable table; - - private Adapter listener; - - /** - * Caching the connectionProfile so we can remove the listener. If the - * cached table object has been removed from the model then we no longer - * have access to parent and cannot find the connectionProfile - */ - private ConnectionProfile connectionProfile; - - private ConnectionListener connectionListener; - - private CCombo combo; - - public TableCombo(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - this.listener = buildTableListener(); - this.connectionListener = buildConnectionListener(); - } - - private Adapter buildTableListener() { - return new AdapterImpl() { - public void notifyChanged(Notification notification) { - tableChanged(notification); - } - }; - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public void closed(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - TableCombo.this.populateTableCombo(); - } - }); - } - - public void modified(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - TableCombo.this.populateTableCombo(); - } - }); - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void opened(Connection connection) { - getCombo().getDisplay().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - TableCombo.this.populateTableCombo(); - } - }); - } - - public void databaseChanged(Connection connection, final Database database) { - getControl().getDisplay().asyncExec(new Runnable() { - public void run() { - if (database == TableCombo.this.getDatabase()) { - if (!getControl().isDisposed()) { - TableCombo.this.populateTableCombo(); - } - } - } - }); - } - - public void schemaChanged(Connection connection, final Schema schema) { - getControl().getDisplay().asyncExec(new Runnable() { - public void run() { - if (schema == TableCombo.this.getTableSchema()) { - if (!getControl().isDisposed()) { - TableCombo.this.populateTableCombo(); - } - } - } - }); - } - - public void tableChanged(Connection connection, final Table table) { - // not interested to this event. - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - this.combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty); - this.combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String tableText = ((CCombo) e.getSource()).getText(); - if (tableText.equals("")) { //$NON-NLS-1$ - tableText = null; - if (table.getSpecifiedName() == null || table.getSpecifiedName().equals("")) { //$NON-NLS-1$ - return; - } - } - if (tableText != null && combo.getItemCount() > 0 && tableText.equals(combo.getItem(0))) { - tableText = null; - } - if (table.getSpecifiedName() == null && tableText != null) { - table.setSpecifiedName(tableText); - } - if (table.getSpecifiedName() != null && !table.getSpecifiedName().equals(tableText)) { - table.setSpecifiedName(tableText); - } - } - }); - } - - protected void tableChanged(Notification notification) { - if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateTableName(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateDefaultTableName(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateTableCombo(); - } - }); - } - else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateTableCombo(); - } - }); - } - } - - public void doPopulate(EObject obj) { - this.table = (ITable) obj; - if (this.table != null) { - populateTableCombo(); - } - else { - this.connectionProfile = null; - } - } - - public void doPopulate() { - if (this.table != null) { - populateTableCombo(); - } - } - - protected Database getDatabase() { - return getConnectionProfile().getDatabase(); - } - - protected Schema getTableSchema() { - return getConnectionProfile().getDatabase().schemaNamed(table.getSchema()); - } - - private ConnectionProfile getConnectionProfile() { - if (this.connectionProfile == null) { - this.connectionProfile = this.table.getJpaProject().connectionProfile(); - } - return this.connectionProfile; - } - - private void populateTableCombo() { - if (this.table == null) { - return; - } - // TODO don't do instanceof check here - check on Table, or isRoot check - // on Entity - // this.tableCombo.setEnabled(!(this.table instanceof - // SingleTableInheritanceChildTableImpl)); - populateDefaultTableName(); - if (getConnectionProfile().isConnected()) { - this.combo.remove(1, this.combo.getItemCount() - 1); - Schema schema = this.getTableSchema(); - if (schema != null) { - Iterator tables = schema.tableNames(); - for (Iterator stream = CollectionTools.sort(tables); stream.hasNext();) { - this.combo.add(stream.next()); - } - } - } - else { - this.combo.remove(1, this.combo.getItemCount() - 1); - } - populateTableName(); - } - - protected void populateDefaultTableName() { - if (this.table == null) { - return; - } - String defaultTableName = table.getDefaultName(); - int selectionIndex = combo.getSelectionIndex(); - combo.setItem(0, NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultTableName)); - if (selectionIndex == 0) { - // combo text does not update when switching between 2 mappings of - // the same type - // that both have a default column name. clear the selection and - // then set it again - combo.clearSelection(); - combo.select(0); - } - } - - protected void populateTableName() { - if (this.table == null) { - return; - } - String tableName = this.table.getSpecifiedName(); - String defaultTableName = this.table.getDefaultName(); - if (tableName != null) { - if (!this.combo.getText().equals(tableName)) { - this.combo.setText(tableName); - } - } - else { - if (!this.combo.getText().equals(NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultTableName))) { - this.combo.select(0); - } - } - } - - public CCombo getCombo() { - return this.combo; - } - - @Override - public Control getControl() { - return getCombo(); - } - - @Override - protected void disengageListeners() { - if (this.table != null) { - this.removeConnectionListener(); - this.table.eAdapters().remove(this.listener); - } - } - - @Override - protected void engageListeners() { - if (this.table != null) { - this.table.eAdapters().add(this.listener); - this.addConnectionListener(); - } - } - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java deleted file mode 100644 index cc6f99ae00..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.mappings.ITable; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -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.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -//TODO repopulate this panel based on the Entity table changing -public class TableComposite extends BaseJpaComposite -{ - private ITable table; - - protected TableCombo tableCombo; - - protected CatalogCombo catalogCombo; - protected SchemaCombo schemaCombo; - - public TableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - composite.setLayout(layout); - - Group columnGroup = getWidgetFactory().createGroup(composite, JptUiMappingsMessages.TableComposite_tableSection); - layout = new GridLayout(); - layout.marginHeight = 0; - columnGroup.setLayout(layout); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - columnGroup.setLayoutData(gridData); - - //created this composite because combos as direct children of a Group do not have a border, no clue why - Composite intermediaryComposite = getWidgetFactory().createComposite(columnGroup); - layout = new GridLayout(2, false); - layout.marginWidth = 0; - intermediaryComposite.setLayout(layout); - - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace= true; - intermediaryComposite.setLayoutData(gridData); - - CommonWidgets.buildTableLabel(intermediaryComposite, getWidgetFactory()); - - this.tableCombo = new TableCombo(intermediaryComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.tableCombo.getCombo().setLayoutData(gridData); - helpSystem.setHelp(tableCombo.getCombo(), IJpaHelpContextIds.ENTITY_TABLE); - - CommonWidgets.buildCatalogLabel(intermediaryComposite, getWidgetFactory()); - this.catalogCombo = new CatalogCombo(intermediaryComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.catalogCombo.getCombo().setLayoutData(gridData); - helpSystem.setHelp(catalogCombo.getCombo(), IJpaHelpContextIds.ENTITY_CATALOG); - - CommonWidgets.buildSchemaLabel(intermediaryComposite, getWidgetFactory()); - this.schemaCombo = new SchemaCombo(intermediaryComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.schemaCombo.getCombo().setLayoutData(gridData); - helpSystem.setHelp(schemaCombo.getCombo(), IJpaHelpContextIds.ENTITY_SCHEMA); - } - - @Override - protected void engageListeners() { - } - - @Override - protected void disengageListeners() { - } - - public void doPopulate(EObject obj) { - this.table = (ITable) obj; - this.tableCombo.populate(this.table); - this.catalogCombo.populate(this.table); - this.schemaCombo.populate(this.table); - } - - public void doPopulate() { - this.tableCombo.populate(); - this.catalogCombo.populate(); - this.schemaCombo.populate(); - } - - @Override - public void dispose() { - this.catalogCombo.dispose(); - this.schemaCombo.dispose(); - this.tableCombo.dispose(); - super.dispose(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java deleted file mode 100644 index 4c2f937535..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java +++ /dev/null @@ -1,535 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import java.util.Iterator; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.ITableGenerator; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class TableGeneratorComposite extends GeneratorComposite -{ - private CCombo tableNameCombo; - private CCombo pkColumnNameCombo; - private CCombo valueColumnNameCombo; - private CCombo pkColumnValueCombo; - - private ConnectionListener connectionListener; - - private ConnectionProfile connectionProfile; - - public TableGeneratorComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, commandStack, widgetFactory); - this.connectionListener = this.buildConnectionListener(); - } - - protected ITableGenerator createGenerator() { - ITableGenerator tableGenerator = idMapping().createTableGenerator(); - idMapping().setTableGenerator(tableGenerator); - return tableGenerator; - } - - protected ITableGenerator generator(IId idMapping) { - return idMapping.getTableGenerator(); - } - - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(2, false); - composite.setLayout(layout); - - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_name); - - this.nameTextWidget = buildNameText(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.nameTextWidget.setLayoutData(gridData); - helpSystem.setHelp(this.nameTextWidget, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_NAME); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_table); - - this.tableNameCombo = buildTableNameCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.tableNameCombo.setLayoutData(gridData); - helpSystem.setHelp(this.tableNameCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_TABLE); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_pkColumn); - - this.pkColumnNameCombo = buildPkColumnNameCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.pkColumnNameCombo.setLayoutData(gridData); - helpSystem.setHelp(this.pkColumnNameCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_valueColumn); - - this.valueColumnNameCombo = buildValueColumnNameCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.valueColumnNameCombo.setLayoutData(gridData); - helpSystem.setHelp(this.valueColumnNameCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_VALUE_COLUMN); - - getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_pkColumnValue); - - this.pkColumnValueCombo = buildPkColumnValueCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.pkColumnValueCombo.setLayoutData(gridData); - helpSystem.setHelp(this.pkColumnValueCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE); - } - - private CCombo buildTableNameCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.TableGeneratorComposite_default); - combo.select(0); - combo.addModifyListener(buildTableNameListener()); - return combo; - } - - private CCombo buildPkColumnNameCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.TableGeneratorComposite_default); - combo.select(0); - combo.addModifyListener(buildPkColumnNameListener()); - return combo; - } - - private CCombo buildValueColumnNameCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.TableGeneratorComposite_default); - combo.select(0); - combo.addModifyListener(buildValueColumnNameListener()); - return combo; - } - - private CCombo buildPkColumnValueCombo(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.TableGeneratorComposite_default); - combo.select(0); - combo.addModifyListener(buildPkColumnValueListener()); - return combo; - } - - private ModifyListener buildTableNameListener() { - return new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String text = ((CCombo) e.getSource()).getText(); - if (text != null && tableNameCombo.getItemCount() > 0 && text.equals(tableNameCombo.getItem(0))) { - text = null; - } - ITableGenerator generator = getGenerator(); - if (generator == null) { - generator = createGenerator(); - } - generator.setSpecifiedTable(text); - } - }; - } - - private ModifyListener buildPkColumnNameListener() { - return new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String text = ((CCombo) e.getSource()).getText(); - if (text != null && pkColumnNameCombo.getItemCount() > 0 && text.equals(pkColumnNameCombo.getItem(0))) { - text = null; - } - ITableGenerator generator = getGenerator(); - if (generator == null) { - generator = createGenerator(); - } - generator.setSpecifiedPkColumnName(text); - } - }; - } - - private ModifyListener buildValueColumnNameListener() { - return new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String text = ((CCombo) e.getSource()).getText(); - if (text != null && valueColumnNameCombo.getItemCount() > 0 && text.equals(valueColumnNameCombo.getItem(0))) { - text = null; - } - ITableGenerator generator = getGenerator(); - if (generator == null) { - generator = createGenerator(); - } - generator.setSpecifiedValueColumnName(text); - } - }; - } - - private ModifyListener buildPkColumnValueListener() { - return new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String text = ((CCombo) e.getSource()).getText(); - if (text != null && pkColumnValueCombo.getItemCount() > 0 && text.equals(pkColumnValueCombo.getItem(0))) { - text = null; - } - ITableGenerator generator = getGenerator(); - if (generator == null) { - generator = createGenerator(); - } - generator.setSpecifiedPkColumnValue(text); - } - }; - } - - protected void generatorChanged(Notification notification) { - super.generatorChanged(notification); - if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_TABLE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - String tableName = getGenerator().getSpecifiedTable(); - if (tableName == null) { - tableNameCombo.select(0); - } - else if (!tableNameCombo.getText().equals(tableName)) { - tableNameCombo.setText(tableName); - } - populatePkColumnNameCombo(); - populateValueColumnNameCombo(); - } - }); - } - else if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populatePkColumnName(); - - } - }); - } - else if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - String columnName = getGenerator().getSpecifiedValueColumnName(); - if (columnName == null) { - valueColumnNameCombo.select(0); - } - else if (!valueColumnNameCombo.getText().equals(columnName)) { - valueColumnNameCombo.setText(columnName); - } - } - }); - } - else if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - String columnValue = getGenerator().getSpecifiedPkColumnValue(); - if (columnValue == null) { - pkColumnValueCombo.select(0); - } - else if (!pkColumnValueCombo.getText().equals(columnValue)) { - pkColumnValueCombo.setText(columnValue); - } - } - }); - } - } - - @Override - protected void doPopulate(EObject obj) { - super.doPopulate(obj); - if (obj == null) { - this.connectionProfile = null; - return; - } - populateTableNameCombo(); - populatePkColumnNameCombo(); - populateValueColumnNameCombo(); - populatePkColumnValueCombo(); - } - - @Override - protected void doPopulate() { - super.doPopulate(); - populateTableNameCombo(); - populatePkColumnNameCombo(); - populateValueColumnNameCombo(); - populatePkColumnValueCombo(); - } - - @Override - protected void engageListeners() { - super.engageListeners(); - if (getGenerator() != null) { - addConnectionListener(); - } - } - - @Override - protected void disengageListeners() { - if (getGenerator() != null) { - removeConnectionListener(); - } - super.disengageListeners(); - } - - private ConnectionProfile getConnectionProfile() { - if(this.connectionProfile == null) { - IJpaProject jpaProject = idMapping().getJpaProject(); - this.connectionProfile = jpaProject.connectionProfile(); - } - return this.connectionProfile; - } - - - private void addConnectionListener() { - this.getConnectionProfile().addConnectionListener(this.connectionListener); - } - - private void removeConnectionListener() { - this.getConnectionProfile().removeConnectionListener(this.connectionListener); - } - - protected Schema getSchema() { - if (getGenerator() != null) { - return this.getConnectionProfile().getDatabase().schemaNamed(getGenerator().getSchema()); - } - return null; - } - private void populateTableNameCombo() { - if (this.getGenerator() == null) { - return; - } - if (this.getConnectionProfile().isConnected()) { - this.tableNameCombo.remove(1, this.tableNameCombo.getItemCount()-1); - Schema schema = this.getSchema(); - if (schema != null) { - Iterator tables = schema.tableNames(); - for (Iterator stream = CollectionTools.sort(tables); stream.hasNext(); ) { - this.tableNameCombo.add(stream.next()); - } - } - } - String tableName = this.getGenerator().getSpecifiedTable(); - if (tableName != null) { - if (!this.tableNameCombo.getText().equals(tableName)) { - this.tableNameCombo.setText(tableName); - } - } - else { - this.tableNameCombo.select(0); - } - } - - private void populatePkColumnNameCombo() { - if (this.getGenerator() == null) { - return; - } - populatePkColumnChoices(); - populatePkColumnName(); - } - private void populatePkColumnChoices() { - this.pkColumnNameCombo.remove(1, this.pkColumnNameCombo.getItemCount() - 1); - - if (this.getConnectionProfile().isConnected()) { - if (!this.tableNameCombo.getText().equals(JptUiMappingsMessages.TableGeneratorComposite_default)) { // hmm, - // if - // they - // actually - // set - // the - // table - // to - // Default?? - String tableName = this.tableNameCombo.getText(); - Schema schema = getSchema(); - if (schema != null) { - Table table = schema.tableNamed(tableName); - if (table != null) { - for (Iterator stream = CollectionTools.sort(table.columnNames()); stream.hasNext();) { - this.pkColumnNameCombo.add(stream.next()); - } - } - } - } - } - } - - private void populatePkColumnName() { - String pkColumnName = this.getGenerator().getSpecifiedPkColumnName(); - if (pkColumnName != null) { - if (!this.pkColumnNameCombo.getText().equals(pkColumnName)) { - this.pkColumnNameCombo.setText(pkColumnName); - } - } - else { - this.pkColumnNameCombo.select(0); - } - } - - private void populateValueColumnNameCombo() { - if (this.getGenerator() == null) { - return; - } - if (this.getConnectionProfile().isConnected()) { - this.valueColumnNameCombo.remove(1, this.valueColumnNameCombo.getItemCount() - 1); - if (!this.tableNameCombo.getText().equals(JptUiMappingsMessages.TableGeneratorComposite_default)) { // hmm, - // if - // they - // actually - // set - // the - // table - // to - // Default?? - String tableName = this.tableNameCombo.getText(); - Schema schema = getSchema(); - if (schema != null) { - Table table = schema.tableNamed(tableName); - if (table != null) { - for (Iterator stream = CollectionTools.sort(table.columnNames()); stream.hasNext();) { - this.valueColumnNameCombo.add(stream.next()); - } - } - } - } - } - String valueColumnName = this.getGenerator().getSpecifiedValueColumnName(); - if (valueColumnName != null) { - if (!this.valueColumnNameCombo.getText().equals(valueColumnName)) { - this.valueColumnNameCombo.setText(valueColumnName); - } - } - else { - this.valueColumnNameCombo.select(0); - } - } - - private void populatePkColumnValueCombo() { - if (this.getGenerator() == null) { - return; - } - String pkColumnValue = this.getGenerator().getSpecifiedPkColumnValue(); - if (pkColumnValue != null) { - if (!this.pkColumnValueCombo.getText().equals(pkColumnValue)) { - this.pkColumnValueCombo.setText(pkColumnValue); - } - } - else { - this.pkColumnValueCombo.select(0); - } - } - - protected void clear() { - super.clear(); - this.tableNameCombo.select(0); - this.pkColumnNameCombo.select(0); - this.pkColumnValueCombo.select(0); - this.valueColumnNameCombo.select(0); - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - public void closed(Connection connection) { - populate(); - } - - public void modified(Connection connection) { - populate(); - } - - public void opened(Connection connection) { - populate(); - } - - public void databaseChanged(Connection connection, final Database database) { - populate(); - } - - public void schemaChanged(Connection connection, final Schema schema) { - populate(); - } - - private void populate() { - getControl().getDisplay().asyncExec( new Runnable() { - public void run() { - if (getControl().isDisposed()) { - return; - } - populateTableNameCombo(); - populatePkColumnChoices(); - populateValueColumnNameCombo(); - } - }); - } - - public void aboutToClose(Connection connection) { - // not interested to this event. - } - - public boolean okToClose(Connection connection) { - // not interested to this event. - return true; - } - - public void tableChanged(Connection connection, final Table table) { - // not interested to this event. - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java deleted file mode 100644 index dd5e76a6ee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.search.SearchEngine; -import org.eclipse.jdt.ui.IJavaElementSearchConstants; -import org.eclipse.jdt.ui.JavaUI; -import org.eclipse.jface.window.Window; -import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.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.ui.PlatformUI; -import org.eclipse.ui.dialogs.SelectionDialog; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class TargetEntityChooser extends BaseJpaController -{ - private IRelationshipMapping relationshipMapping; - private Adapter relationshipMappingListener; - - protected CCombo targetEntityCombo; - - - private Composite composite; - - public TargetEntityChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildRelationshipMappingListener(); - } - - - private void buildRelationshipMappingListener() { - relationshipMappingListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - relationshipMappingChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.composite = getWidgetFactory().createComposite(parent); - GridLayout gridLayout = new GridLayout(); - gridLayout.marginHeight = 0; - gridLayout.marginWidth = 0; - gridLayout.numColumns = 3; - this.composite.setLayout(gridLayout); - - CommonWidgets.buildTargetEntityLabel(this.composite, getWidgetFactory()); - - this.targetEntityCombo = buildTargetEntityCombo(this.composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - this.targetEntityCombo.setLayoutData(gridData); - - buildTargetEntitySelectionButton(this.composite); - - } - - protected CCombo buildTargetEntityCombo(Composite parent) { - final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT); - combo.add(JptUiMappingsMessages.TargetEntityChooser_defaultEmpty); - PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, IJpaHelpContextIds.MAPPING_TARGET_ENTITY); - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (isPopulating()) { - return; - } - String targetEntityName = ((CCombo) e.getSource()).getText(); - if (targetEntityName.equals(combo.getItem(0)) || targetEntityName.equals("")) { //$NON-NLS-1$ - targetEntityName = null; - } - else if (!relationshipMapping.targetEntityIsValid(targetEntityName)) { - return; - } - relationshipMapping.setSpecifiedTargetEntity(targetEntityName); - } - }); - return combo; - } - - - private void relationshipMappingChanged(Notification notification) { - if (notification.getFeatureID(IRelationshipMapping.class) == - JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - else if (notification.getFeatureID(IRelationshipMapping.class) == - JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (relationshipMapping != null) { - relationshipMapping.eAdapters().add(relationshipMappingListener); - } - } - - @Override - protected void disengageListeners() { - if (this.relationshipMapping != null) { - this.relationshipMapping.eAdapters().remove(relationshipMappingListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.relationshipMapping = (IRelationshipMapping) obj; - populateCombo(); - } - - @Override - protected void doPopulate() { - populateCombo(); - } - - private void populateCombo() { - if (relationshipMapping == null) { - targetEntityCombo.clearSelection(); - return; - } - String targetEntity = this.relationshipMapping.getSpecifiedTargetEntity(); - this.targetEntityCombo.setItem(0, NLS.bind(JptUiMappingsMessages.TargetEntityChooser_defaultWithOneParam, this.relationshipMapping.getDefaultTargetEntity())); - if (targetEntity != null) { - if (!this.targetEntityCombo.getText().equals(targetEntity)) { - this.targetEntityCombo.setText(targetEntity); - } - } - else { - if (this.targetEntityCombo.getSelectionIndex() != 0) { - this.targetEntityCombo.select(0); - } - } - } - - @Override - public Control getControl() { - return this.composite; - } - - //see org.eclipse.pde.internal.ui.editor.plugin.rows.ClassAttributeRow - //for example of the hyperlink opening a resource - protected Button buildTargetEntitySelectionButton(Composite parent) { - Button button = new Button(parent, SWT.PUSH); - button.setText(JptUiMappingsMessages.TargetEntityChooser_browse); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - browse(); - } - }); - return button; - } - - protected void browse() { - BusyIndicator.showWhile(this.targetEntityCombo.getDisplay(), new Runnable() { - public void run() { - doOpenSelectionDialog(); - } - }); - } - - private void doOpenSelectionDialog() { - SelectionDialog dialog; - try { - dialog = JavaUI.createTypeDialog(getControl().getShell(), - PlatformUI.getWorkbench().getProgressService(), - SearchEngine.createWorkspaceScope(), - IJavaElementSearchConstants.CONSIDER_ALL_TYPES, - false, - ""); //$NON-NLS-1$ - } - catch (JavaModelException e) { - throw new RuntimeException(e); - } - dialog.setTitle("Select Type"); //$NON-NLS-1$ - if (dialog.open() == Window.OK) { - IType type = (IType) dialog.getResult()[0]; - this.targetEntityCombo.setText(type.getFullyQualifiedName('$')); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java deleted file mode 100644 index 3871e8ac4c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class TransientComposite extends BaseJpaComposite -{ - public TransientComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - - } - - - public void doPopulate(EObject obj) { - } - - public void doPopulate() { - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java deleted file mode 100644 index fe7fb65ac2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.mappings.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.TemporalType; -import org.eclipse.jpt.ui.internal.details.BaseJpaComposite; -import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder; -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.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class VersionComposite extends BaseJpaComposite -{ - private IVersion version; - - private ColumnComposite columnComposite; - - private EnumComboViewer temporalTypeViewer; - - - public VersionComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, SWT.NULL, commandStack, widgetFactory); - } - @Override - protected void initializeLayout(Composite composite) { - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Control generalControl = buildGeneralComposite(composite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - generalControl.setLayoutData(gridData); - - } - - private Control buildGeneralComposite(Composite composite) { -// IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite generalComposite = getWidgetFactory().createComposite(composite); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - generalComposite.setLayout(layout); - - this.columnComposite = new ColumnComposite(generalComposite, this.commandStack, getWidgetFactory()); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.columnComposite.getControl().setLayoutData(gridData); - - CommonWidgets.buildTemporalLabel(generalComposite, getWidgetFactory()); - this.temporalTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.temporalTypeViewer.getControl().setLayoutData(gridData); - - return generalComposite; - } - - public void doPopulate(EObject obj) { - this.version = (IVersion) obj; - if (this.version != null) { - this.columnComposite.populate(this.version.getColumn()); - } - else { - this.columnComposite.populate(null); - } - this.temporalTypeViewer.populate(new TemporalTypeHolder(this.version)); - } - - public void doPopulate() { - this.columnComposite.populate(); - this.temporalTypeViewer.populate(); - } - - protected void engageListeners() { - } - - protected void disengageListeners() { - } - - @Override - public void dispose() { - this.columnComposite.dispose(); - this.temporalTypeViewer.dispose(); - super.dispose(); - } - - protected IVersion getVersion() { - return this.version; - } - - - - - private class TemporalTypeHolder extends EObjectImpl implements EnumHolder { - - private IVersion version; - - TemporalTypeHolder(IVersion version) { - super(); - this.version = version; - } - - public Object get() { - return this.version.getTemporal(); - } - - public void set(Object enumSetting) { - this.version.setTemporal((TemporalType) enumSetting); - } - - public Class featureClass() { - return IBasic.class; - } - - public int featureId() { - return JpaCoreMappingsPackage.IVERSION__TEMPORAL; - } - - public EObject wrappedObject() { - return this.version; - } - - public Object[] enumValues() { - return TemporalType.VALUES.toArray(); - } - - /** - * TemporalType has no Default, return null - */ - public Object defaultValue() { - return null; - } - - /** - * TemporalType has no Default, return null - */ - public String defaultString() { - return null; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java deleted file mode 100644 index 7d3f6ff463..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.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.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(JavaUI.ID_PACKAGES); - 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, JavaUI.ID_PACKAGES); - - //Problems/Console area - IFolderLayout outputFolder = layout.createFolder( - "bottom", IPageLayout.BOTTOM, (float) 0.60, editorArea); //$NON-NLS-1$ - outputFolder.addView(IPageLayout.ID_PROBLEM_VIEW); - outputFolder.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$ - 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", - IPageLayout.RIGHT, (float) .60, "bottom"); - - //JPA Structure area - IFolderLayout outlineFolder = layout.createFolder( - "right", IPageLayout.RIGHT, (float) 0.75, editorArea); //$NON-NLS-1$ - outlineFolder.addView("org.eclipse.jpt.ui.jpaStructureView"); - outlineFolder.addView(IPageLayout.ID_OUTLINE); - - layout.addActionSet(JavaUI.ID_ACTION_SET); - layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); - layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); - - // views - java - layout.addShowViewShortcut(JavaUI.ID_PACKAGES); - layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY); - layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW); - layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW); - - // views - standard workbench - layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); - layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); - layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); - - // new actions - Java project creation wizard - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ - layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$ - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java deleted file mode 100644 index 77fa10c9cd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java +++ /dev/null @@ -1,204 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.prefs; - -import java.io.IOException; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage; -import org.eclipse.jface.preference.IPersistentPreferenceStore; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -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.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Link; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -public class JpaPreferencePage extends PreferencePage - implements IWorkbenchPreferencePage -{ - public static final String ID = "org.eclipse.jpt.ui.jpaPreferencePage"; - - - private IPersistentPreferenceStore preferences; - - private IPreferenceStore userLibPreferences; - - private Label jpaLibLabel; - - private Combo jpaLibCombo; - - private Link userLibsLink; - - - public JpaPreferencePage() { - super(); - preferences = - new ScopedPreferenceStore( - new InstanceScope(), - JptCorePlugin.getPlugin().getBundle().getSymbolicName()); - userLibPreferences = - new ScopedPreferenceStore( - new InstanceScope(), - JavaCore.getPlugin().getBundle().getSymbolicName()); - } - - public void init(IWorkbench workbench) {} - - public Control createContents(Composite parent) { - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - - jpaLibLabel = createLabel(container, 1, JptUiMessages.JpaPreferencePage_defaultJpaLib); - - jpaLibCombo = createCombo(container, true); - - userLibsLink = new Link(container, SWT.NONE); - GridData data = new GridData(GridData.END, GridData.CENTER, false, false); - data.horizontalSpan = 2; - userLibsLink.setLayoutData(data); - userLibsLink.setText(JptUiMessages.JpaPreferencePage_userLibsLink); - userLibsLink.addSelectionListener( - new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - ((IWorkbenchPreferenceContainer) getContainer()) - .openPage(UserLibraryPreferencePage.ID, null); - } - } - ); - - performDefaults(); - return container; - } - - 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 Combo createCombo(Composite container, boolean fillHorizontal) { - Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY); - if (fillHorizontal) { - combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - } - else { - combo.setLayoutData(new GridData()); - } - return combo; - } - - private void fillJpaLibs() { - int index = jpaLibCombo.getSelectionIndex(); - String selectedJpaLib = null; - if (index >= 0) { - selectedJpaLib = jpaLibCombo.getItem(jpaLibCombo.getSelectionIndex()); - } - - jpaLibCombo.clearSelection(); - jpaLibCombo.setItems(JavaCore.getUserLibraryNames()); - - if (selectedJpaLib != null) { - int newIndex = CollectionTools.indexOf(jpaLibCombo.getItems(), selectedJpaLib); - if (newIndex >= 0) { - jpaLibCombo.select(newIndex); - } - } - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) { - fillJpaLibs(); - } - } - - public void performDefaults() { - fillJpaLibs(); - String defaultLib = preferences.getString(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB); - int index = -1; - if (! StringTools.stringIsEmpty(defaultLib)) { - index = CollectionTools.indexOf(jpaLibCombo.getItems(), defaultLib); - } - if (index >= 0) { - jpaLibCombo.select(index); - } - - super.performDefaults(); - } - - public boolean performOk() { - int index = jpaLibCombo.getSelectionIndex(); - String defaultLib = (index >= 0) ? jpaLibCombo.getItem(index) : null; - if (! StringTools.stringIsEmpty(defaultLib)) { - preferences.setValue(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB, defaultLib); - } - try { - preferences.save(); - } - catch (IOException ioe) { - JptCorePlugin.log(ioe); - } - return true; - } - - public void dispose() { - // null pointer check - bug 168337 - if (jpaLibLabel != null) jpaLibLabel.dispose(); - if (jpaLibCombo != null) jpaLibCombo.dispose(); - super.dispose(); - } - - - -// private boolean libContainsJpaClasses() { -// return true; -// String jarLocation = getStringValue(); -// String errorMessage = JptUiMessages.JpaPreferencePage_invalidJpaLib; -// boolean hasError = false; -// -// try { -// JarFile jarFile = new JarFile(jarLocation); -// hasError = jarFile.getEntry("javax/persistence/EntityManager.class") == null; -// } -// catch (IOException ioe) { -// hasError = true; -// } -// -// if (hasError) { -// showErrorMessage(errorMessage); -// } -// else { -// clearErrorMessage(); -// } -// -// return ! hasError; -// } -// } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java deleted file mode 100644 index cc0b64d8f2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/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.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 - * validateControls(). 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.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java deleted file mode 100644 index 0089adfd1a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java +++ /dev/null @@ -1,392 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.properties; - -import java.lang.reflect.InvocationTargetException; -import java.util.Iterator; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.ComboViewer; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JpaPlatformRegistry; -import org.eclipse.jpt.core.internal.JpaProject; -import org.eclipse.jpt.core.internal.facet.IJpaFacetDataModelProperties; -import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider; -import org.eclipse.jpt.core.internal.facet.JpaFacetUtils; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.jpt.db.ui.internal.DTPUiTools; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jpt.utility.internal.CollectionTools; -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.Group; -import org.eclipse.swt.widgets.Link; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public class JpaProjectPropertiesPage - extends DataModelPropertyPage - implements IJpaFacetDataModelProperties -{ - private PlatformGroup platformGroup; - - private ConnectionGroup connectionGroup; - - private PersistentClassManagementGroup persistentClassManagementGroup; - - - /** - * Constructor for SamplePropertyPage. - */ - public JpaProjectPropertiesPage() { - super(DataModelFactory.createDataModel(new JpaFacetDataModelProvider())); - } - - - @Override - protected Composite createTopLevelComposite(Composite parent) { - Composite composite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - composite.setLayout(layout); - - platformGroup = new PlatformGroup(composite); - connectionGroup = new ConnectionGroup(composite); - persistentClassManagementGroup = new PersistentClassManagementGroup(composite); - - setRuntime(); - - Dialog.applyDialogFont(parent); - PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE); - - return composite; - } - - private void setRuntime() { - IFacetedProject facetedProject = null; - try { - facetedProject = ProjectFacetsManager.create(getJpaProject().getProject()); - } - catch (CoreException ce) { - JptUiPlugin.log(ce); - return; - } - IRuntime runtime = facetedProject.getPrimaryRuntime(); - model.setProperty(IJpaFacetDataModelProperties.RUNTIME, runtime); - } - - @Override - protected String[] getValidationPropertyNames() { - return new String[] { - IJpaFacetDataModelProperties.PLATFORM_ID, - IJpaFacetDataModelProperties.CONNECTION, - IJpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES - }; - } - - protected JpaProject getJpaProject() { - return (JpaProject) getElement().getAdapter(IJpaProject.class); - } - - private Combo createCombo(Composite container, boolean fillHorizontal) { - Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY); - if (fillHorizontal) { - combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - } - else { - combo.setLayoutData(new GridData()); - } - return combo; - } - - private 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 void performDefaults() { - platformGroup.performDefaults(); - connectionGroup.performDefaults(); - persistentClassManagementGroup.performDefaults(); - } - - public boolean performOk() { - JpaProject jpaProject = getJpaProject(); - - // the facet has been uninstalled during our trip to the properties ... - if (jpaProject == null) { - return true; - } - - try { - JpaFacetUtils.setPlatform(jpaProject.getProject(), model.getStringProperty(IJpaFacetDataModelProperties.PLATFORM_ID)); - JpaFacetUtils.setConnectionName(jpaProject.getProject(), model.getStringProperty(IJpaFacetDataModelProperties.CONNECTION)); - JpaFacetUtils.setDiscoverAnnotatedClasses(jpaProject.getProject(), model.getBooleanProperty(IJpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES)); - } - catch (CoreException ce) { - return false; - } - - buildProject(); - - return true; - } - - private void buildProject() { - IRunnableWithProgress r= new IRunnableWithProgress() { - public void run(IProgressMonitor pm) throws InvocationTargetException { - try { - getJpaProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, pm); - } - catch (CoreException ce) { - JptUiPlugin.log(ce); - } - } - }; - try { - PlatformUI.getWorkbench().getProgressService().run(true, false, r); - } - catch (InterruptedException ie) { /* nothing to do */ } - catch (InvocationTargetException ie) { /* nothing to do */ } - } - - - private final class PlatformGroup - { - private final ComboViewer 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)); - // TODO - // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE); - - platformCombo = new ComboViewer(createCombo(group, true)); - platformCombo.setContentProvider( - new IStructuredContentProvider() { - public Object[] getElements(Object inputElement) { - return CollectionTools.array(JpaPlatformRegistry.INSTANCE.allJpaPlatformIds()); - } - - public void dispose() {} - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} - } - ); - platformCombo.setLabelProvider( - new ILabelProvider() { - public Image getImage(Object element) { - return null; - } - - public String getText(Object element) { - return JpaPlatformRegistry.INSTANCE.getJpaPlatformLabel((String) element); - } - - public void addListener(ILabelProviderListener listener) {} - - public void removeListener(ILabelProviderListener listener) {} - - public void dispose() {} - - public boolean isLabelProperty(Object element, String property) { - return true; - } - } - ); - platformCombo.addSelectionChangedListener( - new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - model.setProperty(PLATFORM_ID, ((StructuredSelection) platformCombo.getSelection()).getFirstElement()); - } - } - ); - // we need some input here, even if it means absolutely nothing - platformCombo.setInput("null input"); - performDefaults(); - } - - private void performDefaults() { - String platformId = getJpaProject().getPlatform().getId(); - model.setProperty(PLATFORM_ID, platformId); - platformCombo.setSelection(new StructuredSelection(platformId)); - } - } - - - private final class ConnectionGroup - { - private final Combo connectionCombo; - - private Link connectionLink; - - - public ConnectionGroup(Composite composite) { - Group group = new Group(composite, SWT.NONE); - group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel); - group.setLayout(new GridLayout()); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - connectionCombo = createCombo(group, true); - PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION); - connectionCombo.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setProperty(CONNECTION, connectionCombo.getItem(connectionCombo.getSelectionIndex())); - } - } - ); - fillConnections(); - - 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() { - public void widgetSelected(SelectionEvent e) { - openNewConnectionWizard(); - } - } - ); - performDefaults(); - } - - private void fillConnections() { - //clear out connection entries from previous login. - connectionCombo.removeAll(); - - for (Iterator stream = ConnectionProfileRepository.instance().profileNames(); stream.hasNext(); ) { - connectionCombo.add(stream.next()); - } - } - - private void performDefaults() { - String connectionName = getJpaProject().getDataSource().getConnectionProfileName(); - model.setProperty(CONNECTION, connectionName); - if (connectionName == null) { - connectionCombo.clearSelection(); - } - else { - connectionCombo.setText(connectionName); - } - } - - private void openNewConnectionWizard() { - String connectionName = DTPUiTools.createNewProfile(); - if (connectionName != null) { - fillConnections(); - model.setProperty(CONNECTION, connectionName); - connectionCombo.select(connectionCombo.indexOf(connectionName)); - } - } - } - - - private 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, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH); - - discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO); - discoverClassesButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, true); - } - } - ); - - listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO); - listClassesButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, false); - } - } - ); - - model.addListener( - new IDataModelListener() { - public void propertyChanged(DataModelEvent event) { - if (DISCOVER_ANNOTATED_CLASSES.equals(event.getPropertyName())) { - boolean discoverClasses = (Boolean) event.getProperty(); - discoverClassesButton.setSelection(discoverClasses); - listClassesButton.setSelection(! discoverClasses); - } - } - } - ); - - performDefaults(); - } - - private void performDefaults() { - boolean discoverClasses = getJpaProject().isDiscoverAnnotatedClasses(); - model.setProperty(DISCOVER_ANNOTATED_CLASSES, discoverClasses); - discoverClassesButton.setSelection(discoverClasses); - listClassesButton.setSelection(! discoverClasses); - } - } -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java deleted file mode 100644 index 52408ef2bb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -public abstract class AbstractSelectionParticipant - implements ISelectionParticipant -{ - protected ISelectionManager selectionManager; - - - protected AbstractSelectionParticipant(ISelectionManager theSelectionManager) { - selectionManager = theSelectionManager; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java deleted file mode 100644 index df7fd63dbf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import org.eclipse.ui.IWorkbenchPart; - -public interface ISelectionManager -{ - /** - * Return the current selection. - * This will never be null, but it may be Selection.NULL_SELECTION. - */ - public Selection getCurrentSelection(); - - /** - * Not to be called lightly, this will affect the selection for all interested - * objects in a window. - * The newSelection will be selected. - */ - public void select(Selection newSelection); - - /** - * Not to be called lightly, this will affect the selection for all interested - * objects in a window. - * The oldSelection will be deselected, iff it matches the current selection. - */ - public void deselect(Selection oldSelection); - - /** - * This may be used to register a part with the selection manager if the part - * is known to need access to the selection manager before it is ever activated - * or in the case it may be activated prior to the selection manager being - * created. - * - * It should not be necessary to deregister a part, as that happens when the - * part is closed. - */ - public void register(IWorkbenchPart part); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java deleted file mode 100644 index 7657d002b1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - * - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -public interface ISelectionParticipant -{ - /** - * Return the current selection of the participant - */ - Selection getSelection(); - - /** - * The selection has changed in the central selection manager. - * Update this participant accordingly. - */ - void selectionChanged(SelectionEvent evt); - - /** - * Return whether this selection participant should disconnect itself from - * its part when its part is hidden from view. - * Typically editor participants will return true and view participants will - * return false. - */ - boolean disposeOnHide(); - - /** - * This participant is no longer needed (most likely because its part has - * closed). Dispose of it. - */ - void dispose(); -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java deleted file mode 100644 index 9e84ab43b4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import org.eclipse.jpt.ui.internal.views.JpaDetailsView; - - -public class JpaDetailsSelectionParticipant extends AbstractSelectionParticipant -{ - private JpaDetailsView detailsView; - - - public JpaDetailsSelectionParticipant( - ISelectionManager theSelectionManager, JpaDetailsView view) { - super(theSelectionManager); - detailsView = view; - } - - - public Selection getSelection() { - return detailsView.getSelection(); - } - - public void selectionChanged(SelectionEvent evt) { - detailsView.select(evt.getSelection()); - } - - public boolean disposeOnHide() { - return false; - } - - public void dispose() { - // no op - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java deleted file mode 100644 index bfa9499d1a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jpt.ui.internal.views.JpaStructureView; - -public class JpaStructureSelectionParticipant - extends AbstractSelectionParticipant -{ - private JpaStructureView structureView; - - private ISelectionChangedListener structureViewListener; - - - public JpaStructureSelectionParticipant( - ISelectionManager theSelectionManager, JpaStructureView theOutlineView) { - super(theSelectionManager); - structureView = theOutlineView; - structureViewListener = new StructureViewSelectionListener(); - structureView.addSelectionChangedListener(structureViewListener); - } - - - public Selection getSelection() { - return structureView.getSelection(); - } - - public void selectionChanged(SelectionEvent evt) { - structureView.select(evt.getSelection()); - } - - public boolean disposeOnHide() { - return false; - } - - public void dispose() { - // no op - } - - - private class StructureViewSelectionListener - implements ISelectionChangedListener - { - public void selectionChanged(SelectionChangedEvent event) { - selectionManager.select(structureView.getSelection()); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java deleted file mode 100644 index c02d684210..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - * - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import org.eclipse.jpt.core.internal.IJpaContentNode; - - -public class Selection -{ - public static Selection NULL_SELECTION = new Selection(); - - private IJpaContentNode selectedNode; - - - /* Used internally - only for NULL_SELECTION */ - private Selection() {} - - public Selection(IJpaContentNode node) { - if (node == null) { - throw new IllegalArgumentException("Must have non-null node. Use NULL_SELECTION otherwise."); - } - - selectedNode = node; - } - - public IJpaContentNode getSelectedNode() { - return selectedNode; - } - - public boolean equals(Object obj) { - if (! (obj instanceof Selection)) { - return false; - } - - if (this == NULL_SELECTION && obj == NULL_SELECTION) { - return true; - } - - if (this == NULL_SELECTION || obj == NULL_SELECTION) { - return false; - } - - return this.selectedNode.equals(((Selection) obj).selectedNode); - } - - public int hashCode() { - if (this == NULL_SELECTION) { - return super.hashCode(); - } - else { - return this.selectedNode.hashCode(); - } - } - - public String toString() { - if (this == NULL_SELECTION) { - return "NULL_SELECTION"; - } - else { - return selectedNode.toString(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java deleted file mode 100644 index 1020ef3ec1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - * - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import java.util.EventObject; - -public class SelectionEvent extends EventObject -{ - /** - * Serializable uid - * @since 0.5 - */ - private static final long serialVersionUID = 1L; - - - /** - * Indicates that the selection object is now selected - */ - public static int SELECTION = 1; - - /** - * Indicates that the selection object has now been deselected - */ - public static int DESELECTION = 2; - - - /** - * The selection object whose selection status has changed - */ - private Selection selection; - - /** - * The type of the selection event, either a SELECTION or a DESELECTION - */ - private int type; - - - public SelectionEvent(Selection theSelection, int theType, Object source) { - super(source); - selection = theSelection; - type = theType; - } - - /** - * Return the selection object whose selection status has changed - */ - public Selection getSelection() { - return selection; - } - - /** - * Return the type of selection event, either a SELECTION or a DESELECTION - */ - public int getType() { - return type; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java deleted file mode 100644 index e9af08d358..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java +++ /dev/null @@ -1,264 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - * - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import org.eclipse.jpt.utility.internal.iterators.CloneIterator; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IPageListener; -import org.eclipse.ui.IPartListener2; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchPartReference; -import org.eclipse.ui.IWorkbenchWindow; - -/** - * A SelectionManager stores the current Selection and - * notifies ISelectionListeners when the selection changes. - */ -public class SelectionManager - implements ISelectionManager -{ - /* The set of pages for which this object is managing selections */ - private Set pages; - - /* The map of ISelectionParticipants (keyed by part) this object - is using to manage selections */ - private Map selectionParticipants; - - private IPageListener pageListener; - - private IPartListener2 partListener; - - /* The window for which this object manages selections */ - private IWorkbenchWindow window; - - private Selection currentSelection; - - - public SelectionManager() { - super(); - pages = Collections.synchronizedSet(new HashSet()); - selectionParticipants = Collections.synchronizedMap(new HashMap()); - pageListener = new PageListener(); - partListener = new PartListener(); - currentSelection = Selection.NULL_SELECTION; - } - - public void init(IWorkbenchWindow aWindow) { - window = aWindow; - aWindow.addPageListener(pageListener); - initPage(aWindow.getActivePage()); - } - - private void initPage(IWorkbenchPage page) { - if ((page != null) && (! pages.contains(page))) { - page.addPartListener(partListener); - pages.add(page); - IEditorPart activeEditor = page.getActiveEditor(); - initPart(activeEditor); - selectPart(activeEditor); - } - } - - private void disposePage(IWorkbenchPage page) { - if ((page != null) && (pages.contains(page))) { - page.removePartListener(partListener); - pages.remove(page); - } - } - - private void initPart(IWorkbenchPart part) { - if (part != null) { - if (selectionParticipants.get(part) == null) { - ISelectionParticipant selectionParticipant = - (ISelectionParticipant) part.getAdapter(ISelectionParticipant.class); - if (selectionParticipant != null) { - selectionParticipants.put(part, selectionParticipant); - } - } - } - } - - private void selectPart(IWorkbenchPart part) { - ISelectionParticipant selectionParticipant = getSelectionParticipant(part); - if (selectionParticipant != null) { - select(selectionParticipant.getSelection()); - } - } - - private void hidePart(IWorkbenchPart part) { - ISelectionParticipant selectionParticipant = getSelectionParticipant(part); - if ((selectionParticipant != null) && (selectionParticipant.disposeOnHide())) { - closePart(part); - } - } - - private void closePart(IWorkbenchPart part) { - ISelectionParticipant selectionParticipant = getSelectionParticipant(part); - if (selectionParticipant != null) { - disposePart(part); - checkForNoEditors(); - } - } - - private void disposePart(IWorkbenchPart part) { - if ((part != null) && (selectionParticipants.containsKey(part))) { - ISelectionParticipant selectionParticipant = - (ISelectionParticipant) selectionParticipants.remove(part); - selectionParticipant.dispose(); - } - } - - private void checkForNoEditors() { - IWorkbenchPage activePage = window.getActivePage(); - if ((activePage == null) - || (activePage.getActiveEditor() == null)) { - select(Selection.NULL_SELECTION); - } - } - - /** - * This may be used to register a part with the selection manager if the part - * is known to need access to the selection manager before it is ever activated - * or in the case it may be activated prior to the selection manager being - * created. - * - * It should not be necessary to deregister a part, as that happens when the - * part is closed. - */ - public void register(IWorkbenchPart part) { - initPart(part); - } - - /** - * Not to be called lightly, this will affect the selection for all interested - * objects in a window. - * The newSelection will be selected. - */ - public void select(Selection newSelection) { - if (currentSelection.equals(newSelection)) { - return; - } - - currentSelection = newSelection; - fireSelectionChange( - new SelectionEvent(newSelection, SelectionEvent.SELECTION, this) - ); - } - - /** - * Not to be called lightly, this will affect the selection for all interested - * objects in a window. - * The oldSelection will be deselected, iff it matches the current selection. - */ - public void deselect(Selection oldSelection) { - if (currentSelection.equals(oldSelection)) { - currentSelection = Selection.NULL_SELECTION; - fireSelectionChange( - new SelectionEvent(oldSelection, SelectionEvent.DESELECTION, this) - ); - } - } - - private void fireSelectionChange(SelectionEvent event) { - for (Iterator stream = selectionParticipants.values().iterator(); stream.hasNext(); ) { - ((ISelectionParticipant) stream.next()).selectionChanged(event); - } - } - - private ISelectionParticipant getSelectionParticipant(IWorkbenchPart part) { - return (ISelectionParticipant) selectionParticipants.get(part); - } - - public Selection getCurrentSelection() { - return currentSelection; - } - - public void dispose() { - window.removePageListener(pageListener); - selectionParticipants.clear(); - - for (Iterator stream = new CloneIterator(pages); stream.hasNext(); ) { - disposePage((IWorkbenchPage) stream.next()); - } - - for (Iterator stream = new CloneIterator(selectionParticipants.keySet()); stream.hasNext(); ) { - disposePart((IWorkbenchPart) stream.next()); - } - } - - - private class PageListener implements IPageListener - { - public void pageActivated(IWorkbenchPage page) {} - - public void pageClosed(IWorkbenchPage page) { - disposePage(page); - } - - public void pageOpened(IWorkbenchPage page) { - initPage(page); - } - } - - - private class PartListener implements IPartListener2 - { - public void partActivated(IWorkbenchPartReference partRef) { - IWorkbenchPart part = partRef.getPart(false); - if (part != null) { - initPart(part); - selectPart(part); - } - } - - public void partBroughtToTop(IWorkbenchPartReference partRef) {} - - public void partClosed(IWorkbenchPartReference partRef) { - IWorkbenchPart part = partRef.getPart(false); - if (part != null) { - closePart(part); - disposePart(part); - checkForNoEditors(); - } - } - - public void partDeactivated(IWorkbenchPartReference partRef) {} - - public void partHidden(IWorkbenchPartReference partRef) { - IWorkbenchPart part = partRef.getPart(false); - if (part != null) { - hidePart(part); - } - } - - public void partInputChanged(IWorkbenchPartReference partRef) {} - - public void partOpened(IWorkbenchPartReference partRef) { - IWorkbenchPart part = partRef.getPart(false); - if (part != null) { - initPart(part); - } - } - - public void partVisible(IWorkbenchPartReference partRef) { - IWorkbenchPart part = partRef.getPart(false); - if (part != null) { - initPart(part); - } - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java deleted file mode 100644 index 1cfe6e6bb0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - * - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.ui.IWindowListener; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -public class SelectionManagerFactory -{ - private static SelectionManagerFactory INSTANCE; - - private static Object MUTEX = new Object(); - - - /** - * Each IWorkbenchWindow has its own SelectionManager - * to track the selection events in the IWorkbenchWindow. All - * ISelectionListeners in the same IWorkbenchWindow - * share the same SelectionManager. - * - * @return The SelectionManager associated with the current - * IWorkbenchWindow - */ - public static ISelectionManager getSelectionManager(IWorkbenchWindow window) { - if (INSTANCE == null) { - // this is thread safe for now. you never know whats comming - synchronized (MUTEX) { - if(INSTANCE == null) { - INSTANCE = new SelectionManagerFactory(); - // if we do the init inside the constructor we end up in a loop - // because the addWindowListener(this) does a callback to us - INSTANCE.init(); - } - } - } - return INSTANCE.internalGetSelectionManager(window); - } - - - private Map managers; - - private WindowListener windowListener; - - - private SelectionManagerFactory() { - managers = new HashMap(); - windowListener = new WindowListener(); - } - - private void init() { - IWorkbench workbench = PlatformUI.getWorkbench(); - workbench.addWindowListener(windowListener); - } - - /** - * Returns the SelectionManager for the IWorkbenchWindow. - * Creates a new one if none exists yet. - */ - private SelectionManager internalGetSelectionManager(IWorkbenchWindow window) { - if (window == null) { - throw new IllegalArgumentException(window.toString()); - } - - if (! managers.containsKey(window)) { - SelectionManager manager = new SelectionManager(); - this.managers.put(window, manager); - manager.init(window); - } - - return (SelectionManager) managers.get(window); - } - - - private class WindowListener implements IWindowListener - { - /* @see IWindowListener#windowOpened(IWorkbenchWindow) */ - public void windowOpened(IWorkbenchWindow aWindow) {} - - /* @see IWindowListener#windowClosed(IWorkbenchWindow) */ - public void windowClosed(IWorkbenchWindow aWindow) { - SelectionManager manager = internalGetSelectionManager(aWindow); - manager.dispose(); - managers.remove(aWindow); - } - - /* @see IWindowListener#windowActivated(IWorkbenchWindow) */ - public void windowActivated(IWorkbenchWindow aWindow) {} - - /* @see IWindowListener#windowDeactivated(IWorkbenchWindow) */ - public void windowDeactivated(IWorkbenchWindow aWindow) {} - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java deleted file mode 100644 index 2c90739e61..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.selection; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jpt.ui.internal.views.JpaDetailsView; -import org.eclipse.jpt.ui.internal.views.JpaStructureView; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.ITextEditor; - -public class SelectionParticipantFactory - implements IAdapterFactory -{ - /* @see IAdapterFactory#getAdapter(Object, Class) */ - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (! (adaptableObject instanceof IWorkbenchPart)) { - return null; - } - - ISelectionManager selectionManager = - SelectionManagerFactory.getSelectionManager(((IWorkbenchPart) adaptableObject).getSite().getWorkbenchWindow()); - // TODO - turn this into extension point - if (adaptableObject instanceof ITextEditor) { - return new TextEditorSelectionParticipant( - selectionManager, (ITextEditor) adaptableObject); - } - else if (adaptableObject instanceof JpaStructureView) { - return new JpaStructureSelectionParticipant( - selectionManager, (JpaStructureView) adaptableObject); - } - else if (adaptableObject instanceof JpaDetailsView) { - return new JpaDetailsSelectionParticipant( - selectionManager, (JpaDetailsView) adaptableObject); - } - else { - return null; - } - } - - /* @see IAdapterFactory#getAdapterList() */ - public Class[] getAdapterList() { - return new Class[] { ISelectionParticipant.class }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java deleted file mode 100644 index 0c137773f8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java +++ /dev/null @@ -1,164 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.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.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.ui.internal.views.AbstractJpaView; -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; - -public class TextEditorSelectionParticipant - extends AbstractSelectionParticipant -{ - private ITextEditor editor; - - private IPropertyListener editorInputListener; - - private ISelectionChangedListener editorSelectionListener; - - private Selection currentSelection; - - private boolean suppressNotification = false; - - - public TextEditorSelectionParticipant(ISelectionManager theSelectionManager, ITextEditor theEditor) { - super(theSelectionManager); - editor = theEditor; - editorInputListener = new EditorInputListener(); - editor.addPropertyListener(editorInputListener); - editorSelectionListener = new EditorSelectionListener(); - ((IPostSelectionProvider) editor.getSelectionProvider()).addPostSelectionChangedListener(editorSelectionListener); - currentSelection = calculateSelection(); - } - - private void editorInputChanged() { - Selection newSelection = calculateSelection(); - - if (! newSelection.equals(currentSelection)) { - currentSelection = newSelection; - - if (! suppressNotification) { - selectionManager.select(newSelection); - } - } - } - - private void editorSelectionChanged(SelectionChangedEvent event) { - Selection newSelection = calculateSelection(); - - if (! newSelection.equals(currentSelection)) { - currentSelection = newSelection; - - // bug 188344 - won't actively change selection manager selection if - // a "JPA" view is the active (and presumably selecting) view - if (editor.getEditorSite().getPage().getActivePart() instanceof AbstractJpaView) { - return; - } - - if (! suppressNotification) { - selectionManager.select(newSelection); - } - } - } - - private Selection calculateSelection() { - if (editor == null) { - return Selection.NULL_SELECTION; - } - - ISelection selection = editor.getSelectionProvider().getSelection(); - IJpaFile persistenceFile = persistenceFileFor(editor.getEditorInput()); - - if ((persistenceFile == null) - || (! (selection instanceof ITextSelection))) { - return Selection.NULL_SELECTION; - } - - IJpaContentNode selectedNode = persistenceFile.getContentNode(((ITextSelection) selection).getOffset()); - if (selectedNode == null) { - return Selection.NULL_SELECTION; - } - return new Selection(selectedNode); - } - - public Selection getSelection() { - return currentSelection; - } - - public IJpaFile persistenceFileFor(IEditorInput input) { - IFile file = null; - if (input instanceof IFileEditorInput) { - IFileEditorInput fileInput = (IFileEditorInput) input; - file = fileInput.getFile(); - } - if (file == null) { - return null; - } - return JptCorePlugin.getJpaFile(file); - } - - public void selectionChanged(SelectionEvent evt) { - Selection newSelection = evt.getSelection(); - - if ((getSelection().equals(newSelection)) - || (newSelection == Selection.NULL_SELECTION)) { - return; - } - - suppressNotification = true; - IJpaContentNode selectedNode = newSelection.getSelectedNode(); - - ITextRange textRange = selectedNode.selectionTextRange(); - if (textRange != null) { - this.editor.selectAndReveal(textRange.getOffset(), textRange.getLength()); - } - suppressNotification = false; - } - - public boolean disposeOnHide() { - return true; - } - - public void dispose() { - this.editor.removePropertyListener(this.editorInputListener); - ((IPostSelectionProvider) this.editor.getSelectionProvider()).removePostSelectionChangedListener(editorSelectionListener); - } - - - private class EditorInputListener - implements IPropertyListener - { - public void propertyChanged(Object source, int propId) { - if ((editor == source) && (propId == IEditorPart.PROP_INPUT)) { - editorInputChanged(); - } - } - } - - - private class EditorSelectionListener - implements ISelectionChangedListener - { - public void selectionChanged(SelectionChangedEvent event) { - editorSelectionChanged(event); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java deleted file mode 100644 index 90899cac54..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.structure; - -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ITreeContentProvider; - -public interface IJpaStructureProvider -{ - - String fileContentType(); - - /** - * Build an outline content provider. - */ - ITreeContentProvider buildContentProvider(); - - /** - * Build an outline label provider. - */ - ILabelProvider buildLabelProvider(); - - void dispose(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java deleted file mode 100644 index 1f14002888..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 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.ui.internal.util; - -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.widgets.Table; - -//copied from jdt.internal.ui.util -public class SWTUtil { - - public static int getTableHeightHint(Table table, int rows) { - if (table.getFont().equals(JFaceResources.getDefaultFont())) - table.setFont(JFaceResources.getDialogFont()); - int result= table.getItemHeight() * rows + table.getHeaderHeight(); - if (table.getLinesVisible()) - result+= table.getGridLineWidth() * (rows - 1); - return result; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java deleted file mode 100644 index cd51349405..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 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.ui.internal.util; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.Assert; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; - -import org.eclipse.jface.viewers.ColumnLayoutData; -import org.eclipse.jface.viewers.ColumnPixelData; -import org.eclipse.jface.viewers.ColumnWeightData; - -/** - * A special composite to layout columns inside a table. The composite is needed since we have - * to layout the columns "before" the actual table gets layouted. Hence we can't use a normal - * layout manager. - * - * copied from jdt.internal.ui.util - */ -public class TableLayoutComposite extends Composite { - - /** - * The number of extra pixels taken as horizontal trim by the table column. - * To ensure there are N pixels available for the content of the column, - * assign N+COLUMN_TRIM for the column width. - * - * @since 3.1 - */ - private static int COLUMN_TRIM = "carbon".equals(SWT.getPlatform()) ? 24 : 3; //$NON-NLS-1$ - - private List columns= new ArrayList(); - - /** - * Creates a new TableLayoutComposite. - */ - public TableLayoutComposite(Composite parent, int style) { - super(parent, style); - addControlListener(new ControlAdapter() { - public void controlResized(ControlEvent e) { - Rectangle area= getClientArea(); - Table table= (Table)getChildren()[0]; - Point preferredSize= computeTableSize(table); - int width= area.width - 2 * table.getBorderWidth(); - if (preferredSize.y > area.height) { - // Subtract the scrollbar width from the total column width - // if a vertical scrollbar will be required - Point vBarSize = table.getVerticalBar().getSize(); - width -= vBarSize.x; - } - layoutTable(table, width, area, table.getSize().x < area.width); - } - }); - } - - /** - * Adds a new column of data to this table layout. - * - * @param data the column layout data - */ - public void addColumnData(ColumnLayoutData data) { - columns.add(data); - } - - //---- Helpers ------------------------------------------------------------------------------------- - - private Point computeTableSize(Table table) { - Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT); - - int width= 0; - int size= columns.size(); - for (int i= 0; i < size; ++i) { - ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i); - if (layoutData instanceof ColumnPixelData) { - ColumnPixelData col= (ColumnPixelData) layoutData; - width += col.width; - if (col.addTrim) { - width += COLUMN_TRIM; - } - } else if (layoutData instanceof ColumnWeightData) { - ColumnWeightData col= (ColumnWeightData) layoutData; - width += col.minimumWidth; - } else { - Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$ - } - } - if (width > result.x) - result.x= width; - return result; - } - - private void layoutTable(Table table, int width, Rectangle area, boolean increase) { - // XXX: Layout is being called with an invalid value the first time - // it is being called on Linux. This method resets the - // Layout to null so we make sure we run it only when - // the value is OK. - if (width <= 1) - return; - - TableColumn[] tableColumns= table.getColumns(); - int size= Math.min(columns.size(), tableColumns.length); - int[] widths= new int[size]; - int fixedWidth= 0; - int numberOfWeightColumns= 0; - int totalWeight= 0; - - // First calc space occupied by fixed columns - for (int i= 0; i < size; i++) { - ColumnLayoutData col= (ColumnLayoutData) columns.get(i); - if (col instanceof ColumnPixelData) { - ColumnPixelData cpd= (ColumnPixelData) col; - int pixels= cpd.width; - if (cpd.addTrim) { - pixels += COLUMN_TRIM; - } - widths[i]= pixels; - fixedWidth += pixels; - } else if (col instanceof ColumnWeightData) { - ColumnWeightData cw= (ColumnWeightData) col; - numberOfWeightColumns++; - // first time, use the weight specified by the column data, otherwise use the actual width as the weight - // int weight = firstTime ? cw.weight : tableColumns[i].getWidth(); - int weight= cw.weight; - totalWeight += weight; - } else { - Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$ - } - } - - // Do we have columns that have a weight - if (numberOfWeightColumns > 0) { - // Now distribute the rest to the columns with weight. - int rest= width - fixedWidth; - int totalDistributed= 0; - for (int i= 0; i < size; ++i) { - ColumnLayoutData col= (ColumnLayoutData) columns.get(i); - if (col instanceof ColumnWeightData) { - ColumnWeightData cw= (ColumnWeightData) col; - // calculate weight as above - // int weight = firstTime ? cw.weight : tableColumns[i].getWidth(); - int weight= cw.weight; - int pixels= totalWeight == 0 ? 0 : weight * rest / totalWeight; - if (pixels < cw.minimumWidth) - pixels= cw.minimumWidth; - totalDistributed += pixels; - widths[i]= pixels; - } - } - - // Distribute any remaining pixels to columns with weight. - int diff= rest - totalDistributed; - for (int i= 0; diff > 0; ++i) { - if (i == size) - i= 0; - ColumnLayoutData col= (ColumnLayoutData) columns.get(i); - if (col instanceof ColumnWeightData) { - ++widths[i]; - --diff; - } - } - } - - if (increase) { - table.setSize(area.width, area.height); - } - for (int i= 0; i < size; i++) { - tableColumns[i].setWidth(widths[i]); - } - if (!increase) { - table.setSize(area.width, area.height); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java deleted file mode 100644 index e5d7cfc697..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2006, 2007 Versant. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Versant and Others. - initial API and implementation - ********************************************************************************/ -package org.eclipse.jpt.ui.internal.views; - -import org.eclipse.jpt.ui.internal.selection.ISelectionManager; -import org.eclipse.jpt.ui.internal.selection.Selection; -import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public abstract class AbstractJpaView extends ViewPart -{ - protected PageBook pageBook; - - protected Composite defaultComposite; - - - /** - * The string to display when there is no view content - */ - private String defaultLabel; - - private TabbedPropertySheetWidgetFactory widgetFactory; - - - public AbstractJpaView(String aDefaultLabel) { - super(); - defaultLabel = aDefaultLabel; - this.widgetFactory = new TabbedPropertySheetWidgetFactory(); - } - - /* @see IWorkbenchPart#createPartControl(Composite) */ - public final void createPartControl(Composite parent) { - pageBook = new PageBook(parent, SWT.NONE); - defaultComposite = buildDefaultComposite(); - pageBook.showPage(defaultComposite); - - subcreatePartControl(parent); - - ISelectionManager selectionManager = - SelectionManagerFactory.getSelectionManager(getViewSite().getWorkbenchWindow()); - selectionManager.register(this); - select(selectionManager.getCurrentSelection()); - } - - protected void subcreatePartControl(Composite parent) { - // no op - for subclasses to override if wished - } - - private Composite buildDefaultComposite() { - Composite composite = getWidgetFactory().createComposite(pageBook, SWT.NONE); - composite.setLayout(new FillLayout(SWT.VERTICAL)); - Label label = getWidgetFactory().createLabel(composite, defaultLabel); - return composite; - } - - public abstract void select(Selection aSelection); - - protected void showDefaultPage() { - pageBook.showPage(defaultComposite); - } - - /* @see IWorkbenchPart#setFocus() */ - public void setFocus() { - pageBook.setFocus(); - } - - public TabbedPropertySheetWidgetFactory getWidgetFactory() { - return this.widgetFactory; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java deleted file mode 100644 index d4654f079f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.views; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.ui.internal.IJpaPlatformUi; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.PlatformRegistry; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsPage; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider; -import org.eclipse.jpt.ui.internal.selection.Selection; -import org.eclipse.jpt.utility.internal.iterators.CloneIterator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; - -public class JpaDetailsView extends AbstractJpaView -{ - private Selection currentSelection; - - private IJpaDetailsPage currentPage; - - /* key: String file content id, value: IJpaDetailsProvider */ - private Map detailsProviders; - - /* key: Object content node id, value: Composite page */ - private Map detailsPages; - - public JpaDetailsView() { - super(JptUiMessages.JpaDetailsView_viewNotAvailable); - this.currentSelection = Selection.NULL_SELECTION; - this.detailsProviders = new HashMap(); - this.detailsPages = new HashMap(); - } - - - public Selection getSelection() { - return currentSelection; - } - - public void select(Selection newSelection) { - if (newSelection.equals(currentSelection)) { - return; - } - - currentSelection = newSelection; - - if (newSelection != Selection.NULL_SELECTION) { - IJpaContentNode newNode = newSelection.getSelectedNode(); - IJpaDetailsPage newPage = getDetailsPage(newNode); - setCurrentPage(newPage); - } - else if (currentSelection != Selection.NULL_SELECTION) { - setCurrentPage(null); - } - } - - private IJpaDetailsPage getDetailsPage(IJpaContentNode contentNode) { - if (detailsPages.containsKey(contentNode.getId())) { - IJpaDetailsPage page = detailsPages.get(contentNode.getId()); - - if ((page != null) && - (page.getControl().isDisposed())) { - detailsPages.remove(contentNode.getId()); - } - else { - return page; - } - } - - return buildDetailsPage(contentNode); - } - - private IJpaDetailsPage buildDetailsPage(IJpaContentNode contentNode) { - IJpaDetailsProvider detailsProvider = - getDetailsProvider(contentNode); - - if (detailsProvider == null) { - return null; - } - Composite parentComposite = getWidgetFactory().createComposite(pageBook, SWT.NONE); - parentComposite.setLayout(new FillLayout(SWT.VERTICAL)); - IJpaDetailsPage page = - detailsProvider.buildDetailsPage(parentComposite, contentNode.getId(), getWidgetFactory()); - - if (page != null) { - detailsPages.put(contentNode.getId(), page); - } - - return page; - } - - private IJpaDetailsProvider getDetailsProvider(IJpaContentNode contentNode) { - String contentId = contentNode.getJpaFile().getContentId(); - IJpaDetailsProvider provider = detailsProviders.get(contentId); - - if (provider == null) { - String platformId = contentNode.getJpaProject().getPlatform().getId(); - IJpaPlatformUi jpaPlatformUI = PlatformRegistry.INSTANCE.getJpaPlatform(platformId); - for (IJpaDetailsProvider p : jpaPlatformUI.detailsProviders()) { - if (p.fileContentType().equals(contentId)) { - provider = p; - break; - } - } - - //TODO this view and the detailsProviders Map is not created on a per project basis. - //the detailsProviders and their fileContentTypes could overlap across project, this would cause problems with storing this map. - - if (provider != null) { - detailsProviders.put(contentId, provider); - } - } - - return provider; - } - - private void setCurrentPage(IJpaDetailsPage newPage) { - // depopulate old page - if ((currentPage != null) && (currentPage != newPage)) { - currentPage.populate(null); - } - - // populate new page - if (newPage != null) { - newPage.populate(currentSelection.getSelectedNode()); - } - - currentPage = newPage; - - // show new page - if (newPage == null) { - showDefaultPage(); - } - else { - pageBook.showPage(newPage.getControl().getParent()); - } - } - - public void dispose() { - for (Iterator stream = new CloneIterator(detailsProviders.keySet()); stream.hasNext(); ) { - String key = stream.next(); - IJpaDetailsProvider provider = detailsProviders.remove(key); - provider.dispose(); - } - - for (Iterator stream = new CloneIterator(detailsPages.keySet()); stream.hasNext(); ) { - Object key = stream.next(); - IJpaDetailsPage detailsPage = detailsPages.remove(key); - detailsPage.dispose(); - } - - currentSelection = Selection.NULL_SELECTION; - currentPage = null; - - super.dispose(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java deleted file mode 100644 index 154ada0ab3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.views; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ITreeSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.ui.internal.IJpaPlatformUi; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.PlatformRegistry; -import org.eclipse.jpt.ui.internal.jface.NullLabelProvider; -import org.eclipse.jpt.ui.internal.jface.NullTreeContentProvider; -import org.eclipse.jpt.ui.internal.selection.Selection; -import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IWorkbenchActionConstants; - -public class JpaStructureView extends AbstractJpaView -{ - private StructureComposite structureComposite; - - - public JpaStructureView() { - super(JptUiMessages.JpaStructureView_viewNotAvailable); - } - - - @Override - public void subcreatePartControl(Composite parent) { - structureComposite = - new StructureComposite(pageBook, SWT.NULL); - } - - public Selection getSelection() { - if (structureComposite.isVisible()) { - return structureComposite.getSelection(); - } - else { - return Selection.NULL_SELECTION; - } - } - - @Override - public void select(Selection newSelection) { - Selection currentSelection = getSelection(); - - if (newSelection.equals(currentSelection)) { - return; - } - - if (newSelection == Selection.NULL_SELECTION) { - showDefaultPage(); - } - else { - pageBook.showPage(structureComposite); - } - - structureComposite.select(newSelection); - } - - - public void addSelectionChangedListener(ISelectionChangedListener listener) { - structureComposite.viewer.addSelectionChangedListener(listener); - } - - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - structureComposite.viewer.removeSelectionChangedListener(listener); - } - - - private class StructureComposite extends Composite - { - /* key: String file content id, value: IJpaStructureProvider */ - private Map structureProviders; - - private TreeViewer viewer; - - private StructureComposite(Composite parent, int style) { - super(parent, style); - - structureProviders = new HashMap(); - - this.setLayout(new FillLayout()); - - viewer = new TreeViewer(this, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - viewer.setAutoExpandLevel(2); - initContextMenu(); - } - - protected void initContextMenu() { - // Create dynamic menu mgr. Dynamic is currently required to - // support action contributions. - MenuManager mgr = new MenuManager(); - mgr.setRemoveAllWhenShown(true); - mgr.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager mgr) { - fillContextMenu(mgr); - } - }); - Menu menu = mgr.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(mgr, viewer); - - } - - /** - * Called when the context menu is about to open. - * Delegates to the action group using the viewer's selection as the action context. - * @since 2.0 - */ - protected void fillContextMenu(IMenuManager manager) { - manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } - - private Selection getSelection() { - ITreeSelection viewerSelection = (ITreeSelection) viewer.getSelection(); - - if (viewerSelection.isEmpty() || viewerSelection.size() > 1) { - if (viewer.getInput() == null) { - return Selection.NULL_SELECTION; - } - else { - return new Selection((IJpaContentNode) viewer.getInput()); - } - } - - else { - return new Selection((IJpaContentNode) viewerSelection.getFirstElement()); - } - - } - - private void select(Selection selection) { - // note: checks for null and equals() selection have already been performed - - if (selection.equals(Selection.NULL_SELECTION)) { - clearViewer(); - return; - } - - Selection currentSelection = getSelection(); - IJpaContentNode newNode = selection.getSelectedNode(); - IJpaFile newFile = newNode.getJpaFile(); - IJpaContentNode currentNode = - (currentSelection == Selection.NULL_SELECTION) ? - null : getSelection().getSelectedNode(); - IJpaFile currentFile = - (currentNode == null) ? - null : currentNode.getJpaFile(); - - if (newFile.equals(currentFile)) { - viewer.setSelection(new StructuredSelection(newNode), true); - } - else if (currentFile != null && newFile.getContentId().equals(currentFile.getContentId())) { - viewer.setInput(newFile.getContent()); - viewer.setSelection(new StructuredSelection(newNode), true); - } - else { - // new content type - // replace composite and set selection of tree - IJpaStructureProvider provider = getStructureProvider(newNode); - - if (provider == null) { - clearViewer(); - } - else { - viewer.setContentProvider(provider.buildContentProvider()); - viewer.setLabelProvider(provider.buildLabelProvider()); - viewer.setInput(newFile.getContent()); - } - } - } - - private void clearViewer() { - viewer.setContentProvider(NullTreeContentProvider.INSTANCE); - viewer.setLabelProvider(NullLabelProvider.INSTANCE); - viewer.setInput(null); - } - - private IJpaStructureProvider getStructureProvider(IJpaContentNode contentNode) { - String contentId = contentNode.getJpaFile().getContentId(); - IJpaStructureProvider provider = - (IJpaStructureProvider) structureProviders.get(contentId); - - if (provider == null) { - String vendorId = contentNode.getJpaProject().getPlatform().getId(); - IJpaPlatformUi jpaPlatformUI = PlatformRegistry.INSTANCE.getJpaPlatform(vendorId); - for (IJpaStructureProvider p : jpaPlatformUI.structureProviders()) { - if (p.fileContentType().equals(contentId)) { - provider = p; - break; - } - } - - //TODO this view and the detailsProviders Map is not created on a per project basis. - //the detailsProviders and their fileContentTypes could overlap across project, this would cause problems with storing this map. - if (provider != null) { - structureProviders.put(contentId, provider); - } - } - - return provider; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java deleted file mode 100644 index f4dadd0c4f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.widgets; -import org.eclipse.jface.viewers.AbstractListViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -//bug #69254 is why i created this class, it is a copy of ComboViwer but using a CCombo - -/** - * A concrete viewer based on an SWT Combo control. This class is intended - * as an alternative to the JFace ListViewer, which displays its content - * in a combo box rather than a list. Wherever possible, this class attempts to behave - * like ListViewer.

    - * - * This class is designed to be instantiated with a pre-existing SWT combo control - * and configured with a domain-specific content provider, label provider, element - * filter (optional), and element sorter (optional). - *

    - * - * @see org.eclipse.jface.viewers.ListViewer - * @since 3.0 - */ -public final class CComboViewer extends AbstractListViewer { - - /** - * This viewer's list control. - */ - private CCombo combo; - - /** - * Creates a combo viewer on a newly-created combo control under the given parent. - * The viewer has no input, no content provider, a default label provider, - * no sorter, and no filters. - * - * @param parent the parent control - */ - public CComboViewer(Composite parent) { - this(parent, SWT.READ_ONLY | SWT.BORDER); - } - - /** - * Creates a combo viewer on a newly-created combo control under the given parent. - * The combo control is created using the given SWT style bits. - * The viewer has no input, no content provider, a default label provider, - * no sorter, and no filters. - * - * @param parent the parent control - * @param style the SWT style bits - */ - public CComboViewer(Composite parent, int style) { - this(new CCombo(parent, style)); - } - - /** - * Creates a combo viewer on the given combo control. - * The viewer has no input, no content provider, a default label provider, - * no sorter, and no filters. - * - * @param list the combo control - */ - public CComboViewer(CCombo list) { - this.combo = list; - hookControl(list); - } - - protected void listAdd(String string, int index) { - combo.add(string, index); - } - - protected void listSetItem(int index, String string) { - combo.setItem(index, string); - } - - protected int[] listGetSelectionIndices() { - return new int[] { combo.getSelectionIndex() }; - } - - protected int listGetItemCount() { - return combo.getItemCount(); - } - - protected void listSetItems(String[] labels) { - combo.setItems(labels); - } - - protected void listRemoveAll() { - combo.removeAll(); - } - - protected void listRemove(int index) { - combo.remove(index); - } - - /* (non-Javadoc) - * Method declared on Viewer. - */ - public Control getControl() { - return combo; - } - - /** - * Returns this list viewer's list control. - * - * @return the list control - */ - public CCombo getCombo() { - return combo; - } - - /* - * Do nothing -- combos only display the selected element, so there is no way - * we can ensure that the given element is visible without changing the selection. - * Method defined on StructuredViewer. - */ - public void reveal(Object element) { - return; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.AbstractListViewer#listSelectAndShow(int[]) - */ - protected void listSetSelection(int[] ixs) { - for (int idx = 0; idx < ixs.length; idx++) { - combo.select(ixs[idx]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.AbstractListViewer#listDeselectAll() - */ - protected void listDeselectAll() { - combo.deselectAll(); - combo.clearSelection(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.AbstractListViewer#listShowSelection() - */ - protected void listShowSelection() { - - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java deleted file mode 100644 index ce6d25d0d6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.widgets; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.forms.FormColors; -import org.eclipse.ui.forms.widgets.FormToolkit; -import org.eclipse.ui.forms.widgets.SharedScrolledComposite; - -//copied from package org.eclipse.jdt.internal.ui.preferences; -public class ScrolledPageContent extends SharedScrolledComposite { - - private FormToolkit fToolkit; - - public ScrolledPageContent(Composite parent) { - this(parent, SWT.V_SCROLL | SWT.H_SCROLL); - } - - public ScrolledPageContent(Composite parent, int style) { - super(parent, style); - - setFont(parent.getFont()); - - FormColors colors= new FormColors(parent.getDisplay()); - colors.setBackground(null); - colors.setForeground(null); - - fToolkit= new FormToolkit(colors); - - setExpandHorizontal(true); - setExpandVertical(true); - - Composite body= new Composite(this, SWT.NONE); - body.setFont(parent.getFont()); - setContent(body); - } - - /* (non-Javadoc) - * @see org.eclipse.swt.widgets.Widget#dispose() - */ - public void dispose() { - fToolkit.dispose(); - super.dispose(); - } - - public void adaptChild(Control childControl) { - fToolkit.adapt(childControl, true, true); - } - - public Composite getBody() { - return (Composite) getContent(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java deleted file mode 100644 index 337fe0c6d0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java +++ /dev/null @@ -1,361 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.wizards; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionListener; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.JptDbPlugin; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.db.ui.internal.DTPUiTools; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -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.Combo; -import org.eclipse.swt.widgets.Composite; -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 DatabaseReconnectWizardPage extends WizardPage { - private IJpaProject jpaProject; - - private Connection connection; - private ConnectionListener connectionListener; - private DatabaseGroup databaseGroup; - - public DatabaseReconnectWizardPage( IJpaProject jpaProject) { - super( "Database Settings"); //$NON-NLS-1$ - this.jpaProject = jpaProject; - setTitle( JptUiMessages.DatabaseReconnectWizardPage_databaseConnection); - setMessage( JptUiMessages.DatabaseReconnectWizardPage_reconnectToDatabase); - } - - public void createControl( Composite parent) { - this.setPageComplete( false); - Composite top = this.createTopLevelComposite( parent); - this.setControl( top); - } - - protected Composite createTopLevelComposite( Composite parent) { - Composite composite = new Composite( parent, SWT.NULL); - GridLayout layout = new GridLayout(); - composite.setLayout( layout); - this.databaseGroup = new DatabaseGroup( composite); - Dialog.applyDialogFont( parent); - // TODO Add Help - testing - PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION); - return composite; - } - - private Label createLabel( Composite container, int span, String text) { - Label label = new Label( container, SWT.NONE); - label.setText( text); - GridData gd = new GridData(); - gd.horizontalIndent = 30; - gd.horizontalSpan = span; - label.setLayoutData( gd); - return label; - } - - private Combo createCombo( Composite container, boolean fillHorizontal) { - Combo combo = new Combo( container, SWT.BORDER | SWT.SINGLE); - if ( fillHorizontal) { - combo.setLayoutData( new GridData( GridData.FILL_HORIZONTAL)); - } - else { - combo.setLayoutData( new GridData()); - } - return combo; - } - - /** - * Initialize a grid layout with the default Dialog settings. - */ - protected GridLayout initGridLayout( GridLayout layout, boolean margins) { - layout.horizontalSpacing = this.convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_SPACING); - layout.verticalSpacing = this.convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_SPACING); - if ( margins) { - layout.marginWidth = this.convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_MARGIN); - layout.marginHeight = this.convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_MARGIN); - } - else { - layout.marginWidth = 0; - layout.marginHeight = 0; - } - return layout; - } - - public Collection
    getTables() { - Schema schema = this.getProjectUserSchema(); - if ( schema != null && schema.getName() != null) { - return CollectionTools.collection( schema.tables()); - } - return Collections.
    emptyList(); - } - - private void updateGenerateEntitiesPage( Schema schema) { - GenerateEntitiesWizard generateEntitiesWizard = (( GenerateEntitiesWizard) this.getWizard()); - generateEntitiesWizard.updatePossibleTables( CollectionTools.collection( schema.tables())); - } - - public void dispose() { - this.removeConnectionListener(); - super.dispose(); - } - - private void removeConnectionListener() { - if ( this.connectionListener != null) { - if ( this.connection != null) { - this.connection.removeConnectionListener( this.connectionListener); - } - this.connectionListener = null; - } - } - - - ConnectionProfile getProjectConnectionProfile() { - String profileName = this.jpaProject.getDataSource().getConnectionProfileName(); - return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( profileName); - } - - Schema getProjectUserSchema() { - ConnectionProfile profile = this.getProjectConnectionProfile(); - return profile.getDatabase().schemaNamed( profile.getUserName()); - } - - // ********** member classes ********** - - private final class DatabaseGroup { - private final Group group; - private final Label connectionLabel; - private final Combo connectionCombo; - private final Label schemaLabel; - private final Combo schemaCombo; - private final Label schemaInfoLabel; - - private Link addConnectionLink; - private Link reconnectLink; - - public DatabaseGroup( Composite composite) { - this.group = new Group( composite, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - this.group.setLayout( layout); - this.group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL)); - this.group.setText( JptUiMessages.DatabaseReconnectWizardPage_database); - //TODO Add Help -// PlatformUI.getWorkbench().getHelpSystem().setHelp( this.group, IDaliHelpContextIds.XXX); - this.connectionLabel = createLabel( this.group, 1, JptUiMessages.DatabaseReconnectWizardPage_connection); - this.connectionCombo = createCombo( this.group, true); - this.connectionCombo.addSelectionListener( new SelectionAdapter() { - public void widgetDefaultSelected( SelectionEvent e) { - widgetSelected( e); - } - - public void widgetSelected( SelectionEvent e) { - handleConnectionChange(); - } - }); - this.schemaLabel = createLabel( this.group, 1, JptUiMessages.DatabaseReconnectWizardPage_schema); - this.schemaCombo = createCombo( this.group, true); - this.schemaCombo.addSelectionListener( new SelectionAdapter() { - public void widgetDefaultSelected( SelectionEvent e) { - widgetSelected( e); - } - - public void widgetSelected( SelectionEvent e) { - handleSchemaChange(); - } - }); - schemaInfoLabel = createLabel( this.group, 2, JptUiMessages.DatabaseReconnectWizardPage_schemaInfo); - this.addConnectionLink = new Link( this.group, SWT.NONE); - GridData data = new GridData( GridData.END, GridData.CENTER, false, false); - data.horizontalSpan = 2; - this.addConnectionLink.setLayoutData( data); - this.addConnectionLink.setText( JptUiMessages.DatabaseReconnectWizardPage_addConnectionLink); - this.addConnectionLink.addSelectionListener( new SelectionAdapter() { - public void widgetSelected( SelectionEvent e) { - openNewConnectionWizard(); - } - }); - this.reconnectLink = new Link( this.group, SWT.NONE); - data = new GridData( GridData.END, GridData.CENTER, false, false); - data.horizontalSpan = 2; - this.reconnectLink.setLayoutData( data); - this.reconnectLink.setText( JptUiMessages.DatabaseReconnectWizardPage_reconnectLink); - this.reconnectLink.setEnabled( false); - this.reconnectLink.addSelectionListener( new SelectionAdapter() { - public void widgetSelected( SelectionEvent e) { - openConnectionProfileNamed( connectionCombo.getText()); - } - }); - this.populateConnectionCombo(); - this.populateSchemaCombo(); - } - - private ConnectionProfile getConnectionProfileNamed( String profileName) { - return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( profileName); - } - - private Iterator dtpConnectionProfileNames() { - return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNames(); - } - - private String getProjectConnectionProfileName() { - return jpaProject.getDataSource().getConnectionProfileName(); - } - - Schema getProjectUserSchema() { - ConnectionProfile profile = getProjectConnectionProfile(); - return profile.getDatabase().schemaNamed( profile.getUserName()); - } - - private void openConnectionProfileNamed( String connectionProfileName) { - if( DatabaseReconnectWizardPage.this.connection != null) { - DatabaseReconnectWizardPage.this.removeConnectionListener(); - } - ConnectionProfile profile = JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( connectionProfileName); - profile.connect(); - DatabaseReconnectWizardPage.this.connection = profile.getConnection(); - if( DatabaseReconnectWizardPage.this.connection != null) { - this.populateSchemaCombo(); - DatabaseReconnectWizardPage.this.connectionListener = this.buildConnectionListener(); - DatabaseReconnectWizardPage.this.connection.addConnectionListener( DatabaseReconnectWizardPage.this.connectionListener); - } - return; - } - - private void populateConnectionCombo() { - // clear out connection entries from previous login. - this.connectionCombo.removeAll(); - for ( Iterator i = CollectionTools.sort( this.dtpConnectionProfileNames()); i.hasNext();) { - this.connectionCombo.add( ( String) i.next()); - } - - String connectionName = getProjectConnectionProfileName(); - if ( !StringTools.stringIsEmpty( connectionName)) { - this.connectionCombo.select( connectionCombo.indexOf( connectionName)); - this.reconnectLink.setEnabled( true); - } - } - - private void handleConnectionChange() { - this.reconnectLink.setEnabled( true); - this.populateSchemaCombo(); - } - - private void handleSchemaChange() { - ConnectionProfile connectionProfile = this.getConnectionProfileNamed( getConnectionProfileName()); - Schema schema = connectionProfile.getDatabase().schemaNamed( this.getSchemaName()); - DatabaseReconnectWizardPage.this.updateGenerateEntitiesPage( schema); - DatabaseReconnectWizardPage.this.setPageComplete( true); - } - - private void populateSchemaCombo() { - // clear out schema entries from previous connection selection - this.schemaCombo.removeAll(); - ConnectionProfile connectionProfile = this.getConnectionProfileNamed( getConnectionProfileName()); - for ( Iterator stream = CollectionTools.sort( connectionProfile.getDatabase().schemaNames()); stream.hasNext();) { - this.schemaCombo.add( ( String) stream.next()); - } - // set login user name as default schema - Schema schema = this.getProjectUserSchema(); - if ( schema != null && schema.getName() != null) { - schema = connectionProfile.getDatabase().schemaNamed( schema.getName()); // verify schema exist - if ( schema != null) { - this.schemaCombo.select( this.schemaCombo.indexOf( schema.getName())); - updateGenerateEntitiesPage( schema); - setPageComplete( true); - } - } - } - - private String getConnectionProfileName() { - return this.connectionCombo.getText(); - } - - private String getSchemaName() { - return this.schemaCombo.getText(); - } - - private void openNewConnectionWizard() { - String addedProfileName = DTPUiTools.createNewProfile(); - - ConnectionProfile addedProfile = ConnectionProfileRepository.instance().profileNamed( addedProfileName); - - if( !addedProfile.isNull()) { - this.populateConnectionCombo(); - this.connectionCombo.select( connectionCombo.indexOf( addedProfile.getName())); - this.handleConnectionChange(); - } - } - - private ConnectionListener buildConnectionListener() { - return new ConnectionListener() { - - public void modified( Connection connection) { - // not interested to this event. - } - - public boolean okToClose( Connection connection) { - // not interested to this event. - return true; - } - - public void opened( Connection connection) { - if( DatabaseReconnectWizardPage.this.connection.equals( connection)) { - DatabaseGroup.this.populateSchemaCombo(); - } - } - - public void aboutToClose( Connection connection) { - if( DatabaseReconnectWizardPage.this.connection.equals( connection)) { - DatabaseReconnectWizardPage.this.removeConnectionListener(); - } - } - - public void closed( Connection connection) { - // not interested to this event. - } - - public void databaseChanged(Connection connection, final Database database) { - // not interested to this event. - } - - public void schemaChanged(Connection connection, final Schema schema) { - // not interested to this event. - } - - public void tableChanged(Connection connection, final Table table) { - // not interested to this event. - } - }; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java deleted file mode 100644 index 65c7177df1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java +++ /dev/null @@ -1,169 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.wizards; - -import java.util.Collection; -import java.util.Collections; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.gen.internal.EntityGenerator; -import org.eclipse.jpt.gen.internal.PackageGenerator; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.utility.internal.CollectionTools; - -public class GenerateEntitiesWizard extends Wizard { - - private IJpaProject jpaProject; - - private IStructuredSelection selection; - - /** this page is only built when the project is not connected to the db */ - private DatabaseReconnectWizardPage dbSettingsPage; - - private GenerateEntitiesWizardPage generateEntitiesPage; - - private PackageGenerator.Config packageGeneratorConfig; - - private EntityGenerator.Config entityGeneratorConfig; - - private boolean synchronizePersistenceXml; - - private Collection
    selectedTables; - - public GenerateEntitiesWizard( IJpaProject jpaProject, IStructuredSelection selection) { - super(); - this.jpaProject = jpaProject; - this.selection = selection; - this.packageGeneratorConfig = new PackageGenerator.Config(); - this.entityGeneratorConfig = new EntityGenerator.Config(); - this.setWindowTitle( JptUiMessages.GenerateEntitiesWizard_generateEntities); - } - - public void addPages() { - super.addPages(); - if ( ! this.jpaProjectIsConnected() || ! this.projectUserSchemaExists()) { - this.dbSettingsPage = new DatabaseReconnectWizardPage( this.jpaProject); - this.addPage(this.dbSettingsPage); - } - this.generateEntitiesPage = new GenerateEntitiesWizardPage(); - this.addPage( this.generateEntitiesPage); - this.generateEntitiesPage.init( this.selection); - } - - public boolean performFinish() { - this.packageGeneratorConfig.setPackageFragment( this.buildPackageFragment()); - - this.entityGeneratorConfig.setConvertToCamelCase( this.generateEntitiesPage.convertToCamelCase()); - this.entityGeneratorConfig.setFieldAccessType( this.generateEntitiesPage.fieldAccessType()); - this.entityGeneratorConfig.setCollectionTypeName( this.generateEntitiesPage.getCollectionTypeName()); - this.entityGeneratorConfig.setFieldVisibility( this.generateEntitiesPage.getFieldVisibility()); - this.entityGeneratorConfig.setMethodVisibility( this.generateEntitiesPage.getMethodVisibility()); - this.entityGeneratorConfig.setGenerateGettersAndSetters( this.generateEntitiesPage.generateGettersAndSetters()); - this.entityGeneratorConfig.setGenerateDefaultConstructor( this.generateEntitiesPage.generateDefaultConstructor()); - this.entityGeneratorConfig.setSerializable( this.generateEntitiesPage.serializable()); - this.entityGeneratorConfig.setGenerateSerialVersionUID( this.generateEntitiesPage.generateSerialVersionUID()); - this.entityGeneratorConfig.setGenerateEmbeddedIdForCompoundPK( this.generateEntitiesPage.generateEmbeddedIdForCompoundPK()); - this.entityGeneratorConfig.setOverrideEntityNames( this.generateEntitiesPage.getOverrideEntityNames()); - - this.synchronizePersistenceXml = this.generateEntitiesPage.synchronizePersistenceXml(); - - this.selectedTables = this.generateEntitiesPage.getSelectedTables(); - return true; - } - - private IPackageFragment buildPackageFragment() { - IPackageFragmentRoot packageFragmentRoot = this.generateEntitiesPage.getPackageFragmentRoot(); - IPackageFragment packageFragment = this.generateEntitiesPage.getPackageFragment(); - - if ( packageFragment == null) { - packageFragment= packageFragmentRoot.getPackageFragment( ""); //$NON-NLS-1$ - } - - if ( packageFragment.exists()) { - return packageFragment; - } - - try { - return packageFragmentRoot.createPackageFragment( packageFragment.getElementName(), true, null); - } - catch ( JavaModelException ex) { - throw new RuntimeException( ex); - } - } - - Collection
    getPossibleTables() { - if ( this.dbSettingsPage != null) { - return this.dbSettingsPage.getTables(); - } - return ( this.projectUserSchemaExists()) ? CollectionTools.collection( this.getProjectUserSchema().tables()) : Collections.
    emptyList(); - } - - ConnectionProfile getProjectConnectionProfile() { - return this.jpaProject.connectionProfile(); - } - - IJpaProject getJpaProject(){ - return this.jpaProject; - } - - Schema getProjectUserSchema() { - ConnectionProfile profile = this.getProjectConnectionProfile(); - return profile.getDatabase().schemaNamed( profile.getUserName()); - } - - public PackageGenerator.Config getPackageGeneratorConfig() { - return this.packageGeneratorConfig; - } - - public EntityGenerator.Config getEntityGeneratorConfig() { - return this.entityGeneratorConfig; - } - - public Collection
    getSelectedTables() { - return this.selectedTables; - } - - public boolean synchronizePersistenceXml(){ - return this.synchronizePersistenceXml; - } - - public boolean canFinish() { - boolean canFinish = true; - if ( ! this.generateEntitiesPage.isPageComplete()) { - canFinish = false; - } - return canFinish; - } - - private boolean jpaProjectIsConnected() { - return this.getProjectConnectionProfile().isConnected(); - } - - private boolean projectUserSchemaExists() { - return ( this.getProjectUserSchema() != null); - } - - /** - * updatePossibleTables is called when schema’s PossibleTables changed. - * The dbSettingsPage is mainly the source of changes, - * and the generateEntitiesPage needs to be kept in sync. - */ - void updatePossibleTables( Collection
    possibleTables) { - this.generateEntitiesPage.updateTablesListViewer( possibleTables); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java deleted file mode 100644 index 2a00d5cb61..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java +++ /dev/null @@ -1,539 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.wizards; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jpt.ui.internal.util.SWTUtil; -import org.eclipse.jpt.ui.internal.util.TableLayoutComposite; -import org.eclipse.jdt.ui.wizards.NewTypeWizardPage; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ColumnWeightData; -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.IStructuredSelection; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.gen.internal.EntityGenerator; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.utility.internal.StringTools; -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.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.Group; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.PlatformUI; - -// TODO determine name collisions -class GenerateEntitiesWizardPage extends NewTypeWizardPage { - - CheckboxTableViewer tableTable; - - private boolean convertToCamelCase = true; - private boolean fieldAccessType = true; - private String collectionTypeName = Set.class.getName(); - private int fieldVisibility = EntityGenerator.Config.PRIVATE; - private int methodVisibility = EntityGenerator.Config.PUBLIC; - private boolean generateGettersAndSetters = true; - private boolean generateDefaultConstructor = true; - private boolean serializable = true; - private boolean generateSerialVersionUID = true; - private boolean generateEmbeddedIdForCompoundPK = true; - private boolean synchronizePersistenceXml = false; - private Map overrideEntityNames; - - static final String[] TABLE_TABLE_COLUMN_PROPERTIES = { "table", "entityName" }; - private static final int TABLE_COLUMN_INDEX = 0; - private static final int ENTITY_NAME_COLUMN_INDEX = 1; - - - GenerateEntitiesWizardPage() { - super(true, "Generate Entities"); //$NON-NLS-1$ - setTitle(JptUiMessages.GenerateEntitiesWizardPage_generateEntities); - setMessage(JptUiMessages.GenerateEntitiesWizardPage_chooseEntityTable); - } - - // -------- 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 - */ - void init(IStructuredSelection selection) { - IJavaElement jelem= getInitialJavaElement(selection); - initContainerPage(jelem); - initTypePage(jelem); - doStatusUpdate(); - } - - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NULL); - int nColumns= 4; - GridLayout layout = new GridLayout(); - layout.numColumns = nColumns; - composite.setLayout(layout); - PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJpaHelpContextIds.DIALOG_GENERATE_ENTITIES); - - createContainerControls(composite, nColumns); - createPackageControls(composite, nColumns); - - final Button synchronizeClassesCheckBox = new Button(composite, SWT.CHECK); - synchronizeClassesCheckBox.setText(JptUiMessages.GenerateEntitiesWizardPage_synchronizeClasses); - synchronizeClassesCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - setSynchronizePersistenceXml(synchronizeClassesCheckBox.getSelection()); - } - }); - - Group tablesGroup = new Group(composite, SWT.SHADOW_ETCHED_IN); - tablesGroup.setLayout(new GridLayout(2, false)); - tablesGroup.setText(JptUiMessages.GenerateEntitiesWizardPage_tables); - GridData data = new GridData(); - data.horizontalSpan = 4; - data.verticalAlignment = SWT.FILL; - data.horizontalAlignment = SWT.FILL; - data.grabExcessHorizontalSpace = true; - data.grabExcessVerticalSpace = true; - tablesGroup.setLayoutData(data); - - createTablesSelectionControl(tablesGroup); - createButtonComposite(tablesGroup); - - GenerateEntitiesWizard generateEntitiesWizard = ((GenerateEntitiesWizard)this.getWizard()); - Collection
    possibleTables = generateEntitiesWizard.getPossibleTables(); - initTablesSelectionControl(possibleTables); - - //set initial selection state of the synchronize classes checkbox - synchronizeClassesCheckBox.setSelection(!generateEntitiesWizard.getJpaProject().isDiscoverAnnotatedClasses()); - setSynchronizePersistenceXml(synchronizeClassesCheckBox.getSelection()); - - PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableTable.getControl(), IJpaHelpContextIds.DIALOG_GENERATE_ENTITIES_TABLES); - - setControl(composite); - this.setPageComplete( false); - } - - private void selectAllTables(){ - this.tableTable.setAllChecked(true); - doStatusUpdate(); - } - - private void deselectAllTables(){ - this.tableTable.setAllChecked(false); - doStatusUpdate(); - } - - private void initTablesSelectionControl(Collection
    possibleTables) { - this.overrideEntityNames = new HashMap(possibleTables.size()); - this.tableTable.setInput(possibleTables); - } - - private void createTablesSelectionControl(Composite parent) { - 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 | SWT.CHECK); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableColumn tableNameColumn = new TableColumn(table, SWT.NONE, TABLE_COLUMN_INDEX); - tableNameColumn.setText(JptUiMessages.GenerateEntitiesWizardPage_tableColumn); - tableNameColumn.setResizable(true); - - TableColumn entityNameColumn = new TableColumn(table, SWT.NONE, ENTITY_NAME_COLUMN_INDEX); - entityNameColumn.setText(JptUiMessages.GenerateEntitiesWizardPage_entityNameColumn); - entityNameColumn.setResizable(true); - - GridData gd= new GridData(GridData.FILL_BOTH); - gd.heightHint= SWTUtil.getTableHeightHint(table, 20); - gd.widthHint = 600; - layout.setLayoutData(gd); - - this.tableTable = new CheckboxTableViewer(table); - this.tableTable.setUseHashlookup(true); - this.tableTable.setLabelProvider(this.buildTableTableLabelProvider()); - this.tableTable.setContentProvider(this.buildTableTableContentProvider()); - this.tableTable.setSorter(new ViewerSorter() { - public int compare(Viewer viewer, Object e1, Object e2) { - return ((Table) e1).getName().compareTo(((Table) e2).getName()); - } - }); - - this.tableTable.addPostSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - handleTablesListSelectionChanged(event); - } - }); - - table.addKeyListener(new KeyAdapter() { - public void keyPressed(KeyEvent e) { - if (e.keyCode == SWT.F2 && e.stateMask == SWT.NONE) { - editEntityNameIfPossible(); - e.doit= false; - } - } - }); - - this.addCellEditors(); - } - - private void createButtonComposite(Group tablesGroup){ - - 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 selectAllButton = new Button(buttonComposite, SWT.PUSH); - selectAllButton.setText(JptUiMessages.General_selectAll); - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - selectAllButton.setLayoutData(gridData); - selectAllButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - selectAllTables(); - - } - }); - - Button deselectAllButton = new Button(buttonComposite, SWT.PUSH); - deselectAllButton.setText(JptUiMessages.General_deselectAll); - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - deselectAllButton.setLayoutData(gridData); - deselectAllButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - deselectAllTables(); - } - }); - } - - - private void addColumnLayoutData(TableLayoutComposite layout) { - layout.addColumnData(new ColumnWeightData(50, true)); - layout.addColumnData(new ColumnWeightData(50, true)); - } - - void editEntityNameIfPossible(){ - Object[] selected = ((IStructuredSelection) this.tableTable.getSelection()).toArray(); - if (selected.length != 1) { - return; - } - this.tableTable.editElement(selected[0], ENTITY_NAME_COLUMN_INDEX); - } - - private void addCellEditors() { - this.tableTable.setColumnProperties(TABLE_TABLE_COLUMN_PROPERTIES); - - TextCellEditor[] editors = new TextCellEditor[TABLE_TABLE_COLUMN_PROPERTIES.length]; - editors[ENTITY_NAME_COLUMN_INDEX]= new TextCellEditor(this.tableTable.getTable(), SWT.SINGLE); - - this.tableTable.setCellEditors(editors); - this.tableTable.setCellModifier(this.buildTableTableCellModifier()); - } - - void handleTablesListSelectionChanged(SelectionChangedEvent event) { - this.setPageComplete(true); - if ( ! this.hasTablesSelected()) { - this.setPageComplete(false); - } - } - - private IBaseLabelProvider buildTableTableLabelProvider() { - return new TableTableLabelProvider(); - } - - private IContentProvider buildTableTableContentProvider() { - return new TableTableContentProvider(); - } - - private ICellModifier buildTableTableCellModifier() { - return new TableTableCellModifier(); - } - - Collection
    getSelectedTables() { - ArrayList
    selectedTables = new ArrayList
    (); - for (Object selectedTable : this.tableTable.getCheckedElements()) - selectedTables.add((Table) selectedTable); - return selectedTables; - } - - private boolean hasTablesSelected() { - return (this.tableTable != null) ? (this.getSelectedTables().size() > 0) : false; - } - - void updateTablesListViewer(Collection
    possibleTables) { - if (this.tableTable != null) { - this.initTablesSelectionControl(possibleTables); - } - } - - private void doStatusUpdate() { - // status of all used components - IStatus[] status= new IStatus[] { - fContainerStatus, - fPackageStatus - }; - // the mode severe status will be displayed and the OK button enabled/disabled. - this.updateStatus(status); - } - - /** - * Update the status line and the OK button according to the given status - */ - protected void updateStatus(IStatus status) { - super.updateStatus(status); - if (this.isPageComplete() && ! this.hasTablesSelected()) { - this.setPageComplete(false); - } - } - - String entityName(Table table) { - String overrideEntityName = (String) this.overrideEntityNames.get(table); - return (overrideEntityName != null) ? overrideEntityName : this.defaultEntityName(table); - } - - private String defaultEntityName(Table table) { - String entityName = table.shortJavaClassName(); - if (this.convertToCamelCase) { - entityName = StringTools.convertUnderscoresToCamelCase(entityName); - } - return entityName; - } - - void setOverrideEntityName(Table table, String name) { - if (table.shortJavaClassName().equals(name)) { - this.overrideEntityNames.remove(table); - } else { - this.overrideEntityNames.put(table, name); - } - } - - boolean convertToCamelCase() { - return this.convertToCamelCase; - } - private void setConvertToCamelCase(boolean convertToCamelCase) { - // TODO re-calculate the default entity names if this changes - this.convertToCamelCase = convertToCamelCase; - } - - boolean fieldAccessType() { - return this.fieldAccessType; - } - private void setFieldAccessType(boolean fieldAccessType) { - this.fieldAccessType = fieldAccessType; - } - - String getCollectionTypeName() { - return this.collectionTypeName; - } - private void setCollectionTypeName(String collectionTypeName) { - this.collectionTypeName = collectionTypeName; - } - - int getFieldVisibility() { - return this.fieldVisibility; - } - private void setFieldVisibility(int fieldVisibility) { - this.fieldVisibility = fieldVisibility; - } - - int getMethodVisibility() { - return this.methodVisibility; - } - private void setMethodVisibility(int methodVisibility) { - this.methodVisibility = methodVisibility; - } - - boolean generateGettersAndSetters() { - return this.generateGettersAndSetters; - } - private void setGenerateGettersAndSetters(boolean generateGettersAndSetters) { - this.generateGettersAndSetters = generateGettersAndSetters; - } - - boolean generateDefaultConstructor() { - return this.generateDefaultConstructor; - } - private void setGenerateDefaultConstructor(boolean generateDefaultConstructor) { - this.generateDefaultConstructor = generateDefaultConstructor; - } - - boolean serializable() { - return this.serializable; - } - private void setSerializable(boolean serializable) { - this.serializable = serializable; - } - - boolean generateSerialVersionUID() { - return this.generateSerialVersionUID; - } - private void setGenerateSerialVersionUID(boolean generateSerialVersionUID) { - this.generateSerialVersionUID = generateSerialVersionUID; - } - - boolean generateEmbeddedIdForCompoundPK() { - return this.generateEmbeddedIdForCompoundPK; - } - private void setGenerateEmbeddedIdForCompoundPK(boolean generateEmbeddedIdForCompoundPK) { - this.generateEmbeddedIdForCompoundPK = generateEmbeddedIdForCompoundPK; - } - - boolean synchronizePersistenceXml() { - return this.synchronizePersistenceXml; - } - - private void setSynchronizePersistenceXml(boolean synchronizePersistenceXml){ - this.synchronizePersistenceXml = synchronizePersistenceXml; - } - - /** - * key = table - * value = override entity name - */ - Map getOverrideEntityNames() { - return this.overrideEntityNames; - } - - - // ********** inner classes ********** - - private class TableTableLabelProvider extends LabelProvider implements ITableLabelProvider { - - TableTableLabelProvider() { - super(); - } - - 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(); - - case ENTITY_NAME_COLUMN_INDEX: - return GenerateEntitiesWizardPage.this.entityName((Table) element); - } - throw new IllegalArgumentException("invalid column index: " + columnIndex); - } - - } - - - private class TableTableContentProvider implements IStructuredContentProvider { - - TableTableContentProvider() { - super(); - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // do nothing - } - - public void dispose() { - // do nothing - } - - public Object[] getElements(Object inputElement) { - return ((Collection) inputElement).toArray(); - } - - } - - - private class TableTableCellModifier implements ICellModifier { - - TableTableCellModifier() { - super(); - } - - public boolean canModify(Object element, String property) { - return property.equals(TABLE_TABLE_COLUMN_PROPERTIES[ENTITY_NAME_COLUMN_INDEX]); - } - - public Object getValue(Object element, String property) { - if (property.equals(TABLE_TABLE_COLUMN_PROPERTIES[ENTITY_NAME_COLUMN_INDEX])) { - return GenerateEntitiesWizardPage.this.entityName((Table) element); - } - return null; - } - - public void modify(Object element, String property, Object value) { - if (element instanceof TableItem) { - element= ((TableItem) element).getData(); - } - if ( ! (element instanceof Table)) { - return; - } - - boolean unchanged = false; - Table table = (Table) element; - if (property.equals(TABLE_TABLE_COLUMN_PROPERTIES[ENTITY_NAME_COLUMN_INDEX])) { - unchanged = GenerateEntitiesWizardPage.this.entityName(table).equals(value); - GenerateEntitiesWizardPage.this.setOverrideEntityName(table, (String) value); - } - if (! unchanged) { - GenerateEntitiesWizardPage.this.tableTable.update(table, new String[] { property }); - } - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java deleted file mode 100644 index 225c69e19a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java +++ /dev/null @@ -1,528 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.wizards; - -import java.util.Iterator; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.preference.PreferenceDialog; -import org.eclipse.jface.viewers.ComboViewer; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jpt.core.internal.JpaPlatformRegistry; -import org.eclipse.jpt.core.internal.facet.IJpaFacetDataModelProperties; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.jpt.db.ui.internal.DTPUiTools; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.JptUiIcons; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jpt.ui.internal.prefs.JpaPreferencePage; -import org.eclipse.jpt.utility.internal.CollectionTools; -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.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Link; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.PreferencesUtil; -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.project.facet.ui.internal.AbstractDataModel; -import org.eclipse.wst.common.project.facet.ui.internal.ChangeTargetedRuntimesDataModel; -import org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPage; -import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage; - -public class JpaFacetWizardPage - extends DataModelFacetInstallPage - implements IJpaFacetDataModelProperties -{ - private PlatformGroup platformGroup; - - private ConnectionGroup connectionGroup; - - private ClasspathConfigGroup classpathConfigGroup; - - private PersistentClassManagementGroup persistentClassManagementGroup; - - private OrmXmlGroup ormXmlGroup; - - - public JpaFacetWizardPage() { - super("jpt.jpa.facet.install.page"); //$NON-NLS-1$ - setTitle(JptUiMessages.JpaFacetWizardPage_title); - setDescription(JptUiMessages.JpaFacetWizardPage_description); - setImageDescriptor(JptUiPlugin.getPlugin().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); - - platformGroup = new PlatformGroup(composite); - connectionGroup = new ConnectionGroup(composite); - classpathConfigGroup = new ClasspathConfigGroup(composite); - persistentClassManagementGroup = new PersistentClassManagementGroup(composite); - ormXmlGroup = new OrmXmlGroup(composite); - - setUpRuntimeListener(); - - Dialog.applyDialogFont(parent); - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJpaHelpContextIds.DIALOG_JPA_FACET); - - return composite; - } - - private void setUpRuntimeListener() { - final ChangeTargetedRuntimesDataModel runtimeDataModel = getRuntimeDataModel(); - // must do it manually the first time - model.setProperty(RUNTIME, runtimeDataModel.getPrimaryRuntime()); - runtimeDataModel.addListener( - ChangeTargetedRuntimesDataModel.EVENT_PRIMARY_RUNTIME_CHANGED, - new AbstractDataModel.IDataModelListener() { - public void handleEvent() { - model.setProperty(RUNTIME, runtimeDataModel.getPrimaryRuntime()); - } - } - ); - } - - private ChangeTargetedRuntimesDataModel getRuntimeDataModel() { - // This is hacky, but unfortunately the only current way to do this - // see bug 138074 - FacetsSelectionPage facetPage = null; - for (IWizardPage page : getWizard().getPages()) { - if (page instanceof FacetsSelectionPage) { - facetPage = (FacetsSelectionPage) page; - break; - } - } - return (facetPage == null) ? - null : - facetPage.panel.getDataModel().getTargetedRuntimesDataModel(); - } - - - - 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 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; - } - - private 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_ID, - CONNECTION, - USE_SERVER_JPA_IMPLEMENTATION, - JPA_LIBRARY, - DISCOVER_ANNOTATED_CLASSES - }; - } - - @Override - public boolean isPageComplete() { - if (! super.isPageComplete()) { - return false; - } - else { - return (model.validate().getSeverity() != IStatus.ERROR); - } - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) { - setErrorMessage(); - } - } - - - private final class PlatformGroup - { - private final ComboViewer 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, IJpaHelpContextIds.DIALOG_JPA_PLATFORM); - - platformCombo = new ComboViewer(createCombo(group, 1, true)); - platformCombo.setContentProvider( - new IStructuredContentProvider() { - public Object[] getElements(Object inputElement) { - return CollectionTools.array(JpaPlatformRegistry.INSTANCE.allJpaPlatformIds()); - } - - public void dispose() {} - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} - } - ); - platformCombo.setLabelProvider( - new ILabelProvider() { - public Image getImage(Object element) { - return null; - } - - public String getText(Object element) { - return JpaPlatformRegistry.INSTANCE.getJpaPlatformLabel((String) element); - } - - public void addListener(ILabelProviderListener listener) {} - - public void removeListener(ILabelProviderListener listener) {} - - public void dispose() {} - - public boolean isLabelProperty(Object element, String property) { - return true; - } - } - ); - platformCombo.addSelectionChangedListener( - new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - model.setProperty(PLATFORM_ID, ((StructuredSelection) event.getSelection()).getFirstElement()); - } - } - ); - // we need some input here, even if it means absolutely nothing - platformCombo.setInput("null input"); - if (platformCombo.getElementAt(0) != null) { - platformCombo.setSelection(new StructuredSelection(platformCombo.getElementAt(0))); - } - } - } - - - private final class ConnectionGroup - { - private final Combo connectionCombo; - - private Link connectionLink; - - - public ConnectionGroup(Composite composite) { - Group group = new Group(composite, SWT.NONE); - group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel); - group.setLayout(new GridLayout()); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE); - - connectionCombo = createCombo(group, 1, true); - connectionCombo.addSelectionListener( - new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - model.setProperty(CONNECTION, connectionCombo.getItem(connectionCombo.getSelectionIndex())); - } - - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - } - ); - fillConnections(); - if (connectionCombo.getItemCount() > 0) { - connectionCombo.select(0); - model.setProperty(CONNECTION, connectionCombo.getItem(0)); - } - else { - connectionCombo.clearSelection(); - model.setProperty(CONNECTION, null); - } - - 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() { - public void widgetSelected(SelectionEvent e) { - openNewConnectionWizard(); - } - } - ); - } - - private void fillConnections() { - //clear out connection entries from previous login. - connectionCombo.removeAll(); - - for (Iterator stream = ConnectionProfileRepository.instance().profileNames(); stream.hasNext(); ) { - connectionCombo.add((String) stream.next()); - } - } - - private String getConnectionName() { - return connectionCombo.getText(); - } - - private void openNewConnectionWizard() { - String connectionName = DTPUiTools.createNewProfile(); - if (connectionName != null) { - fillConnections(); - model.setProperty(CONNECTION, connectionName); - connectionCombo.select(connectionCombo.indexOf(connectionName)); - } - } - } - - - private final class ClasspathConfigGroup - { - private final Button useServerLibButton; - - private final Button specifyLibButton; - - private final Combo jpaLibCombo; - - private final Link jpaPrefsLink; - - private final Link userLibsLink; - - - - public ClasspathConfigGroup(Composite composite) { - Group group = new Group(composite, SWT.NONE); - group.setText(JptUiMessages.JpaFacetWizardPage_jpaImplementationLabel); - group.setLayout(new GridLayout(2, false)); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH); - - useServerLibButton = createButton(group, 2, JptUiMessages.JpaFacetWizardPage_userServerLibLabel, SWT.RADIO); - useServerLibButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, true); - } - } - ); - - specifyLibButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_specifyLibLabel, SWT.RADIO); - specifyLibButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, false); - } - } - ); - - jpaLibCombo = createCombo(group, 1, true); - synchHelper.synchCombo(jpaLibCombo, JPA_LIBRARY, null); - - model.addListener( - new IDataModelListener() { - public void propertyChanged(DataModelEvent event) { - if (USE_SERVER_JPA_IMPLEMENTATION.equals(event.getPropertyName())) { - boolean useServerLib = (Boolean) event.getProperty(); - useServerLibButton.setSelection(useServerLib); - specifyLibButton.setSelection(! useServerLib); - jpaLibCombo.setEnabled(! useServerLib); - } - } - } - ); - - jpaPrefsLink = new Link(group, SWT.NONE); - GridData data = new GridData(GridData.END, GridData.CENTER, false, false); - data.horizontalSpan = 2; - jpaPrefsLink.setLayoutData(data); - jpaPrefsLink.setText(JptUiMessages.JpaFacetWizardPage_jpaPrefsLink); - jpaPrefsLink.addSelectionListener( - new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - promptToConfigJpaPrefs(); - } - } - ); - - userLibsLink = new Link(group, SWT.NONE); - data = new GridData(GridData.END, GridData.CENTER, false, false); - data.horizontalSpan = 2; - userLibsLink.setLayoutData(data); - userLibsLink.setText(JptUiMessages.JpaFacetWizardPage_userLibsLink); - userLibsLink.addSelectionListener( - new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - promptToConfigUserLibraries(); - } - } - ); - } - - private void promptToConfigJpaPrefs() { - PreferenceDialog dlg = - PreferencesUtil.createPreferenceDialogOn( - getShell(), - JpaPreferencePage.ID, - new String[] {JpaPreferencePage.ID}, - null); - dlg.open(); - model.notifyPropertyChange(JPA_LIBRARY, IDataModel.VALID_VALUES_CHG); - model.notifyPropertyChange(JPA_LIBRARY, IDataModel.DEFAULT_CHG); - } - - private void promptToConfigUserLibraries() { - PreferenceDialog dlg = - PreferencesUtil.createPreferenceDialogOn( - getShell(), - UserLibraryPreferencePage.ID, - new String[] {UserLibraryPreferencePage.ID}, - null); - dlg.open(); - model.notifyPropertyChange(JPA_LIBRARY, IDataModel.VALID_VALUES_CHG); - } - } - - - private 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, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH); - - discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO); - discoverClassesButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, true); - } - } - ); - - listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO); - listClassesButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, false); - } - } - ); - - model.addListener( - new IDataModelListener() { - public void propertyChanged(DataModelEvent event) { - if (DISCOVER_ANNOTATED_CLASSES.equals(event.getPropertyName())) { - boolean discoverClasses = (Boolean) event.getProperty(); - discoverClassesButton.setSelection(discoverClasses); - listClassesButton.setSelection(! discoverClasses); - } - } - } - ); - } - } - - - private 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, IJpaHelpContextIds.DIALOG_CREATE_ORM); - - createOrmXmlButton = new Button(group, SWT.CHECK); - createOrmXmlButton.setText(JptUiMessages.JpaFacetWizardPage_createOrmXmlButton); - createOrmXmlButton.setSelection(model.getBooleanProperty(CREATE_ORM_XML)); - createOrmXmlButton.addSelectionListener( - new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - public void widgetSelected(SelectionEvent e) { - model.setBooleanProperty(CREATE_ORM_XML, createOrmXmlButton.getSelection()); - } - } - ); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java deleted file mode 100644 index 299d2ebb06..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.wizards; - -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jst.j2ee.ui.project.facet.UtilityProjectFirstPage; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class NewJpaProjectFirstPage extends UtilityProjectFirstPage -{ - public NewJpaProjectFirstPage(IDataModel dataModel, String pageName) { - super(dataModel, pageName); - setTitle(JptUiMessages.NewJpaProjectWizard_firstPage_title); - setDescription(JptUiMessages.NewJpaProjectWizard_firstPage_description); - setInfopopID(IJpaHelpContextIds.NEW_JPA_PROJECT); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java deleted file mode 100644 index d5f83a3b49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.wizards; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jpt.ui.internal.JptUiIcons; -import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jst.j2ee.ui.project.facet.UtilityProjectWizard; -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; - -public class NewJpaProjectWizard extends UtilityProjectWizard { - - public NewJpaProjectWizard() { - super(); - setWindowTitle(JptUiMessages.NewJpaProjectWizard_title); - } - - public NewJpaProjectWizard(IDataModel model) { - super(model); - setWindowTitle(JptUiMessages.NewJpaProjectWizard_title); - } - - // TODO - when we have a data model to add -// protected IDataModel createDataModel() { -// return DataModelFactory.createDataModel(new UtilityProjectCreationDataModelProvider()); -// } - - protected ImageDescriptor getDefaultPageImageDescriptor() { - return JptUiPlugin.getPlugin().getImageDescriptor(JptUiIcons.JPA_WIZ_BANNER); - } - - protected IFacetedProjectTemplate getTemplate() { - return ProjectFacetsManager.getTemplate("jpt.jpa.template"); - } - - protected IWizardPage createFirstPage() { - return new NewJpaProjectFirstPage(model, "first.page"); //$NON-NLS-1$ - } - - protected String getFinalPerspectiveID() { - return "org.eclipse.jpt.ui.jpaPerspective"; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java deleted file mode 100644 index c6804dd5a9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml; - -import org.eclipse.osgi.util.NLS; - -public class JptUiXmlMessages -{ - private static final String BUNDLE_NAME = "jpt_ui_xml"; //$NON-NLS-1$ - - public static String PersistentTypePage_javaClassLabel; - public static String PersistentTypePage_MetadataCompleteLabel; - public static String PersistentTypePage_AccessLabel; - - public static String PersistenceUnitMetadataSection_SchemaDefault; - public static String PersistenceUnitMetadataSection_CatalogDefault; - - public static String PersistentAttributePage_javaAttributeLabel; - - public static String XMLEntityMappingsPage_XmlMappingMetadataCompleteCheckBox; - public static String XMLEntityMappingsPage_CascadePersistCheckBox; - public static String XMLEntityMappingsPage_PersistenceUnitSection; - public static String XMLEntityMappingsPage_SchemaDefault; - public static String XMLEntityMappingsPage_SchemaNoDefaultSpecified; - public static String XMLEntityMappingsPage_CatalogDefault; - public static String XMLEntityMappingsPage_CatalogNoDefaultSpecified; - - public static String XmlSchemaChooser_SchemaChooser; - public static String XmlCatalogChooser_CatalogChooser; - - public static String XmlJavaClassChooser_XmlJavaClassDialog_title; - public static String XmlJavaClassChooser_XmlJavaClassDialog_message; - public static String XmlPackageChooser_PackageDialog_title; - public static String XmlPackageChooser_PackageDialog_message; - - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, JptUiXmlMessages.class); - } - - private JptUiXmlMessages() { - throw new UnsupportedOperationException(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java deleted file mode 100644 index 55afba9db8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class AccessTypeComboViewer extends BaseJpaController -{ - private AccessHolder accessHolder; - private Adapter accessHolderListener; - - private CComboViewer comboViewer; - - - public AccessTypeComboViewer(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildAccessHolderListener(); - } - - - private void buildAccessHolderListener() { - this.accessHolderListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - accessHolderChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - this.comboViewer = new CComboViewer(combo); - this.comboViewer.setLabelProvider(buildAccessTypeLabelProvider()); - this.comboViewer.add(AccessType.VALUES.toArray()); - - this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - AccessTypeComboViewer.this.accessTypeSelectionChanged(event.getSelection()); - } - }); - } - - private IBaseLabelProvider buildAccessTypeLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == AccessType.DEFAULT) { - return JptUiMappingsMessages.AccessTypeCombo_default; - } - return super.getText(element); - } - }; - } - - void accessTypeSelectionChanged(ISelection selection) { - if (selection instanceof IStructuredSelection) { - AccessType access = (AccessType) ((IStructuredSelection) selection).getFirstElement(); - if ( ! this.accessHolder.getAccess().equals(access)) { - this.accessHolder.setAccess(access); - } - } - } - - private void accessHolderChanged(Notification notification) { - if (notification.getFeatureID(accessHolder.featureClass()) == - this.accessHolder.featureId()) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.accessHolder != null && this.accessHolder.wrappedObject() != null) { - this.accessHolder.wrappedObject().eAdapters().add(this.accessHolderListener); - } - } - - @Override - protected void disengageListeners() { - if (this.accessHolder != null && this.accessHolder.wrappedObject() != null) { - this.accessHolder.wrappedObject().eAdapters().remove(this.accessHolderListener); - } - } - - public final void populate(AccessHolder accessHolder) { - super.populate(accessHolder); - } - - @Override - public void doPopulate(EObject obj) { - this.accessHolder = (AccessHolder) obj; - populateCombo(); - } - - @Override - protected void doPopulate() { - populateCombo(); - } - - private void populateCombo() { - if (this.accessHolder.wrappedObject() == null) { - return; - } - - AccessType access = this.accessHolder.getAccess(); - - if (((IStructuredSelection) this.comboViewer.getSelection()).getFirstElement() != access) { - this.comboViewer.setSelection(new StructuredSelection(access)); - } - } - - - @Override - public Control getControl() { - return this.comboViewer.getCombo(); - } - - /** - * An interface to wrap an object that supports accessType - * An object of this type must be passed in to populate(EObject) - */ - public static interface AccessHolder extends EObject { - /** - * Return the AccessType from the wrapped object - * @return - */ - AccessType getAccess(); - - /** - * Set the AccessType on the wrapped object - * @param accessType - */ - void setAccess(AccessType accessType); - - /** - * Return the Class of the wrapped object - * @return - */ - Class featureClass(); - - /** - * Return the feature id of accessType on the wrapped object - * @return - */ - int featureId(); - - /** - * The wrapped EObject that the accessType is stored on - * @return - */ - EObject wrappedObject(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java deleted file mode 100644 index 332079a3f8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -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.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class CascadePersistCheckBox extends BaseJpaController -{ - private PersistenceUnitDefaults persistenceUnitDefaults; - private Adapter persistenceUnitDefaultsListener; - - private Button button; - - - public CascadePersistCheckBox(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildPeristenceUnitDefaultsListener(); - } - - private void buildPeristenceUnitDefaultsListener() { - this.persistenceUnitDefaultsListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - persistenceUnitDefaultsChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.button = getWidgetFactory().createButton( - parent, - JptUiXmlMessages.XMLEntityMappingsPage_CascadePersistCheckBox, - SWT.CHECK); - - this.button.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent event) { - CascadePersistCheckBox.this.cascadePersistSelectionChanged(); - } - - public void widgetDefaultSelected(SelectionEvent e) { - CascadePersistCheckBox.this.cascadePersistSelectionChanged(); - } - }); - } - - void cascadePersistSelectionChanged() { - boolean cascadePersist = this.button.getSelection(); - if (this.persistenceUnitDefaults.isCascadePersist() != cascadePersist) { - this.persistenceUnitDefaults.setCascadePersist(cascadePersist); - } - } - - private void persistenceUnitDefaultsChanged(Notification notification) { - if (notification.getFeatureID(PersistenceUnitDefaults.class) == - OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.persistenceUnitDefaults != null) { - this.persistenceUnitDefaults.eAdapters().add(this.persistenceUnitDefaultsListener); - } - } - - @Override - protected void disengageListeners() { - if (this.persistenceUnitDefaults != null) { - this.persistenceUnitDefaults.eAdapters().remove(this.persistenceUnitDefaultsListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.persistenceUnitDefaults = (PersistenceUnitDefaults) obj; - populateButton(); - } - - @Override - protected void doPopulate() { - populateButton(); - } - - private void populateButton() { - boolean cascadePersist = false; - if (this.persistenceUnitDefaults != null) { - cascadePersist = this.persistenceUnitDefaults.isCascadePersist(); - } - - if (this.button.getSelection() != cascadePersist) { - this.button.setSelection(cascadePersist); - } - } - - - @Override - public Control getControl() { - return this.button; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java deleted file mode 100644 index 01e5c21461..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class CommonWidgets -{ - public static Label buildJavaClassLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - Label label = widgetFactory.createLabel(parent, JptUiXmlMessages.PersistentTypePage_javaClassLabel); - return label; - } - - public static XmlJavaClassChooser buildJavaClassChooser( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new XmlJavaClassChooser(parent, commandStack, widgetFactory); - } - - public static Label buildJavaAttributeNameLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - Label label = widgetFactory.createLabel(parent, JptUiXmlMessages.PersistentAttributePage_javaAttributeLabel); - return label; - } - - public static XmlJavaAttributeChooser buildJavaAttributeChooser( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new XmlJavaAttributeChooser(parent, commandStack, widgetFactory); - } - - - public static Label buildAccessLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiXmlMessages.PersistentTypePage_AccessLabel); - } - - public static AccessTypeComboViewer buildAccessTypeComboViewer( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new AccessTypeComboViewer(parent, commandStack, widgetFactory); - } - - - public static Label buildCatalogLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiXmlMessages.XmlCatalogChooser_CatalogChooser); - } - - public static StringWithDefaultChooser buildCatalogChooser( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new StringWithDefaultChooser(parent, commandStack, widgetFactory); - } - - - public static Label buildSchemaLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, JptUiXmlMessages.XmlSchemaChooser_SchemaChooser); - } - - public static StringWithDefaultChooser buildSchemaChooser( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new StringWithDefaultChooser(parent, commandStack, widgetFactory); - } - - - public static Label buildPackageLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - return widgetFactory.createLabel(parent, "Package:"); - } - - public static XmlPackageChooser buildXmlPackageChooser( - Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - return new XmlPackageChooser(parent, commandStack, widgetFactory); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java deleted file mode 100644 index 4d98719c2c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean; -import org.eclipse.jpt.core.internal.mappings.InheritanceType; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class MetaDataCompleteComboViewer extends BaseJpaController -{ - private XmlTypeMapping mapping; - private Adapter typeMappingListener; - - private CComboViewer comboViewer; - - - public MetaDataCompleteComboViewer(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildTypeMappingListener(); - } - - - private void buildTypeMappingListener() { - this.typeMappingListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - typeMappingChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - CCombo combo = getWidgetFactory().createCCombo(parent); - this.comboViewer = new CComboViewer(combo); - this.comboViewer.setLabelProvider(buildLabelProvider()); - this.comboViewer.add(DefaultFalseBoolean.VALUES.toArray()); - this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - MetaDataCompleteComboViewer.this.metadataCompleteSelectionChanged(event.getSelection()); - } - }); - } - private IBaseLabelProvider buildLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - if (element == DefaultFalseBoolean.DEFAULT) { - //TODO need to move this to the model, don't want hardcoded String - return NLS.bind(JptUiMappingsMessages.MetaDataCompleteCombo_Default, "False"); - } - return super.getText(element); - } - }; - } - - void metadataCompleteSelectionChanged(ISelection selection) { - if (selection instanceof IStructuredSelection) { - DefaultFalseBoolean metadataComplete = (DefaultFalseBoolean) ((IStructuredSelection) selection).getFirstElement(); - if ( ! this.mapping.getMetadataComplete().equals(metadataComplete)) { - this.mapping.setMetadataComplete(metadataComplete); -// this.editingDomain.getCommandStack().execute( -// SetCommand.create( -// this.editingDomain, -// this.basicMapping, -// OrmPackage.eINSTANCE.getBasicMapping_Optional(), -// optional -// ) -// ); - } - } - } - - private void typeMappingChanged(Notification notification) { - if (notification.getFeatureID(XmlTypeMapping.class) == - OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.mapping != null) { - this.mapping.eAdapters().add(this.typeMappingListener); - } - } - - @Override - protected void disengageListeners() { - if (this.mapping != null) { - this.mapping.eAdapters().remove(this.typeMappingListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.mapping = (XmlTypeMapping) obj; - populateCombo(); - } - - @Override - protected void doPopulate() { - populateCombo(); - } - - private void populateCombo() { - if (this.mapping == null) { - return; - } - - DefaultFalseBoolean metadataComplete = mapping.getMetadataComplete(); - - if (((IStructuredSelection) this.comboViewer.getSelection()).getFirstElement() != metadataComplete) { - this.comboViewer.setSelection(new StructuredSelection(metadataComplete)); - } - } - - - @Override - public Control getControl() { - return this.comboViewer.getCombo(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java deleted file mode 100644 index 253d9c91c4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java +++ /dev/null @@ -1,285 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.jpt.ui.internal.xml.details.AccessTypeComboViewer.AccessHolder; -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.ui.PlatformUI; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class PersistenceUnitMetadataSection extends BaseJpaController -{ - - private Section section; - private XmlMappingMetadataCompleteCheckBox xmlMappingMetadataCompleteCheckBox; - private StringWithDefaultChooser xmlSchemaChooser; - private StringWithDefaultChooser xmlCatalogChooser; - private AccessTypeComboViewer accessComboViewer; - private CascadePersistCheckBox cascadePersistCheckBox; - - public PersistenceUnitMetadataSection(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, commandStack, widgetFactory); - } - - @Override - protected void buildWidget(Composite parent) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - this.section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); - this.section.setText(JptUiXmlMessages.XMLEntityMappingsPage_PersistenceUnitSection); - - Composite persistenceUnitComposite = getWidgetFactory().createComposite(this.section); - this.section.setClient(persistenceUnitComposite); - - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 1; - persistenceUnitComposite.setLayout(layout); - - - this.xmlMappingMetadataCompleteCheckBox = buildXmlMappingMetadataCompleteCheckBox(persistenceUnitComposite); - GridData gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.xmlMappingMetadataCompleteCheckBox.getControl().setLayoutData(gridData); - helpSystem.setHelp(xmlMappingMetadataCompleteCheckBox.getControl(), IJpaHelpContextIds.ENTITY_ORM_XML); - - CommonWidgets.buildSchemaLabel(persistenceUnitComposite, getWidgetFactory()); - - this.xmlSchemaChooser = CommonWidgets.buildSchemaChooser(persistenceUnitComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.xmlSchemaChooser.getCombo().setLayoutData(gridData); - helpSystem.setHelp(xmlSchemaChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_SCHEMA); - - CommonWidgets.buildCatalogLabel(persistenceUnitComposite, getWidgetFactory()); - - this.xmlCatalogChooser = CommonWidgets.buildCatalogChooser(persistenceUnitComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.xmlCatalogChooser.getCombo().setLayoutData(gridData); - helpSystem.setHelp(xmlCatalogChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_CATALOG); - - CommonWidgets.buildAccessLabel(persistenceUnitComposite, getWidgetFactory()); - - this.accessComboViewer = CommonWidgets.buildAccessTypeComboViewer(persistenceUnitComposite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.accessComboViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(accessComboViewer.getControl(), IJpaHelpContextIds.ENTITY_ORM_ACCESS); - - - this.cascadePersistCheckBox = buildCascadePersistCheckBox(persistenceUnitComposite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.cascadePersistCheckBox.getControl().setLayoutData(gridData); - helpSystem.setHelp(cascadePersistCheckBox.getControl(), IJpaHelpContextIds.ENTITY_ORM_CASCADE); - - } - - private XmlMappingMetadataCompleteCheckBox buildXmlMappingMetadataCompleteCheckBox(Composite parent) { - return new XmlMappingMetadataCompleteCheckBox(parent, this.commandStack, getWidgetFactory()); - } - - private CascadePersistCheckBox buildCascadePersistCheckBox(Composite parent) { - return new CascadePersistCheckBox(parent, this.commandStack, getWidgetFactory()); - } - - @Override - protected void engageListeners() { - } - - @Override - protected void disengageListeners() { - } - - @Override - public void doPopulate(EObject obj) { - PersistenceUnitMetadata persistenceUnitMetadata = (PersistenceUnitMetadata) obj; - this.xmlMappingMetadataCompleteCheckBox.populate(persistenceUnitMetadata); - if (persistenceUnitMetadata != null) { - this.accessComboViewer.populate(new MyAccessHolder(persistenceUnitMetadata.getPersistenceUnitDefaults())); - this.xmlSchemaChooser.populate(new SchemaHolder(persistenceUnitMetadata.getPersistenceUnitDefaults())); - this.xmlCatalogChooser.populate(new CatalogHolder(persistenceUnitMetadata.getPersistenceUnitDefaults())); - this.cascadePersistCheckBox.populate(persistenceUnitMetadata.getPersistenceUnitDefaults()); - } - else { - this.accessComboViewer.populate(new MyAccessHolder(null)); - this.xmlSchemaChooser.populate(new SchemaHolder(null)); - this.xmlCatalogChooser.populate(new CatalogHolder(null)); - this.cascadePersistCheckBox.populate(null); - } - } - private class MyAccessHolder extends XmlEObject implements AccessHolder{ - - private PersistenceUnitDefaultsInternal persistenceUnitDefaults; - MyAccessHolder(PersistenceUnitDefaults persistenceUnitDefaultsInternal) { - super(); - this.persistenceUnitDefaults = (PersistenceUnitDefaultsInternal) persistenceUnitDefaultsInternal; - } - public void setAccess(AccessType accessType) { - persistenceUnitDefaults.setAccess(accessType); - } - - public AccessType getAccess() { - return persistenceUnitDefaults.getAccess(); - } - - public Class featureClass() { - return PersistenceUnitDefaults.class; - } - - public int featureId() { - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__ACCESS; - } - - public EObject wrappedObject() { - return this.persistenceUnitDefaults; - } - } - - private class SchemaHolder extends XmlEObject implements StringHolder { - private PersistenceUnitDefaults persistenceUnitDefaults; - SchemaHolder(PersistenceUnitDefaults persistenceUnitDefaults) { - super(); - this.persistenceUnitDefaults = persistenceUnitDefaults; - } - - public Class featureClass() { - return PersistenceUnitDefaults.class; - } - - public int featureId() { - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__SCHEMA; - } - - public boolean supportsDefault() { - return false; - } - - public int defaultFeatureId() { - throw new UnsupportedOperationException(); - } - - public String defaultItem() { - return JptUiXmlMessages.PersistenceUnitMetadataSection_SchemaDefault; - } - - public String getString() { - return this.persistenceUnitDefaults.getSchema(); - } - - public void setString(String newSchema) { - this.persistenceUnitDefaults.setSchema(newSchema); - } - - public EObject wrappedObject() { - return this.persistenceUnitDefaults; - } - } - - private class CatalogHolder extends XmlEObject implements StringHolder { - private PersistenceUnitDefaults persistenceUnitDefaults; - CatalogHolder(PersistenceUnitDefaults persistenceUnitDefaults) { - super(); - this.persistenceUnitDefaults = persistenceUnitDefaults; - } - - public Class featureClass() { - return PersistenceUnitDefaults.class; - } - - public int featureId() { - return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CATALOG; - } - - public boolean supportsDefault() { - return false; - } - - public int defaultFeatureId() { - throw new UnsupportedOperationException(); - } - - public String defaultItem() { - return JptUiXmlMessages.PersistenceUnitMetadataSection_CatalogDefault; - } - - public String getString() { - return this.persistenceUnitDefaults.getCatalog(); - } - - public void setString(String string) { - this.persistenceUnitDefaults.setCatalog(string); - } - - public EObject wrappedObject() { - return this.persistenceUnitDefaults; - } - - } - - @Override - protected void doPopulate() { - this.xmlMappingMetadataCompleteCheckBox.populate(); - this.xmlSchemaChooser.populate(); - this.xmlCatalogChooser.populate(); - this.accessComboViewer.populate(); - this.cascadePersistCheckBox.populate(); - } - - @Override - public void dispose() { - this.xmlMappingMetadataCompleteCheckBox.dispose(); - this.xmlSchemaChooser.dispose(); - this.xmlCatalogChooser.dispose(); - this.accessComboViewer.dispose(); - this.cascadePersistCheckBox.dispose(); - super.dispose(); - } - - public Section getSection() { - return this.section; - } - - @Override - public Control getControl() { - return getSection(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java deleted file mode 100644 index 0bcd70ded8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.internal.content.orm.IXmlContentNodes; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsPage; -import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlDetailsProvider - implements IJpaDetailsProvider -{ - public XmlDetailsProvider() { - super(); - } - - public String fileContentType() { - return JptCorePlugin.ORM_XML_CONTENT_TYPE; - } - - public IJpaDetailsPage buildDetailsPage( - Composite parentComposite, Object contentNodeId, TabbedPropertySheetWidgetFactory widgetFactory) { - if (contentNodeId.equals(IXmlContentNodes.ENTITY_MAPPINGS_ID)) { - return new XmlEntityMappingsDetailsPage(parentComposite, widgetFactory); - } - else if (contentNodeId.equals(IXmlContentNodes.PERSISTENT_TYPE_ID)) { - return new XmlPersistentTypeDetailsPage(parentComposite, widgetFactory); - } - else if (contentNodeId.equals(IXmlContentNodes.PERSISTENT_ATTRIBUTE_ID)) { - return new XmlPersistentAttributeDetailsPage(parentComposite, widgetFactory); - } - - return null; - } - - public void dispose() { - // no op ... for now - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java deleted file mode 100644 index b70bde8825..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java +++ /dev/null @@ -1,274 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.ui.internal.IJpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.BaseJpaDetailsPage; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser; -import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.jpt.ui.internal.xml.details.AccessTypeComboViewer.AccessHolder; -import org.eclipse.osgi.util.NLS; -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.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlEntityMappingsDetailsPage extends BaseJpaDetailsPage -{ - private EntityMappings entityMappings; - - private XmlPackageChooser xmlPackageChooser; - - private StringWithDefaultChooser xmlSchemaChooser; - - private StringWithDefaultChooser xmlCatalogChooser; - - private AccessTypeComboViewer accessComboViewer; - - private PersistenceUnitMetadataSection persistenceUnitMetadataSection; - - public XmlEntityMappingsDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, new BasicCommandStack(), widgetFactory); - } - - @Override - protected void initializeLayout(Composite composite) { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - GridLayout layout = new GridLayout(2, false); - layout.horizontalSpacing = 6; - composite.setLayout(layout); - - GridData gridData; - - CommonWidgets.buildPackageLabel(composite, getWidgetFactory()); - - this.xmlPackageChooser = CommonWidgets.buildXmlPackageChooser(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.xmlPackageChooser.getControl().setLayoutData(gridData); - helpSystem.setHelp(xmlPackageChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_PACKAGE); - - - CommonWidgets.buildSchemaLabel(composite, getWidgetFactory()); - - this.xmlSchemaChooser = CommonWidgets.buildSchemaChooser(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.xmlSchemaChooser.getCombo().setLayoutData(gridData); - helpSystem.setHelp(xmlSchemaChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_SCHEMA); - - - CommonWidgets.buildCatalogLabel(composite, getWidgetFactory()); - - this.xmlCatalogChooser = CommonWidgets.buildCatalogChooser(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.xmlCatalogChooser.getCombo().setLayoutData(gridData); - helpSystem.setHelp(xmlCatalogChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_CATALOG); - - - CommonWidgets.buildAccessLabel(composite, getWidgetFactory()); - - this.accessComboViewer = CommonWidgets.buildAccessTypeComboViewer(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.accessComboViewer.getControl().setLayoutData(gridData); - helpSystem.setHelp(accessComboViewer.getControl(), IJpaHelpContextIds.ENTITY_ORM_ACCESS); - - this.persistenceUnitMetadataSection = new PersistenceUnitMetadataSection(composite, this.commandStack, getWidgetFactory()); - - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalSpan = 2; - this.persistenceUnitMetadataSection.getSection().setLayoutData(gridData); - } - - - @Override - protected void doPopulate(IJpaContentNode contentNode) { - this.entityMappings = (EntityMappings) contentNode; - this.xmlPackageChooser.populate(this.entityMappings); - this.xmlSchemaChooser.populate(new SchemaHolder(this.entityMappings)); - this.xmlCatalogChooser.populate(new CatalogHolder(this.entityMappings)); - this.accessComboViewer.populate(new MyAccessHolder(this.entityMappings)); - if (this.entityMappings != null) { - this.persistenceUnitMetadataSection.populate(this.entityMappings.getPersistenceUnitMetadata()); - } - else { - this.persistenceUnitMetadataSection.populate(null); - } - } - - @Override - protected void doPopulate() { - this.xmlPackageChooser.populate(); - this.xmlSchemaChooser.populate(); - this.xmlCatalogChooser.populate(); - this.accessComboViewer.populate(); - this.persistenceUnitMetadataSection.populate(); - } - - @Override - public void dispose() { - this.xmlPackageChooser.dispose(); - this.xmlSchemaChooser.dispose(); - this.xmlCatalogChooser.dispose(); - this.accessComboViewer.dispose(); - this.persistenceUnitMetadataSection.dispose(); - super.dispose(); - } - - @Override - protected void engageListeners() { - } - - @Override - protected void disengageListeners() { - } - - - private class MyAccessHolder extends XmlEObject implements AccessHolder{ - - private EntityMappingsInternal entityMappings; - MyAccessHolder(EntityMappings entityMappings) { - super(); - this.entityMappings = (EntityMappingsInternal) entityMappings; - } - public void setAccess(AccessType accessType) { - entityMappings.setSpecifiedAccess(accessType); - } - - public AccessType getAccess() { - return entityMappings.getSpecifiedAccess(); - } - - public Class featureClass() { - return EntityMappingsInternal.class; - } - - public int featureId() { - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS; - } - - public EObject wrappedObject() { - return this.entityMappings; - } - - } - - private class SchemaHolder extends XmlEObject implements StringHolder { - private EntityMappingsInternal entityMappings; - SchemaHolder(EntityMappings entityMappings) { - super(); - this.entityMappings = (EntityMappingsInternal) entityMappings; - } - - public Class featureClass() { - return EntityMappingsInternal.class; - } - - public int featureId() { - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA; - } - - public boolean supportsDefault() { - return true; - } - - public int defaultFeatureId() { - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA; - } - - public String defaultItem() { - String defaultSchema = this.entityMappings.getDefaultSchema(); - if (defaultSchema != null) { - return NLS.bind(JptUiXmlMessages.XMLEntityMappingsPage_SchemaDefault, defaultSchema); - } - return JptUiXmlMessages.XMLEntityMappingsPage_SchemaNoDefaultSpecified; - } - - public String getString() { - return this.entityMappings.getSpecifiedSchema(); - } - - public void setString(String newSchema) { - this.entityMappings.setSpecifiedSchema(newSchema); - } - - public EObject wrappedObject() { - return this.entityMappings; - } - } - - private class CatalogHolder extends XmlEObject implements StringHolder { - private EntityMappingsInternal entityMappings; - CatalogHolder(EntityMappings entityMappings) { - super(); - this.entityMappings = (EntityMappingsInternal) entityMappings; - } - - public Class featureClass() { - return EntityMappingsInternal.class; - } - - public int featureId() { - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG; - } - - public boolean supportsDefault() { - return true; - } - - public int defaultFeatureId() { - return OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG; - } - - public String defaultItem() { - String defaultCatalog = this.entityMappings.getDefaultCatalog(); - if (defaultCatalog != null) { - return NLS.bind(JptUiXmlMessages.XMLEntityMappingsPage_CatalogDefault, defaultCatalog); - } - return JptUiXmlMessages.XMLEntityMappingsPage_CatalogNoDefaultSpecified; - } - - public String getString() { - return this.entityMappings.getSpecifiedCatalog(); - } - - public void setString(String newCatalog) { - this.entityMappings.setSpecifiedCatalog(newCatalog); - } - - public EObject wrappedObject() { - return this.entityMappings; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java deleted file mode 100644 index 8f58be68b4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java +++ /dev/null @@ -1,133 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlJavaAttributeChooser extends BaseJpaController -{ - private XmlPersistentAttribute attribute; - private Adapter persistentAttributeListener; - - private Text text; - - - public XmlJavaAttributeChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildPersistentAttributeListener(); - } - - - private void buildPersistentAttributeListener() { - this.persistentAttributeListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - persistentAttributeChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - text = getWidgetFactory().createText(parent, ""); - text.addModifyListener( - new ModifyListener() { - public void modifyText(ModifyEvent e) { - textModified(e); - } - }); - } - - private void textModified(ModifyEvent e) { - if (isPopulating()) { - return; - } - - String text = ((Text) e.getSource()).getText(); - attribute.setName(text); - - // TODO Does this need to be done? - //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text)); - } - - private void persistentAttributeChanged(Notification notification) { - if (notification.getFeatureID(XmlAttributeMapping.class) == - OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (attribute != null) { - attribute.eAdapters().add(persistentAttributeListener); - } - } - - @Override - protected void disengageListeners() { - if (attribute != null) { - attribute.eAdapters().remove(persistentAttributeListener); - } - } - - @Override - public void doPopulate(EObject obj) { - attribute = (obj == null) ? null : ((XmlAttributeMapping) obj).getPersistentAttribute(); - populateText(); - } - - @Override - protected void doPopulate() { - populateText(); - } - - private void populateText() { - if (attribute == null) { - text.clearSelection(); - return; - } - - String name = attribute.getName(); - - if (name == null) { - name = ""; - } - setTextData(name); - } - - private void setTextData(String textData) { - if (! textData.equals(text.getText())) { - text.setText(textData); - } - } - - public Control getControl() { - return text; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java deleted file mode 100644 index 43fead2876..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java +++ /dev/null @@ -1,249 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.core.resources.IProject; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.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.window.Window; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.SelectionDialog; -import org.eclipse.ui.progress.IProgressService; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -//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 -public class XmlJavaClassChooser extends BaseJpaController -{ - private XmlPersistentType persistentType; - private Adapter persistentTypeListener; - - private Composite composite; - private Text text; - private JavaTypeCompletionProcessor javaTypeCompletionProcessor; - - public XmlJavaClassChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildPersistentTypeListener(); - } - - - private void buildPersistentTypeListener() { - persistentTypeListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - persistentTypeChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.composite = getWidgetFactory().createComposite(parent); - GridLayout gridLayout = new GridLayout(); - gridLayout.marginHeight = 0; - gridLayout.marginWidth = 1; - gridLayout.numColumns = 2; - this.composite.setLayout(gridLayout); - - text = getWidgetFactory().createText(this.composite, ""); - GridData data = new GridData(); - data.grabExcessHorizontalSpace = true; - data.horizontalAlignment = GridData.FILL; - this.text.setLayoutData(data); - text.addModifyListener( - new ModifyListener() { - public void modifyText(ModifyEvent e) { - textModified(e); - } - }); - - //TODO bug 156185 - when this is fixed there should be api for this - this.javaTypeCompletionProcessor = new JavaTypeCompletionProcessor(false, false); - ControlContentAssistHelper.createTextContentAssistant(this.text, this.javaTypeCompletionProcessor); - - - Button browseButton = getWidgetFactory().createButton(this.composite, "Browse...", SWT.FLAT); - data = new GridData(); - browseButton.setLayoutData(data); - browseButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - IType type = chooseType(); - if (type != null) { - text.setText(type.getFullyQualifiedName()); - } - } - public void widgetDefaultSelected(SelectionEvent e) { - IType type = chooseType(); - if (type != null) { - text.setText(type.getFullyQualifiedName()); - } - } - }); - - } - - private void textModified(ModifyEvent e) { - if (isPopulating()) { - return; - } - - String text = ((Text) e.getSource()).getText(); - persistentType.setClass(text); - - // TODO Does this need to be done? - //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text)); - } - - - protected IType chooseType() { - IPackageFragmentRoot root= getPackageFragmentRoot(); - if (root == null) { - return null; - } - - IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() }; - IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); - IProgressService service = PlatformUI.getWorkbench().getProgressService(); - - SelectionDialog typeSelectionDialog; - try { - typeSelectionDialog = JavaUI.createTypeDialog(this.text.getShell(), service, scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, getType()); - } - catch (JavaModelException e) { - JptUiPlugin.log(e); - throw new RuntimeException(e); - } - typeSelectionDialog.setTitle(JptUiXmlMessages.XmlJavaClassChooser_XmlJavaClassDialog_title); - typeSelectionDialog.setMessage(JptUiXmlMessages.XmlJavaClassChooser_XmlJavaClassDialog_message); - - if (typeSelectionDialog.open() == Window.OK) { - return (IType) typeSelectionDialog.getResult()[0]; - } - return null; - } - - private String getType() { - return this.text.getText(); - } - - private IPackageFragmentRoot getPackageFragmentRoot() { - IProject project = this.persistentType.getJpaProject().getProject(); - IJavaProject root = JavaCore.create(project); - try { - return root.getAllPackageFragmentRoots()[0]; - } - catch (JavaModelException e) { - JptUiPlugin.log(e); - } - return null; - } - - private void persistentTypeChanged(Notification notification) { - if (notification.getFeatureID(XmlPersistentType.class) == - OrmPackage.XML_PERSISTENT_TYPE__CLASS) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (persistentType != null) { - persistentType.eAdapters().add(persistentTypeListener); - } - } - - @Override - protected void disengageListeners() { - if (persistentType != null) { - persistentType.eAdapters().remove(persistentTypeListener); - } - } - - @Override - public void doPopulate(EObject obj) { - persistentType = (obj == null) ? null : ((XmlTypeMapping) obj).getPersistentType(); - populateText(); - } - - @Override - protected void doPopulate() { - populateText(); - } - - private void populateText() { - if (persistentType == null) { - text.clearSelection(); - return; - } - - IPackageFragmentRoot root = getPackageFragmentRoot(); - if (root != null) { - this.javaTypeCompletionProcessor.setPackageFragment(root.getPackageFragment("")); - } - - - String javaClass = persistentType.getClass_(); - - if (javaClass == null) { - setTextData(""); - } - else { - setTextData(javaClass); - } - } - - private void setTextData(String textData) { - if (! textData.equals(text.getText())) { - text.setText(textData); - } - } - - public Control getControl() { - return this.composite; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java deleted file mode 100644 index 5cdd03801e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -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.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlMappingMetadataCompleteCheckBox extends BaseJpaController -{ - private PersistenceUnitMetadata persistenceUnitMetadata; - private Adapter persistenceUnitMetadataListener; - - private Button button; - - - public XmlMappingMetadataCompleteCheckBox(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildPeristenceUnitMetadataListener(); - } - - private void buildPeristenceUnitMetadataListener() { - this.persistenceUnitMetadataListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - persistenceUnitMetadataChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.button = getWidgetFactory().createButton( - parent, - JptUiXmlMessages.XMLEntityMappingsPage_XmlMappingMetadataCompleteCheckBox, - SWT.CHECK); - - this.button.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent event) { - XmlMappingMetadataCompleteCheckBox.this.xmlMappingMetadataCompleteSelectionChanged(); - } - - public void widgetDefaultSelected(SelectionEvent e) { - XmlMappingMetadataCompleteCheckBox.this.xmlMappingMetadataCompleteSelectionChanged(); - } - }); - } - - void xmlMappingMetadataCompleteSelectionChanged() { - boolean xmlMappingMetadataComplete = this.button.getSelection(); - if (this.persistenceUnitMetadata.isXmlMappingMetadataComplete() != xmlMappingMetadataComplete) { - this.persistenceUnitMetadata.setXmlMappingMetadataComplete(xmlMappingMetadataComplete); - } - } - - private void persistenceUnitMetadataChanged(Notification notification) { - if (notification.getFeatureID(PersistenceUnitMetadata.class) == - OrmPackage.PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.persistenceUnitMetadata != null) { - this.persistenceUnitMetadata.eAdapters().add(this.persistenceUnitMetadataListener); - } - } - - @Override - protected void disengageListeners() { - if (this.persistenceUnitMetadata != null) { - this.persistenceUnitMetadata.eAdapters().remove(this.persistenceUnitMetadataListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.persistenceUnitMetadata = (PersistenceUnitMetadata) obj; - populateButton(); - } - - @Override - protected void doPopulate() { - populateButton(); - } - - private void populateButton() { - boolean xmlMappingMetadataComplete = false; - if (this.persistenceUnitMetadata != null) { - xmlMappingMetadataComplete = this.persistenceUnitMetadata.isXmlMappingMetadataComplete(); - } - - if (this.button.getSelection() != xmlMappingMetadataComplete) { - this.button.setSelection(xmlMappingMetadataComplete); - } - } - - - @Override - public Control getControl() { - return this.button; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java deleted file mode 100644 index fbaf451347..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java +++ /dev/null @@ -1,255 +0,0 @@ - /******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import org.eclipse.core.resources.IProject; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper; -import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaPackageCompletionProcessor; -import org.eclipse.jdt.ui.JavaElementLabelProvider; -import org.eclipse.jdt.ui.JavaUI; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.window.Window; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.ui.internal.JptUiPlugin; -import org.eclipse.jpt.ui.internal.details.BaseJpaController; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.SelectionDialog; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlPackageChooser extends BaseJpaController -{ - private EntityMappingsInternal entityMappings; - private Adapter entityMappingsListener; - private IContentAssistProcessor contentAssistProcessor; - - private Composite composite; - private Text text; - - - public XmlPackageChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, theCommandStack, widgetFactory); - buildSchemaHolderListener(); - } - - - private void buildSchemaHolderListener() { - this.entityMappingsListener = new AdapterImpl() { - public void notifyChanged(Notification notification) { - entityMappingsChanged(notification); - } - }; - } - - @Override - protected void buildWidget(Composite parent) { - this.composite = getWidgetFactory().createComposite(parent); - GridLayout gridLayout = new GridLayout(); - gridLayout.marginHeight = 0; - gridLayout.marginWidth = 1; - gridLayout.numColumns = 2; - this.composite.setLayout(gridLayout); - this.text = getWidgetFactory().createText(this.composite, ""); - GridData data = new GridData(); - data.grabExcessHorizontalSpace = true; - data.horizontalAlignment = GridData.FILL; - this.text.setLayoutData(data); - this.contentAssistProcessor = new JavaPackageCompletionProcessor(new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_ROOT)); - ControlContentAssistHelper.createTextContentAssistant(this.text, this.contentAssistProcessor); - - this.text.addModifyListener( - new ModifyListener() { - public void modifyText(ModifyEvent e) { - textModified(e); - } - }); - - Button browseButton = getWidgetFactory().createButton(this.composite, "Browse...", SWT.FLAT); - data = new GridData(); - browseButton.setLayoutData(data); - browseButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - IPackageFragment packageFragment = choosePackage(); - if (packageFragment != null) { - text.setText(packageFragment.getElementName()); - } - } - public void widgetDefaultSelected(SelectionEvent e) { - IPackageFragment packageFragment = choosePackage(); - if (packageFragment != null) { - text.setText(packageFragment.getElementName()); - } - } - }); - } - - private void textModified(ModifyEvent e) { - if (isPopulating()) { - return; - } - - String text = ((Text) e.getSource()).getText(); - this.entityMappings.setPackage(text); - //TODO set a JEM Package?? - //.setJavaClass(JavaRefFactory.eINSTANCE.createClassRef(text)); - - // TODO Does this need to be done? - //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text)); - } - - private void entityMappingsChanged(Notification notification) { - if (notification.getFeatureID(EntityMappings.class) == - OrmPackage.ENTITY_MAPPINGS__PACKAGE) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - populate(); - } - }); - } - } - - @Override - protected void engageListeners() { - if (this.entityMappings != null) { - entityMappings.eAdapters().add(this.entityMappingsListener); - } - } - - @Override - protected void disengageListeners() { - if (this.entityMappings != null) { - this.entityMappings.eAdapters().remove(this.entityMappingsListener); - } - } - - @Override - public void doPopulate(EObject obj) { - this.entityMappings = (EntityMappingsInternal) obj; - populateText(); - } - - @Override - protected void doPopulate() { - populateText(); - } - - private void populateText() { - if (entityMappings == null) { - text.clearSelection(); - return; - } - - IPackageFragmentRoot root = getPackageFragmentRoot(); - if (root != null) { - ((JavaPackageCompletionProcessor)this.contentAssistProcessor).setPackageFragmentRoot(root); - } - - String package_ = this.entityMappings.getPackage(); - - if (package_ == null) { - setTextData(""); - } - else { - setTextData(package_); - } - } - - private IPackageFragmentRoot getPackageFragmentRoot() { - IProject project = ((XmlEObject) this.entityMappings).getJpaProject().getProject(); - IJavaProject root = JavaCore.create(project); - try { - return root.getAllPackageFragmentRoots()[0]; - } - catch (JavaModelException e) { - JptUiPlugin.log(e); - } - return null; - } - - private void setTextData(String textData) { - if (! textData.equals(text.getText())) { - text.setText(textData); - } - } - - @Override - public Control getControl() { - return this.composite; - } - - /** - * Opens a selection dialog that allows to select a package. - * - * @return returns the selected package or null if the dialog has been canceled. - * The caller typically sets the result to the package input field. - *

    - * Clients can override this method if they want to offer a different dialog. - *

    - * - * @since 3.2 - */ - protected IPackageFragment choosePackage() { - SelectionDialog selectionDialog; - try { - selectionDialog = JavaUI.createPackageDialog(text.getShell(), getPackageFragmentRoot()); - } - catch (JavaModelException e) { - JptUiPlugin.log(e); - throw new RuntimeException(e); - } - selectionDialog.setTitle(JptUiXmlMessages.XmlPackageChooser_PackageDialog_title); - selectionDialog.setMessage(JptUiXmlMessages.XmlPackageChooser_PackageDialog_message); - selectionDialog.setHelpAvailable(false); - IPackageFragment pack= getPackageFragment(); - if (pack != null) { - selectionDialog.setInitialSelections(new Object[] { pack }); - } - - if (selectionDialog.open() == Window.OK) { - return (IPackageFragment) selectionDialog.getResult()[0]; - } - return null; - } - - /** - * Returns the package fragment corresponding to the current input. - * - * @return a package fragment or null if the input - * could not be resolved. - */ - public IPackageFragment getPackageFragment() { - String packageString = this.text.getText(); - return getPackageFragmentRoot().getPackageFragment(packageString); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java deleted file mode 100644 index 7940f5503e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java +++ /dev/null @@ -1,173 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import java.util.Iterator; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.IPersistentAttribute; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage; -import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; -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.Display; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlPersistentAttributeDetailsPage - extends PersistentAttributeDetailsPage -{ - private XmlJavaAttributeChooser javaAttributeChooser; - - private Adapter persistentTypeListener; - - private IPersistentType persistentType; - - public XmlPersistentAttributeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, widgetFactory); - buildPersistentTypeListener(); - } - - private void buildPersistentTypeListener() { - this.persistentTypeListener = new AdapterImpl() { - @Override - public void notifyChanged(Notification notification) { - persistentTypeChanged(notification); - } - }; - } - - void persistentTypeChanged(Notification notification) { - if (notification.getFeatureID(XmlPersistentType.class) == - OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS) { - Display.getDefault().asyncExec( - new Runnable() { - public void run() { - updateEnbabledState(); - } - }); - } - } - - @Override - protected void initializeLayout(Composite composite) { - composite.setLayout(new GridLayout(2, false)); - - GridData gridData; - - CommonWidgets.buildJavaAttributeNameLabel(composite, getWidgetFactory()); - - this.javaAttributeChooser = CommonWidgets.buildJavaAttributeChooser(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.javaAttributeChooser.getControl().setLayoutData(gridData); - - - buildMappingLabel(composite); - - CComboViewer mappingCombo = buildMappingCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - mappingCombo.getCombo().setLayoutData(gridData); - - PageBook book = buildMappingPageBook(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - book.setLayoutData(gridData); - } - - @Override - protected void engageListeners() { - super.engageListeners(); - if (getAttribute() != null) { - this.persistentType = getAttribute().typeMapping().getPersistentType(); - this.persistentType.eAdapters().add(this.persistentTypeListener); - } - } - - @Override - protected void disengageListeners() { - if (this.persistentType != null) { - this.persistentType.eAdapters().remove(this.persistentTypeListener); - this.persistentType = null; - } - super.disengageListeners(); - } - - @Override - protected void doPopulate(IJpaContentNode persistentAttributeNode) { - super.doPopulate(persistentAttributeNode); - if (persistentAttributeNode == null) { - this.javaAttributeChooser.populate(null); - } - else { - XmlAttributeMapping mapping = ((XmlPersistentAttribute) persistentAttributeNode).getMapping(); - this.javaAttributeChooser.populate(mapping); - updateEnbabledState(); - } - } - - @Override - protected void doPopulate() { - super.doPopulate(); - this.javaAttributeChooser.populate(); - updateEnbabledState(); - } - - @Override - public void dispose() { - this.javaAttributeChooser.dispose(); - super.dispose(); - } - - public void updateEnbabledState() { - if (getAttribute() == null || getAttribute().eContainer() == null) { - return; - } - boolean enabled = !((XmlPersistentAttribute) getAttribute()).isVirtual(); - updateEnabledState(enabled, getControl()); - } - - public void updateEnabledState(boolean enabled, Control control) { - control.setEnabled(enabled); - if (control instanceof Composite) { - for (Iterator i = new ArrayIterator(((Composite) control).getChildren()); i.hasNext(); ) { - updateEnabledState(enabled, i.next()); - } - } - } - - @Override - //TODO Not really how I would want to implement this, but it is low risk fix for bug 192035 for 1.0RC3 - protected IAttributeMappingUiProvider[] uiProvidersFor(IPersistentAttribute persistentAttribute) { - return attributeMappingUiProviders().toArray(new IAttributeMappingUiProvider[attributeMappingUiProviders().size()]); - } - -} \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java deleted file mode 100644 index 3c615476dd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.details; - -import java.util.ArrayList; -import java.util.Collection; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jpt.core.internal.AccessType; -import org.eclipse.jpt.core.internal.IJpaContentNode; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping; -import org.eclipse.jpt.ui.internal.details.PersistentTypeDetailsPage; -import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddableUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.EntityUiProvider; -import org.eclipse.jpt.ui.internal.java.mappings.properties.MappedSuperclassUiProvider; -import org.eclipse.jpt.ui.internal.widgets.CComboViewer; -import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages; -import org.eclipse.jpt.ui.internal.xml.details.AccessTypeComboViewer.AccessHolder; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; - -public class XmlPersistentTypeDetailsPage extends PersistentTypeDetailsPage -{ - private XmlJavaClassChooser javaClassChooser; - - private MetaDataCompleteComboViewer metadataCompleteComboViewer; - - private AccessTypeComboViewer accessComboViewer; - - public XmlPersistentTypeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) { - super(parent, widgetFactory); - } - - protected Collection buildTypeMappingUiProviders() { - Collection typeMappingUiProviders = new ArrayList(); - typeMappingUiProviders.add(new EntityUiProvider()); - typeMappingUiProviders.add(new MappedSuperclassUiProvider()); - typeMappingUiProviders.add(new EmbeddableUiProvider()); - return typeMappingUiProviders; - } - - @Override - protected void initializeLayout(Composite composite) { - composite.setLayout(new GridLayout(2, false)); - - GridData gridData; - - CommonWidgets.buildJavaClassLabel(composite, getWidgetFactory()); - - this.javaClassChooser = CommonWidgets.buildJavaClassChooser(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.javaClassChooser.getControl().setLayoutData(gridData); - - buildTypeMappingLabel(composite); - - CComboViewer typeMappingCombo = buildTypeMappingCombo(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - typeMappingCombo.getCombo().setLayoutData(gridData); - - buildMetadataCompleteLabel(composite); - this.metadataCompleteComboViewer = new MetaDataCompleteComboViewer(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.metadataCompleteComboViewer.getControl().setLayoutData(gridData); - - CommonWidgets.buildAccessLabel(composite, getWidgetFactory()); - this.accessComboViewer = CommonWidgets.buildAccessTypeComboViewer(composite, this.commandStack, getWidgetFactory()); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.BEGINNING; - gridData.grabExcessHorizontalSpace = true; - this.accessComboViewer.getControl().setLayoutData(gridData); - - PageBook typeMappingPageBook = buildTypeMappingPageBook(composite); - gridData = new GridData(); - gridData.horizontalAlignment = SWT.FILL; - gridData.verticalAlignment = SWT.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - gridData.horizontalSpan = 2; - typeMappingPageBook.setLayoutData(gridData); - } - - private Label buildMetadataCompleteLabel(Composite parent ) { - return getWidgetFactory().createLabel(parent, JptUiXmlMessages.PersistentTypePage_MetadataCompleteLabel); - } - - @Override - protected void doPopulate(IJpaContentNode persistentTypeNode) { - super.doPopulate(persistentTypeNode); - if (persistentTypeNode == null) { - this.javaClassChooser.populate(null); - this.metadataCompleteComboViewer.populate(null); - this.accessComboViewer.populate(new MyAccessHolder(null)); - } - else { - XmlTypeMapping mapping = ((XmlPersistentType) persistentTypeNode).getMapping(); - this.javaClassChooser.populate(mapping); - this.metadataCompleteComboViewer.populate(mapping); - this.accessComboViewer.populate(new MyAccessHolder(mapping)); - } - } - - @Override - protected void doPopulate() { - super.doPopulate(); - this.javaClassChooser.populate(); - this.metadataCompleteComboViewer.populate(); - this.accessComboViewer.populate(); - } - - @Override - public void dispose() { - this.javaClassChooser.dispose(); - this.metadataCompleteComboViewer.dispose(); - this.accessComboViewer.dispose(); - super.dispose(); - } - - - private class MyAccessHolder extends XmlEObject implements AccessHolder{ - - private XmlTypeMapping xmlTypeMapping; - MyAccessHolder(XmlTypeMapping xmlTypeMapping) { - super(); - this.xmlTypeMapping = xmlTypeMapping; - } - public void setAccess(AccessType accessType) { - xmlTypeMapping.setSpecifiedAccess(accessType); - } - - public AccessType getAccess() { - return xmlTypeMapping.getSpecifiedAccess(); - } - - public Class featureClass() { - return XmlTypeMapping.class; - } - - public int featureId() { - return OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS; - } - - public EObject wrappedObject() { - return this.xmlTypeMapping; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java deleted file mode 100644 index 171664b153..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.structure; - -import java.util.Collection; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages; - -public class EntityMappingsItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public EntityMappingsItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(OrmPackage.Literals.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES); - } - return childrenFeatures; - } - - @Override - public Object getParent(Object object) { - return null; - } - - @Override - public Object getImage(Object object) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.ENTITY_MAPPINGS); - } - - @Override - public String getText(Object object) { - // TODO - return "EntityMappings"; - } - - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(EntityMappingsInternal.class)) { - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES: - case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS: - fireNotifyChanged( - new ViewerNotification( - notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java deleted file mode 100644 index a79c0ffa0b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java +++ /dev/null @@ -1,197 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.structure; - -import java.util.ArrayList; -import java.util.Collection; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jpt.core.internal.content.orm.util.OrmAdapterFactory; -import org.eclipse.ui.services.IDisposable; - -/** - * This is the factory that is used to provide the interfaces needed to support Viewers. - * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. - * The adapters also support Eclipse property sheets. - * Note that most of the adapters are shared among multiple instances. - */ -public class JpaCoreXmlItemProviderAdapterFactory - extends OrmAdapterFactory - implements ComposeableAdapterFactory, - IChangeNotifier, - IDisposable -{ - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - - public JpaCoreXmlItemProviderAdapterFactory() { - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemLabelProvider.class); - } - - - protected XmlRootContentNodeItemProvider xmlRootContentNodeItemProvider; - - public Adapter createXmlRootContentNodeAdapter() { - if (xmlRootContentNodeItemProvider == null) { - xmlRootContentNodeItemProvider = new XmlRootContentNodeItemProvider(this); - } - - return xmlRootContentNodeItemProvider; - } - - protected EntityMappingsItemProvider entityMappingsItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsImpl}. - */ - public Adapter createEntityMappingsAdapter() { - if (entityMappingsItemProvider == null) { - entityMappingsItemProvider = new EntityMappingsItemProvider(this); - } - - return entityMappingsItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType} instances. - */ - protected XmlPersistentTypeItemProvider xmlPersistentTypeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType}. - */ - public Adapter createXmlPersistentTypeAdapter() { - if (xmlPersistentTypeItemProvider == null) { - xmlPersistentTypeItemProvider = new XmlPersistentTypeItemProvider( - this); - } - - return xmlPersistentTypeItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute} instances. - */ - protected XmlPersistentAttributeItemProvider xmlPersistentAttributeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute}. - */ - public Adapter createXmlPersistentAttributeAdapter() { - if (xmlPersistentAttributeItemProvider == null) { - xmlPersistentAttributeItemProvider = new XmlPersistentAttributeItemProvider( - this); - } - - return xmlPersistentAttributeItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory - .getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory( - ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - */ - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) - || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This disposes all of the item providers created by this factory. - */ - public void dispose() { - if (xmlRootContentNodeItemProvider != null) - xmlRootContentNodeItemProvider.dispose(); - if (entityMappingsItemProvider != null) - entityMappingsItemProvider.dispose(); - if (xmlPersistentTypeItemProvider != null) - xmlPersistentTypeItemProvider.dispose(); - if (xmlPersistentAttributeItemProvider != null) - xmlPersistentAttributeItemProvider.dispose(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java deleted file mode 100644 index e9f4260b1f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.structure; - -import org.eclipse.draw2d.ImageUtilities; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; -import org.eclipse.jpt.core.internal.mappings.IBasic; -import org.eclipse.jpt.core.internal.mappings.IEmbedded; -import org.eclipse.jpt.core.internal.mappings.IEmbeddedId; -import org.eclipse.jpt.core.internal.mappings.IId; -import org.eclipse.jpt.core.internal.mappings.IManyToMany; -import org.eclipse.jpt.core.internal.mappings.IManyToOne; -import org.eclipse.jpt.core.internal.mappings.IOneToMany; -import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.ITransient; -import org.eclipse.jpt.core.internal.mappings.IVersion; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; - -public class XmlPersistentAttributeItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public XmlPersistentAttributeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - @Override - public Object getImage(Object object) { - XmlAttributeMapping mapping = ((XmlPersistentAttribute) object).getMapping(); - - Image image; - if (mapping instanceof IBasic) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.BASIC); - } - else if (mapping instanceof IId) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.ID); - } - else if (mapping instanceof IVersion) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.VERSION); - } - else if (mapping instanceof IEmbedded) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED); - } - else if (mapping instanceof IEmbeddedId) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED_ID); - } - else if (mapping instanceof IOneToOne) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_ONE); - } - else if (mapping instanceof IOneToMany) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_MANY); - } - else if (mapping instanceof IManyToOne) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_ONE); - } - else if (mapping instanceof IManyToMany) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_MANY); - } - else if (mapping instanceof ITransient) { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.TRANSIENT); - } - else { - image = JptUiMappingsImages.getImage(JptUiMappingsImages.NULL_ATTRIBUTE_MAPPING); - } - - // apply "ghosting" - if (mapping.isVirtual()) { - Color offwhite = new Color(image.getDevice(), 250, 250, 250); - ImageData imageData = ImageUtilities.createShadedImage(image, offwhite); - image = new Image(image.getDevice(), imageData); - } - - return image; - } - - @Override - public String getText(Object object) { - return ((XmlPersistentAttribute) object).getName(); - } - - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(XmlPersistentAttribute.class)) { - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING: - case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME: - fireNotifyChanged(new ViewerNotification(notification, notification - .getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java deleted file mode 100644 index f87750ae2b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.structure; - -import java.util.Collection; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.jpt.core.internal.IPersistentType; -import org.eclipse.jpt.core.internal.ITypeMapping; -import org.eclipse.jpt.core.internal.JpaCorePackage; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; -import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; -import org.eclipse.jpt.core.internal.mappings.IEmbeddable; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass; -import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages; - -public class XmlPersistentTypeItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public XmlPersistentTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - - @Override - protected Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(OrmPackage.Literals.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES); - childrenFeatures.add(OrmPackage.Literals.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES); - } - return childrenFeatures; - } - - @Override - public Object getImage(Object object) { - ITypeMapping mapping = ((IPersistentType) object).getMapping(); - - if (mapping instanceof IEntity) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.ENTITY); - } - else if (mapping instanceof IEmbeddable) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDABLE); - } - else if (mapping instanceof IMappedSuperclass) { - return JptUiMappingsImages.getImage(JptUiMappingsImages.MAPPED_SUPERCLASS); - } - else { - return null; - } - } - - @Override - public String getText(Object object) { - return ((XmlPersistentType) object).getClass_(); - } - - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(XmlPersistentType.class)) { - case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY: - case OrmPackage.XML_PERSISTENT_TYPE__CLASS: - fireNotifyChanged( - new ViewerNotification( - notification, notification.getNotifier(), false, true)); - return; - - case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES: - case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES: - fireNotifyChanged( - new ViewerNotification( - notification, notification.getNotifier(), true, false)); - return; - } - - super.notifyChanged(notification); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java deleted file mode 100644 index 969c7c8407..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.structure; - -import java.util.Collection; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.jpt.core.internal.content.orm.EntityMappings; -import org.eclipse.jpt.core.internal.content.orm.OrmPackage; - -public class XmlRootContentNodeItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider -{ - public XmlRootContentNodeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(OrmPackage.Literals.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS); - } - return childrenFeatures; - } - - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(EntityMappings.class)) { - case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS: - fireNotifyChanged( - new ViewerNotification( - notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java deleted file mode 100644 index ca7dddcceb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Oracle. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.ui.internal.xml.structure; - -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider; - -public class XmlStructureProvider implements IJpaStructureProvider { - - public String fileContentType() { - return JptCorePlugin.ORM_XML_CONTENT_TYPE; - } - - public ITreeContentProvider buildContentProvider() { - return new AdapterFactoryContentProvider(new JpaCoreXmlItemProviderAdapterFactory()); - } - - public ILabelProvider buildLabelProvider() { - return new AdapterFactoryLabelProvider(new JpaCoreXmlItemProviderAdapterFactory()); - } - - public void dispose() { - // TODO Auto-generated method stub - - } -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/.classpath b/jpa/plugins/org.eclipse.jpt.utility/.classpath deleted file mode 100644 index 1d0cf0db7b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/jpa/plugins/org.eclipse.jpt.utility/.cvsignore b/jpa/plugins/org.eclipse.jpt.utility/.cvsignore deleted file mode 100644 index 42191b4579..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -@dot -build.xml \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.utility/.project b/jpa/plugins/org.eclipse.jpt.utility/.project deleted file mode 100644 index 99b389b9c5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.utility - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 8b1918da29..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:11:35 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 443826069d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:55:37 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF deleted file mode 100644 index 20aef05fb4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF +++ /dev/null @@ -1,10 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.utility -Bundle-Version: 1.0.0.qualifier -Bundle-Localization: plugin -Export-Package: org.eclipse.jpt.utility.internal, - org.eclipse.jpt.utility.internal.iterators -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/jpa/plugins/org.eclipse.jpt.utility/about.html b/jpa/plugins/org.eclipse.jpt.utility/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/plugins/org.eclipse.jpt.utility/build.properties b/jpa/plugins/org.eclipse.jpt.utility/build.properties deleted file mode 100644 index 11ab8d42f6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/build.properties +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2007 Oracle. All rights reserved. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0, which accompanies this distribution -# and is available at http://www.eclipse.org/legal/epl-v10.html. -# -# Contributors: -# Oracle - initial API and implementation -################################################################################ -javacSource=1.5 -javacTarget=1.5 -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - about.html,\ - plugin.properties diff --git a/jpa/plugins/org.eclipse.jpt.utility/component.xml b/jpa/plugins/org.eclipse.jpt.utility/component.xml deleted file mode 100644 index b210b281dd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/component.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.utility/plugin.properties b/jpa/plugins/org.eclipse.jpt.utility/plugin.properties deleted file mode 100644 index 95c029d5d8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/plugin.properties +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2007 Oracle. All rights reserved. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0, which accompanies this distribution -# and is available at http://www.eclipse.org/legal/epl-v10.html. -# -# Contributors: -# Oracle - initial API and implementation -################################################################################ -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence API Tools - Utility -providerName = Eclipse.org - diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java deleted file mode 100644 index 2c68536c51..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -/** - * A collection that allows duplicate elements. - *

    - * The Bag interface places additional stipulations, - * beyond those inherited from the java.util.Collection interface, - * on the contracts of the equals and hashCode methods. - * - * @version 1.00 Jan-2002 - * @see java.util.Collection - * @see HashBag - */ - -public interface Bag extends java.util.Collection { - - /** - * Compares the specified object with this bag for equality. Returns - * true if the specified object is also a bag, the two bags - * have the same size, and every member of the specified bag is - * contained in this bag with the same number of occurrences (or equivalently, - * every member of this bag is contained in the specified bag with the same - * number of occurrences). This definition ensures that the - * equals method works properly across different implementations of the - * bag interface. - */ - boolean equals(Object o); - - /** - * Returns the hash code value for this bag. The hash code of a bag is - * defined to be the sum of the hash codes of the elements in the bag, - * where the hashcode of a null element is defined to be zero. - * This ensures that b1.equals(b2) implies that - * b1.hashCode() == b2.hashCode() for any two bags - * b1 and b2, as required by the general - * contract of the Object.hashCode method. - */ - int hashCode(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java deleted file mode 100644 index cc1221a473..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -/** - * Assorted bit tools - */ -public class BitTools { - - /** - * Return whether the specified 'flags' has all the specified - * 'flagsToCheck' set. - */ - public static boolean allFlagsAreSet(int flags, int flagsToCheck) { - return (flags & flagsToCheck) == flagsToCheck; - } - - /** - * Return whether the specified 'flags' has any one of the specified - * 'flagsToCheck' set. - */ - public static boolean anyFlagsAreSet(int flags, int flagsToCheck) { - return (flags & flagsToCheck) != 0; - } - - /** - * Return whether the specified 'flags' has all the specified - * 'flagsToCheck' set. - */ - public static boolean allFlagsAreSet(int flags, int[] flagsToCheck) { - for (int i = flagsToCheck.length; i-- > 0; ) { - if ( ! allFlagsAreSet(flags, flagsToCheck[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified 'flags' has any one of the specified - * 'flagsToCheck' set. - */ - public static boolean anyFlagsAreSet(int flags, int[] flagsToCheck) { - for (int i = flagsToCheck.length; i-- > 0; ) { - if (anyFlagsAreSet(flags, flagsToCheck[i])) { - return true; - } - } - return false; - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private BitTools() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java deleted file mode 100644 index 9f8e2021e8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java +++ /dev/null @@ -1,1505 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.Collections; -import java.util.Stack; - -/** - * Convenience methods related to the java.lang.reflect package. - * These methods provide shortcuts for manipulating objects via - * reflection; particularly when dealing with fields and/or methods that - * are not publicly accessible or are inherited. - * - * In most cases, all the exceptions are handled and - * wrapped in java.lang.RuntimeExceptions; so these methods should - * be used when you are confident that you will not having any problems - * using reflection. - * - * There are also a number of methods whose names - * begin with "attempt". These methods will throw a NoSuchMethodException - * or NoSuchFieldException when appropriate, allowing you to probe - * for methods that should be present but might not. - */ -public final class ClassTools { - - public static final Class[] ZERO_PARAMETER_TYPES = new Class[0]; - public static final Object[] ZERO_PARAMETERS = new Object[0]; - private static final String CR = StringTools.CR; - - public static final char NESTED_CLASS_NAME_SEPARATOR = '$'; - - public static final char ARRAY_INDICATOR = '['; - - public static final char REFERENCE_CLASS_CODE = 'L'; - public static final char REFERENCE_CLASS_NAME_DELIMITER = ';'; - - private static PrimitiveClassCode[] PRIMITIVE_CLASS_CODES; // pseudo 'final' - lazy-initialized - public static final char BYTE_CODE = 'B'; - public static final char CHAR_CODE = 'C'; - public static final char DOUBLE_CODE = 'D'; - public static final char FLOAT_CODE = 'F'; - public static final char INT_CODE = 'I'; - public static final char LONG_CODE = 'J'; - public static final char SHORT_CODE = 'S'; - public static final char BOOLEAN_CODE = 'Z'; - public static final char VOID_CODE = 'V'; - - private static int MAX_PRIMITIVE_CLASS_NAME_LENGTH = -1; // pseudo 'final' - lazy-initialized - - - /** - * Return all the fields for the - * specified class, including inherited fields. - * Class#allFields() - */ - public static Field[] allFields(Class javaClass) { - Stack stack = new Stack(); - for (Class tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) { - pushDeclaredFields(tempClass, stack); - } - Collections.reverse(stack); - return stack.toArray(new Field[stack.size()]); - } - - /** - * Return all the methods for the - * specified class, including inherited methods. - * Class#allMethods() - */ - public static Method[] allMethods(Class javaClass) { - Stack stack = new Stack(); - for (Class tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) { - pushDeclaredMethods(tempClass, stack); - } - Collections.reverse(stack); - return stack.toArray(new Method[stack.size()]); - } - - /** - * Convenience method. - * Return a new instance of the specified class, - * using the class's default (zero-argument) constructor. - * Throw an exception if the default constructor is not defined. - * Class#newInstance() throws NoSuchMethodException - */ - public static T attemptNewInstance(Class javaClass) throws NoSuchMethodException { - return attemptNewInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Return a new instance of the specified class, - * given the constructor parameter types and parameters. - * Throw an exception if the constructor is not defined. - * Class#newInstance(Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException - */ - public static T attemptNewInstance(Class javaClass, Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException { - try { - return constructor(javaClass, parameterTypes).newInstance(parameters); - } catch (InstantiationException ie) { - throw new RuntimeException(ie + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), ie); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), iae); - } catch (InvocationTargetException ite) { - throw new RuntimeException(fullyQualifiedConstructorSignature(javaClass, parameterTypes) + CR + ite.getTargetException(), ite); - } - } - - /** - * Convenience method. - * Return a new instance of the specified class, - * given the constructor parameter type and parameter. - * Throw an exception if the constructor is not defined. - * Class#newInstance(Class parameterType, Object parameter) throws NoSuchMethodException - */ - public static T attemptNewInstance(Class javaClass, Class parameterType, Object parameter) throws NoSuchMethodException { - return attemptNewInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Attempt to get a field value, given the containing object and field name. - * Return its result. - * Useful for accessing private, package, or protected fields. - * Throw an exception if the field is not defined. - * Object#getFieldValue(String fieldName) throws NoSuchFieldException - */ - public static Object attemptToGetFieldValue(Object object, String fieldName) throws NoSuchFieldException { - try { - return field(object, fieldName).get(object); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae); - } - } - - /** - * Attempt to get a static field value, given the containing object and field name. - * Return its result. - * Useful for accessing private, package, or protected fields. - * Throw an exception if the field is not defined. - * Class#getStaticFieldValue(String fieldName) throws NoSuchFieldException - */ - public static Object attemptToGetStaticFieldValue(Class javaClass, String fieldName) throws NoSuchFieldException { - try { - return field(javaClass, fieldName).get(null); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae); - } - } - - /** - * Convenience method. - * Attempt to execute a zero-argument method, - * given the receiver and method name. - * Return its result. - * Throw an exception if the method is not found. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName) throws NoSuchMethodException - */ - public static Object attemptToExecuteMethod(Object receiver, String methodName) throws NoSuchMethodException { - return attemptToExecuteMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Convenience method. - * Attempt to execute a method, given the receiver, - * method name, parameter type, and parameter. - * Return its result. - * Throw an exception if the method is not found. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class parameterType, Object parameter) throws NoSuchMethodException - */ - public static Object attemptToExecuteMethod(Object receiver, String methodName, Class parameterType, Object parameter) throws NoSuchMethodException { - return attemptToExecuteMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Attempt to execute a method, given the receiver, - * method name, parameter types, and parameters. - * Return its result. - * Throw an exception if the method is not found. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException - */ - public static Object attemptToExecuteMethod(Object receiver, String methodName, Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException { - return executeMethod(method(receiver, methodName, parameterTypes), receiver, parameters); - } - - /** - * Attempt to execute a method, given the receiver, - * method name, parameter types, and parameters. - * Return its result. - * Throw an exception if the method is not found. - * If the executed method throws an exception, rethrow that exception. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException - */ - public static Object attemptToExecuteMethodWithException(Object receiver, String methodName, Class[] parameterTypes, Object[] parameters) - throws Throwable, NoSuchMethodException - { - return executeMethodWithException(method(receiver, methodName, parameterTypes), receiver, parameters); - } - - /** - * Convenience method. - * Attempt to execute a zero-argument static method, - * given the class and method name. - * Return its result. - * Throw an exception if the method is not found. - * Useful for invoking private, package, or protected methods. - * Class#executeStaticMethod(String methodName) throws NoSuchMethodException - */ - public static Object attemptToExecuteStaticMethod(Class javaClass, String methodName) throws NoSuchMethodException { - return attemptToExecuteStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Attempt to execute a static method, given the class, - * method name, parameter types, and parameters. - * Return its result. - * Throw an exception if the method is not found. - * Useful for invoking private, package, or protected methods. - * Class#executeStaticMethod(String methodName, Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException - */ - public static Object attemptToExecuteStaticMethod(Class javaClass, String methodName, Class[] parameterTypes, Object[] parameters) throws NoSuchMethodException { - return executeStaticMethod(staticMethod(javaClass, methodName, parameterTypes), parameters); - } - - /** - * Convenience method. - * Attempt to execute a static method, given the class, - * method name, parameter type, and parameter. - * Return its result. - * Throw an exception if the method is not found. - * Useful for invoking private, package, or protected methods. - * Class#executeStaticMethod(String methodName, Class parameterType, Object parameter) throws NoSuchMethodException - */ - public static Object attemptToExecuteStaticMethod(Class javaClass, String methodName, Class parameterType, Object parameter) throws NoSuchMethodException { - return attemptToExecuteStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Attempt to set a field value, given the - * containing object, field name, and new field value. - * Useful for accessing private, package, or protected fields. - * Throw an exception if the field is not defined. - * Object#setFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException - */ - public static void attemptToSetFieldValue(Object object, String fieldName, Object fieldValue) throws NoSuchFieldException { - try { - field(object, fieldName).set(object, fieldValue); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae); - } - } - - /** - * Attempt to set a static field value, given the - * containing class, field name, and new field value. - * Useful for accessing private, package, or protected fields. - * Throw an exception if the field is not defined. - * Class#setStaticFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException - */ - public static void attemptToSetStaticFieldValue(Class javaClass, String fieldName, Object fieldValue) throws NoSuchFieldException { - try { - field(javaClass, fieldName).set(null, fieldValue); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae); - } - } - - /** - * Convenience method. - * Return the default (zero-argument) constructor - * for the specified class. - * Set accessible to true, so we can access - * private/package/protected constructors. - * Class#constructor() throws NoSuchMethodException - */ - public static Constructor constructor(Class javaClass) throws NoSuchMethodException { - return constructor(javaClass, ZERO_PARAMETER_TYPES); - } - - /** - * Return the constructor for the specified class - * and formal parameter types. - * Set accessible to true, so we can access - * private/package/protected constructors. - * Class#constructor(Class[] parameterTypes) throws NoSuchMethodException - */ - public static Constructor constructor(Class javaClass, Class[] parameterTypes) throws NoSuchMethodException { - Constructor constructor = javaClass.getDeclaredConstructor(parameterTypes); - constructor.setAccessible(true); - return constructor; - } - - /** - * Convenience method. - * Return the constructor for the specified class - * and formal parameter type. - * Set accessible to true, so we can access - * private/package/protected constructors. - * Class#constructor(Class parameterType) throws NoSuchMethodException - */ - public static Constructor constructor(Class javaClass, Class parameterType) throws NoSuchMethodException { - return constructor(javaClass, new Class[] {parameterType}); - } - - /** - * Return the declared fields for the specified class. - * Set accessible to true, so we can access - * private/package/protected fields. - * Class#accessibleDeclaredFields() - */ - public static Field[] declaredFields(Class javaClass) { - Field[] fields = javaClass.getDeclaredFields(); - for (Field field : fields) { - field.setAccessible(true); - } - return fields; - } - - /** - * Return the declared methods for the - * specified class. - * Set accessible to true, so we can access - * private/package/protected methods. - * Class#accessibleDeclaredMethods() - */ - public static Method[] declaredMethods(Class javaClass) { - Method[] methods = javaClass.getDeclaredMethods(); - for (Method method : methods) { - method.setAccessible(true); - } - return methods; - } - - /** - * Return the default (zero-argument) constructor - * for the specified class. - * Set accessible to true, so we can access - * private/package/protected constructors. - * Class#defaultConstructor() - */ - public static Constructor defaultConstructor(Class javaClass) throws NoSuchMethodException { - return constructor(javaClass); - } - - /** - * Return a field for the specified class and field name. - * If the class does not directly - * define the field, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected fields. - */ - public static Field field(Class javaClass, String fieldName) throws NoSuchFieldException { - Field field = null; - try { - field = javaClass.getDeclaredField(fieldName); - } catch (NoSuchFieldException ex) { - Class superclass = javaClass.getSuperclass(); - if (superclass == null) { - throw ex; - } - // recurse - return field(superclass, fieldName); - } - field.setAccessible(true); - return field; - } - - /** - * Convenience method. - * Return a field for the specified object and field name. - * If the object's class does not directly - * define the field, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected fields. - */ - public static Field field(Object object, String fieldName) throws NoSuchFieldException { - return field(object.getClass(), fieldName); - } - - /** - * Return a string representation of the specified constructor. - */ - private static String fullyQualifiedConstructorSignature(Class javaClass, Class[] parameterTypes) { - return fullyQualifiedMethodSignature(javaClass, null, parameterTypes); - } - - /** - * Return a string representation of the specified field. - */ - private static String fullyQualifiedFieldName(Class javaClass, String fieldName) { - StringBuffer sb = new StringBuffer(200); - sb.append(javaClass.getName()); - sb.append('.'); - sb.append(fieldName); - return sb.toString(); - } - - /** - * Return a string representation of the specified field. - */ - private static String fullyQualifiedFieldName(Object object, String fieldName) { - return fullyQualifiedFieldName(object.getClass(), fieldName); - } - - /** - * Return a string representation of the specified method. - */ - private static String fullyQualifiedMethodSignature(Class javaClass, String methodName, Class[] parameterTypes) { - StringBuffer sb = new StringBuffer(200); - sb.append(javaClass.getName()); - // this check allows us to use this code for constructors, where the methodName is null - if (methodName != null) { - sb.append('.'); - sb.append(methodName); - } - sb.append('('); - int max = parameterTypes.length - 1; - if (max != -1) { - // stop one short of the end of the array - for (int i = 0; i < max; i++) { - sb.append(parameterTypes[i].getName()); - sb.append(", "); - } - sb.append(parameterTypes[max].getName()); - } - sb.append(')'); - return sb.toString(); - } - - /** - * Return a string representation of the specified method. - */ - private static String fullyQualifiedMethodSignature(Object receiver, String methodName, Class[] parameterTypes) { - return fullyQualifiedMethodSignature(receiver.getClass(), methodName, parameterTypes); - } - - /** - * Get a field value, given the containing object and field name. - * Return its result. - * Useful for accessing private, package, or protected fields. - * Object#getFieldValue(String fieldName) - */ - public static Object getFieldValue(Object object, String fieldName) { - try { - return attemptToGetFieldValue(object, fieldName); - } catch (NoSuchFieldException nsfe) { - throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe); - } - } - - /** - * Get a static field value, given the containing class and field name. - * Return its result. - * Useful for accessing private, package, or protected fields. - * Class#getStaticFieldValue(String fieldName) - */ - public static Object getStaticFieldValue(Class javaClass, String fieldName) { - try { - return attemptToGetStaticFieldValue(javaClass, fieldName); - } catch (NoSuchFieldException nsfe) { - throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe); - } - } - - /** - * Convenience method. - * Execute a zero-argument method, given the receiver and method name. - * Return its result. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName) - */ - public static Object executeMethod(Object receiver, String methodName) { - return executeMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Execute a method, given the receiver, - * method name, parameter types, and parameters. - * Return its result. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class[] parameterTypes, Object[] parameters) - */ - public static Object executeMethod(Object receiver, String methodName, Class[] parameterTypes, Object[] parameters) { - try { - return attemptToExecuteMethod(receiver, methodName, parameterTypes, parameters); - } catch (NoSuchMethodException nsme) { - throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme); - } - } - - /** - * Convenience method. - * Execute a one-argument method, given the receiver, - * method name, parameter type, and parameter. - * Return its result. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class parameterType, Object parameter) - */ - public static Object executeMethod(Object receiver, String methodName, Class parameterType, Object parameter) { - return executeMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Convenience method. - * Execute a zero-argument method, given the receiver and method name. - * Return its result. - * If the method throws an exception, rethrow that exception. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName) - */ - public static Object executeMethodWithException(Object receiver, String methodName) - throws Throwable - { - return executeMethodWithException(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Convenience method. - * Execute a one-argument method, given the receiver, - * method name, parameter type, and parameter. - * Return its result. - * If the method throws an exception, rethrow that exception. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class parameterType, Object parameter) - */ - public static Object executeMethodWithException(Object receiver, String methodName, Class parameterType, Object parameter) - throws Throwable - { - return executeMethodWithException(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Execute a method, given the receiver, - * method name, parameter types, and parameters. - * Return its result. - * If the method throws an exception, rethrow that exception. - * Useful for invoking private, package, or protected methods. - * Object#execute(String methodName, Class[] parameterTypes, Object[] parameters) - */ - public static Object executeMethodWithException(Object receiver, String methodName, Class[] parameterTypes, Object[] parameters) - throws Throwable - { - try { - return attemptToExecuteMethodWithException(receiver, methodName, parameterTypes, parameters); - } catch (NoSuchMethodException nsme) { - throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme); - } - } - - /** - * Execute the specified method with the specified parameters. - * Return its result. - * Convert exceptions to RuntimeExceptions. - */ - public static Object executeMethod(Method method, Object receiver, Object[] parameters) { - try { - return method.invoke(receiver, parameters); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + method, iae); - } catch (InvocationTargetException ite) { - throw new RuntimeException(method + CR + ite.getTargetException(), ite); - } - } - - /** - * Execute the specified method with the specified parameters. - * Return its result. - * If the method throws an exception, rethrow that exception. - * Convert all other exceptions to RuntimeExceptions. - */ - public static Object executeMethodWithException(Method method, Object receiver, Object[] parameters) - throws Throwable - { - try { - return method.invoke(receiver, parameters); - } catch (IllegalAccessException iae) { - throw new RuntimeException(iae + CR + method, iae); - } catch (InvocationTargetException ite) { - Throwable cause = ite.getCause(); - if (cause == null) { - throw new RuntimeException(method.toString(), ite); - } - throw cause; - } - } - - /** - * Convenience method. - * Execute a zero-argument static method, - * given the class and method name. - * Return its result. - * Useful for invoking private, package, or protected methods. - * Class#executeStaticMethod(String methodName) - */ - public static Object executeStaticMethod(Class javaClass, String methodName) { - return executeStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Execute a static method, given the class, - * method name, parameter types, and parameters. - * Return its result. - * Useful for invoking private, package, or protected methods. - * Class#executeStaticMethod(String methodName, Class[] parameterTypes, Object[] parameters) - */ - public static Object executeStaticMethod(Class javaClass, String methodName, Class[] parameterTypes, Object[] parameters) { - try { - return attemptToExecuteStaticMethod(javaClass, methodName, parameterTypes, parameters); - } catch (NoSuchMethodException nsme) { - throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), nsme); - } - } - - /** - * Convenience method. - * Execute a static method, given the class, - * method name, parameter type, and parameter. - * Return its result. - * Useful for invoking private, package, or protected methods. - * Class#executeStaticMethod(String methodName, Class parameterType, Object parameter) - */ - public static Object executeStaticMethod(Class javaClass, String methodName, Class parameterType, Object parameter) { - return executeStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Execute the specified static method with the specified parameters. - * Return its result. - * Convert exceptions to RuntimeExceptions. - */ - public static Object executeStaticMethod(Method method, Object[] parameters) { - return executeMethod(method, null, parameters); - } - - /** - * Convenience method. - * Return a zero-argument method for the specified class - * and method name. If the class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method method(Class javaClass, String methodName) throws NoSuchMethodException { - return method(javaClass, methodName, ZERO_PARAMETER_TYPES); - } - - /** - * Return a method for the specified class, method name, - * and formal parameter types. If the class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method method(Class javaClass, String methodName, Class[] parameterTypes) throws NoSuchMethodException { - Method method = null; - try { - method = javaClass.getDeclaredMethod(methodName, parameterTypes); - } catch (NoSuchMethodException ex) { - Class superclass = javaClass.getSuperclass(); - if (superclass == null) { - throw ex; - } - // recurse - return method(superclass, methodName, parameterTypes); - } - method.setAccessible(true); - return method; - } - - /** - * Convenience method. - * Return a method for the specified class, method name, - * and formal parameter type. If the class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method method(Class javaClass, String methodName, Class parameterType) throws NoSuchMethodException { - return method(javaClass, methodName, new Class[] {parameterType}); - } - - /** - * Convenience method. - * Return a zero-argument method for the specified object - * and method name. If the object's class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method method(Object object, String methodName) throws NoSuchMethodException { - return method(object.getClass(), methodName); - } - - /** - * Convenience method. - * Return a method for the specified object, method name, - * and formal parameter types. If the object's class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method method(Object object, String methodName, Class[] parameterTypes) throws NoSuchMethodException { - return method(object.getClass(), methodName, parameterTypes); - } - - /** - * Convenience method. - * Return a method for the specified object, method name, - * and formal parameter type. If the object's class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method method(Object object, String methodName, Class parameterType) throws NoSuchMethodException { - return method(object.getClass(), methodName, parameterType); - } - - /** - * Convenience method. - * Return the specified class,. - */ - public static Class classForName(String javaClassName) { - try { - return Class.forName(javaClassName); - } catch (ClassNotFoundException ex) { - throw new RuntimeException(javaClassName, ex); - } - } - - /** - * Convenience method. - * Return a new instance of the specified class, - * using the class's default (zero-argument) constructor. - * Class#newInstance() - */ - public static T newInstance(Class javaClass) { - return newInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS); - } - - /** - * Convenience method. - * Return a new instance of the specified class, - * using the class's default (zero-argument) constructor. - * Class#newInstance() - */ - public static Object newInstance(String javaClassName) throws ClassNotFoundException { - return newInstance(javaClassName, ClassTools.class.getClassLoader()); - } - - /** - * Convenience method. - * Return a new instance of the specified class, - * using the class's default (zero-argument) constructor. - * Class#newInstance() - */ - public static Object newInstance(String javaClassName, ClassLoader classLoader) throws ClassNotFoundException { - return newInstance(classLoader.loadClass(javaClassName)); - } - - /** - * Return a new instance of the specified class, - * given the constructor parameter types and parameters. - * Class#newInstance(Class[] parameterTypes, Object[] parameters) - */ - public static T newInstance(Class javaClass, Class[] parameterTypes, Object[] parameters) { - try { - return attemptNewInstance(javaClass, parameterTypes, parameters); - } catch (NoSuchMethodException nsme) { - throw new RuntimeException(nsme + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), nsme); - } - } - - /** - * Return a new instance of the specified class, - * given the constructor parameter types and parameters. - * Class#newInstance(Class[] parameterTypes, Object[] parameters) - */ - public static Object newInstance(String javaClassName, Class[] parameterTypes, Object[] parameters) throws ClassNotFoundException { - return newInstance(javaClassName, parameterTypes, parameters, ClassTools.class.getClassLoader()); - } - - /** - * Return a new instance of the specified class, - * given the constructor parameter types and parameters. - * Class#newInstance(Class[] parameterTypes, Object[] parameters) - */ - public static Object newInstance(String javaClassName, Class[] parameterTypes, Object[] parameters, ClassLoader classLoader) throws ClassNotFoundException { - return newInstance(classLoader.loadClass(javaClassName), parameterTypes, parameters); - } - - /** - * Convenience method. - * Return a new instance of the specified class, - * given the constructor parameter type and parameter. - * Class#newInstance(Class parameterType, Object parameter) - */ - public static T newInstance(Class javaClass, Class parameterType, Object parameter) { - return newInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter}); - } - - /** - * Return a new instance of the specified class, - * given the constructor parameter type and parameter. - * Class#newInstance(Class parameterType, Object parameter) - */ - public static Object newInstance(String javaClassName, Class parameterType, Object parameter) throws ClassNotFoundException { - return newInstance(javaClassName, parameterType, parameter, ClassTools.class.getClassLoader()); - } - - /** - * Return a new instance of the specified class, - * given the constructor parameter type and parameter. - * Class#newInstance(Class parameterType, Object parameter) - */ - public static Object newInstance(String javaClassName, Class parameterType, Object parameter, ClassLoader classLoader) throws ClassNotFoundException { - return newInstance(classLoader.loadClass(javaClassName), parameterType, parameter); - } - - /** - * Push the declared fields for the specified class - * onto the top of the stack. - */ - private static void pushDeclaredFields(Class javaClass, Stack stack) { - Field[] fields = declaredFields(javaClass); - for (int i = fields.length; i-- > 0; ) { - stack.push(fields[i]); - } - } - - /** - * Push the declared methods for the specified class - * onto the top of the stack. - */ - private static void pushDeclaredMethods(Class javaClass, Stack stack) { - Method[] methods = declaredMethods(javaClass); - for (int i = methods.length; i-- > 0; ) { - stack.push(methods[i]); - } - } - - /** - * Set a field value, given the containing object, field name, and new field value. - * Useful for accessing private, package, or protected fields. - * Object#setFieldValue(String fieldName, Object fieldValue) - */ - public static void setFieldValue(Object object, String fieldName, Object fieldValue) { - try { - attemptToSetFieldValue(object, fieldName, fieldValue); - } catch (NoSuchFieldException nsfe) { - throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe); - } - } - - /** - * Set a static field value, given the containing class, field name, and new field value. - * Useful for accessing private, package, or protected fields. - * Class#setStaticFieldValue(String fieldName, Object fieldValue) - */ - public static void setStaticFieldValue(Class javaClass, String fieldName, Object fieldValue) { - try { - attemptToSetStaticFieldValue(javaClass, fieldName, fieldValue); - } catch (NoSuchFieldException nsfe) { - throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe); - } - } - - /** - * Return the short name of the object's class. - * Class#getShortName() - */ - public static String shortClassNameForObject(Object object) { - return shortNameFor(object.getClass()); - } - - /** - * Return the short name of the class (e.g. "Object"). - * Class#getShortName() - */ - public static String shortNameForClassNamed(String className) { - return className.substring(className.lastIndexOf('.') + 1); - } - - /** - * Return the short name of the class (e.g. "Object"). - * Class#getShortName() - */ - public static String shortNameFor(Class javaClass) { - return shortNameForClassNamed(javaClass.getName()); - } - - /** - * Return the nested name of the object's class. - * Class#getNestedName() - */ - public static String nestedClassNameForObject(Object object) { - return nestedNameFor(object.getClass()); - } - - /** - * Return the nested name of the class (e.g. "Entry"). - * Class#getNestedName() - */ - public static String nestedNameForClassNamed(String className) { - return className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1); - } - - /** - * Return the nested name of the class (e.g. "Entry"). - * Class#getNestedName() - */ - public static String nestedNameFor(Class javaClass) { - return nestedNameForClassNamed(javaClass.getName()); - } - - /** - * Return the "toString()" name of the object's class. - */ - public static String toStringClassNameForObject(Object object) { - return toStringNameFor(object.getClass()); - } - - /** - * Return the "toString()" name of the class. - * "Member" classes will return only the final name: - * "com.foo.bar.TopLevelClass$MemberClass$NestedMemberClass" - * => "NestedMemberClass" - * "Local" and "anonymous" classes will still return the embedded '$'s: - * "com.foo.bar.TopLevelClass$1LocalClass" - * => "TopLevelClass$1LocalClass" - * "com.foo.bar.TopLevelClass$1" - * => "TopLevelClass$1" - */ - public static String toStringNameForClassNamed(String className) { - return classNamedIsMember(className) ? - className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1) - : - className.substring(className.lastIndexOf('.') + 1); - } - - /** - * Return the "toString()" name of the class. - */ - public static String toStringNameFor(Class javaClass) { - return toStringNameForClassNamed(javaClass.getName()); - } - - /** - * Return the package name of the class (e.g. "java.lang"). - * Class#getPackageName() - */ - public static String packageNameFor(Class javaClass) { - return packageNameForClassNamed(javaClass.getName()); - } - - /** - * Return the package name of the class (e.g. "java.lang"). - * Class#getPackageName() - */ - public static String packageNameForClassNamed(String className) { - int lastPeriod = className.lastIndexOf('.'); - if (lastPeriod == -1) { - return ""; - } - return className.substring(0, lastPeriod); - } - - /** - * Return the short name of the class, - * followed by its package name (e.g. "Object (java.lang)"). - * Class#getShortNameWithPackage() - */ - public static String shortNameWithPackage(Class javaClass) { - StringBuffer sb = new StringBuffer(200); - sb.append(shortNameFor(javaClass)); - if ( ! javaClass.isPrimitive()) { - sb.append(" ("); - sb.append(packageNameFor(javaClass)); - sb.append(')'); - } - return sb.toString(); - } - - /** - * Convenience method. - * Return a zero-argument, static method for the specified class - * and method name. If the class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method staticMethod(Class javaClass, String methodName) throws NoSuchMethodException { - return staticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES); - } - - /** - * Return a static method for the specified class, method name, - * and formal parameter types. If the class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method staticMethod(Class javaClass, String methodName, Class[] parameterTypes) throws NoSuchMethodException { - Method method = method(javaClass, methodName, parameterTypes); - if (Modifier.isStatic(method.getModifiers())) { - return method; - } - throw new NoSuchMethodException(fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes)); - } - - /** - * Convenience method. - * Return a static method for the specified class, method name, - * and formal parameter type. If the class does not directly - * implement the method, look for it in the class's superclasses. - * Set accessible to true, so we can access - * private/package/protected methods. - */ - public static Method staticMethod(Class javaClass, String methodName, Class parameterTypes) throws NoSuchMethodException { - return staticMethod(javaClass, methodName, new Class[] {parameterTypes}); - } - - /** - * Return whether the specified class can be "declared" in code; - * i.e. it is either a "top-level" class or a "member" class, but it - * is not an "array" class. This method rolls together all the checks - * from the other methods for a bit of a performance tweak. - * Class#isDeclarable() - */ - public static boolean classNamedIsDeclarable(String className) { - if (className.charAt(0) == ARRAY_INDICATOR) { - return false; // it is an "array" class - } - int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR); - if (index == -1) { - return true; // it is a "top-level" class - } - do { - // the character immediately after each dollar sign cannot be a digit - index++; - if (Character.isDigit(className.charAt(index))) { - return false; - } - index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index); - } while (index != -1); - return true; - } - - /** - * Return whether the specified class is a "top-level" class, - * as opposed to a "member", "local", or "anonymous" class, - * using the standard jdk naming conventions (i.e. the class - * name does NOT contain a '$': "TopLevelClass"). - * Class#isTopLevel() - */ - public static boolean classNamedIsTopLevel(String className) { - if (classNamedIsArray(className)) { - return false; - } - return className.indexOf(NESTED_CLASS_NAME_SEPARATOR) == -1; - } - - /** - * Return whether the specified class is a "member" class, - * as opposed to a "top-level", "local", or "anonymous" class, - * using the standard jdk naming conventions (i.e. the class - * name contains at least one '$' and all the names between - * each '$' are legal class names: - * "TopLevelClass$MemberClass$NestedMemberClass"). - * Class#isMember() - */ - public static boolean classNamedIsMember(String className) { - if (classNamedIsArray(className)) { - return false; - } - int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR); - if (index == -1) { - return false; // it is a "top-level" class - } - do { - // the character immediately after each dollar sign cannot be a digit - index++; - if (Character.isDigit(className.charAt(index))) { - return false; - } - index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index); - } while (index != -1); - return true; - } - - /** - * Return whether the specified class is a "local" class, - * as opposed to a "top-level", "member", or "anonymous" class, - * using the standard jdk (or Eclipse) naming conventions. - * In the jdk, the class name ends with '$nnnXXX' where the '$' is - * followed by a series of numeric digits which are followed by the - * local class name: "TopLevelClass$1LocalClass". - * In Eclipse, the class name ends with '$nnn$XXX' where the '$' is - * followed by a series of numeric digits which are separated from - * the local class name by another '$': "TopLevelClass$1$LocalClass". - * Class#isLocal() - */ - public static boolean classNamedIsLocal(String className) { - if (classNamedIsArray(className)) { - return false; - } - int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR); - if (dollar == -1) { - return false; - } - if ( ! Character.isDigit(className.charAt(dollar + 1))) { - return false; - } - int len = className.length(); - for (int i = dollar + 2; i < len; i++) { - if (Character.isJavaIdentifierStart(className.charAt(i))) { - return true; - } - } - // all the characters past the $ are digits (anonymous) - return false; - } - - /** - * Return whether the specified class is an "anonymous" class, - * as opposed to a "top-level", "member", or "local" class, - * using the standard jdk naming conventions (i.e. the class - * name ends with '$nnn' where all the characters past the - * last '$' are numeric digits: "TopLevelClass$1"). - * Class#isAnonymous() - */ - public static boolean classNamedIsAnonymous(String className) { - if (classNamedIsArray(className)) { - return false; - } - int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR); - if (dollar == -1) { - return false; - } - int start = dollar + 1; - for (int i = className.length(); i-- > start; ) { - if ( ! Character.isDigit(className.charAt(i))) { - return false; - } - } - // all the characters past the $ are digits - return true; - } - - /** - * Return the "array depth" of the specified class. - * The depth is the number of dimensions for an array type. - * Non-array types have a depth of zero. - * Class#getArrayDepth() - */ - public static int arrayDepthFor(Class javaClass) { - int depth = 0; - while (javaClass.isArray()) { - depth++; - javaClass = javaClass.getComponentType(); - } - return depth; - } - - /** - * Return the "array depth" of the specified object. - * The depth is the number of dimensions for an array. - * Non-arrays have a depth of zero. - */ - public static int arrayDepthForObject(Object object) { - return arrayDepthFor(object.getClass()); - } - - /** - * Return the "array depth" of the specified class. - * The depth is the number of dimensions for an array type. - * Non-array types have a depth of zero. - * @see java.lang.Class#getName() - * Class#getArrayDepth() - */ - public static int arrayDepthForClassNamed(String className) { - int depth = 0; - while (className.charAt(depth) == ARRAY_INDICATOR) { - depth++; - } - return depth; - } - - /** - * Return whether the specified class is an array type. - * @see java.lang.Class#getName() - */ - public static boolean classNamedIsArray(String className) { - return className.charAt(0) == ARRAY_INDICATOR; - } - - /** - * Return the "element type" of the specified class. - * The element type is the base type held by an array type. - * A non-array type simply returns itself. - * Class#getElementType() - */ - public static Class elementTypeFor(Class javaClass) { - while (javaClass.isArray()) { - javaClass = javaClass.getComponentType(); - } - return javaClass; - } - - /** - * Return the "element type" of the specified object. - * The element type is the base type held by an array. - * A non-array simply returns its class. - */ - public static Class elementTypeForObject(Object object) { - return elementTypeFor(object.getClass()); - } - - /** - * Return the "element type" of the specified class. - * The element type is the base type held by an array type. - * Non-array types simply return themselves. - * Class#getElementType() - */ - public static String elementTypeNameFor(Class javaClass) { - return elementTypeFor(javaClass).getName(); - } - - /** - * Return the "element type" of the specified class. - * The element type is the base type held by an array type. - * Non-array types simply return themselves. - * @see java.lang.Class#getName() - * Class#getElementType() - */ - public static String elementTypeNameForClassNamed(String className) { - int depth = arrayDepthForClassNamed(className); - if (depth == 0) { - // the name is in the form: "java.lang.Object" or "int" - return className; - } - int last = className.length() - 1; - if (className.charAt(depth) == REFERENCE_CLASS_CODE) { - // the name is in the form: "[[[Ljava.lang.Object;" - return className.substring(depth + 1, last); // drop the trailing ';' - } - // the name is in the form: "[[[I" - return classNameForCode(className.charAt(last)); - } - - /** - * Return whether the specified class is a "reference" - * class (i.e. not void or one of the primitives). - */ - public static boolean classNamedIsReference(String className) { - return ! classNamedIsNonReference(className); - } - - /** - * Return whether the specified class is a "non-reference" - * class (i.e. void or one of the primitives). - */ - public static boolean classNamedIsNonReference(String className) { - if (classNamedIsArray(className) || (className.length() > maxPrimitiveClassNameLength())) { - return false; // performance tweak - } - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - if (codes[i].javaClass.getName().equals(className)) { - return true; - } - } - return false; - } - - /** - * Return the class name for the specified class code. - * @see java.lang.Class#getName() - */ - public static String classNameForCode(char classCode) { - return classForCode(classCode).getName(); - } - - /** - * Return the class name for the specified class code. - * @see java.lang.Class#getName() - */ - public static String classNameForCode(int classCode) { - return classNameForCode((char) classCode); - } - - /** - * Return the class for the specified class code. - * @see java.lang.Class#getName() - */ - public static Class classForCode(char classCode) { - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - if (codes[i].code == classCode) { - return codes[i].javaClass; - } - } - throw new IllegalArgumentException(String.valueOf(classCode)); - } - - /** - * Return the class for the specified class code. - * @see java.lang.Class#getName() - */ - public static Class classForCode(int classCode) { - return classForCode((char) classCode); - } - - /** - * Return the class code for the specified class. - * @see java.lang.Class.getName() - */ - public static char codeForClass(Class javaClass) { - if (( ! javaClass.isArray()) && (javaClass.getName().length() <= maxPrimitiveClassNameLength())) { - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - if (codes[i].javaClass == javaClass) { - return codes[i].code; - } - } - } - throw new IllegalArgumentException(javaClass.getName()); - } - - /** - * Return the class code for the specified class. - * @see java.lang.Class.getName() - */ - public static char codeForClassNamed(String className) { - if (( ! classNamedIsArray(className)) && (className.length() <= maxPrimitiveClassNameLength())) { - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - if (codes[i].javaClass.getName().equals(className)) { - return codes[i].code; - } - } - } - throw new IllegalArgumentException(className); - } - - /** - * Return the class for specified "type declaration". - */ - public static Class classForTypeDeclaration(String elementTypeName, int arrayDepth) throws ClassNotFoundException { - return classForTypeDeclaration(elementTypeName, arrayDepth, ClassTools.class.getClassLoader()); - } - - /** - * Return the class for specified "type declaration", - * using the specified class loader. - */ - public static Class classForTypeDeclaration(String elementTypeName, int arrayDepth, ClassLoader classLoader) throws ClassNotFoundException { - // primitives cannot be loaded via Class#forName(), - // so check for a primitive class name first - PrimitiveClassCode pcc = null; - if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - if (codes[i].javaClass.getName().equals(elementTypeName)) { - pcc = codes[i]; - break; - } - } - } - - // non-array - if (arrayDepth == 0) { - return (pcc == null) ? classLoader.loadClass(elementTypeName) : pcc.javaClass; - } - - // array - StringBuffer sb = new StringBuffer(100); - for (int i = arrayDepth; i-- > 0; ) { - sb.append(ARRAY_INDICATOR); - } - if (pcc == null) { - sb.append(REFERENCE_CLASS_CODE); - sb.append(elementTypeName); - sb.append(REFERENCE_CLASS_NAME_DELIMITER); - } else { - sb.append(pcc.code); - } - return classLoader.loadClass(sb.toString()); - } - - /** - * Return the class name for specified "type declaration". - */ - public static String classNameForTypeDeclaration(String elementTypeName, int arrayDepth) { - // non-array - if (arrayDepth == 0) { - return elementTypeName; - } - - if (elementTypeName.equals(void.class.getName())) { - throw new IllegalArgumentException("'void' must have an array depth of zero: " + arrayDepth + '.'); - } - // array - StringBuffer sb = new StringBuffer(100); - for (int i = arrayDepth; i-- > 0; ) { - sb.append(ARRAY_INDICATOR); - } - - // look for a primitive first - PrimitiveClassCode pcc = null; - if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - if (codes[i].javaClass.getName().equals(elementTypeName)) { - pcc = codes[i]; - break; - } - } - } - - if (pcc == null) { - sb.append(REFERENCE_CLASS_CODE); - sb.append(elementTypeName); - sb.append(REFERENCE_CLASS_NAME_DELIMITER); - } else { - sb.append(pcc.code); - } - - return sb.toString(); - } - - private static int maxPrimitiveClassNameLength() { - if (MAX_PRIMITIVE_CLASS_NAME_LENGTH == -1) { - MAX_PRIMITIVE_CLASS_NAME_LENGTH = calculateMaxPrimitiveClassNameLength(); - } - return MAX_PRIMITIVE_CLASS_NAME_LENGTH; - } - - private static int calculateMaxPrimitiveClassNameLength() { - int max = -1; - PrimitiveClassCode[] codes = primitiveClassCodes(); - for (int i = codes.length; i-- > 0; ) { - int len = codes[i].javaClass.getName().length(); - if (len > max) { - max = len; - } - } - return max; - } - - private static PrimitiveClassCode[] primitiveClassCodes() { - if (PRIMITIVE_CLASS_CODES == null) { - PRIMITIVE_CLASS_CODES = buildPrimitiveClassCodes(); - } - return PRIMITIVE_CLASS_CODES; - } - - private static PrimitiveClassCode[] buildPrimitiveClassCodes() { - PrimitiveClassCode[] result = new PrimitiveClassCode[9]; - result[0] = new PrimitiveClassCode(BYTE_CODE, byte.class); - result[1] = new PrimitiveClassCode(CHAR_CODE, char.class); - result[2] = new PrimitiveClassCode(DOUBLE_CODE, double.class); - result[3] = new PrimitiveClassCode(FLOAT_CODE, float.class); - result[4] = new PrimitiveClassCode(INT_CODE, int.class); - result[5] = new PrimitiveClassCode(LONG_CODE, long.class); - result[6] = new PrimitiveClassCode(SHORT_CODE, short.class); - result[7] = new PrimitiveClassCode(BOOLEAN_CODE, boolean.class); - result[8] = new PrimitiveClassCode(VOID_CODE, void.class); - return result; - } - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private ClassTools() { - super(); - throw new UnsupportedOperationException(); - } - - - // ********** member class ********** - - private static class PrimitiveClassCode { - char code; - Class javaClass; - PrimitiveClassCode(char code, Class javaClass) { - this.code = code; - this.javaClass = javaClass; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java deleted file mode 100644 index 0eac533075..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java +++ /dev/null @@ -1,910 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.io.Serializable; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * TODO - */ -public class Classpath - implements Serializable -{ - /** The entries in the classpath */ - private final Entry[] entries; - - private static final long serialVersionUID = 1L; - - - // ********** static methods ********** - - // ***** factory methods for "standard" classpaths ***** - - /** - * Return the Java "boot" classpath. This includes rt.jar. - */ - public static Classpath bootClasspath() { - return new Classpath(System.getProperty("sun.boot.class.path")); - } - - /** - * Return a "virtual classpath" that contains all the jars - * that would be used by the Java Extension Mechanism. - */ - public static Classpath javaExtensionClasspath() { - File[] dirs = javaExtensionDirectories(); - List jarFileNames = new ArrayList(); - for (File dir : dirs) { - if (dir.isDirectory()) { - addJarFileNamesTo(dir, jarFileNames); - } - } - return new Classpath(jarFileNames); - } - - /** - * Return the Java "system" classpath. - */ - public static Classpath javaClasspath() { - return new Classpath(System.getProperty("java.class.path")); - } - - /** - * Return the unretouched "complete" classpath. - * This includes the boot classpath, the Java Extension - * Mechanism classpath, and the normal "system" classpath. - */ - public static Classpath completeClasspath() { - return new Classpath(new Classpath[] { - bootClasspath(), - javaExtensionClasspath(), - javaClasspath() - }); - } - - /** - * Return a classpath that contains the location of the specified class. - */ - public static Classpath classpathFor(Class javaClass) { - return new Classpath(locationFor(javaClass)); - } - - - // ***** file => class ***** - - /** - * Convert a relative file name to a class name; this will work for - * any file that has a single extension beyond the base - * class name. - * e.g. "java/lang/String.class" is converted to "java.lang.String" - * e.g. "java/lang/String.java" is converted to "java.lang.String" - */ - public static String convertToClassName(String classFileName) { - String className = FileTools.stripExtension(classFileName); - // do this for archive entry names - className = className.replace('/', '.'); - // do this for O/S-specific file names - if (File.separatorChar != '/') { - className = className.replace(File.separatorChar, '.'); - } - return className; - } - - /** - * Convert a file to a class name; - * e.g. File(java/lang/String.class) is converted to "java.lang.String" - */ - public static String convertToClassName(File classFile) { - return convertToClassName(classFile.getPath()); - } - - /** - * Convert a relative file name to a class; - * e.g. "java/lang/String.class" is converted to java.lang.String.class - */ - public static Class convertToClass(String classFileName) throws ClassNotFoundException { - return Class.forName(convertToClassName(classFileName)); - } - - /** - * Convert a relative file to a class; - * e.g. File(java/lang/String.class) is converted to java.lang.String.class - */ - public static Class convertToClass(File classFile) throws ClassNotFoundException { - return convertToClass(classFile.getPath()); - } - - - // ***** class => JAR entry ***** - - /** - * Convert a class name to an archive entry name base; - * e.g. "java.lang.String" is converted to "java/lang/String" - */ - public static String convertToArchiveEntryNameBase(String className) { - return className.replace('.', '/'); - } - - /** - * Convert a class to an archive entry name base; - * e.g. java.lang.String.class is converted to "java/lang/String" - */ - public static String convertToArchiveEntryNameBase(Class javaClass) { - return convertToArchiveEntryNameBase(javaClass.getName()); - } - - /** - * Convert a class name to an archive class file entry name; - * e.g. "java.lang.String" is converted to "java/lang/String.class" - */ - public static String convertToArchiveClassFileEntryName(String className) { - return convertToArchiveEntryNameBase(className) + ".class"; - } - - /** - * Convert a class to an archive class file entry name; - * e.g. java.lang.String.class is converted to "java/lang/String.class" - */ - public static String convertToArchiveClassFileEntryName(Class javaClass) { - return convertToArchiveClassFileEntryName(javaClass.getName()); - } - - - // ***** class => file (.class or .java) ***** - - /** - * Convert a class name to a file name base for the current O/S; - * e.g. "java.lang.String" is converted to "java/lang/String" on Unix - * and "java\\lang\\String" on Windows - */ - public static String convertToFileNameBase(String className) { - return className.replace('.', File.separatorChar); - } - - /** - * Convert a class to a file name base for the current O/S; - * e.g. java.lang.String.class is converted to "java/lang/String" on Unix - * and "java\\lang\\String" on Windows - */ - public static String convertToFileNameBase(Class javaClass) { - return convertToFileNameBase(javaClass.getName()); - } - - /** - * Convert a class name to a class file name for the current O/S; - * e.g. "java.lang.String" is converted to "java/lang/String.class" on Unix - * and "java\\lang\\String.class" on Windows - */ - public static String convertToClassFileName(String className) { - return convertToFileNameBase(className) + ".class"; - } - - /** - * Convert a class to a class file name for the current O/S; - * e.g. java.lang.String.class is converted to "java/lang/String.class" on Unix - * and "java\\lang\\String.class" on Windows - */ - public static String convertToClassFileName(Class javaClass) { - return convertToClassFileName(javaClass.getName()); - } - - /** - * Convert a class name to a class file for the current O/S; - * e.g. "java.lang.String" is converted to File(java/lang/String.class) - */ - public static File convertToClassFile(String className) { - return new File(convertToClassFileName(className)); - } - - /** - * Convert a class to a class file for the current O/S; - * e.g. java.lang.String.class is converted to File(java/lang/String.class) - */ - public static File convertToClassFile(Class javaClass) { - return convertToClassFile(javaClass.getName()); - } - - /** - * Convert a class name to a java file name for the current O/S; - * e.g. "java.lang.String" is converted to "java/lang/String.java" on Unix - * and "java\\lang\\String.java" on Windows - */ - public static String convertToJavaFileName(String className) { - return convertToFileNameBase(className) + ".java"; - } - - /** - * Convert a class to a java file name for the current O/S; - * e.g. java.lang.String.class is converted to "java/lang/String.java" on Unix - * and "java\\lang\\String.java" on Windows - */ - public static String convertToJavaFileName(Class javaClass) { - return convertToJavaFileName(javaClass.getName()); - } - - /** - * Convert a class name to a java file for the current O/S; - * e.g. "java.lang.String" is converted to File(java/lang/String.java) - */ - public static File convertToJavaFile(String className) { - return new File(convertToJavaFileName(className)); - } - - /** - * Convert a class to a java file for the current O/S; - * e.g. java.lang.String.class is converted to File(java/lang/String.java) - */ - public static File convertToJavaFile(Class javaClass) { - return convertToJavaFile(javaClass.getName()); - } - - - // ***** class => resource ***** - - /** - * Convert a class to a resource name; - * e.g. java.lang.String.class is converted to "/java/lang/String.class". - */ - public static String convertToResourceName(Class javaClass) { - return '/' + convertToArchiveClassFileEntryName(javaClass); - } - - /** - * Convert a class to a resource; - * e.g. java.lang.String.class is converted to - * URL(jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class). - */ - public static URL convertToResource(Class javaClass) { - return javaClass.getResource(convertToResourceName(javaClass)); - } - - - // ***** utilities ***** - - /** - * Return whether the specified file is an archive file; - * i.e. its name ends with ".zip" or ".jar" - */ - public static boolean fileNameIsArchive(String fileName) { - String ext = FileTools.extension(fileName).toLowerCase(); - return ext.equals(".jar") || ext.equals(".zip"); - } - - /** - * Return whether the specified file is an archive file; - * i.e. its name ends with ".zip" or ".jar" - */ - public static boolean fileIsArchive(File file) { - return fileNameIsArchive(file.getName()); - } - - /** - * Return what should be the fully-qualified file name - * for the JRE runtime JAR; - * e.g. "C:\jdk1.4.2_04\jre\lib\rt.jar". - */ - public static String rtJarName() { - return locationFor(java.lang.Object.class); - } - - /** - * Return the location from where the specified class was loaded. - */ - public static String locationFor(Class javaClass) { - URL url = convertToResource(javaClass); - String path; - try { - path = FileTools.buildFile(url).getPath(); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - String protocol = url.getProtocol().toLowerCase(); - if (protocol.equals("jar")) { - // if the class is in a JAR, the URL will look something like this: - // jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class - return path.substring(0, path.indexOf('!')); - } else if (protocol.equals("file")) { - // if the class is in a directory, the URL will look something like this: - // file:/C:/dev/main/mwdev/class/org/eclipse/dali/utility/Classpath.class - return path.substring(0, path.length() - convertToClassFileName(javaClass).length() - 1); - } else if (protocol.equals("bundleresource")) { - // if the class is in a bundle resource (Eclipse?), the URL will look something like this: - // bundleresource://43/org/eclipse/dali/utility/Classpath.class - return path.substring(0, path.length() - convertToClassFileName(javaClass).length() - 1); - } - - throw new IllegalStateException(url.toString()); - } - - /** - * Return the directories used by the Java Extension Mechanism. - */ - public static File[] javaExtensionDirectories() { - return convertToFiles(javaExtensionDirectoryNames()); - } - - /** - * Return the directory names used by the Java Extension Mechanism. - */ - public static String[] javaExtensionDirectoryNames() { - return System.getProperty("java.ext.dirs").split(File.pathSeparator); - } - - - // ***** internal ***** - - private static File[] convertToFiles(String[] fileNames) { - File[] files = new File[fileNames.length]; - for (int i = fileNames.length; i-- > 0; ) { - files[i] = new File(fileNames[i]); - } - return files; - } - - private static void addJarFileNamesTo(File dir, List jarFileNames) { - File[] jarFiles = jarFilesIn(dir); - for (File jarFile : jarFiles) { - jarFileNames.add(FileTools.canonicalFile(jarFile).getPath()); - } - } - - private static File[] jarFilesIn(File directory) { - return directory.listFiles(jarFileFilter()); - } - - private static FileFilter jarFileFilter() { - return new FileFilter() { - public boolean accept(File file) { - return FileTools.extension(file.getName()).toLowerCase().equals(".jar"); - } - }; - } - - - // ********** constructors ********** - - /** - * Construct a classpath with the specified entries. - */ - private Classpath(Entry[] entries) { - super(); - this.entries = entries; - } - - /** - * Construct a classpath with the specified entries. - */ - public Classpath(String[] fileNames) { - this(buildEntries(fileNames)); - } - - /** - * Skip empty file names because they will end up expanding to the current - * working directory, which is not what we want. Empty file names actually - * occur with some frequency; such as when the classpath has been built up - * dynamically with too many separators. For example: - * "C:\dev\foo.jar;;C:\dev\bar.jar" - * will be parsed into three file names: - * { "C:\dev\foo.jar", "", "C:\dev\bar.jar" } - */ - private static Entry[] buildEntries(String[] fileNames) { - List entries = new ArrayList(); - for (String fileName : fileNames) { - if ((fileName != null) && (fileName.length() != 0)) { - entries.add(new Entry(fileName)); - } - } - return entries.toArray(new Entry[entries.size()]); - } - - /** - * Construct a classpath with the specified path. - */ - public Classpath(String path) { - this(path.split(File.pathSeparator)); - } - - /** - * Construct a classpath with the specified entries. - */ - public Classpath(List fileNames) { - this(fileNames.toArray(new String[fileNames.size()])); - } - - /** - * Consolidate the specified classpaths into a single classpath. - */ - public Classpath(Classpath[] classpaths) { - this(consolidateEntries(classpaths)); - } - - private static Entry[] consolidateEntries(Classpath[] classpaths) { - List entries = new ArrayList(); - for (Classpath classpath : classpaths) { - CollectionTools.addAll(entries, classpath.getEntries()); - } - return entries.toArray(new Entry[entries.size()]); - } - - - // ********** public API ********** - - /** - * Return the classpath's entries. - */ - public Entry[] getEntries() { - return this.entries; - } - - /** - * Return the classpath's path. - */ - public String path() { - Entry[] localEntries = this.entries; - int max = localEntries.length - 1; - if (max == -1) { - return ""; - } - StringBuffer sb = new StringBuffer(2000); - // stop one short of the end of the array - for (int i = 0; i < max; i++) { - sb.append(localEntries[i].fileName()); - sb.append(File.pathSeparatorChar); - } - sb.append(localEntries[max].fileName()); - return sb.toString(); - } - - /** - * Search the classpath for the specified (unqualified) file - * and return its entry. Return null if an entry is not found. - * For example, you could use this method to find the entry - * for "rt.jar" or "toplink.jar". - */ - public Entry entryForFileNamed(String shortFileName) { - Entry[] localEntries = this.entries; - for (Entry entry : localEntries) { - if (entry.file().getName().equals(shortFileName)) { - return entry; - } - } - return null; - } - - /** - * Return the first entry file in the classpath - * that contains the specified class. - * Return null if an entry is not found. - */ - public Entry entryForClassNamed(String className) { - String relativeClassFileName = convertToClassFileName(className); - String archiveEntryName = convertToArchiveClassFileEntryName(className); - Entry[] localEntries = this.entries; - for (Entry entry : localEntries) { - if (entry.contains(relativeClassFileName, archiveEntryName)) { - return entry; - } - } - return null; - } - - /** - * Return the names of all the classes discovered on the classpath, - * with duplicates removed. - */ - public String[] classNames() { - return this.classNames(Filter.Null.instance()); - } - - /** - * Return the names of all the classes discovered on the classpath - * and accepted by the specified filter, with duplicates removed. - */ - public String[] classNames(Filter filter) { - Collection classNames = new HashSet(10000); - this.addClassNamesTo(classNames, filter); - return classNames.toArray(new String[classNames.size()]); - } - - /** - * Add the names of all the classes discovered on the classpath - * to the specified collection. - */ - public void addClassNamesTo(Collection classNames) { - this.addClassNamesTo(classNames, Filter.Null.instance()); - } - - /** - * Add the names of all the classes discovered on the classpath - * and accepted by the specified filter to the specified collection. - */ - public void addClassNamesTo(Collection classNames, Filter filter) { - Entry[] localEntries = this.entries; - for (Entry entry : localEntries) { - entry.addClassNamesTo(classNames, filter); - } - } - - /** - * Return the names of all the classes discovered on the classpath. - * Just a bit more performant than #classNames(). - */ - public Iterator classNamesStream() { - return this.classNamesStream(Filter.Null.instance()); - } - - /** - * Return the names of all the classes discovered on the classpath - * that are accepted by the specified filter. - * Just a bit more performant than #classNames(Filter). - */ - public Iterator classNamesStream(Filter filter) { - return new CompositeIterator(this.entryClassNamesStreams(filter)); - } - - private Iterator> entryClassNamesStreams(final Filter filter) { - return new TransformationIterator>(new ArrayIterator(this.entries)) { - @Override - protected Iterator transform(Entry entry) { - return entry.classNamesStream(filter); - } - }; - } - - /** - * Return a "compressed" version of the classpath with its - * duplicate entries eliminated. - */ - public Classpath compressed() { - return new Classpath((Entry[]) CollectionTools.removeDuplicateElements(this.entries)); - } - - /** - * Convert the classpath to an array of URLs - * (that can be used to instantiate a URLClassLoader). - */ - public URL[] urls() { - Entry[] localEntries = this.entries; - int len = localEntries.length; - URL[] urls = new URL[len]; - for (int i = 0; i < len; i++) { - urls[i] = localEntries[i].url(); - } - return urls; - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.path()); - } - - - // ********** inner class ********** - - /** - * TODO - */ - public static class Entry implements Serializable { - private final String fileName; - private final File file; - private final File canonicalFile; - - private static final long serialVersionUID = 1L; - - Entry(String fileName) { - super(); - if ((fileName == null) || (fileName.length() == 0)) { - throw new IllegalArgumentException("'fileName' must be non-empty"); - } - this.fileName = fileName; - this.file = new File(fileName); - this.canonicalFile = FileTools.canonicalFile(this.file); - } - - public String fileName() { - return this.fileName; - } - - public File file() { - return this.file; - } - - public File canonicalFile() { - return this.canonicalFile; - } - - public String canonicalFileName() { - return this.canonicalFile.getAbsolutePath(); - } - - @Override - public boolean equals(Object o) { - if ( ! (o instanceof Entry)) { - return false; - } - return ((Entry) o).canonicalFile.equals(this.canonicalFile); - } - - @Override - public int hashCode() { - return this.canonicalFile.hashCode(); - } - - /** - * Return the entry's "canonical" URL. - */ - public URL url() { - try { - return this.canonicalFile.toURL(); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - /** - * Return whether the entry contains the specified class. - */ - public boolean contains(Class javaClass) { - return this.contains(javaClass.getName()); - } - - /** - * Return whether the entry contains the specified class. - */ - public boolean contains(String className) { - return this.contains(convertToClassFileName(className), convertToArchiveClassFileEntryName(className)); - } - - /** - * Return whether the entry contains either the specified relative - * class file or the specified archive entry. - * Not the prettiest signature, but it's internal.... - */ - boolean contains(String relativeClassFileName, String archiveEntryName) { - if ( ! this.canonicalFile.exists()) { - return false; - } - if (this.canonicalFile.isDirectory() && (new File(this.canonicalFile, relativeClassFileName)).exists()) { - return true; - } - return (fileIsArchive(this.canonicalFile) && this.archiveContainsEntry(archiveEntryName)); - } - - /** - * Return whether the entry's archive contains the specified entry. - */ - private boolean archiveContainsEntry(String zipEntryName) { - ZipFile zipFile = null; - ZipEntry zipEntry = null; - try { - zipFile = new ZipFile(this.canonicalFile); - zipEntry = zipFile.getEntry(zipEntryName); - } catch (IOException ex) { - zipEntry = null; // something is wrong, clear out the entry - } finally { - try { - if (zipFile != null) { - zipFile.close(); - } - } catch (IOException ex) { - zipEntry = null; // something is wrong, clear out the entry - } - } - return zipEntry != null; - } - - /** - * Return the names of all the classes discovered in the entry. - */ - public String[] classNames() { - return this.classNames(Filter.Null.instance()); - } - - /** - * Return the names of all the classes discovered in the entry - * and accepted by the specified filter. - */ - public String[] classNames(Filter filter) { - Collection classNames = new ArrayList(2000); - this.addClassNamesTo(classNames, filter); - return classNames.toArray(new String[classNames.size()]); - } - - /** - * Add the names of all the classes discovered in the entry - * to the specified collection. - */ - public void addClassNamesTo(Collection classNames) { - this.addClassNamesTo(classNames, Filter.Null.instance()); - } - - /** - * Add the names of all the classes discovered in the entry - * and accepted by the specified filter to the specified collection. - */ - public void addClassNamesTo(Collection classNames, Filter filter) { - if (this.canonicalFile.exists()) { - if (this.canonicalFile.isDirectory()) { - this.addClassNamesForDirectoryTo(classNames, filter); - } else if (fileIsArchive(this.canonicalFile)) { - this.addClassNamesForArchiveTo(classNames, filter); - } - } - } - - /** - * Add the names of all the classes discovered - * under the entry's directory and accepted by - * the specified filter to the specified collection. - */ - private void addClassNamesForDirectoryTo(Collection classNames, Filter filter) { - int start = this.canonicalFile.getAbsolutePath().length() + 1; - for (Iterator stream = this.classFilesForDirectory(); stream.hasNext(); ) { - String className = convertToClassName(stream.next().getAbsolutePath().substring(start)); - if (filter.accept(className)) { - classNames.add(className); - } - } - } - - /** - * Return an iterator on all the class files discovered - * under the entry's directory. - */ - private Iterator classFilesForDirectory() { - return new FilteringIterator(FileTools.filesInTree(this.canonicalFile)) { - @Override - protected boolean accept(Object next) { - return Entry.this.fileNameMightBeForClassFile(((File) next).getName()); - } - }; - } - - /** - * Add the names of all the classes discovered - * in the entry's archive file and accepted by the - * specified filter to the specified collection. - */ - private void addClassNamesForArchiveTo(Collection classNames, Filter filter) { - ZipFile zipFile = null; - try { - zipFile = new ZipFile(this.canonicalFile); - } catch (IOException ex) { - return; - } - for (Enumeration stream = zipFile.entries(); stream.hasMoreElements(); ) { - ZipEntry zipEntry = stream.nextElement(); - String zipEntryName = zipEntry.getName(); - if (this.fileNameMightBeForClassFile(zipEntryName)) { - String className = convertToClassName(zipEntryName); - if (filter.accept(className)) { - classNames.add(className); - } - } - } - try { - zipFile.close(); - } catch (IOException ex) { - return; - } - } - - /** - * Return whether the specified file might be a Java class file. - * The file name must at least end with ".class" and contain no spaces. - * (Neither class names nor package names may contain spaces.) - * Whether it actually is a class file will need to be determined by - * a class loader. - */ - boolean fileNameMightBeForClassFile(String name) { - return FileTools.extension(name).toLowerCase().equals(".class") - && (name.indexOf(' ') == -1); - } - - /** - * Return the names of all the classes discovered on the classpath. - * Just a bit more performant than #classNames(). - */ - public Iterator classNamesStream() { - return this.classNamesStream(Filter.Null.instance()); - } - - /** - * Return the names of all the classes discovered on the classpath - * that are accepted by the specified filter. - * Just a bit more performant than #classNames(Filter). - */ - public Iterator classNamesStream(Filter filter) { - if (this.canonicalFile.exists()) { - if (this.canonicalFile.isDirectory()) { - return this.classNamesForDirectory(filter); - } - if (fileIsArchive(this.canonicalFile)) { - return this.classNamesForArchive(filter); - } - } - return EmptyIterator.instance(); - } - - /** - * Return the names of all the classes discovered - * under the entry's directory and accepted by - * the specified filter. - */ - private Iterator classNamesForDirectory(Filter filter) { - return new FilteringIterator(this.classNamesForDirectory(), filter); - } - - /** - * Transform the class files to class names. - */ - private Iterator classNamesForDirectory() { - final int start = this.canonicalFile.getAbsolutePath().length() + 1; - return new TransformationIterator(this.classFilesForDirectory()) { - @Override - protected String transform(File f) { - return convertToClassName(f.getAbsolutePath().substring(start)); - } - }; - } - - /** - * Return the names of all the classes discovered - * in the entry's archive file and accepted by the - * specified filter. - */ - private Iterator classNamesForArchive(Filter filter) { - // we can't simply wrap iterators here because we need to close the archive file... - ZipFile zipFile = null; - try { - zipFile = new ZipFile(this.canonicalFile); - } catch (IOException ex) { - return EmptyIterator.instance(); - } - Collection classNames = new HashSet(zipFile.size()); - for (Enumeration stream = zipFile.entries(); stream.hasMoreElements(); ) { - ZipEntry zipEntry = stream.nextElement(); - String zipEntryName = zipEntry.getName(); - if (this.fileNameMightBeForClassFile(zipEntryName)) { - String className = convertToClassName(zipEntryName); - if (filter.accept(className)) { - classNames.add(className); - } - } - } - try { - zipFile.close(); - } catch (IOException ex) { - return EmptyIterator.instance(); - } - return classNames.iterator(); - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java deleted file mode 100644 index e4df43b1f2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java +++ /dev/null @@ -1,2417 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.Random; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.Vector; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; -import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; - -public final class CollectionTools { - - /** - * Return a new array that contains the elements in the - * specified array followed by the specified object to be added. - * java.util.Arrays#add(Object[] array, Object o) - */ - @SuppressWarnings("unchecked") - public static E[] add(E[] array, E value) { - int len = array.length; - E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), len + 1); - System.arraycopy(array, 0, result, 0, len); - result[len] = value; - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified object added at the specified index. - * java.util.Arrays#add(Object[] array, int index, Object o) - */ - @SuppressWarnings("unchecked") - public static E[] add(E[] array, int index, E value) { - int len = array.length; - E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), len + 1); - if (index > 0) { - System.arraycopy(array, 0, result, 0, index); - } - result[index] = value; - if (len > index) { - System.arraycopy(array, index, result, index + 1, len - index); - } - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array followed by the specified value to be added. - * java.util.Arrays#add(char[] array, char value) - */ - public static char[] add(char[] array, char value) { - int len = array.length; - char[] result = new char[len + 1]; - System.arraycopy(array, 0, result, 0, len); - result[len] = value; - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified value added at the specified index. - * java.util.Arrays#add(char[] array, int index, char value) - */ - public static char[] add(char[] array, int index, char value) { - int len = array.length; - char[] result = new char[len + 1]; - System.arraycopy(array, 0, result, 0, index); - result[index] = value; - System.arraycopy(array, index, result, index + 1, len - index); - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array followed by the specified value to be added. - * java.util.Arrays#add(int[] array, int value) - */ - public static int[] add(int[] array, int value) { - int len = array.length; - int[] result = new int[len + 1]; - System.arraycopy(array, 0, result, 0, len); - result[len] = value; - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified value added at the specified index. - * java.util.Arrays#add(int[] array, int index, int value) - */ - public static int[] add(int[] array, int index, int value) { - int len = array.length; - int[] result = new int[len + 1]; - System.arraycopy(array, 0, result, 0, index); - result[index] = value; - System.arraycopy(array, index, result, index + 1, len - index); - return result; - } - - /** - * Add all the elements returned by the specified iterator - * to the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#addAll(java.util.Iterator iterator) - */ - public static boolean addAll(Collection collection, Iterator iterator) { - boolean modified = false; - while (iterator.hasNext()) { - modified |= collection.add(iterator.next()); - } - return modified; - } - - /** - * Add all the elements in the specified array - * to the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#addAll(Object[] array) - */ - public static boolean addAll(Collection collection, E[] array) { - boolean modified = false; - for (E item : array) { - modified |= collection.add(item); - } - return modified; - } - - /** - * Return a new array that contains the elements in the - * specified array followed by the elements - * in the specified collection. - * java.util.Arrays#addAll(Object[] array, java.util.Collection c) - */ - @SuppressWarnings("unchecked") - public static E[] addAll(E[] array, Collection collection) { - int len = array.length; - E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), array.length + collection.size()); - System.arraycopy(array, 0, result, 0, len); - int i = len; - for (E item : collection) { - result[i++] = item; - } - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array followed by the elements - * in the specified iterator. - * java.util.Arrays#addAll(Object[] array, java.util.Iterator iterator) - */ - public static E[] addAll(E[] array, Iterator iterator) { - return addAll(array, list(iterator)); - } - - /** - * Return a new array that contains the elements in the - * specified array 1 followed by the elements - * in the specified array 2. - * java.util.Arrays#addAll(Object[] array1, Object[] array2) - */ - @SuppressWarnings("unchecked") - public static E[] addAll(E[] array1, E[] array2) { - int len1 = array1.length; - int len2 = array2.length; - E[] result = (E[]) Array.newInstance(array1.getClass().getComponentType(), len1 + len2); - System.arraycopy(array1, 0, result, 0, len1); - System.arraycopy(array2, 0, result, len1, len2); - return result; - } - - /** - * Return a new array that contains the elements in the - * first specified array with the objects in the second - * specified array added at the specified index. - * java.util.Arrays#add(Object[] array1, int index, Object[] array2) - */ - @SuppressWarnings("unchecked") - public static E[] addAll(E[] array1, int index, E[] array2) { - int len1 = array1.length; - int len2 = array2.length; - E[] result = (E[]) Array.newInstance(array1.getClass().getComponentType(), len1 + len2); - System.arraycopy(array1, 0, result, 0, index); - System.arraycopy(array2, 0, result, index, len2); - System.arraycopy(array1, index, result, index + len2, len1 - index); - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array 1 followed by the elements - * in the specified array 2. - * java.util.Arrays#addAll(char[] array1, char[] array2) - */ - public static char[] addAll(char[] array1, char[] array2) { - int len1 = array1.length; - int len2 = array2.length; - char[] result = new char[len1 + len2]; - System.arraycopy(array1, 0, result, 0, len1); - System.arraycopy(array2, 0, result, len1, len2); - return result; - } - - /** - * Return a new array that contains the elements in the - * first specified array with the objects in the second - * specified array added at the specified index. - * java.util.Arrays#add(char[] array1, int index, char[] array2) - */ - public static char[] addAll(char[] array1, int index, char[] array2) { - int len1 = array1.length; - int len2 = array2.length; - char[] result = new char[len1 + len2]; - System.arraycopy(array1, 0, result, 0, index); - System.arraycopy(array2, 0, result, index, len2); - System.arraycopy(array1, index, result, index + len2, len1 - index); - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array 1 followed by the elements - * in the specified array 2. - * java.util.Arrays#addAll(int[] array1, int[] array2) - */ - public static int[] addAll(int[] array1, int[] array2) { - int len1 = array1.length; - int len2 = array2.length; - int[] result = new int[len1 + len2]; - System.arraycopy(array1, 0, result, 0, len1); - System.arraycopy(array2, 0, result, len1, len2); - return result; - } - - /** - * Return a new array that contains the elements in the - * first specified array with the objects in the second - * specified array added at the specified index. - * java.util.Arrays#add(int[] array1, int index, int[] array2) - */ - public static int[] addAll(int[] array1, int index, int[] array2) { - int len1 = array1.length; - int len2 = array2.length; - int[] result = new int[len1 + len2]; - System.arraycopy(array1, 0, result, 0, index); - System.arraycopy(array2, 0, result, index, len2); - System.arraycopy(array1, index, result, index + len2, len1 - index); - return result; - } - - /** - * Return an array corresponding to the specified iterator. - * @see java.util.Collection#toArray() - * java.util.Iterator#toArray() - */ - public static Object[] array(Iterator iterator) { - return list(iterator).toArray(); - } - - /** - * Return an array corresponding to the specified iterator; - * the runtime type of the returned array is that of the specified array. - * If the collection fits in the specified array, it is returned therein. - * Otherwise, a new array is allocated with the runtime type of the - * specified array and the size of this collection. - * @see java.util.Collection#toArray(java.lang.Object[]) - * java.util.Iterator#toArray(Object[]) - */ - public static E[] array(Iterator iterator, E[] array) { - return list(iterator).toArray(array); - } - - /** - * Return a bag corresponding to the specified enumeration. - * HashBag(java.util.Enumeration enumeration) - */ - public static Bag bag(Enumeration enumeration) { - Bag bag = new HashBag(); - while (enumeration.hasMoreElements()) { - bag.add(enumeration.nextElement()); - } - return bag; - } - - /** - * Return a bag corresponding to the specified iterator. - * HashBag(java.util.Iterator iterator) - */ - public static Bag bag(Iterator iterator) { - Bag bag = new HashBag(); - while (iterator.hasNext()) { - bag.add(iterator.next()); - } - return bag; - } - - /** - * Return a bag corresponding to the specified array. - * HashBag(Object[] array) - */ - public static Bag bag(E... array) { - Bag bag = new HashBag(array.length); - for (E item : array) { - bag.add(item); - } - return bag; - } - - /** - * Return a collection corresponding to the specified enumeration. - */ - public static Collection collection(Enumeration enumeration) { - return bag(enumeration); - } - - /** - * Return a collection corresponding to the specified iterator. - */ - public static Collection collection(Iterator iterator) { - return bag(iterator); - } - - /** - * Return a collection corresponding to the specified array. - */ - public static Collection collection(E... array) { - return bag(array); - } - - /** - * Return whether the specified enumeration contains the - * specified element. - * java.util.Enumeration#contains(Object o) - */ - public static boolean contains(Enumeration enumeration, Object value) { - if (value == null) { - while (enumeration.hasMoreElements()) { - if (enumeration.nextElement() == null) { - return true; - } - } - } else { - while (enumeration.hasMoreElements()) { - if (value.equals(enumeration.nextElement())) { - return true; - } - } - } - return false; - } - - /** - * Return whether the specified iterator contains the - * specified element. - * java.util.Iterator#contains(Object o) - */ - public static boolean contains(Iterator iterator, Object value) { - if (value == null) { - while (iterator.hasNext()) { - if (iterator.next() == null) { - return true; - } - } - } else { - while (iterator.hasNext()) { - if (value.equals(iterator.next())) { - return true; - } - } - } - return false; - } - - /** - * Return whether the specified array contains the - * specified element. - * java.util.Arrays#contains(Object[] array, Object o) - */ - public static boolean contains(Object[] array, Object value) { - if (value == null) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == null) { - return true; - } - } - } else { - for (int i = array.length; i-- > 0; ) { - if (value.equals(array[i])) { - return true; - } - } - } - return false; - } - - /** - * Return whether the specified array contains the - * specified element. - * java.util.Arrays#contains(char[] array, char value) - */ - public static boolean contains(char[] array, char value) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == value) { - return true; - } - } - return false; - } - - /** - * Return whether the specified array contains the - * specified element. - * java.util.Arrays#contains(int[] array, int value) - */ - public static boolean contains(int[] array, int value) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == value) { - return true; - } - } - return false; - } - - /** - * Return whether the specified collection contains all of the - * elements in the specified iterator. - * java.util.Collection#containsAll(java.util.Iterator iterator) - */ - public static boolean containsAll(Collection collection, Iterator iterator) { - while (iterator.hasNext()) { - if ( ! collection.contains(iterator.next())) { - return false; - } - } - return true; - } - - /** - * Return whether the specified collection contains all of the - * elements in the specified array. - * java.util.Collection#containsAll(Object[] array) - */ - public static boolean containsAll(Collection collection, Object[] array) { - for (int i = array.length; i-- > 0; ) { - if ( ! collection.contains(array[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified iterator contains all of the - * elements in the specified collection. - * java.util.Iterator#containsAll(java.util.Collection collection) - */ - public static boolean containsAll(Iterator iterator, Collection collection) { - return collection(iterator).containsAll(collection); - } - - /** - * Return whether the specified iterator 1 contains all of the - * elements in the specified iterator 2. - * java.util.Iterator#containsAll(java.util.Iterator iterator) - */ - public static boolean containsAll(Iterator iterator1, Iterator iterator2) { - return containsAll(collection(iterator1), iterator2); - } - - /** - * Return whether the specified iterator contains all of the - * elements in the specified array. - * java.util.Iterator#containsAll(Object[] array) - */ - public static boolean containsAll(Iterator iterator, Object[] array) { - return containsAll(collection(iterator), array); - } - - /** - * Return whether the specified array contains all of the - * elements in the specified collection. - * java.util.Arrays#containsAll(Object[] array, java.util.Collection collection) - */ - public static boolean containsAll(Object[] array, Collection collection) { - return containsAll(array, collection.iterator()); - } - - /** - * Return whether the specified array contains all of the - * elements in the specified iterator. - * java.util.Arrays#containsAll(Object[] array, java.util.Iterator iterator) - */ - public static boolean containsAll(Object[] array, Iterator iterator) { - while (iterator.hasNext()) { - if ( ! contains(array, iterator.next())) { - return false; - } - } - return true; - } - - /** - * Return whether the specified array 1 contains all of the - * elements in the specified array 2. - * java.util.Arrays#containsAll(Object[] array1, Object[] array2) - */ - public static boolean containsAll(Object[] array1, Object[] array2) { - for (int i = array2.length; i-- > 0; ) { - if ( ! contains(array1, array2[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified array 1 contains all of the - * elements in the specified array 2. - * java.util.Arrays#containsAll(char[] array1, char[] array2) - */ - public static boolean containsAll(char[] array1, char[] array2) { - for (int i = array2.length; i-- > 0; ) { - if ( ! contains(array1, array2[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified array 1 contains all of the - * elements in the specified array 2. - * java.util.Arrays#containsAll(int[] array1, int[] array2) - */ - public static boolean containsAll(int[] array1, int[] array2) { - for (int i = array2.length; i-- > 0; ) { - if ( ! contains(array1, array2[i])) { - return false; - } - } - return true; - } - - /** - * Return the index of the first elements in the specified - * arrays that are different, beginning at the end. - * If the arrays are identical, return -1. - * If the arrays are different sizes, return the index of the - * last element in the longer array. - * Use the elements' #equals() method to compare the - * elements. - */ - public static int diffEnd(Object[] array1, Object[] array2) { - return diffEnd(Arrays.asList(array1), Arrays.asList(array2)); - } - - /** - * Return the index of the first elements in the specified - * lists that are different, beginning at the end. - * If the lists are identical, return -1. - * If the lists are different sizes, return the index of the - * last element in the longer list. - * Use the elements' #equals() method to compare the - * elements. - */ - public static int diffEnd(List list1, List list2) { - int size1 = list1.size(); - int size2 = list2.size(); - if (size1 != size2) { - return Math.max(size1, size2) - 1; - } - int end = size1 - 1; - while (end > -1) { - Object o = list1.get(end); - if (o == null) { - if (list2.get(end) == null) { - end--; - } else { - return end; - } - } else { - if (o.equals(list2.get(end))) { - end--; - } else { - return end; - } - } - } - return end; - } - - /** - * Return the range of elements in the specified - * arrays that are different. - * If the arrays are identical, return [size, -1]. - * Use the elements' #equals() method to compare the - * elements. - * @see #diffStart(Object[], Object[]) - * @see #diffEnd(Object[], Object[]) - */ - public static Range diffRange(Object[] array1, Object[] array2) { - return diffRange(Arrays.asList(array1), Arrays.asList(array2)); - } - - /** - * Return the range of elements in the specified - * arrays that are different. - * If the arrays are identical, return [size, -1]. - * Use the elements' #equals() method to compare the - * elements. - * @see #diffStart(java.util.List, java.util.List) - * @see #diffEnd(java.util.List, java.util.List) - */ - public static Range diffRange(List list1, List list2) { - int end = diffEnd(list1, list2); - if (end == -1) { - // the lists are identical, the start is the size of the two lists - return new Range(list1.size(), end); - } - // the lists are different, calculate the start of the range - return new Range(diffStart(list1, list2), end); - } - - /** - * Return the index of the first elements in the specified - * arrays that are different. If the arrays are identical, return - * the size of the two arrays (i.e. one past the last index). - * If the arrays are different sizes and all the elements in - * the shorter array match their corresponding elements in - * the longer array, return the size of the shorter array - * (i.e. one past the last index of the shorter array). - * Use the elements' #equals() method to compare the - * elements. - */ - public static int diffStart(Object[] array1, Object[] array2) { - return diffStart(Arrays.asList(array1), Arrays.asList(array2)); - } - - /** - * Return the index of the first elements in the specified - * lists that are different. If the lists are identical, return - * the size of the two lists (i.e. one past the last index). - * If the lists are different sizes and all the elements in - * the shorter list match their corresponding elements in - * the longer list, return the size of the shorter list - * (i.e. one past the last index of the shorter list). - * Use the elements' #equals() method to compare the - * elements. - */ - public static int diffStart(List list1, List list2) { - int end = Math.min(list1.size(), list2.size()); - int start = 0; - while (start < end) { - Object o = list1.get(start); - if (o == null) { - if (list2.get(start) == null) { - start++; - } else { - return start; - } - } else { - if (o.equals(list2.get(start))) { - start++; - } else { - return start; - } - } - } - return start; - } - - /** - * Return whether the specified iterators return equal elements. - * java.util.ListIterator#equals(java.util.ListIterator iterator) - */ - public static boolean equals(ListIterator iterator1, ListIterator iterator2) { - while (iterator1.hasNext() && iterator2.hasNext()) { - Object o1 = iterator1.next(); - Object o2 = iterator2.next(); - if ( ! (o1 == null ? o2 == null : o1.equals(o2))) { - return false; - } - } - return ! (iterator1.hasNext() || iterator2.hasNext()); - } - - /** - * Return the element corresponding to the specified index - * in the specified iterator. - * java.util.ListIterator#get(int index) - */ - public static E get(ListIterator iterator, int index) { - while (iterator.hasNext()) { - E next = iterator.next(); - if (iterator.previousIndex() == index) { - return next; - } - } - throw new IndexOutOfBoundsException(String.valueOf(index) + ':' + String.valueOf(iterator.previousIndex())); - } - - /** - * Return whether the specified arrays contain the same elements. - * java.util.Arrays#identical(Object[] array1, Object[] array2) - */ - public static boolean identical(Object[] array1, Object[] array2) { - if (array1 == array2) { - return true; - } - if (array1 == null || array2 == null) { - return false; - } - int length = array1.length; - if (array2.length != length) { - return false; - } - for (int i = length; i-- > 0; ) { - if (array1[i] != array2[i]) { - return false; - } - } - return true; - } - - /** - * Return whether the specified iterators return the same elements. - * java.util.ListIterator#identical(java.util.ListIterator iterator) - */ - public static boolean identical(ListIterator iterator1, ListIterator iterator2) { - while (iterator1.hasNext() && iterator2.hasNext()) { - if (iterator1.next() != iterator2.next()) { - return false; - } - } - return ! (iterator1.hasNext() || iterator2.hasNext()); - } - - /** - * Return the index of the first elements in the specified - * arrays that are different, beginning at the end. - * If the arrays are identical, return -1. - * If the arrays are different sizes, return the index of the - * last element in the longer array. - * Use object identity to compare the elements. - */ - public static int identityDiffEnd(Object[] array1, Object[] array2) { - return identityDiffEnd(Arrays.asList(array1), Arrays.asList(array2)); - } - - /** - * Return the index of the first elements in the specified - * lists that are different, beginning at the end. - * If the lists are identical, return -1. - * If the lists are different sizes, return the index of the - * last element in the longer list. - * Use object identity to compare the elements. - */ - public static int identityDiffEnd(List list1, List list2) { - int size1 = list1.size(); - int size2 = list2.size(); - if (size1 != size2) { - return Math.max(size1, size2) - 1; - } - int end = size1 - 1; - while (end > -1) { - if (list1.get(end) == list2.get(end)) { - end--; - } else { - return end; - } - } - return end; - } - - /** - * Return the range of elements in the specified - * arrays that are different. - * If the arrays are identical, return [size, -1]. - * Use object identity to compare the elements. - * @see #identityDiffStart(Object[], Object[]) - * @see #identityDiffEnd(Object[], Object[]) - */ - public static Range identityDiffRange(Object[] array1, Object[] array2) { - return identityDiffRange(Arrays.asList(array1), Arrays.asList(array2)); - } - - /** - * Return the range of elements in the specified - * arrays that are different. - * If the arrays are identical, return [size, -1]. - * Use object identity to compare the elements. - * @see #identityDiffStart(java.util.List, java.util.List) - * @see #identityDiffEnd(java.util.List, java.util.List) - */ - public static Range identityDiffRange(List list1, List list2) { - int end = identityDiffEnd(list1, list2); - if (end == -1) { - // the lists are identical, the start is the size of the two lists - return new Range(list1.size(), end); - } - // the lists are different, calculate the start of the range - return new Range(identityDiffStart(list1, list2), end); - } - - /** - * Return the index of the first elements in the specified - * arrays that are different. If the arrays are identical, return - * the size of the two arrays (i.e. one past the last index). - * If the arrays are different sizes and all the elements in - * the shorter array match their corresponding elements in - * the longer array, return the size of the shorter array - * (i.e. one past the last index of the shorter array). - * Use object identity to compare the elements. - */ - public static int identityDiffStart(Object[] array1, Object[] array2) { - return identityDiffStart(Arrays.asList(array1), Arrays.asList(array2)); - } - - /** - * Return the index of the first elements in the specified - * lists that are different. If the lists are identical, return - * the size of the two lists (i.e. one past the last index). - * If the lists are different sizes and all the elements in - * the shorter list match their corresponding elements in - * the longer list, return the size of the shorter list - * (i.e. one past the last index of the shorter list). - * Use object identity to compare the elements. - */ - public static int identityDiffStart(List list1, List list2) { - int end = Math.min(list1.size(), list2.size()); - int start = 0; - while (start < end) { - if (list1.get(start) == list2.get(start)) { - start++; - } else { - return start; - } - } - return start; - } - - /** - * Return the index of the first occurrence of the - * specified element in the specified iterator, - * or return -1 if there is no such index. - * java.util.ListIterator#indexOf(Object o) - */ - public static int indexOf(ListIterator iterator, Object value) { - if (value == null) { - for (int i = 0; iterator.hasNext(); i++) { - if (iterator.next() == null) { - return i; - } - } - } else { - for (int i = 0; iterator.hasNext(); i++) { - if (value.equals(iterator.next())) { - return i; - } - } - } - return -1; - } - - /** - * Return the index of the first occurrence of the - * specified element in the specified array, - * or return -1 if there is no such index. - * java.util.Arrays#indexOf(Object[] array, Object o) - */ - public static int indexOf(Object[] array, Object value) { - int len = array.length; - if (value == null) { - for (int i = 0; i < len; i++) { - if (array[i] == null) { - return i; - } - } - } else { - for (int i = 0; i < len; i++) { - if (value.equals(array[i])) { - return i; - } - } - } - return -1; - } - - /** - * Return the index of the first occurrence of the - * specified element in the specified array, - * or return -1 if there is no such index. - * java.util.Arrays#indexOf(char[] array, char value) - */ - public static int indexOf(char[] array, char value) { - int len = array.length; - for (int i = 0; i < len; i++) { - if (array[i] == value) { - return i; - } - } - return -1; - } - - /** - * Return the index of the first occurrence of the - * specified element in the specified array, - * or return -1 if there is no such index. - * java.util.Arrays#indexOf(int[] array, int value) - */ - public static int indexOf(int[] array, int value) { - int len = array.length; - for (int i = 0; i < len; i++) { - if (array[i] == value) { - return i; - } - } - return -1; - } - - /** - * Return the maximum index of where the specified comparable object - * should be inserted into the specified sorted list and still keep - * the list sorted. - */ - public static > int insertionIndexOf(List sortedList, Comparable value) { - int len = sortedList.size(); - for (int i = 0; i < len; i++) { - if (value.compareTo(sortedList.get(i)) < 0) { - return i; - } - } - return len; - } - - /** - * Return the maximum index of where the specified object - * should be inserted into the specified sorted list and still keep - * the list sorted. - */ - public static int insertionIndexOf(List sortedList, E value, Comparator comparator) { - int len = sortedList.size(); - for (int i = 0; i < len; i++) { - if (comparator.compare(value, sortedList.get(i)) < 0) { - return i; - } - } - return len; - } - - /** - * Return the maximum index of where the specified comparable object - * should be inserted into the specified sorted array and still keep - * the array sorted. - */ - public static > int insertionIndexOf(E[] sortedArray, Comparable value) { - int len = sortedArray.length; - for (int i = 0; i < len; i++) { - if (value.compareTo(sortedArray[i]) < 0) { - return i; - } - } - return len; - } - - /** - * Return the maximum index of where the specified comparable object - * should be inserted into the specified sorted array and still keep - * the array sorted. - */ - public static int insertionIndexOf(E[] sortedArray, E value, Comparator comparator) { - int len = sortedArray.length; - for (int i = 0; i < len; i++) { - if (comparator.compare(value, sortedArray[i]) < 0) { - return i; - } - } - return len; - } - - /** - * Return an iterator on the elements in the specified array. - * java.util.Arrays#iterator(Object[] array) - */ - public static Iterator iterator(E... array) { - return new ArrayIterator(array); - } - - /** - * Return the index of the last occurrence of the - * specified element in the specified iterator, - * or return -1 if there is no such index. - * java.util.ListIterator#lastIndexOf(Object o) - */ - public static int lastIndexOf(ListIterator iterator, Object value) { - return list(iterator).lastIndexOf(value); - } - - /** - * Return the index of the last occurrence of the - * specified element in the specified array, - * or return -1 if there is no such index. - * java.util.Arrays#lastIndexOf(Object[] array, Object o) - */ - public static int lastIndexOf(Object[] array, Object value) { - int len = array.length; - if (value == null) { - for (int i = len; i-- > 0; ) { - if (array[i] == null) { - return i; - } - } - } else { - for (int i = len; i-- > 0; ) { - if (value.equals(array[i])) { - return i; - } - } - } - return -1; - } - - /** - * Return the index of the last occurrence of the - * specified element in the specified array, - * or return -1 if there is no such index. - * java.util.Arrays#lastIndexOf(char[] array, char value) - */ - public static int lastIndexOf(char[] array, char value) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == value) { - return i; - } - } - return -1; - } - - /** - * Return the index of the last occurrence of the - * specified element in the specified array, - * or return -1 if there is no such index. - * java.util.Arrays#lastIndexOf(int[] array, int value) - */ - public static int lastIndexOf(int[] array, int value) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == value) { - return i; - } - } - return -1; - } - - /** - * Return a list corresponding to the specified iterator. - * java.util.Iterator#toList() - */ - public static List list(Iterator iterator) { - List list = new ArrayList(); - while (iterator.hasNext()) { - list.add(iterator.next()); - } - return list; - } - - /** - * Return a list corresponding to the specified array. - * Unlike java.util.Arrays.asList(Object[]), the list - * is modifiable and is not backed by the array. - */ - public static List list(E... array) { - List list = new ArrayList(array.length); - for (E item : array) { - list.add(item); - } - return list; - } - - /** - * Return a list iterator for the specified array. - * java.util.Arrays#listIterator(Object[] array) - */ - public static ListIterator listIterator(E... array) { - return listIterator(array, 0); - } - - /** - * Return a list iterator for the specified array - * starting at the specified position in the array. - * java.util.Arrays#listIterator(Object[] array, int index) - */ - public static ListIterator listIterator(E[] array, int index) { - return Arrays.asList(array).listIterator(index); - } - - /** - * Return the character from the specified array with the maximum value. - * java.util.Arrays#max(char[] array) - */ - public static char max(char... array) { - int len = array.length; - if (len == 0) { - throw new IndexOutOfBoundsException(); - } - char max = array[0]; - // start at 1 - for (int i = 1; i < len; i++) { - char next = array[i]; - if (next > max) { - max = next; - } - } - return max; - } - - /** - * Return the integer from the specified array with the maximum value. - * java.util.Arrays#max(int[] array) - */ - public static int max(int... array) { - int len = array.length; - if (len == 0) { - throw new IndexOutOfBoundsException(); - } - int max = array[0]; - // start at 1 - for (int i = 1; i < len; i++) { - int next = array[i]; - if (next > max) { - max = next; - } - } - return max; - } - - /** - * Return the character from the specified array with the minimum value. - * java.util.Arrays#min(char[] array) - */ - public static char min(char... array) { - int len = array.length; - if (len == 0) { - throw new IndexOutOfBoundsException(); - } - char min = array[0]; - // start at 1 - for (int i = 1; i < len; i++) { - char next = array[i]; - if (next < min) { - min = next; - } - } - return min; - } - - /** - * Return the integer from the specified array with the minimum value. - * java.util.Arrays#min(int[] array) - */ - public static int min(int... array) { - int len = array.length; - if (len == 0) { - throw new IndexOutOfBoundsException(); - } - int min = array[0]; - // start at 1 - for (int i = 1; i < len; i++) { - int next = array[i]; - if (next < min) { - min = next; - } - } - return min; - } - - /** - * Replace all occurrences of the specified old value with - * the specified new value. - * java.util.Arrays#replaceAll(Object[] array, Object oldValue, Object newValue) - */ - public static E[] replaceAll(E[] array, Object oldValue, E newValue) { - if (oldValue == null) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == null) { - array[i] = newValue; - } - } - } else { - for (int i = array.length; i-- > 0; ) { - if (oldValue.equals(array[i])) { - array[i] = newValue; - } - } - } - return array; - } - - /** - * Replace all occurrences of the specified old value with - * the specified new value. - * java.util.Arrays#replaceAll(int[] array, int oldValue, int newValue) - */ - public static int[] replaceAll(int[] array, int oldValue, int newValue) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == oldValue) { - array[i] = newValue; - } - } - return array; - } - - /** - * Replace all occurrences of the specified old value with - * the specified new value. - * java.util.Arrays#replaceAll(char[] array, char oldValue, char newValue) - */ - public static char[] replaceAll(char[] array, char oldValue, char newValue) { - for (int i = array.length; i-- > 0; ) { - if (array[i] == oldValue) { - array[i] = newValue; - } - } - return array; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified element removed. - * java.util.Arrays#remove(Object[] array, Object value) - */ - public static E[] remove(E[] array, Object value) { - return removeElementAtIndex(array, indexOf(array, value)); - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified element removed. - * java.util.Arrays#remove(char[] array, char value) - */ - public static char[] remove(char[] array, char value) { - return removeElementAtIndex(array, indexOf(array, value)); - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified element removed. - * java.util.Arrays#remove(int[] array, int value) - */ - public static int[] remove(int[] array, int value) { - return removeElementAtIndex(array, indexOf(array, value)); - } - - /** - * Remove all the elements returned by the specified iterator - * from the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#removeAll(java.util.Iterator iterator) - */ - public static boolean removeAll(Collection collection, Iterator iterator) { - boolean modified = false; - while (iterator.hasNext()) { - modified |= removeAllOccurrences(collection, iterator.next()); - } - return modified; - } - - /** - * Remove all the elements in the specified array - * from the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#removeAll(Object[] array) - */ - public static boolean removeAll(Collection collection, Object[] array) { - boolean modified = false; - for (int i = array.length; i-- > 0; ) { - modified |= removeAllOccurrences(collection, array[i]); - } - return modified; - } - - /** - * Remove from the specified array all the elements in - * the specified collection and return the result. - * java.util.Arrays#removeAll(Object[] array, Collection collection) - */ - public static E[] removeAll(E[] array, Collection collection) { - E[] result = array; - // go backwards since we will be pulling elements - // out of 'result' and it will get shorter as we go - for (int i = array.length; i-- > 0; ) { - E item = array[i]; - if (collection.contains(item)) { - result = removeElementAtIndex(result, i); - } - } - return result; - } - - /** - * Remove from the first specified array all the elements in - * the second specified array and return the result. - * java.util.Arrays#removeAll(Object[] array1, Object[] array2) - */ - public static E[] removeAll(E[] array1, Object[] array2) { - // convert to a bag to take advantage of hashed look-up - return removeAll(array1, bag(array2)); - } - - /** - * Remove from the first specified array all the elements in - * the second specified array and return the result. - * java.util.Arrays#removeAll(char[] array1, char[] array2) - */ - public static char[] removeAll(char[] array1, char[] array2) { - char[] result1 = array1; - // go backwards since we will be pulling elements - // out of 'result1' and it will get shorter as we go - for (int i = array1.length; i-- > 0; ) { - char item = array1[i]; - if (contains(array2, item)) { - result1 = removeElementAtIndex(result1, i); - } - } - return result1; - } - - /** - * Remove from the first specified array all the elements in - * the second specified array and return the result. - * java.util.Arrays#removeAll(int[] array1, int[] array2) - */ - public static int[] removeAll(int[] array1, int[] array2) { - int[] result1 = array1; - // go backwards since we will be pulling elements - // out of 'result1' and it will get shorter as we go - for (int i = array1.length; i-- > 0; ) { - int item = array1[i]; - if (contains(array2, item)) { - result1 = removeElementAtIndex(result1, i); - } - } - return result1; - } - - /** - * Remove all occurrences of the specified element - * from the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#removeAllOccurrences(Object value) - */ - public static boolean removeAllOccurrences(Collection collection, Object value) { - boolean modified = false; - Iterator stream = collection.iterator(); - if (value == null) { - while (stream.hasNext()) { - if (stream.next() == null) { - stream.remove(); - modified = true; - } - } - } else { - while (stream.hasNext()) { - if (value.equals(stream.next())) { - stream.remove(); - modified = true; - } - } - } - return modified; - } - - /** - * Remove from the specified array all occurrences of - * the specified element and return the result. - * java.util.Arrays#removeAllOccurrences(Object[] array, Object value) - */ - public static E[] removeAllOccurrences(E[] array, Object value) { - E[] result = array; - if (value == null) { - // go backwards since we will be pulling elements - // out of 'result' and it will get shorter as we go - for (int i = array.length; i-- > 0; ) { - if (array[i] == null) { - result = removeElementAtIndex(result, i); - } - } - } else { - // go backwards since we will be pulling elements - // out of 'result' and it will get shorter as we go - for (int i = array.length; i-- > 0; ) { - if (value.equals(array[i])) { - result = removeElementAtIndex(result, i); - } - } - } - return result; - } - - /** - * Remove from the specified array all occurrences of - * the specified element and return the result. - * java.util.Arrays#removeAllOccurrences(char[] array, char value) - */ - public static char[] removeAllOccurrences(char[] array, char value) { - char[] result = array; - // go backwards since we will be pulling elements - // out of 'result' and it will get shorter as we go - for (int i = array.length; i-- > 0; ) { - if (array[i] == value) { - result = removeElementAtIndex(result, i); - } - } - return result; - } - - /** - * Remove from the specified array all occurrences of - * the specified element and return the result. - * java.util.Arrays#removeAllOccurrences(int[] array, int value) - */ - public static int[] removeAllOccurrences(int[] array, int value) { - int[] result = array; - // go backwards since we will be pulling elements - // out of 'result' and it will get shorter as we go - for (int i = array.length; i-- > 0; ) { - if (array[i] == value) { - result = removeElementAtIndex(result, i); - } - } - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified element removed. - * java.util.Arrays#removeElementAtIndex(Object[] array, int index) - */ - @SuppressWarnings("unchecked") - public static E[] removeElementAtIndex(E[] array, int index) { - int len = array.length; - E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), len - 1); - System.arraycopy(array, 0, result, 0, index); - System.arraycopy(array, index + 1, result, index, len - index - 1); - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified element removed. - * java.util.Arrays#removeElementAtIndex(char[] array, int index) - */ - public static char[] removeElementAtIndex(char[] array, int index) { - int len = array.length; - char[] result = new char[len - 1]; - System.arraycopy(array, 0, result, 0, index); - System.arraycopy(array, index + 1, result, index, len - index - 1); - return result; - } - - /** - * Return a new array that contains the elements in the - * specified array with the specified element removed. - * java.util.Arrays#removeElementAtIndex(int[] array, int index) - */ - public static int[] removeElementAtIndex(int[] array, int index) { - int len = array.length; - int[] result = new int[len - 1]; - System.arraycopy(array, 0, result, 0, index); - System.arraycopy(array, index + 1, result, index, len - index - 1); - return result; - } - - /** - * Remove any duplicate elements from the specified array, - * while maintaining the order. - */ - @SuppressWarnings("unchecked") - public static E[] removeDuplicateElements(E... array) { - List list = removeDuplicateElements(Arrays.asList(array)); - return list.toArray((E[]) Array.newInstance(array.getClass().getComponentType(), list.size())); - } - - /** - * Remove any duplicate elements from the specified list, - * while maintaining the order. - */ - public static List removeDuplicateElements(List list) { - List result = new ArrayList(list.size()); - Set set = new HashSet(list.size()); // take advantage of hashed look-up - for (E item : list) { - if (set.add(item)) { - result.add(item); - } - } - return result; - } - - /** - * Retain only the elements in the specified iterator - * in the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#retainAll(java.util.Iterator iterator) - */ - public static boolean retainAll(Collection collection, Iterator iterator) { - return collection.retainAll(collection(iterator)); - } - - /** - * Retain only the elements in the specified array - * in the specified collection. - * Return whether the collection changed as a result. - * java.util.Collection#retainAll(Object[] array) - */ - public static boolean retainAll(Collection collection, Object[] array) { - return collection.retainAll(set(array)); - } - - /** - * Retain in the specified array all the elements in - * the specified collection and return the result. - * java.util.Arrays#retainAll(Object[] array, Collection collection) - */ - public static E[] retainAll(E[] array, Collection collection) { - E[] result = array; - // go backwards since we will be pulling elements - // out of 'result' and it will get shorter as we go - for (int i = array.length; i-- > 0; ) { - if ( ! collection.contains(array[i])) { - result = removeElementAtIndex(result, i); - } - } - return result; - } - - /** - * Remove from the first specified array all the elements in - * the second specified array and return the result. - * java.util.Arrays#retainAll(Object[] array1, Object[] array2) - */ - public static E[] retainAll(E[] array1, Object[] array2) { - // convert to a bag to take advantage of hashed look-up - return retainAll(array1, bag(array2)); - } - - /** - * Remove from the first specified array all the elements in - * the second specified array and return the result. - * java.util.Arrays#retainAll(char[] array1, char[] array2) - */ - public static char[] retainAll(char[] array1, char[] array2) { - char[] result1 = array1; - // go backwards since we will be pulling elements - // out of 'result1' and it will get shorter as we go - for (int i = array1.length; i-- > 0; ) { - char item = array1[i]; - if ( ! contains(array2, item)) { - result1 = removeElementAtIndex(result1, i); - } - } - return result1; - } - - /** - * Remove from the first specified array all the elements in - * the second specified array and return the result. - * java.util.Arrays#removeAll(int[] array1, int[] array2) - */ - public static int[] retainAll(int[] array1, int[] array2) { - int[] result1 = array1; - // go backwards since we will be pulling elements - // out of 'result1' and it will get shorter as we go - for (int i = array1.length; i-- > 0; ) { - int item = array1[i]; - if ( ! contains(array2, item)) { - result1 = removeElementAtIndex(result1, i); - } - } - return result1; - } - - /** - * Return the array reversed. - * java.util.Arrays.reverse(Object[] array) - */ - public static E[] reverse(E... array) { - int len = array.length; - for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) { - swap(array, i, j); - } - return array; - } - - /** - * Return the array reversed. - * java.util.Arrays.reverse(char[] array) - */ - public static char[] reverse(char... array) { - int len = array.length; - for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) { - swap(array, i, j); - } - return array; - } - - /** - * Return the array reversed. - * java.util.Arrays.reverse(int[] array) - */ - public static int[] reverse(int... array) { - int len = array.length; - for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) { - swap(array, i, j); - } - return array; - } - - /** - * Return a list with entries in reverse order from those - * returned by the specified iterator. - */ - public static List reverseList(Iterator iterator) { - return reverse(list(iterator)); - } - - /** - * Return the rotated array after rotating it one position. - * java.util.Arrays.rotate(Object[] array) - */ - public static E[] rotate(E... array) { - return rotate(array, 1); - } - - /** - * Return the rotated array after rotating it the specified distance. - * java.util.Arrays.rotate(Object[] array, int distance) - */ - public static E[] rotate(E[] array, int distance) { - int len = array.length; - if (len == 0) { - return array; - } - distance = distance % len; - if (distance < 0) { - distance += len; - } - if (distance == 0) { - return array; - } - for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) { - E displaced = array[cycleStart]; - int i = cycleStart; - do { - i += distance; - if (i >= len) { - i -= len; - } - E temp = array[i]; - array[i] = displaced; - displaced = temp; - nMoved ++; - } while (i != cycleStart); - } - return array; - } - - /** - * Return the rotated array after rotating it one position. - * java.util.Arrays.rotate(char[] array) - */ - public static char[] rotate(char... array) { - return rotate(array, 1); - } - - /** - * Return the rotated array after rotating it the specified distance. - * java.util.Arrays.rotate(char[] array, int distance) - */ - public static char[] rotate(char[] array, int distance) { - int len = array.length; - if (len == 0) { - return array; - } - distance = distance % len; - if (distance < 0) { - distance += len; - } - if (distance == 0) { - return array; - } - for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) { - char displaced = array[cycleStart]; - int i = cycleStart; - do { - i += distance; - if (i >= len) { - i -= len; - } - char temp = array[i]; - array[i] = displaced; - displaced = temp; - nMoved ++; - } while (i != cycleStart); - } - return array; - } - - /** - * Return the rotated array after rotating it one position. - * java.util.Arrays.rotate(int[] array) - */ - public static int[] rotate(int... array) { - return rotate(array, 1); - } - - /** - * Return the rotated array after rotating it the specified distance. - * java.util.Arrays.rotate(int[] array, int distance) - */ - public static int[] rotate(int[] array, int distance) { - int len = array.length; - if (len == 0) { - return array; - } - distance = distance % len; - if (distance < 0) { - distance += len; - } - if (distance == 0) { - return array; - } - for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) { - int displaced = array[cycleStart]; - int i = cycleStart; - do { - i += distance; - if (i >= len) { - i -= len; - } - int temp = array[i]; - array[i] = displaced; - displaced = temp; - nMoved ++; - } while (i != cycleStart); - } - return array; - } - - /** - * Return a set corresponding to the specified iterator. - * java.util.HashSet(java.util.Iterator iterator) - */ - public static Set set(Iterator iterator) { - Set set = new HashSet(); - while (iterator.hasNext()) { - set.add(iterator.next()); - } - return set; - } - - /** - * Return a set corresponding to the specified array. - * java.util.HashSet(Object[] array) - */ - public static Set set(E... array) { - Set set = new HashSet(2 * array.length); - for (E item : array) { - set.add(item); - } - return set; - } - - private static final Random RANDOM = new Random(); - - /** - * Return the array after "shuffling" it. - * java.util.Arrays#shuffle(Object[] array) - */ - public static E[] shuffle(E... array) { - return shuffle(array, RANDOM); - } - - /** - * Return the array after "shuffling" it. - * java.util.Arrays#shuffle(Object[] array, Random r) - */ - public static E[] shuffle(E[] array, Random random) { - int len = array.length; - for (int i = len; i-- > 0; ) { - swap(array, i, random.nextInt(len)); - } - return array; - } - - /** - * Return the array after "shuffling" it. - * java.util.Arrays#shuffle(char[] array) - */ - public static char[] shuffle(char... array) { - return shuffle(array, RANDOM); - } - - /** - * Return the array after "shuffling" it. - * java.util.Arrays#shuffle(char[] array, Random r) - */ - public static char[] shuffle(char[] array, Random random) { - int len = array.length; - for (int i = len; i-- > 0; ) { - swap(array, i, random.nextInt(len)); - } - return array; - } - - /** - * Return the array after "shuffling" it. - * java.util.Arrays#shuffle(int[] array) - */ - public static int[] shuffle(int... array) { - return shuffle(array, RANDOM); - } - - /** - * Return the array after "shuffling" it. - * java.util.Arrays#shuffle(int[] array, Random r) - */ - public static int[] shuffle(int[] array, Random random) { - int len = array.length; - for (int i = len; i-- > 0; ) { - swap(array, i, random.nextInt(len)); - } - return array; - } - - /** - * Return an iterator that returns only the single, - * specified object. - * Object#toIterator() ?! - */ - public static Iterator singletonIterator(E value) { - return new SingleElementIterator(value); - } - - /** - * Return the number of elements returned by the specified iterator. - * java.util.Iterator#size() - */ - public static int size(Iterator iterator) { - int size = 0; - while (iterator.hasNext()) { - iterator.next(); - size++; - } - return size; - } - - /** - * Return a sorted set corresponding to the specified iterator. - * java.util.TreeSet(java.util.Iterator iterator) - */ - public static > SortedSet sortedSet(Iterator iterator) { - return sortedSet(iterator, null); - } - - /** - * Return a sorted set corresponding to the specified iterator - * and comparator. - * java.util.TreeSet(java.util.Iterator iterator, java.util.Comparator c) - */ - public static SortedSet sortedSet(Iterator iterator, Comparator comparator) { - SortedSet sortedSet = new TreeSet(comparator); - sortedSet.addAll(list(iterator)); - return sortedSet; - } - - /** - * Return a sorted set corresponding to the specified array. - * java.util.TreeSet(Object[] array) - */ - public static > SortedSet sortedSet(E... array) { - return sortedSet(array, null); - } - - /** - * Return a sorted set corresponding to the specified array - * and comparator. - * java.util.TreeSet(Object[] array, java.util.Comparator c) - */ - public static SortedSet sortedSet(E[] array, Comparator comparator) { - SortedSet sortedSet = new TreeSet(comparator); - sortedSet.addAll(Arrays.asList(array)); - return sortedSet; - } - - /** - * Return the array after the specified elements have been "swapped". - * java.util.Arrays#swap(Object[] array, int i, int j) - */ - public static E[] swap(E[] array, int i, int j) { - E temp = array[i]; - array[i] = array[j]; - array[j] = temp; - return array; - } - - /** - * Return the array after the specified elements have been "swapped". - * java.util.Arrays#swap(char[] array, int i, int j) - */ - public static char[] swap(char[] array, int i, int j) { - char temp = array[i]; - array[i] = array[j]; - array[j] = temp; - return array; - } - - /** - * Return the array after the specified elements have been "swapped". - * java.util.Arrays#swap(int[] array, int i, int j) - */ - public static int[] swap(int[] array, int i, int j) { - int temp = array[i]; - array[i] = array[j]; - array[j] = temp; - return array; - } - - /** - * Return a vector corresponding to the specified iterator. - * This is useful for legacy code that requires a java.util.Vector. - * java.util.Vector(java.util.Iterator iterator) - */ - public static Vector vector(Iterator iterator) { - Vector v = new Vector(); - while (iterator.hasNext()) { - v.addElement(iterator.next()); - } - return v; - } - - /** - * Return a vector corresponding to the specified array. - * This is useful for legacy code that requires a java.util.Vector. - * java.util.Vector(Object[] array) - */ - public static Vector vector(E... array) { - int len = array.length; - Vector v = new Vector(len); - for (E item : array) { - v.addElement(item); - } - return v; - } - - - //********** java.util.Collections enhancements ********** - - /** - * Return the destination list after the source list has been copied into it. - * @see java.util.Collections#copy(java.util.List, java.util.List) - */ - public static List copy(List dest, List src) { - Collections.copy(dest, src); - return dest; - } - - /** - * Return the list after it has been "filled". - * @see java.util.Collections#fill(java.util.List, java.lang.Object) - */ - public static List fill(List list, E value) { - Collections.fill(list, value); - return list; - } - - /** - * Return the list after it has been "reversed". - * @see java.util.Collections#reverse(java.util.List) - */ - public static List reverse(List list) { - Collections.reverse(list); - return list; - } - - /** - * Return the list after it has been "rotated" by one position. - * @see java.util.Collections#rotate(java.util.List, int) - */ - public static List rotate(List list) { - return rotate(list, 1); - } - - /** - * Return the list after it has been "rotated". - * @see java.util.Collections#rotate(java.util.List, int) - */ - public static List rotate(List list, int distance) { - Collections.rotate(list, distance); - return list; - } - - /** - * Return the list after it has been "shuffled". - * @see java.util.Collections#shuffle(java.util.List) - */ - public static List shuffle(List list) { - Collections.shuffle(list); - return list; - } - - /** - * Return the list after it has been "shuffled". - * @see java.util.Collections#shuffle(java.util.List, java.util.Random) - */ - public static List shuffle(List list, Random random) { - Collections.shuffle(list, random); - return list; - } - - /** - * Return the list after it has been "sorted". - * @see java.util.Collections#sort(java.util.List) - */ - public static > List sort(List list) { - Collections.sort(list); - return list; - } - - /** - * Return the list after it has been "sorted". - * @see java.util.Collections#sort(java.util.List, java.util.Comparator) - */ - public static List sort(List list, Comparator comparator) { - Collections.sort(list, comparator); - return list; - } - - /** - * Return the iterator after it has been "sorted". - */ - public static > Iterator sort(Iterator iterator) { - return sort(iterator, null); - } - - /** - * Return the list after it has been "sorted". - */ - public static Iterator sort(Iterator iterator, Comparator comparator) { - return sort(list(iterator), comparator).iterator(); - } - - /** - * Return the list after the specified elements have been "swapped". - * @see java.util.Collections#swap(java.util.List, int, int) - */ - public static List swap(List list, int i, int j) { - Collections.swap(list, i, j); - return list; - } - - - //********** java.util.Arrays enhancements ********** - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(boolean[], boolean) - */ - public static boolean[] fill(boolean[] array, boolean value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(boolean[], int, int, boolean) - */ - public static boolean[] fill(boolean[] array, int fromIndex, int toIndex, boolean value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(byte[], byte) - */ - public static byte[] fill(byte[] array, byte value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(byte[], int, int, byte) - */ - public static byte[] fill(byte[] array, int fromIndex, int toIndex, byte value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(char[], char) - */ - public static char[] fill(char[] array, char value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(char[], int, int, char) - */ - public static char[] fill(char[] array, int fromIndex, int toIndex, char value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(double[], double) - */ - public static double[] fill(double[] array, double value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(double[], int, int, double) - */ - public static double[] fill(double[] array, int fromIndex, int toIndex, double value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(float[], float) - */ - public static float[] fill(float[] array, float value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(float[], int, int, float) - */ - public static float[] fill(float[] array, int fromIndex, int toIndex, float value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(int[], int) - */ - public static int[] fill(int[] array, int value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(int[], int, int, int) - */ - public static int[] fill(int[] array, int fromIndex, int toIndex, int value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(Object[], Object) - */ - public static E[] fill(E[] array, E value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(Object[], int, int, Object) - */ - public static E[] fill(E[] array, int fromIndex, int toIndex, E value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(long[], long) - */ - public static long[] fill(long[] array, long value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(long[], int, int, long) - */ - public static long[] fill(long[] array, int fromIndex, int toIndex, long value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(short[], short) - */ - public static short[] fill(short[] array, short value) { - Arrays.fill(array, value); - return array; - } - - /** - * Return the array after it has been "filled". - * @see java.util.Arrays#fill(short[], int, int, short) - */ - public static short[] fill(short[] array, int fromIndex, int toIndex, short value) { - Arrays.fill(array, fromIndex, toIndex, value); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(byte[]) - */ - public static byte[] sort(byte... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(byte[], int, int) - */ - public static byte[] sort(byte[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(char[]) - */ - public static char[] sort(char... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(char[], int, int) - */ - public static char[] sort(char[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(double[]) - */ - public static double[] sort(double... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(double[], int, int) - */ - public static double[] sort(double[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(float[]) - */ - public static float[] sort(float... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(float[], int, int) - */ - public static float[] sort(float[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(int[]) - */ - public static int[] sort(int... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(int[], int, int) - */ - public static int[] sort(int[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(Object[]) - */ - public static E[] sort(E... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(Object[], java.util.Comparator) - */ - public static E[] sort(E[] array, Comparator comparator) { - Arrays.sort(array, comparator); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(Object[], int, int) - */ - public static E[] sort(E[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(Object[], int, int, java.util.Comparator) - */ - public static E[] sort(E[] array, int fromIndex, int toIndex, Comparator comparator) { - Arrays.sort(array, fromIndex, toIndex, comparator); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(long[]) - */ - public static long[] sort(long... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(long[], int, int) - */ - public static long[] sort(long[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(short[]) - */ - public static short[] sort(short... array) { - Arrays.sort(array); - return array; - } - - /** - * Return the array after it has been "sorted". - * @see java.util.Arrays#sort(short[], int, int) - */ - public static short[] sort(short[] array, int fromIndex, int toIndex) { - Arrays.sort(array, fromIndex, toIndex); - return array; - } - - - //********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private CollectionTools() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java deleted file mode 100644 index 39c3efed1c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java +++ /dev/null @@ -1,1006 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.channels.FileChannel; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Assorted file tools: - * - delete entire trees of directories and files - * - build iterators on entire trees of directories and files - * - build a temporary directory - * - "canonize" files - */ -public final class FileTools { - - public static final String USER_HOME_DIRECTORY_NAME = System.getProperty("user.home"); - public static final String USER_TEMPORARY_DIRECTORY_NAME = System.getProperty("java.io.tmpdir"); - public static String DEFAULT_TEMPORARY_DIRECTORY_NAME = "tmpdir"; - public static final String CURRENT_WORKING_DIRECTORY_NAME = System.getProperty("user.dir"); - - /** A list of some invalid file name characters. - : is the filename separator in MacOS and the drive indicator in DOS - * is a DOS wildcard character - | is a DOS redirection character - & is our own escape character - / is the filename separator in Unix and the command option tag in DOS - \ is the filename separator in DOS/Windows and the escape character in Unix - ; is ??? - ? is a DOS wildcard character - [ is ??? - ] is ??? - = is ??? - + is ??? - < is a DOS redirection character - > is a DOS redirection character - " is used by DOS to delimit file names with spaces - , is ??? - */ - public static final char[] INVALID_FILENAME_CHARACTERS = { ':', '*', '|', '&', '/', '\\', ';', '?', '[', ']', '=', '+', '<', '>', '"', ',' }; - - /** This encoder will convert strings into valid file names. */ - public static final XMLStringEncoder FILE_NAME_ENCODER = new XMLStringEncoder(INVALID_FILENAME_CHARACTERS); - - /** Windows files that are redirected to devices etc. */ - private static final String[] WINDOWS_RESERVED_FILE_NAMES = { - "con", - "aux", - "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9", - "lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", - "prn", - "nul" - }; - - /** The default length of a shortened file name. */ - public static final int MAXIMUM_SHORTENED_FILE_NAME_LENGTH = 60; - - - // ********** deleting directories ********** - - /** - * Delete the specified directory and all of its contents. - * USE WITH CARE. - * File#deleteAll()? - */ - public static void deleteDirectory(String directoryName) { - deleteDirectory(new File(directoryName)); - } - - /** - * Delete the specified directory and all of its contents. - * USE WITH CARE. - * File#deleteAll()? - */ - public static void deleteDirectory(File directory) { - deleteDirectoryContents(directory); - if ( ! directory.delete()) { - throw new RuntimeException("unable to delete directory: " + directory.getAbsolutePath()); - } - } - - /** - * Delete the contents of the specified directory - * (but not the directory itself). - * USE WITH CARE. - * File#deleteFiles() - */ - public static void deleteDirectoryContents(String directoryName) { - deleteDirectoryContents(new File(directoryName)); - } - - /** - * Delete the contents of the specified directory - * (but not the directory itself). - * USE WITH CARE. - * File#deleteFiles() - */ - public static void deleteDirectoryContents(File directory) { - for (File file : directory.listFiles()) { - if (file.isDirectory()) { - deleteDirectory(file); // recurse through subdirectories - } else { - if ( ! file.delete()) { - throw new RuntimeException("unable to delete file: " + file.getAbsolutePath()); - } - } - } - } - - - // ********** copying files ********** - - /** - * Copies the content of the source file to the destination file. - * File#copy(File destinationFile) - */ - public static void copyToFile(File sourceFile, File destinationFile) - throws IOException - { - FileChannel sourceChannel = new FileInputStream(sourceFile).getChannel(); - FileChannel destinationChannel = new FileOutputStream(destinationFile).getChannel(); - try { - destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size()); - } finally { - sourceChannel.close(); - destinationChannel.close(); - } - } - - /** - * Copies the content of the source file to a file by - * the same name in the destination directory. - * File#copyToDirectory(File destinationDirectory) - */ - public static void copyToDirectory(File sourceFile, File destinationDirectory) - throws IOException - { - File destinationFile = new File(destinationDirectory, sourceFile.getName()); - destinationFile.createNewFile(); - copyToFile(sourceFile, destinationFile); - } - - - // ********** iteratoring over files and directories ********** - - /** - * Return an iterator on all the files in the specified directory. - * The iterator will skip over subdirectories. - * File#files() - */ - public static Iterator filesIn(String directoryName) { - return filesIn(new File(directoryName)); - } - - /** - * Return an iterator on all the files in the specified directory. - * The iterator will skip over subdirectories. - * File#files() - */ - public static Iterator filesIn(File directory) { - return filesIn(directory.listFiles()); - } - - private static Iterator filesIn(File[] files) { - return new FilteringIterator(new ArrayIterator(files)) { - @Override - protected boolean accept(Object next) { - return ((File) next).isFile(); - } - }; - } - - /** - * Return an iterator on all the subdirectories - * in the specified directory. - * File#subDirectories() - */ - public static Iterator directoriesIn(String directoryName) { - return directoriesIn(new File(directoryName)); - } - - /** - * Return an iterator on all the subdirectories - * in the specified directory. - * File#subDirectories() - */ - public static Iterator directoriesIn(File directory) { - return directoriesIn(directory.listFiles()); - } - - private static Iterator directoriesIn(File[] files) { - return new FilteringIterator(new ArrayIterator(files)) { - @Override - protected boolean accept(Object next) { - return ((File) next).isDirectory(); - } - }; - } - - /** - * Return an iterator on all the files under the specified - * directory, recursing into subdirectories. - * The iterator will skip over the subdirectories themselves. - * File#filesRecurse() - */ - public static Iterator filesInTree(String directoryName) { - return filesInTree(new File(directoryName)); - } - - /** - * Return an iterator on all the files under the specified - * directory, recursing into subdirectories. - * The iterator will skip over the subdirectories themselves. - * File#filesRecurse() - */ - public static Iterator filesInTree(File directory) { - return filesInTreeAsSet(directory).iterator(); - } - - private static Set filesInTreeAsSet(File directory) { - Set files = new HashSet(10000); - addFilesInTreeTo(directory, files); - return files; - } - - private static void addFilesInTreeTo(File directory, Collection allFiles) { - for (File file : directory.listFiles()) { - if (file.isFile()) { - allFiles.add(file); - } else if (file.isDirectory()) { - addFilesInTreeTo(file, allFiles); - } - } - } - - /** - * Return an iterator on all the directories under the specified - * directory, recursing into subdirectories. - * File#subDirectoriesRecurse() - */ - public static Iterator directoriesInTree(String directoryName) { - return directoriesInTree(new File(directoryName)); - } - - /** - * Return an iterator on all the directories under the specified - * directory, recursing into subdirectories. - * File#subDirectoriesRecurse() - */ - @SuppressWarnings("unchecked") - public static Iterator directoriesInTree(File directory) { - File[] files = directory.listFiles(); - return new CompositeIterator(directoriesIn(files), directoriesInTrees(directoriesIn(files))); - } - - private static Iterator directoriesInTrees(Iterator directories) { - return new CompositeIterator( - new TransformationIterator>(directories) { - @Override - protected Iterator transform(File next) { - return FileTools.directoriesInTree(next); - } - } - ); - } - - - // ********** short file name manipulation ********** - - /** - * Strip the extension from the specified file name - * and return the result. If the file name has no - * extension, it is returned unchanged - * File#basePath() - */ - public static String stripExtension(String fileName) { - int index = fileName.lastIndexOf('.'); - if (index == -1) { - return fileName; - } - return fileName.substring(0, index); - } - - /** - * Strip the extension from the specified file's name - * and return the result. If the file's name has no - * extension, it is returned unchanged - * File#basePath() - */ - public static String stripExtension(File file) { - return stripExtension(file.getPath()); - } - - /** - * Return the extension, including the dot, of the specified file name. - * If the file name has no extension, return an empty string. - * File#extension() - */ - public static String extension(String fileName) { - int index = fileName.lastIndexOf('.'); - if (index == -1) { - return ""; - } - return fileName.substring(index); - } - - /** - * Return the extension, including the dot, of the specified file's name. - * If the file's name has no extension, return an empty string. - * File#extension() - */ - public static String extension(File file) { - return extension(file.getPath()); - } - - - // ********** temporary directories ********** - - /** - * Build and return an empty temporary directory with the specified - * name. If the directory already exists, it will be cleared out. - * This directory will be a subdirectory of the Java temporary directory, - * as indicated by the System property "java.io.tmpdir". - */ - public static File emptyTemporaryDirectory(String name) { - File dir = new File(userTemporaryDirectory(), name); - if (dir.exists()) { - deleteDirectoryContents(dir); - } else { - dir.mkdirs(); - } - return dir; - } - - /** - * Build and return an empty temporary directory with a - * name of "tmpdir". If the directory already exists, it will be cleared out. - * This directory will be a subdirectory of the Java temporary directory, - * as indicated by the System property "java.io.tmpdir". - */ - public static File emptyTemporaryDirectory() { - return emptyTemporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME); - } - - /** - * Build and return a temporary directory with the specified - * name. If the directory already exists, it will be left unchanged; - * if it does not already exist, it will be created. - * This directory will be a subdirectory of the Java temporary directory, - * as indicated by the System property "java.io.tmpdir". - */ - public static File temporaryDirectory(String name) { - File dir = new File(userTemporaryDirectory(), name); - if ( ! dir.exists()) { - dir.mkdirs(); - } - return dir; - } - - /** - * Build and return a temporary directory with a name of - * "tmpdir". If the directory already exists, it will be left unchanged; - * if it does not already exist, it will be created. - * This directory will be a subdirectory of the Java temporary directory, - * as indicated by the System property "java.io.tmpdir". - */ - public static File temporaryDirectory() { - return temporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME); - } - - /** - * Build and return a *new* temporary directory with the specified - * prefix. The prefix will be appended with a number that - * is incremented, starting with 1, until a non-pre-existing directory - * is found and successfully created. This directory will be a - * subdirectory of the Java temporary directory, as indicated by - * the System property "java.io.tmpdir". - */ - public static File newTemporaryDirectory(String prefix) { - if ( ! prefix.endsWith(".")) { - prefix = prefix + "."; - } - File dir; - int i = 0; - do { - i++; - dir = new File(userTemporaryDirectory(), prefix + i); - } while ( ! dir.mkdirs()); - return dir; - } - - /** - * Build and return a *new* temporary directory with a - * prefix of "tmpdir". This prefix will be appended with a number that - * is incremented, starting with 1, until a non-pre-existing directory - * is found and successfully created. This directory will be a - * subdirectory of the Java temporary directory, as indicated by - * the System property "java.io.tmpdir". - */ - public static File newTemporaryDirectory() { - return newTemporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME); - } - - - // ********** resource files ********** - - /** - * Build and return a file for the specified resource. - * The resource name must be fully-qualified, i.e. it cannot be relative - * to the package name/directory. - * NB: There is a bug in jdk1.4.x the prevents us from getting - * a resource that has spaces (or other special characters) in - * its name.... (see Sun's Java bug 4466485) - */ - public static File resourceFile(String resourceName) throws URISyntaxException { - if ( ! resourceName.startsWith("/")) { - throw new IllegalArgumentException(resourceName); - } - return resourceFile(resourceName, FileTools.class); - } - - /** - * Build and return a file for the specified resource. - * NB: There is a bug in jdk1.4.x the prevents us from getting - * a resource that has spaces (or other special characters) in - * its name.... (see Sun's Java bug 4466485) - */ - public static File resourceFile(String resourceName, Class javaClass) throws URISyntaxException { - URL url = javaClass.getResource(resourceName); - return buildFile(url); - } - - /** - * Build and return a file for the specified URL. - * NB: There is a bug in jdk1.4.x the prevents us from getting - * a resource that has spaces (or other special characters) in - * its name.... (see Sun's Java bug 4466485) - */ - public static File buildFile(URL url) throws URISyntaxException { - return buildFile(url.getFile()); - } - - /** - * Build and return a file for the specified file name. - * NB: There is a bug in jdk1.4.x the prevents us from getting - * a resource that has spaces (or other special characters) in - * its name.... (see Sun's Java bug 4466485) - */ - public static File buildFile(String fileName) throws URISyntaxException { - URI uri = new URI(fileName); - File file = new File(uri.getPath()); - return file; - } - - - // ********** "canonical" files ********** - - /** - * Convert the specified file into a "canonical" file. - */ - public static File canonicalFile(File file) { - try { - return file.getCanonicalFile(); - } catch (IOException ioexception) { - // settle for the absolute file - return file.getAbsoluteFile(); - } - } - - /** - * Build an iterator that will convert the specified files - * into "canonical" files. - */ - public static Iterator canonicalFiles(Iterator files) { - return new TransformationIterator(files) { - @Override - protected File transform(File next) { - return canonicalFile(next); - } - }; - } - - /** - * Build an iterator that will convert the specified files - * into "canonical" files. - */ - public static Iterator canonicalFiles(Collection files) { - return canonicalFiles(files.iterator()); - } - - /** - * Convert the specified file name into a "canonical" file name. - */ - public static String canonicalFileName(String fileName) { - return canonicalFile(new File(fileName)).getAbsolutePath(); - } - - /** - * Build an iterator that will convert the specified file names - * into "canonical" file names. - */ - public static Iterator canonicalFileNames(Iterator fileNames) { - return new TransformationIterator(fileNames) { - @Override - protected String transform(String next) { - return canonicalFileName(next); - } - }; - } - - /** - * Build an iterator that will convert the specified file names - * into "canonical" file names. - */ - public static Iterator canonicalFileNames(Collection fileNames) { - return canonicalFileNames(fileNames.iterator()); - } - - - // ********** file name validation ********** - - /** - * Return whether the specified file name is invalid. - */ - public static boolean fileNameIsInvalid(String filename) { - return ! fileNameIsValid(filename); - } - - /** - * Return whether the specified file name is valid. - */ - public static boolean fileNameIsValid(String filename) { - int len = filename.length(); - for (int i = 0; i < len; i++) { - char filenameChar = filename.charAt(i); - if (CollectionTools.contains(INVALID_FILENAME_CHARACTERS, filenameChar)) { - return false; - } - } - return true; - } - - /** - * Convert the illegal characters in the specified file name to - * the specified character and return the result. - */ - public static String convertToValidFileName(String filename, char replacementChar) { - int len = filename.length(); - StringBuffer sb = new StringBuffer(len); - for (int i = 0; i < len; i++) { - char filenameChar = filename.charAt(i); - if (CollectionTools.contains(INVALID_FILENAME_CHARACTERS, filenameChar)) { - sb.append(replacementChar); - } else { - sb.append(filenameChar); - } - } - return sb.toString(); - } - - /** - * Convert the illegal characters in the specified file name to - * periods ('.') and return the result. - */ - public static String convertToValidFileName(String filename) { - return convertToValidFileName(filename, '.'); - } - - /** - * Return whether the specified file name is "reserved" - * (i.e. it cannot be used for "user" files). Windows reserves - * a number of file names (e.g. CON, AUX, PRN). - */ - public static boolean fileNameIsReserved(String fileName) { - if (executingOnWindows()) { - return CollectionTools.contains(WINDOWS_RESERVED_FILE_NAMES, fileName.toLowerCase()); - } - return false; // Unix does not have any "reserved" file names (I think...) - } - - /** - * Return whether the specified file contains any "reserved" - * components. - * Windows reserves a number of file names (e.g. CON, AUX, PRN); - * and these file names cannot be used for either the names of - * files or directories. - */ - public static boolean fileHasAnyReservedComponents(File file) { - File temp = file; - while (temp != null) { - if (fileNameIsReserved(temp.getName())) { - return true; - } - temp = temp.getParentFile(); - } - return false; - } - - - // ********** shortened file names ********** - - /** - * Return a shorter version of the absolute file name for the specified file. - * The shorter version will not be longer than the maximum length. - * The first directory (usually the drive letter) and the file name or the - * last directory will always be added to the generated string regardless of - * the maximum length allowed. - */ - public static String shortenFileName(URL url) { - return shortenFileName(url, MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - } - - /** - * Return a shorter version of the absolute file name for the specified file. - * The shorter version will not be longer than the maximum length. - * The first directory (usually the drive letter) and the file name or the - * last directory will always be added to the generated string regardless of - * the maximum length allowed. - */ - public static String shortenFileName(URL url, int maxLength) { - File file; - try { - file = buildFile(url); - } catch (URISyntaxException e) { - file = new File(url.getFile()); - } - return shortenFileName(file, maxLength); - } - - /** - * Return a shorter version of the absolute file name for the specified file. - * The shorter version will not be longer than the maximum length. - * The first directory (usually the drive letter) and the file name or the - * last directory will always be added to the generated string regardless of - * the maximum length allowed. - */ - public static String shortenFileName(File file) { - return shortenFileName(file, MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - } - - /** - * Return a shorter version of the absolute file name for the specified file. - * The shorter version will not be longer than the maximum length. - * The first directory (usually the drive letter) and the file name or the - * last directory will always be added to the generated string regardless of - * the maximum length allowed. - */ - public static String shortenFileName(File file, int maxLength) { - String absoluteFileName = canonicalFile(file).getAbsolutePath(); - if (absoluteFileName.length() <= maxLength) { - // no need to shorten - return absoluteFileName; - } - - // break down the path into its components - String fs = File.separator; - String[] paths = absoluteFileName.split("\\" + fs); - - if (paths.length <= 1) { - // e.g. "C:\" - return paths[0]; - } - - if (paths.length == 2) { - // e.g. "C:\MyReallyLongFileName.ext" or "C:\MyReallyLongDirectoryName" - // return the complete file name since this is a minimum requirement, - // regardless of the maximum length allowed - return absoluteFileName; - } - - StringBuffer sb = new StringBuffer(); - sb.append(paths[0]); // always add the first directory, which is usually the drive letter - - // Keep the index of insertion into the string buffer - int insertIndex = sb.length(); - - sb.append(fs); - sb.append(paths[paths.length - 1]); // append the file name or the last directory - - maxLength -= 4; // -4 for "/..." - - int currentLength = sb.length() - 4; // -4 for "/..." - int leftIndex = 1; // 1 to skip the root directory - int rightIndex = paths.length - 2; // -1 for the file name or the last directory - - boolean canAddFromLeft = true; - boolean canAddFromRight = true; - - // Add each directory, the insertion is going in both direction: left and - // right, once a side can't be added, the other side is still continuing - // until both can't add anymore - while (true) { - if (!canAddFromLeft && !canAddFromRight) - break; - - if (canAddFromRight) { - String rightDirectory = paths[rightIndex]; - int rightLength = rightDirectory.length(); - - // Add the directory on the right side of the loop - if (currentLength + rightLength + 1 <= maxLength) { - sb.insert(insertIndex, fs); - sb.insert(insertIndex + 1, rightDirectory); - - currentLength += rightLength + 1; - rightIndex--; - - // The right side is now overlapping the left side, that means - // we can't add from the right side anymore - if (leftIndex >= rightIndex) { - canAddFromRight = false; - } - } else { - canAddFromRight = false; - } - } - - if (canAddFromLeft) { - String leftDirectory = paths[leftIndex]; - int leftLength = leftDirectory.length(); - - // Add the directory on the left side of the loop - if (currentLength + leftLength + 1 <= maxLength) { - sb.insert(insertIndex, fs); - sb.insert(insertIndex + 1, leftDirectory); - - insertIndex += leftLength + 1; - currentLength += leftLength + 1; - leftIndex++; - - // The left side is now overlapping the right side, that means - // we can't add from the left side anymore - if (leftIndex >= rightIndex) { - canAddFromLeft = false; - } - } else { - canAddFromLeft = false; - } - } - } - - if (leftIndex <= rightIndex) { - sb.insert(insertIndex, fs); - sb.insert(insertIndex + 1, "..."); - } - - return sb.toString(); - } - - - // ********** system properties ********** - - /** - * Return a file representing the user's home directory. - */ - public static File userHomeDirectory() { - return new File(USER_HOME_DIRECTORY_NAME); - } - - /** - * Return a file representing the user's temporary directory. - */ - public static File userTemporaryDirectory() { - return new File(USER_TEMPORARY_DIRECTORY_NAME); - } - - /** - * Return a file representing the current working directory. - */ - public static File currentWorkingDirectory() { - return new File(CURRENT_WORKING_DIRECTORY_NAME); - } - - - // ********** miscellaneous ********** - - private static boolean executingOnWindows() { - return executingOn("Windows"); - } - -// private static boolean executingOnLinux() { -// return executingOn("Linux"); -// } -// - private static boolean executingOn(String osName) { - return System.getProperty("os.name").indexOf(osName) != -1; - } - - /** - * Return only the files that fit the filter. - * File#files(FileFilter fileFilter) - */ - public static Iterator filter(Iterator files, final FileFilter fileFilter) { - return new FilteringIterator(files) { - @Override - protected boolean accept(Object next) { - return fileFilter.accept((File) next); - } - }; - } - - /** - * Return a file that is a re-specification of the specified - * file, relative to the specified directory. - * Linux/Unix/Mac: - * convertToRelativeFile(/foo/bar/baz.java, /foo) - * => bar/baz.java - * Windows: - * convertToRelativeFile(C:\foo\bar\baz.java, C:\foo) - * => bar/baz.java - * The file can be either a file or a directory; the directory - * *should* be a directory. - * If the file is already relative or it cannot be made relative - * to the directory, it will be returned unchanged. - * - * NB: This method has been tested on Windows and Linux, - * but not Mac (but the Mac is Unix-based these days, so - * it shouldn't be a problem...). - */ - public static File convertToRelativeFile(final File file, final File dir) { - // check whether the file is already relative - if ( ! file.isAbsolute()) { - return file; // return unchanged - } - - File cFile = canonicalFile(file); - File cDir = canonicalFile(dir); - - // the two are the same directory - if (cFile.equals(cDir)) { - return new File("."); - } - - File[] filePathFiles = pathFiles(cFile); - File[] dirPathFiles = pathFiles(cDir); - - // Windows only (?): the roots are different - e.g. D:\ vs. C:\ - if ( ! dirPathFiles[0].equals(filePathFiles[0])) { - return file; // return unchanged - } - - // at this point we know the root is the same, now find how much is in common - int i = 0; // this will point at the first miscompare - while ((i < dirPathFiles.length) && (i < filePathFiles.length)) { - if (dirPathFiles[i].equals(filePathFiles[i])) { - i++; - } else { - break; - } - } - // save our current position - int firstMismatch = i; - - // check whether the file is ABOVE the directory: ../.. - if (firstMismatch == filePathFiles.length) { - return relativeParentFile(dirPathFiles.length - firstMismatch); - } - - // build a new file from the path beyond the matching portions - File diff = new File(filePathFiles[i].getName()); - while (++i < filePathFiles.length) { - diff = new File(diff, filePathFiles[i].getName()); - } - - // check whether the file is BELOW the directory: subdir1/subdir2/file.ext - if (firstMismatch == dirPathFiles.length) { - return diff; - } - - // the file must be a PEER of the directory: ../../subdir1/subdir2/file.ext - return new File(relativeParentFile(dirPathFiles.length - firstMismatch), diff.getPath()); - } - - /** - * Return a file that is a re-specification of the specified - * file, relative to the current working directory. - * Linux/Unix/Mac (CWD = /foo): - * convertToRelativeFile(/foo/bar/baz.java) - * => bar/baz.java - * Windows (CWD = C:\foo): - * convertToRelativeFile(C:\foo\bar\baz.java) - * => bar/baz.java - * The file can be either a file or a directory. - * If the file is already relative or it cannot be made relative - * to the directory, it will be returned unchanged. - * - * NB: This method has been tested on Windows and Linux, - * but not Mac (but the Mac is Unix-based these days, so - * it shouldn't be a problem...). - */ - public static File convertToRelativeFile(final File file) { - return convertToRelativeFile(file, currentWorkingDirectory()); - } - - /** - * Return an array of files representing the path to the specified - * file. For example: - * C:/foo/bar/baz.txt => - * { C:/, C:/foo, C:/foo/bar, C:/foo/bar/baz.txt } - */ - private static File[] pathFiles(File file) { - List path = new ArrayList(); - for (File f = file; f != null; f = f.getParentFile()) { - path.add(f); - } - Collections.reverse(path); - return path.toArray(new File[path.size()]); - } - - /** - * Return a file with the specified (non-zero) number of relative - * file names, e.g. xxx(3) => ../../.. - */ - private static File relativeParentFile(int len) { - if (len <= 0) { - throw new IllegalArgumentException("length must be greater than zero: " + len); - } - File result = new File(".."); - for (int i = len - 1; i-- > 0; ) { - result = new File(result, ".."); - } - return result; - } - - /** - * Return a file that is a re-specification of the specified - * file, absolute to the specified directory. - * Linux/Unix/Mac: - * convertToAbsoluteFile(bar/baz.java, /foo) - * => /foo/bar/baz.java - * Windows: - * convertToAbsoluteFile(bar/baz.java, C:\foo) - * => C:\foo\bar\baz.java - * The file can be either a file or a directory; the directory - * *should* be a directory. - * If the file is already absolute, it will be returned unchanged. - * - * NB: This method has been tested on Windows and Linux, - * but not Mac (but the Mac is Unix-based these days, so - * it shouldn't be a problem...). - */ - public static File convertToAbsoluteFile(final File file, final File dir) { - // check whether the file is already absolute - if (file.isAbsolute()) { - return file; // return unchanged - } - return canonicalFile(new File(dir, file.getPath())); - } - - /** - * Return a file that is a re-specification of the specified - * file, absolute to the current working directory. - * Linux/Unix/Mac (CWD = /foo): - * convertToAbsoluteFile(bar/baz.java) - * => /foo/bar/baz.java - * Windows (CWD = C:\foo): - * convertToAbsoluteFile(bar/baz.java) - * => C:\foo\bar\baz.java - * The file can be either a file or a directory. - * If the file is already absolute, it will be returned unchanged. - * - * NB: This method has been tested on Windows and Linux, - * but not Mac (but the Mac is Unix-based these days, so - * it shouldn't be a problem...). - */ - public static File convertToAbsoluteFile(final File file) { - return convertToAbsoluteFile(file, currentWorkingDirectory()); - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private FileTools() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java deleted file mode 100644 index 20f95e0c33..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -/** - * Used by various "pluggable" classes to filter objects. - */ -public interface Filter { - - /** - * Return whether the specified object is "accepted" by the - * filter. The semantics of "accept" is determined by the - * contract between the client and the server. - */ - boolean accept(T o); - - - final class Null implements Filter { - @SuppressWarnings("unchecked") - public static final Filter INSTANCE = new Null(); - @SuppressWarnings("unchecked") - public static Filter instance() { - return INSTANCE; - } - // ensure single instance - private Null() { - super(); - } - // nothing is filtered - everything is accepted - public boolean accept(S next) { - return true; - } - @Override - public String toString() { - return "Filter.Null"; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java deleted file mode 100644 index 5017cf944d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java +++ /dev/null @@ -1,733 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.Serializable; -import java.util.AbstractCollection; -import java.util.Collection; -import java.util.Collections; -import java.util.ConcurrentModificationException; -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * This class implements the Bag interface, backed by a - * hash table. It makes no guarantees as to the iteration order of - * the bag's elements; in particular, it does not guarantee that the order - * will remain constant over time. This class permits the null - * element. - *

    - * This class offers constant time performance for the basic operations - * (add, remove, contains and - * size), assuming the hash function disperses the elements - * properly among the buckets. Iterating over this bag requires time - * proportional to the sum of the bag's size (the number of elements) plus the - * "capacity" of the backing hash table (the number of buckets). Thus, it is - * important not to set the initial capacity too high (or the load factor too - * low) if iteration performance is important. - *

    - * Note that this implementation is not synchronized. If multiple - * threads access a bag concurrently, and at least one of the threads modifies - * the bag, it must be synchronized externally. This is typically - * accomplished by synchronizing on some object that naturally encapsulates - * the bag. If no such object exists, the bag should be "wrapped" using the - * Collections.synchronizedCollection method. This is - * best done at creation time, to prevent accidental unsynchronized access - * to the bag: - *

    - * Collection c = Collections.synchronizedCollection(new HashBag(...));
    - * 
    - *

    - * The iterators returned by this class's iterator method are - * fail-fast: if the bag is modified at any time after the iterator is - * created, in any way except through the iterator's own remove - * method, the iterator throws a ConcurrentModificationException. - * Thus, in the face of concurrent modification, the iterator fails quickly - * and cleanly, rather than risking arbitrary, non-deterministic behavior at - * an undetermined time in the future. - * - * @see Collections#synchronizedCollection(Collection) - */ - -public class HashBag extends AbstractCollection - implements Bag, Cloneable, Serializable { - - /** The hash table. */ - transient Entry[] table; - - /** The total number of entries in the bag. */ - transient int count = 0; - - /** The number of unique entries in the bag. */ - transient int uniqueCount = 0; - - /** - * The hash table is rehashed when its size exceeds this threshold. (The - * value of this field is (int)(capacity * loadFactor).) - * - * @serial - */ - private int threshold; - - /** - * The load factor for the hash table. - * - * @serial - */ - private float loadFactor; - - /** - * The number of times this bag has been structurally modified. - * Structural modifications are those that change the number of entries in - * the bag or otherwise modify its internal structure (e.g. rehash). - * This field is used to make iterators on this bag fail-fast. - * - * @see java.util.ConcurrentModificationException - */ - transient int modCount = 0; - - /** - * Constructs a new, empty bag with the - * default capacity, which is 11, and load factor, which is 0.75. - */ - public HashBag() { - this(11, 0.75f); - } - - /** - * Constructs a new, empty bag with the specified initial capacity - * and default load factor, which is 0.75. - * - * @param initialCapacity the initial capacity of the backing map. - * @throws IllegalArgumentException if the initial capacity is less - * than zero. - */ - public HashBag(int initialCapacity) { - this(initialCapacity, 0.75f); - } - - /** - * Constructs a new, empty bag with - * the specified initial capacity and the specified load factor. - * - * @param initialCapacity the initial capacity of the backing map. - * @param loadFactor the load factor of the backing map. - * @throws IllegalArgumentException if the initial capacity is less - * than zero, or if the load factor is nonpositive. - */ - @SuppressWarnings("unchecked") - public HashBag(int initialCapacity, float loadFactor) { - if (initialCapacity < 0) { - throw new IllegalArgumentException("Illegal Initial Capacity: " + initialCapacity); - } - if (loadFactor <= 0 || Float.isNaN(loadFactor)) { - throw new IllegalArgumentException("Illegal Load factor: " + loadFactor); - } - if (initialCapacity == 0) { - initialCapacity = 1; - } - this.loadFactor = loadFactor; - this.table = new Entry[initialCapacity]; - this.threshold = (int) (initialCapacity * loadFactor); - } - - /** - * Constructs a new bag containing the elements in the specified - * collection. The capacity of the bag is - * twice the size of the specified collection or 11 (whichever is - * greater), and the default load factor, which is 0.75, is used. - * - * @param c the collection whose elements are to be placed into this bag. - */ - public HashBag(Collection c) { - this(Math.max(2*c.size(), 11)); - this.addAll(c); - } - - /** - * This implementation simply returns the maintained count. - */ - @Override - public int size() { - return this.count; - } - - /** - * This implementation simply compares the maintained count to zero. - */ - @Override - public boolean isEmpty() { - return this.count == 0; - } - - /** - * This implementation searches for the object in the hash table by calculating - * the object's hash code and examining the entries in the corresponding hash - * table bucket. - */ - @Override - public boolean contains(Object o) { - Entry[] tab = this.table; - if (o == null) { - for (Entry e = tab[0]; e != null; e = e.next) { - if (e.object == null) { - return true; - } - } - } else { - int hash = o.hashCode(); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index]; e != null; e = e.next) { - if ((e.hash == hash) && o.equals(e.object)) { - return true; - } - } - } - return false; - } - - /** - * Return the number of times the specified object occurs in the bag. - */ - public int count(Object o) { - Entry[] tab = this.table; - if (o == null) { - for (Entry e = tab[0]; e != null; e = e.next) { - if (e.object == null) { - return e.count; - } - } - } else { - int hash = o.hashCode(); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index]; e != null; e = e.next) { - if ((e.hash == hash) && o.equals(e.object)) { - return e.count; - } - } - } - return 0; - } - - /** - * Rehashes the contents of this bag into a new hash table - * with a larger capacity. This method is called when the - * number of different elements in this map exceeds its - * capacity and load factor. - */ - @SuppressWarnings("unchecked") - private void rehash() { - Entry[] oldMap = this.table; - int oldCapacity = oldMap.length; - - int newCapacity = oldCapacity * 2 + 1; - Entry[] newMap = new Entry[newCapacity]; - - this.modCount++; - this.threshold = (int) (newCapacity * this.loadFactor); - this.table = newMap; - - for (int i = oldCapacity; i-- > 0; ) { - for (Entry old = oldMap[i]; old != null; ) { - Entry e = old; - old = old.next; - - int index = (e.hash & 0x7FFFFFFF) % newCapacity; - e.next = newMap[index]; - newMap[index] = e; - } - } - } - - /** - * This implementation searches for the object in the hash table by calculating - * the object's hash code and examining the entries in the corresponding hash - * table bucket. - */ - @Override - @SuppressWarnings("unchecked") - public boolean add(E o) { - this.modCount++; - Entry[] tab = this.table; - int hash = 0; - int index = 0; - - // if the object is already in the bag, simply bump its count - if (o == null) { - for (Entry e = tab[0]; e != null; e = e.next) { - if (e.object == null) { - e.count++; - this.count++; - return true; - } - } - } else { - hash = o.hashCode(); - index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index]; e != null; e = e.next) { - if ((e.hash == hash) && o.equals(e.object)) { - e.count++; - this.count++; - return true; - } - } - } - - // rehash the table if the threshold is exceeded - if (this.uniqueCount >= this.threshold) { - this.rehash(); - tab = this.table; - index = (hash & 0x7FFFFFFF) % tab.length; - } - - // create the new entry and put it in the table - Entry e = new Entry(hash, o, tab[index]); - tab[index] = e; - this.count++; - this.uniqueCount++; - return true; - } - - /** - * This implementation searches for the object in the hash table by calculating - * the object's hash code and examining the entries in the corresponding hash - * table bucket. - */ - @Override - public boolean remove(Object o) { - Entry[] tab = this.table; - if (o == null) { - for (Entry e = tab[0], prev = null; e != null; prev = e, e = e.next) { - if (e.object == null) { - this.modCount++; - e.count--; - // if we are removing the last one, remove the entry from the table - if (e.count == 0) { - if (prev == null) { - tab[0] = e.next; - } else { - prev.next = e.next; - } - this.uniqueCount--; - } - this.count--; - return true; - } - } - } else { - int hash = o.hashCode(); - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) { - if ((e.hash == hash) && o.equals(e.object)) { - this.modCount++; - e.count--; - // if we are removing the last one, remove the entry from the table - if (e.count == 0) { - if (prev == null) { - tab[index] = e.next; - } else { - prev.next = e.next; - } - this.uniqueCount--; - } - this.count--; - return true; - } - } - } - - return false; - } - - /** - * This implementation simply clears out all of the hash table buckets. - */ - @Override - public void clear() { - Entry[] tab = this.table; - this.modCount++; - for (int i = tab.length; --i >= 0; ) { - tab[i] = null; - } - this.count = 0; - this.uniqueCount = 0; - } - - /** - * Returns a shallow copy of this bag: the elements - * themselves are not cloned. - * - * @return a shallow copy of this bag. - */ - @Override - @SuppressWarnings("unchecked") - public HashBag clone() { - try { - HashBag clone = (HashBag) super.clone(); - clone.table = new Entry[this.table.length]; - for (int i = this.table.length; i-- > 0; ) { - clone.table[i] = (this.table[i] == null) - ? null : (Entry) this.table[i].clone(); - } - clone.modCount = 0; - return clone; - } catch (CloneNotSupportedException e) { - throw new InternalError(); - } - } - - /** - * Hash table collision list entry. - */ - private static class Entry { - int hash; - E object; - int count; - Entry next; - - Entry(int hash, E object, Entry next) { - this(hash, object, 1, next); - } - - private Entry(int hash, E object, int count, Entry next) { - this.hash = hash; - this.object = object; - this.count = count; - this.next = next; - } - - @Override - @SuppressWarnings("unchecked") - protected Entry clone() { - return new Entry(this.hash, this.object, this.count, - (this.next == null ? null : this.next.clone())); - } - - @Override - public String toString() { - return this.object + "=>" + this.count; - } - } - - @Override - @SuppressWarnings("unchecked") - public Iterator iterator() { - if (this.count == 0) { - return EMPTY_ITERATOR; - } - return new HashIterator(); - } - - /** - * Return an iterator that returns each item in the bag - * once and only once, irrespective of how many times - * the item was added to the bag. - */ - @SuppressWarnings("unchecked") - public Iterator uniqueIterator() { - if (this.count == 0) { - return EMPTY_ITERATOR; - } - return new UniqueIterator(); - } - - /** - * Empty iterator that does just about nothing. - */ - @SuppressWarnings("unchecked") - private static final Iterator EMPTY_ITERATOR = new EmptyIterator(); - - @SuppressWarnings("unchecked") - private static class EmptyIterator implements Iterator { - - EmptyIterator() { - super(); - } - - public boolean hasNext() { - return false; - } - - public Object next() { - throw new NoSuchElementException(); - } - - public void remove() { - throw new IllegalStateException(); - } - } - - private class HashIterator implements Iterator { - Entry[] localTable = HashBag.this.table; - int index = this.localTable.length; // start at the end of the table - Entry nextEntry = null; - int nextEntryCount = 0; - Entry lastReturnedEntry = null; - - /** - * The modCount value that the iterator believes that the backing - * Bag should have. If this expectation is violated, the iterator - * has detected a concurrent modification. - */ - private int expectedModCount = HashBag.this.modCount; - - HashIterator() { - super(); - } - - public boolean hasNext() { - Entry e = this.nextEntry; - int i = this.index; - Entry[] tab = this.localTable; - // Use locals for faster loop iteration - while ((e == null) && (i > 0)) { - e = tab[--i]; // move backwards through the table - } - this.nextEntry = e; - this.index = i; - return e != null; - } - - public E next() { - if (HashBag.this.modCount != this.expectedModCount) { - throw new ConcurrentModificationException(); - } - Entry et = this.nextEntry; - int i = this.index; - Entry[] tab = this.localTable; - // Use locals for faster loop iteration - while ((et == null) && (i > 0)) { - et = tab[--i]; // move backwards through the table - } - this.nextEntry = et; - this.index = i; - if (et == null) { - throw new NoSuchElementException(); - } - Entry e = this.lastReturnedEntry = this.nextEntry; - this.nextEntryCount++; - if (this.nextEntryCount == e.count) { - this.nextEntry = e.next; - this.nextEntryCount = 0; - } - return e.object; - } - - public void remove() { - if (this.lastReturnedEntry == null) { - throw new IllegalStateException(); - } - if (HashBag.this.modCount != this.expectedModCount) { - throw new ConcurrentModificationException(); - } - Entry[] tab = this.localTable; - int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[slot], prev = null; e != null; prev = e, e = e.next) { - if (e == this.lastReturnedEntry) { - HashBag.this.modCount++; - this.expectedModCount++; - e.count--; - if (e.count == 0) { - // if we are removing the last one, remove the entry from the table - if (prev == null) { - tab[slot] = e.next; - } else { - prev.next = e.next; - } - HashBag.this.uniqueCount--; - } else { - // slide back the count to account for the just-removed element - this.nextEntryCount--; - } - HashBag.this.count--; - this.lastReturnedEntry = null; // it cannot be removed again - return; - } - } - throw new ConcurrentModificationException(); - } - - } - - - private class UniqueIterator implements Iterator { - Entry[] localTable = HashBag.this.table; - int index = this.localTable.length; // start at the end of the table - Entry nextEntry = null; - Entry lastReturnedEntry = null; - - /** - * The modCount value that the iterator believes that the backing - * Bag should have. If this expectation is violated, the iterator - * has detected a concurrent modification. - */ - private int expectedModCount = HashBag.this.modCount; - - UniqueIterator() { - super(); - } - - public boolean hasNext() { - Entry e = this.nextEntry; - int i = this.index; - Entry[] tab = this.localTable; - // Use locals for faster loop iteration - while ((e == null) && (i > 0)) { - e = tab[--i]; // move backwards through the table - } - this.nextEntry = e; - this.index = i; - return e != null; - } - - public E next() { - if (HashBag.this.modCount != this.expectedModCount) { - throw new ConcurrentModificationException(); - } - Entry et = this.nextEntry; - int i = this.index; - Entry[] tab = this.localTable; - // Use locals for faster loop iteration - while ((et == null) && (i > 0)) { - et = tab[--i]; // move backwards through the table - } - this.nextEntry = et; - this.index = i; - if (et == null) { - throw new NoSuchElementException(); - } - Entry e = this.lastReturnedEntry = this.nextEntry; - this.nextEntry = e.next; - return e.object; - } - - public void remove() { - if (this.lastReturnedEntry == null) { - throw new IllegalStateException(); - } - if (HashBag.this.modCount != this.expectedModCount) { - throw new ConcurrentModificationException(); - } - Entry[] tab = this.localTable; - int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[slot], prev = null; e != null; prev = e, e = e.next) { - if (e == this.lastReturnedEntry) { - HashBag.this.modCount++; - this.expectedModCount++; - // remove the entry from the table - if (prev == null) { - tab[slot] = e.next; - } else { - prev.next = e.next; - } - HashBag.this.uniqueCount--; - HashBag.this.count -= this.lastReturnedEntry.count; - this.lastReturnedEntry = null; // it cannot be removed again - return; - } - } - throw new ConcurrentModificationException(); - } - - } - - - @Override - @SuppressWarnings("unchecked") - public boolean equals(Object o) { - if (o == this) { - return true; - } - if ( ! (o instanceof Bag)) { - return false; - } - Bag b = (Bag) o; - if (b.size() != this.size()) { - return false; - } - Bag clone = this.clone(); - for (E e : b) { - if ( ! clone.remove(e)) { - return false; - } - } - return clone.isEmpty(); - } - - @Override - public int hashCode() { - int h = 0; - for (Iterator stream = this.iterator(); stream.hasNext(); ) { - Object next = stream.next(); - if (next != null) { - h += next.hashCode(); - } - } - return h; - } - - /** - * Save the state of this bag to a stream (i.e. serialize it). - * - * @serialData Emit the capacity of the bag (int), - * followed by the number of unique elements in the bag (int), - * followed by all of the bag's elements (each an Object) and - * their counts (each an int), in no particular order. - */ - private synchronized void writeObject(java.io.ObjectOutputStream s) - throws java.io.IOException { - // write out the threshold, load factor, and any hidden stuff - s.defaultWriteObject(); - - // write out number of buckets - s.writeInt(this.table.length); - - // write out number of unique elements - s.writeInt(this.uniqueCount); - - Entry[] tab = this.table; - // write out elements and counts (alternating) - for (Entry entry : tab) { - while (entry != null) { - s.writeObject(entry.object); - s.writeInt(entry.count); - entry = entry.next; - } - } - } - - private static final long serialVersionUID = 1L; - - /** - * Reconstitute the bag from a stream (i.e. deserialize it). - */ - @SuppressWarnings("unchecked") - private synchronized void readObject(java.io.ObjectInputStream s) - throws java.io.IOException, ClassNotFoundException { - // read in the threshold, loadfactor, and any hidden stuff - s.defaultReadObject(); - - // read in number of buckets and allocate the bucket array - this.table = new Entry[s.readInt()]; - - // read in number of unique elements - int unique = s.readInt(); - - // read the elements and counts, and put the elements in the bag - for (int i = 0; i < unique; i++) { - E element = (E) s.readObject(); - int elementCount = s.readInt(); - for (int j = 0; j < elementCount; j++) { - this.add(element); - } - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java deleted file mode 100644 index c510c86ebb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.PrintWriter; -import java.io.Writer; - -/** - * Extend PrintWriter to automatically indent new lines. - */ -public class IndentingPrintWriter extends PrintWriter { - - private final String indent; - private int indentLevel; - private boolean needsIndent; - - public static String DEFAULT_INDENT = "\t"; - - - /** - * Construct a writer that indents with tabs. - */ - public IndentingPrintWriter(Writer out) { - this(out, DEFAULT_INDENT); - } - - /** - * Construct a writer that indents with the specified string. - */ - public IndentingPrintWriter(Writer out, String indent) { - super(out); - this.indent = indent; - this.indentLevel = 0; - this.needsIndent = true; - } - - /** - * Set flag so following line is indented. - */ - @Override - public void println() { - synchronized (this.lock) { - super.println(); - this.needsIndent = true; - } - } - - /** - * Print the appropriate indent. - */ - private void printIndent() { - if (this.needsIndent) { - this.needsIndent = false; - for (int i = this.indentLevel; i-- > 0; ) { - this.print(this.indent); - } - } - } - - /** - * Write a portion of an array of characters. - */ - @Override - public void write(char buf[], int off, int len) { - synchronized (this.lock) { - this.printIndent(); - super.write(buf, off, len); - } - } - - /** - * Write a single character. - */ - @Override - public void write(int c) { - synchronized (this.lock) { - this.printIndent(); - super.write(c); - } - } - - /** - * Write a portion of a string. - */ - @Override - public void write(String s, int off, int len) { - synchronized (this.lock) { - this.printIndent(); - super.write(s, off, len); - } - } - - /** - * Bump the indent level. - */ - public void indent() { - this.incrementIndentLevel(); - } - - /** - * Decrement the indent level. - */ - public void undent() { - this.decrementIndentLevel(); - } - - /** - * Bump the indent level. - */ - public void incrementIndentLevel() { - synchronized (this.lock) { - this.indentLevel++; - } - } - - /** - * Decrement the indent level. - */ - public void decrementIndentLevel() { - synchronized (this.lock) { - this.indentLevel--; - } - } - - /** - * Return the current indent level. - */ - public int getIndentLevel() { - return this.indentLevel; - } - - /** - * Allow the indent level to be set directly. - */ - public void setIndentLevel(int indentLevel) { - synchronized (this.lock) { - this.indentLevel = indentLevel; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java deleted file mode 100644 index 23c4f6d39e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.sql.Types; -import java.util.HashMap; - -/** - * Helper methods for dealing with the JDBC API. - */ -public final class JDBCTools{ - - - /** - * Return the JDBC type corresponding to the specified class. - * @see java.sql.Types - */ - public static JDBCType jdbcTypeForClassNamed(String className) { - JavaToJDBCTypeMapping mapping = javaToJDBCTypeMapping(className); - return (mapping == null) ? DEFAULT_JDBC_TYPE : mapping.getJDBCType(); - } - - /** - * Return the JDBC type corresponding to the specified class. - * @see java.sql.Types - */ - public static JDBCType jdbcTypeFor(Class javaClass) { - return jdbcTypeForClassNamed(javaClass.getName()); - } - - /** - * Return the JDBC type corresponding to the specified class. - * @see java.sql.Types - */ - public static JDBCType jdbcTypeFor(JavaType javaType) { - return jdbcTypeForClassNamed(javaType.javaClassName()); - } - - /** - * Return the Java type corresponding to the specified JDBC type. - * @see java.sql.Types - */ - public static JavaType javaTypeForJDBCTypeNamed(String jdbcTypeName) { - JDBCToJavaTypeMapping mapping = jdbcToJavaTypeMapping(jdbcTypeName); - return (mapping == null) ? DEFAULT_JAVA_TYPE : mapping.getJavaType(); - } - - /** - * Return the Java type corresponding to the specified JDBC type. - * @see java.sql.Types - */ - public static JavaType javaTypeFor(JDBCType jdbcType) { - return javaTypeForJDBCTypeNamed(jdbcType.getName()); - } - - /** - * Return the Java type corresponding to the specified JDBC type. - * @see java.sql.Types - */ - public static JavaType javaTypeForJDBCTypeCode(int jdbcTypeCode) { - return javaTypeFor(JDBCType.type(jdbcTypeCode)); - } - - - // ********** internal stuff ********** - - - // ********** JDBC => Java ********** - - /** - * JDBC => Java type mappings, keyed by JDBC type name (e.g. "VARCHAR") - */ - private static HashMap JDBC_TO_JAVA_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized - private static final JavaType DEFAULT_JAVA_TYPE = new JavaType(java.lang.Object.class); // TODO Object is the default? - - - private static JDBCToJavaTypeMapping jdbcToJavaTypeMapping(String jdbcTypeName) { - return jdbcToJavaTypeMappings().get(jdbcTypeName); - } - - private static synchronized HashMap jdbcToJavaTypeMappings() { - if (JDBC_TO_JAVA_TYPE_MAPPINGS == null) { - JDBC_TO_JAVA_TYPE_MAPPINGS = buildJDBCToJavaTypeMappings(); - } - return JDBC_TO_JAVA_TYPE_MAPPINGS; - } - - private static HashMap buildJDBCToJavaTypeMappings() { - HashMap mappings = new HashMap(); - addJDBCToJavaTypeMappingsTo(mappings); - return mappings; - } - - /** - * hard code the default mappings from the JDBC types to the - * appropriate Java types - * @see java.sql.Types - * see "JDBC 3.0 Specification" Appendix B - */ - private static void addJDBCToJavaTypeMappingsTo(HashMap mappings) { - addJDBCToJavaTypeMappingTo(Types.ARRAY, java.sql.Array.class, mappings); - addJDBCToJavaTypeMappingTo(Types.BIGINT, long.class, mappings); - addJDBCToJavaTypeMappingTo(Types.BINARY, byte[].class, mappings); - addJDBCToJavaTypeMappingTo(Types.BIT, boolean.class, mappings); - addJDBCToJavaTypeMappingTo(Types.BLOB, java.sql.Blob.class, mappings); - addJDBCToJavaTypeMappingTo(Types.BOOLEAN, boolean.class, mappings); - addJDBCToJavaTypeMappingTo(Types.CHAR, java.lang.String.class, mappings); - addJDBCToJavaTypeMappingTo(Types.CLOB, java.sql.Clob.class, mappings); - addJDBCToJavaTypeMappingTo(Types.DATALINK, java.net.URL.class, mappings); - addJDBCToJavaTypeMappingTo(Types.DATE, java.sql.Date.class, mappings); - addJDBCToJavaTypeMappingTo(Types.DECIMAL, java.math.BigDecimal.class, mappings); - addJDBCToJavaTypeMappingTo(Types.DISTINCT, java.lang.Object.class, mappings); // ??? - addJDBCToJavaTypeMappingTo(Types.DOUBLE, double.class, mappings); - addJDBCToJavaTypeMappingTo(Types.FLOAT, double.class, mappings); - addJDBCToJavaTypeMappingTo(Types.INTEGER, int.class, mappings); - addJDBCToJavaTypeMappingTo(Types.JAVA_OBJECT, java.lang.Object.class, mappings); // ??? - addJDBCToJavaTypeMappingTo(Types.LONGVARBINARY, byte[].class, mappings); - addJDBCToJavaTypeMappingTo(Types.LONGVARCHAR, java.lang.String.class, mappings); - // not sure why this is defined in java.sql.Types -// addJDBCMappingTo(Types.NULL, java.lang.Object.class, mappings); - addJDBCToJavaTypeMappingTo(Types.NUMERIC, java.math.BigDecimal.class, mappings); - addJDBCToJavaTypeMappingTo(Types.OTHER, java.lang.Object.class, mappings); // ??? - addJDBCToJavaTypeMappingTo(Types.REAL, float.class, mappings); - addJDBCToJavaTypeMappingTo(Types.REF, java.sql.Ref.class, mappings); - addJDBCToJavaTypeMappingTo(Types.SMALLINT, short.class, mappings); - addJDBCToJavaTypeMappingTo(Types.STRUCT, java.sql.Struct.class, mappings); - addJDBCToJavaTypeMappingTo(Types.TIME, java.sql.Time.class, mappings); - addJDBCToJavaTypeMappingTo(Types.TIMESTAMP, java.sql.Timestamp.class, mappings); - addJDBCToJavaTypeMappingTo(Types.TINYINT, byte.class, mappings); - addJDBCToJavaTypeMappingTo(Types.VARBINARY, byte[].class, mappings); - addJDBCToJavaTypeMappingTo(Types.VARCHAR, java.lang.String.class, mappings); - } - - private static void addJDBCToJavaTypeMappingTo(int jdbcTypeCode, Class javaClass, HashMap mappings) { - // check for duplicates - JDBCType jdbcType = JDBCType.type(jdbcTypeCode); - Object prev = mappings.put(jdbcType.getName(), buildJDBCToJavaTypeMapping(jdbcType, javaClass)); - if (prev != null) { - throw new IllegalArgumentException("duplicate JDBC type: " + jdbcType.getName()); - } - } - - private static JDBCToJavaTypeMapping buildJDBCToJavaTypeMapping(JDBCType jdbcType, Class javaClass) { - return new JDBCToJavaTypeMapping(jdbcType, new JavaType(javaClass)); - } - - - // ********** Java => JDBC ********** - - /** - * Java => JDBC type mappings, keyed by Java class name (e.g. "java.lang.Object") - */ - private static HashMap JAVA_TO_JDBC_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized - private static final JDBCType DEFAULT_JDBC_TYPE = JDBCType.type(Types.VARCHAR); // TODO VARCHAR is the default? - - - private static JavaToJDBCTypeMapping javaToJDBCTypeMapping(String className) { - return javaToJDBCTypeMappings().get(className); - } - - private static synchronized HashMap javaToJDBCTypeMappings() { - if (JAVA_TO_JDBC_TYPE_MAPPINGS == null) { - JAVA_TO_JDBC_TYPE_MAPPINGS = buildJavaToJDBCTypeMappings(); - } - return JAVA_TO_JDBC_TYPE_MAPPINGS; - } - - private static HashMap buildJavaToJDBCTypeMappings() { - HashMap mappings = new HashMap(); - addJavaToJDBCTypeMappingsTo(mappings); - return mappings; - } - - /** - * hard code the default mappings from the Java types to the - * appropriate JDBC types - * @see java.sql.Types - * see "JDBC 3.0 Specification" Appendix B - */ - private static void addJavaToJDBCTypeMappingsTo(HashMap mappings) { - // primitives - addJavaToJDBCTypeMappingTo(boolean.class, Types.BIT, mappings); - addJavaToJDBCTypeMappingTo(byte.class, Types.TINYINT, mappings); - addJavaToJDBCTypeMappingTo(double.class, Types.DOUBLE, mappings); - addJavaToJDBCTypeMappingTo(float.class, Types.REAL, mappings); - addJavaToJDBCTypeMappingTo(int.class, Types.INTEGER, mappings); - addJavaToJDBCTypeMappingTo(long.class, Types.BIGINT, mappings); - addJavaToJDBCTypeMappingTo(short.class, Types.SMALLINT, mappings); - - // reference classes - addJavaToJDBCTypeMappingTo(java.lang.Boolean.class, Types.BIT, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Byte.class, Types.TINYINT, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Double.class, Types.DOUBLE, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Float.class, Types.REAL, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Integer.class, Types.INTEGER, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Long.class, Types.BIGINT, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Short.class, Types.SMALLINT, mappings); - addJavaToJDBCTypeMappingTo(java.lang.String.class, Types.VARCHAR, mappings); - addJavaToJDBCTypeMappingTo(java.math.BigDecimal.class, Types.NUMERIC, mappings); - addJavaToJDBCTypeMappingTo(java.net.URL.class, Types.DATALINK, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Array.class, Types.ARRAY, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Blob.class, Types.BLOB, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Clob.class, Types.CLOB, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Date.class, Types.DATE, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Ref.class, Types.REF, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Struct.class, Types.STRUCT, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Time.class, Types.TIME, mappings); - addJavaToJDBCTypeMappingTo(java.sql.Timestamp.class, Types.TIMESTAMP, mappings); - - // arrays - addJavaToJDBCTypeMappingTo(byte[].class, Types.VARBINARY, mappings); - addJavaToJDBCTypeMappingTo(java.lang.Byte[].class, Types.VARBINARY, mappings); - } - - private static void addJavaToJDBCTypeMappingTo(Class javaClass, int jdbcTypeCode, HashMap mappings) { - // check for duplicates - Object prev = mappings.put(javaClass.getName(), buildJavaToJDBCTypeMapping(javaClass, jdbcTypeCode)); - if (prev != null) { - throw new IllegalArgumentException("duplicate Java class: " + ((JavaToJDBCTypeMapping) prev).getJavaType().declaration()); - } - } - - private static JavaToJDBCTypeMapping buildJavaToJDBCTypeMapping(Class javaClass, int jdbcTypeCode) { - return new JavaToJDBCTypeMapping(new JavaType(javaClass), JDBCType.type(jdbcTypeCode)); - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private JDBCTools() { - super(); - throw new UnsupportedOperationException(); - } - - - // ********** member classes ********** - - /** - * JDBC => Java - */ - private static class JDBCToJavaTypeMapping { - private final JDBCType jdbcType; - private final JavaType javaType; - - JDBCToJavaTypeMapping(JDBCType jdbcType, JavaType javaType) { - super(); - this.jdbcType = jdbcType; - this.javaType = javaType; - } - - public JDBCType getJDBCType() { - return this.jdbcType; - } - - public JavaType getJavaType() { - return this.javaType; - } - - public boolean maps(int jdbcTypeCode) { - return this.jdbcType.getCode() == jdbcTypeCode; - } - - public boolean maps(String jdbcTypeName) { - return this.jdbcType.getName().equals(jdbcTypeName); - } - - public boolean maps(JDBCType type) { - return this.jdbcType == type; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - this.appendTo(sb); - return sb.toString(); - } - - public void appendTo(StringBuffer sb) { - this.jdbcType.appendTo(sb); - sb.append(" => "); - this.javaType.appendDeclarationTo(sb); - } - - } - - /** - * Java => JDBC - */ - private static class JavaToJDBCTypeMapping { - private final JavaType javaType; - private final JDBCType jdbcType; - - JavaToJDBCTypeMapping(JavaType javaType, JDBCType jdbcType) { - super(); - this.javaType = javaType; - this.jdbcType = jdbcType; - } - - public JavaType getJavaType() { - return this.javaType; - } - - public JDBCType getJDBCType() { - return this.jdbcType; - } - - public boolean maps(JavaType jt) { - return this.javaType.equals(jt); - } - - public boolean maps(String elementTypeName, int arrayDepth) { - return this.javaType.equals(elementTypeName, arrayDepth); - } - - public boolean maps(String javaClassName) { - return this.javaType.describes(javaClassName); - } - - public boolean maps(Class javaClass) { - return this.javaType.describes(javaClass); - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - this.appendTo(sb); - return sb.toString(); - } - - public void appendTo(StringBuffer sb) { - this.javaType.appendDeclarationTo(sb); - sb.append(" => "); - this.jdbcType.appendTo(sb); - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java deleted file mode 100644 index fccea11fec..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.Serializable; -import java.lang.reflect.Field; -import java.sql.Types; -import java.text.Collator; - -/** - * Associate the Java constant and the JDBC type name. - * These are derived from java.sql.Types. - * - * @see java.sql.Types - */ -public final class JDBCType - implements Comparable, Cloneable, Serializable -{ - - /** - * the constant name (e.g. VARCHAR) - */ - private final String name; - - /** - * the JDBC code used by JDBC drivers - */ - private final int code; - - private static final long serialVersionUID = 1L; - - - // ********** constructors ********** - - /** - * Construct a JDBC type with the specified name and type code. - * This is private because all the possible JDBC types are built and - * stored in the static array TYPES. - * @see #types() - */ - private JDBCType(String name, int code) { - super(); - this.name = name; - this.code = code; - } - - - // ********** accessors ********** - - /** - * Return the name of the type, as defined in java.sql.Types. - */ - public String getName() { - return this.name; - } - - - /** - * Return the type code, as defined in java.sql.Types. - */ - public int getCode() { - return this.code; - } - - - // ********** printing and displaying ********** - - public void appendTo(StringBuffer sb) { - sb.append(this.name); - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(ClassTools.shortClassNameForObject(this)); - sb.append('('); - this.appendTo(sb); - sb.append(')'); - return sb.toString(); - } - - @Override - public JDBCType clone() { - try { - return (JDBCType) super.clone(); - } catch (CloneNotSupportedException ex) { - throw new InternalError(); - } - } - - public int compareTo(JDBCType type) { - return Collator.getInstance().compare(this.name, type.name); - } - - - // ********** static stuff ********** - - /** - * all the JDBC type defined in java.sql.Types - */ - private static JDBCType[] TYPES; // pseudo 'final' - lazy-initialized - - - public synchronized static JDBCType[] types() { - if (TYPES == null) { - TYPES = buildTypes(); - } - return TYPES; - } - - /** - * Return the JDBC type for the specified type code (e.g. Types.VARCHAR). - * @see java.sql.Types - */ - public static JDBCType type(int code) { - JDBCType[] types = types(); - for (int i = types.length; i-- > 0; ) { - if (types[i].getCode() == code) { - return types[i]; - } - } - throw new IllegalArgumentException("invalid JDBC type code: " + code); - } - - /** - * Return the JDBC type for the specified type name (e.g. "VARCHAR"). - * @see java.sql.Types - */ - public static JDBCType type(String name) { - JDBCType[] types = types(); - for (int i = types.length; i-- > 0; ) { - if (types[i].getName().equals(name)) { - return types[i]; - } - } - throw new IllegalArgumentException("invalid JDBC type name: " + name); - } - - /** - * build up the JDBC types via reflection - * @see java.sql.Types - */ - private static JDBCType[] buildTypes() { - Field[] fields = Types.class.getDeclaredFields(); - int len = fields.length; - JDBCType[] types = new JDBCType[len]; - for (int i = len; i-- > 0; ) { - String name = fields[i].getName(); - int code; - try { - code = ((Integer) fields[i].get(null)).intValue(); - } catch (IllegalAccessException ex) { - throw new RuntimeException(ex); // shouldn't happen... - } - types[i] = new JDBCType(name, code); - } - return types; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java deleted file mode 100644 index 682cda61df..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.PrintWriter; -import java.io.Serializable; -import java.text.Collator; - -/** - * This class describes a Java type; i.e. its "element type" - * and its "array depth". The element type is referenced by name, - * allowing us to reference classes that are not (or cannot be) loaded. - */ -public final class JavaType - implements Comparable, Cloneable, Serializable -{ - - /** - * store the type as a name, so we can reference classes - * that are not loaded - */ - private final String elementTypeName; - - /** - * non-array types have an array depth of zero - */ - private final int arrayDepth; - - private static final long serialVersionUID = 1L; - - - // ********** constructors ********** - - /** - * Construct a Java type with the specified element type and array depth. - */ - public JavaType(String elementTypeName, int arrayDepth) { - super(); - if ((elementTypeName == null) || (elementTypeName.length() == 0)) { - throw new IllegalArgumentException("The element type name is required."); - } - if (ClassTools.arrayDepthForClassNamed(elementTypeName) != 0) { // e.g. "[Ljava.lang.Object;" - throw new IllegalArgumentException("The element type must not be an array: " + elementTypeName + '.'); - } - if (arrayDepth < 0) { - throw new IllegalArgumentException("The array depth must be greater than or equal to zero: " + arrayDepth + '.'); - } - if (elementTypeName.equals(void.class.getName()) && (arrayDepth != 0)) { - throw new IllegalArgumentException("'void' must have an array depth of zero: " + arrayDepth + '.'); - } - this.elementTypeName = elementTypeName; - this.arrayDepth = arrayDepth; - } - - /** - * Construct a Java type for the specified class. - * The class name can be in one of the following forms: - * java.lang.Object - * int - * java.util.Map$Entry - * [Ljava.lang.Object; - * [I - * [Ljava.util.Map$Entry; - */ - public JavaType(String javaClassName) { - this(ClassTools.elementTypeNameForClassNamed(javaClassName), ClassTools.arrayDepthForClassNamed(javaClassName)); - } - - /** - * Construct a Java type for the specified class. - */ - public JavaType(Class javaClass) { - this(javaClass.getName()); - } - - - // ********** accessors ********** - - /** - * Return the name of the type's "element type". - * A member type will have one or more '$' characters in its name. - */ - public String getElementTypeName() { - return this.elementTypeName; - } - - /** - * Return the type's "array depth". - */ - public int getArrayDepth() { - return this.arrayDepth; - } - - - // ********** queries ********** - - public boolean isArray() { - return this.arrayDepth > 0; - } - - public boolean isPrimitive() { - return (this.arrayDepth == 0) && ClassTools.classNamedIsNonReference(this.elementTypeName); - } - - /** - * Return the class corresponding to the type's element type and array depth. - */ - public Class javaClass() throws ClassNotFoundException { - return ClassTools.classForTypeDeclaration(this.elementTypeName, this.arrayDepth); - } - - /** - * Return the version of the type's name that matches that - * returned by java.lang.Class#getName() - * (e.g. "[[J", "[Ljava.lang.Object;", "java.util.Map$Entry"). - */ - public String javaClassName() { - return ClassTools.classNameForTypeDeclaration(this.elementTypeName, this.arrayDepth); - } - - - // ********** comparison ********** - - public boolean equals(String otherElementTypeName, int otherArrayDepth) { - return (this.arrayDepth == otherArrayDepth) - && this.elementTypeName.equals(otherElementTypeName); - } - - public boolean describes(String className) { - return this.equals(ClassTools.elementTypeNameForClassNamed(className), ClassTools.arrayDepthForClassNamed(className)); - } - - public boolean describes(Class javaClass) { - return this.describes(javaClass.getName()); - } - - public boolean equals(JavaType other) { - return this.equals(other.elementTypeName, other.arrayDepth); - } - - @Override - public boolean equals(Object o) { - return (o instanceof JavaType) ? this.equals((JavaType) o) : false; - } - - @Override - public int hashCode() { - return this.elementTypeName.hashCode() ^ this.arrayDepth; - } - - public int compareTo(JavaType jt) { - int x = Collator.getInstance().compare(this.elementTypeName, jt.elementTypeName); - return (x != 0) ? x : (this.arrayDepth - jt.arrayDepth); - } - - - // ********** printing and displaying ********** - - /** - * Return the version of the type's name that can be used in source code: - * "[[J" => "long[][]" - * "java.util.Map$Entry" => "java.util.Map.Entry" - */ - public String declaration() { - if (this.arrayDepth == 0) { - return this.elementTypeNameDeclaration(); - } - StringBuffer sb = new StringBuffer(this.elementTypeName.length() + (2 * this.arrayDepth)); - this.appendDeclarationTo(sb); - return sb.toString(); - } - - /** - * Append the version of the type's name that can be used in source code: - * "[[J" => "long[][]" - * "java.util.Map$Entry" => "java.util.Map.Entry" - */ - public void appendDeclarationTo(StringBuffer sb) { - sb.append(this.elementTypeNameDeclaration()); - for (int i = this.arrayDepth; i-- > 0; ) { - sb.append("[]"); - } - } - - /** - * Print the version of the type's name that can be used in source code: - * "[[J" => "long[][]" - * "java.util.Map$Entry" => "java.util.Map.Entry" - */ - public void printDeclarationOn(PrintWriter pw) { - pw.print(this.elementTypeNameDeclaration()); - for (int i = this.arrayDepth; i-- > 0; ) { - pw.print("[]"); - } - } - - /** - * The '$' version of the name is used in Class.forName(String), - * but the '.' verions of the name is used in source code. - * Very irritating.... - */ - private String elementTypeNameDeclaration() { - return this.elementTypeName.replace('$', '.'); - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(ClassTools.shortClassNameForObject(this)); - sb.append('('); - this.appendDeclarationTo(sb); - sb.append(')'); - return sb.toString(); - } - - @Override - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException ex) { - throw new InternalError(); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java deleted file mode 100644 index be13c70dcf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java +++ /dev/null @@ -1,305 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; - - -/** - * Various helper methods for generating names. - */ -public final class NameTools { - - /** - * Given a "root" name and a set of existing names, generate a unique, - * Java-legal name that is either the "root" name or some variation on - * the "root" name (e.g. "root2", "root3",...). - * The names are case-sensitive. - */ - public static String uniqueJavaNameFor(String rootName, Iterator existingNames) { - Collection existingNames2 = CollectionTools.set(existingNames); - existingNames2.addAll(JAVA_RESERVED_WORDS_SET); - return uniqueNameFor(rootName, existingNames2, rootName); - } - - /** - * Given a "root" name and a set of existing names, generate a unique, - * Java-legal name that is either the "root" name or some variation on - * the "root" name (e.g. "root2", "root3",...). - * The names are case-sensitive. - */ - public static String uniqueJavaNameFor(String rootName, Collection existingNames) { - Collection existingNames2 = new HashSet(existingNames); - existingNames2.addAll(JAVA_RESERVED_WORDS_SET); - return uniqueNameFor(rootName, existingNames2, rootName); - } - - /** - * Given a "root" name and a set of existing names, generate a unique - * name that is either the "root" name or some variation on the "root" - * name (e.g. "root2", "root3",...). The names are case-sensitive. - */ - public static String uniqueNameFor(String rootName, Iterator existingNames) { - return uniqueNameFor(rootName, CollectionTools.set(existingNames)); - } - - /** - * Given a "root" name and a set of existing names, generate a unique - * name that is either the "root" name or some variation on the "root" - * name (e.g. "root2", "root3",...). The names are case-sensitive. - */ - public static String uniqueNameFor(String rootName, Collection existingNames) { - return uniqueNameFor(rootName, existingNames, rootName); - } - - /** - * Given a "root" name and a set of existing names, generate a unique - * name that is either the "root" name or some variation on the "root" - * name (e.g. "root2", "root3",...). The names are NOT case-sensitive. - */ - public static String uniqueNameForIgnoreCase(String rootName, Iterator existingNames) { - return uniqueNameForIgnoreCase(rootName, CollectionTools.set(existingNames)); - } - - /** - * Given a "root" name and a set of existing names, generate a unique - * name that is either the "root" name or some variation on the "root" - * name (e.g. "root2", "root3",...). The names are NOT case-sensitive. - */ - public static String uniqueNameForIgnoreCase(String rootName, Collection existingNames) { - return uniqueNameFor(rootName, convertToLowerCase(existingNames), rootName.toLowerCase()); - } - - /** - * use the suffixed "template" name to perform the comparisons, but RETURN - * the suffixed "root" name; this allows case-insensitive comparisons - * (i.e. the "template" name has been morphed to the same case as - * the "existing" names, while the "root" name has not, but the "root" name - * is what the client wants morphed to be unique) - */ - private static String uniqueNameFor(String rootName, Collection existingNames, String templateName) { - if ( ! existingNames.contains(templateName)) { - return rootName; - } - String uniqueName = templateName; - for (int suffix = 2; true; suffix++) { - if ( ! existingNames.contains(uniqueName + suffix)) { - return rootName.concat(String.valueOf(suffix)); - } - } - } - - /** - * Convert the specified collection of strings to a collection of the same - * strings converted to lower case. - */ - private static Collection convertToLowerCase(Collection strings) { - Collection result = new HashBag(strings.size()); - for (String string : strings) { - result.add(string.toLowerCase()); - } - return result; - } - - /** - * Build a fully-qualified name for the specified database object. - * Variations: - * catalog.schema.name - * catalog..name - * schema.name - * name - */ - public static String buildQualifiedDatabaseObjectName(String catalog, String schema, String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - if ((catalog == null) && (schema == null)) { - return name; - } - - StringBuffer sb = new StringBuffer(100); - if (catalog != null) { - sb.append(catalog); - sb.append('.'); - } - if (schema != null) { - sb.append(schema); - } - sb.append('.'); - sb.append(name); - return sb.toString(); - } - - /** - * The set of reserved words in the Java programming language. - * These words cannot be used as identifiers (i.e. names). - * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html - */ - public static final String[] JAVA_RESERVED_WORDS = new String[] { - "abstract", - "assert", // jdk 1.4 - "boolean", - "break", - "byte", - "case", - "catch", - "char", - "class", - "const", // unused - "continue", - "default", - "do", - "double", - "else", - "enum", // jdk 5.0 - "extends", - "false", - "final", - "finally", - "float", - "for", - "goto", // unused - "if", - "implements", - "import", - "instanceof", - "int", - "interface", - "long", - "native", - "new", - "null", - "package", - "private", - "protected", - "public", - "return", - "short", - "static", - "strictfp", // jdk 1.2 - "super", - "switch", - "synchronized", - "this", - "throw", - "throws", - "transient", - "true", - "try", - "void", - "volatile", - "while" - }; - - /** - * The set of reserved words in the Java programming language. - * These words cannot be used as identifiers (i.e. names). - * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html - */ - public static final Set JAVA_RESERVED_WORDS_SET = CollectionTools.set(JAVA_RESERVED_WORDS); - - /** - * Return the set of Java programming language reserved words. - * These words cannot be used as identifiers (i.e. names). - * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html - */ - public static Iterator javaReservedWords() { - return new ArrayIterator(JAVA_RESERVED_WORDS); - } - - /** - * Convert the specified string to a valid Java identifier - * by substituting an underscore '_' for any invalid characters - * in the string and capitalizing the string if it is a Java - * reserved word. - */ - public static String convertToJavaIdentifier(String string) { - return convertToJavaIdentifier(string, '_'); - } - - /** - * Convert the specified string to a valid Java identifier - * by substituting the specified character for any invalid characters - * in the string and capitalizing the string if it is a Java - * reserved word. - */ - public static String convertToJavaIdentifier(String string, char c) { - if (string.length() == 0) { - return string; - } - if (JAVA_RESERVED_WORDS_SET.contains(string)) { - // a reserved words is a valid identifier, we just need to tweak it a bit - return StringTools.capitalize(string); - } - return new String(convertToJavaIdentifierInternal(string.toCharArray(), c)); - } - - /** - * Convert the specified string to a valid Java identifier - * by substituting an underscore '_' for any invalid characters - * in the string and capitalizing the string if it is a Java - * reserved word. - */ - public static char[] convertToJavaIdentifier(char[] string) { - return convertToJavaIdentifier(string, '_'); - } - - /** - * Convert the specified string to a valid Java identifier - * by substituting the specified character for any invalid characters - * in the string and capitalizing the string if it is a Java - * reserved word. - */ - public static char[] convertToJavaIdentifier(char[] string, char c) { - int length = string.length; - if (length == 0) { - return string; - } - if (JAVA_RESERVED_WORDS_SET.contains(new String(string))) { - // a reserved words is a valid identifier, we just need to tweak it a bit - return StringTools.capitalize(string); - } - return convertToJavaIdentifierInternal(string, c); - } - - private static char[] convertToJavaIdentifierInternal(char[] string, char c) { - if ( ! Character.isJavaIdentifierStart(string[0])) { - if ( ! Character.isJavaIdentifierStart(c)) { - throw new IllegalArgumentException("invalid Java identifier start char: '" + c + "'"); - } - string[0] = c; - } - if ( ! Character.isJavaIdentifierPart(c)) { - throw new IllegalArgumentException("invalid Java identifier part char: '" + c + "'"); - } - for (int i = string.length; i-- > 1; ) { // NB: end with 1 - if ( ! Character.isJavaIdentifierPart(string[i])) { - string[i] = c; - } - } - return string; - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private NameTools() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java deleted file mode 100644 index 4dbe48618a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.Serializable; - -/** - * This simple container class simply puts a bit of semantics - * around a pair of numbers. - */ -public class Range - implements Cloneable, Serializable -{ - /** The starting index of the range. */ - public final int start; - - /** The ending index of the range. */ - public final int end; - - /** - * The size can be negative if the ending index - * is less than the starting index. - */ - public final int size; - - private static final long serialVersionUID = 1L; - - - /** - * Construct with the specified start and end, - * both of which are immutable. - */ - public Range(int start, int end) { - super(); - this.start = start; - this.end = end; - this.size = end - start + 1; - } - - /** - * Return whether the range includes the specified - * index. - */ - public boolean includes(int index) { - return (this.start <= index) && (index <= this.end); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if ( ! (o instanceof Range)) { - return false; - } - Range otherRange = (Range) o; - return (this.start == otherRange.start) - && (this.end == otherRange.end); - } - - @Override - public int hashCode() { - return this.start ^ this.end; - } - - @Override - public Range clone() { - try { - return (Range) super.clone(); - } catch (CloneNotSupportedException ex) { - throw new InternalError(); - } - } - - @Override - public String toString() { - return "[" + this.start + ", " + this.end + ']'; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java deleted file mode 100644 index 16ff4584d5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.Serializable; -import java.util.Comparator; - -/** - * This comparator will reverse the order of the specified comparator. - * If the comparator is null, the natural ordering of the objects will be used. - */ -public class ReverseComparator> - implements Comparator, Serializable -{ - private final Comparator comparator; - - public ReverseComparator() { - this(null); - } - - public ReverseComparator(Comparator comparator) { - super(); - this.comparator = comparator; - } - - @SuppressWarnings("unchecked") - public int compare(E e1, E e2) { - return (this.comparator == null) ? - e2.compareTo(e1) - : - this.comparator.compare(e2, e1); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java deleted file mode 100644 index c42674eada..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.Serializable; - -/** - * Simple, abstract implementation of Filter - * that holds on to a criterion object that can be used in the - * accept(Object) or reject(Object) - * methods. Subclasses can override either of these methods, - * depending on which is easier to implement. Note that at least - * one of these methods must be overridden or - * an infinite loop will occur. If both of them are overridden, - * only the accept(Object) method will be used. - *

    - * Simplifies the implementation of straightforward inner classes. - * Here is an example of a filter that can be used by a - * FilteringIterator to return only those strings - * in the nested iterator start with "prefix": - *

    - *	Filter filter = new SimpleFilter("prefix") {
    - *		public boolean accept(String o) {
    - *			return o.startsWith((String) criterion);
    - *		}
    - *	};
    - * 
    - */ -public abstract class SimpleFilter - implements Filter, Cloneable, Serializable -{ - protected final S criterion; - - private static final long serialVersionUID = 1L; - - - /** - * More useful constructor. The specified criterion can - * be used by a subclass to "accept" or "reject" objects. - */ - protected SimpleFilter(S criterion) { - super(); - this.criterion = criterion; - } - - /** - * Construct a simple filter with a null criterion - */ - protected SimpleFilter() { - this(null); - } - - /** - * Return whether the the specified object should be "rejected". - * The semantics of "rejected" is determined by the client. - */ - protected boolean reject(T o) { - return ! this.accept(o); - } - - /** - * Return whether the the specified object should be "accepted". - * The semantics of "accepted" is determined by the client. - */ - public boolean accept(T o) { - return ! this.reject(o); - } - - @Override - @SuppressWarnings("unchecked") - public SimpleFilter clone() { - try { - return (SimpleFilter) super.clone(); - } catch (CloneNotSupportedException ex) { - throw new InternalError(); - } - } - - @Override - public boolean equals(Object o) { - if ( ! (o instanceof SimpleFilter)) { - return false; - } - SimpleFilter other = (SimpleFilter) o; - return (this.criterion == null) ? - (other.criterion == null) : this.criterion.equals(other.criterion); - } - - @Override - public int hashCode() { - return (this.criterion == null) ? 0 : this.criterion.hashCode(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.criterion); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java deleted file mode 100644 index 5d17b69a15..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java +++ /dev/null @@ -1,2101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.IOException; -import java.io.Writer; -import java.util.Arrays; -import java.util.Iterator; - -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -/** - * Convenience methods related to the java.lang.String class. - */ -public final class StringTools { - - /** carriage return */ - public static final String CR = System.getProperty("line.separator"); - - /** double quote */ - public static final char QUOTE = '"'; - - - - // ********** padding/truncating ********** - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#pad(int) - */ - public static String pad(String string, int length) { - return pad(string, length, ' '); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOn(int, Writer) - */ - public static void padOn(String string, int length, Writer writer) { - padOn(string, length, ' ', writer); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOn(int, StringBuffer) - */ - public static void padOn(String string, int length, StringBuffer sb) { - padOn(string, length, ' ', sb); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#pad(int, char) - */ - public static String pad(String string, int length, char c) { - int stringLength = string.length(); - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - return string; - } - return padInternal(string, length, c); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOn(int, char, Writer) - */ - public static void padOn(String string, int length, char c, Writer writer) { - padOn(string.toCharArray(), length, c, writer); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOn(int, char, StringBuffer) - */ - public static void padOn(String string, int length, char c, StringBuffer sb) { - padOn(string.toCharArray(), length, c, sb); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#pad(int) - */ - public static char[] pad(char[] string, int length) { - return pad(string, length, ' '); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOn(int, writer) - */ - public static void padOn(char[] string, int length, Writer writer) { - padOn(string, length, ' ', writer); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOn(int, StringBuffer) - */ - public static void padOn(char[] string, int length, StringBuffer sb) { - padOn(string, length, ' ', sb); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#pad(int, char) - */ - public static char[] pad(char[] string, int length, char c) { - int stringLength = string.length; - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - return string; - } - return padInternal(string, length, c); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOn(int, char, Writer) - */ - public static void padOn(char[] string, int length, char c, Writer writer) { - int stringLength = string.length; - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - writeStringOn(string, writer); - } else { - padOnInternal(string, length, c, writer); - } - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOn(int, char, StringBuffer) - */ - public static void padOn(char[] string, int length, char c, StringBuffer sb) { - int stringLength = string.length; - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - sb.append(string); - } else { - padOnInternal(string, length, c, sb); - } - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOrTruncate(int) - */ - public static String padOrTruncate(String string, int length) { - return padOrTruncate(string, length, ' '); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOrTruncateOn(int, Writer) - */ - public static void padOrTruncateOn(String string, int length, Writer writer) { - padOrTruncateOn(string, length, ' ', writer); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOrTruncateOn(int, StringBuffer) - */ - public static void padOrTruncateOn(String string, int length, StringBuffer sb) { - padOrTruncateOn(string, length, ' ', sb); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOrTruncate(int, char) - */ - public static String padOrTruncate(String string, int length, char c) { - int stringLength = string.length(); - if (stringLength == length) { - return string; - } - if (stringLength > length) { - return string.substring(0, length); - } - return padInternal(string, length, c); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOrTruncateOn(int, char, Writer) - */ - public static void padOrTruncateOn(String string, int length, char c, Writer writer) { - padOrTruncateOn(string.toCharArray(), length, c, writer); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOrTruncateOn(int, char, StringBuffer) - */ - public static void padOrTruncateOn(String string, int length, char c, StringBuffer sb) { - padOrTruncateOn(string.toCharArray(), length, c, sb); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOrTruncate(int) - */ - public static char[] padOrTruncate(char[] string, int length) { - return padOrTruncate(string, length, ' '); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOrTruncateOn(int, Writer) - */ - public static void padOrTruncateOn(char[] string, int length, Writer writer) { - padOrTruncateOn(string, length, ' ', writer); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with spaces at the end. - * String#padOrTruncateOn(int, StringBuffer) - */ - public static void padOrTruncate(char[] string, int length, StringBuffer sb) { - padOrTruncateOn(string, length, ' ', sb); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOrTruncate(int, char) - */ - public static char[] padOrTruncate(char[] string, int length, char c) { - int stringLength = string.length; - if (stringLength == length) { - return string; - } - if (stringLength > length) { - char[] result = new char[length]; - System.arraycopy(string, 0, result, 0, length); - return result; - } - return padInternal(string, length, c); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOrTruncateOn(int, char, Writer) - */ - public static void padOrTruncateOn(char[] string, int length, char c, Writer writer) { - int stringLength = string.length; - if (stringLength == length) { - writeStringOn(string, writer); - } else if (stringLength > length) { - writeStringOn(string, 0, length, writer); - } else { - padOnInternal(string, length, c, writer); - } - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, it is truncated. - * If it is shorter than the specified length, it is padded with the - * specified character at the end. - * String#padOrTruncateOn(int, char, StringBuffer) - */ - public static void padOrTruncateOn(char[] string, int length, char c, StringBuffer sb) { - int stringLength = string.length; - if (stringLength == length) { - sb.append(string); - } else if (stringLength > length) { - sb.append(string, 0, length); - } else { - padOnInternal(string, length, c, sb); - } - } - - /** - * Pad the specified string without validating the parms. - */ - private static String padInternal(String string, int length, char c) { - return new String(padInternal(string.toCharArray(), length, c)); - } - - /** - * Pad the specified string without validating the parms. - */ - private static char[] padInternal(char[] string, int length, char c) { - char[] result = new char[length]; - int stringLength = string.length; - System.arraycopy(string, 0, result, 0, stringLength); - Arrays.fill(result, stringLength, length, c); - return result; - } - - /** - * Pad the specified string without validating the parms. - */ - private static void padOnInternal(char[] string, int length, char c, Writer writer) { - writeStringOn(string, writer); - writeStringOn(CollectionTools.fill(new char[length - string.length], c), writer); - } - - /** - * Pad the specified string without validating the parms. - */ - private static void padOnInternal(char[] string, int length, char c, StringBuffer sb) { - sb.append(string); - sb.append(CollectionTools.fill(new char[length - string.length], c)); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPad(int) - */ - public static String zeroPad(String string, int length) { - return frontPad(string, length, '0'); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOn(int, Writer) - */ - public static void zeroPadOn(String string, int length, Writer writer) { - frontPadOn(string, length, '0', writer); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOn(int, StringBuffer) - */ - public static void zeroPadOn(String string, int length, StringBuffer sb) { - frontPadOn(string, length, '0', sb); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPad(int, char) - */ - public static String frontPad(String string, int length, char c) { - int stringLength = string.length(); - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - return string; - } - return frontPadInternal(string, length, c); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOn(int, char, Writer) - */ - public static void frontPadOn(String string, int length, char c, Writer writer) { - frontPadOn(string.toCharArray(), length, c, writer); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOn(int, char, StringBuffer) - */ - public static void frontPadOn(String string, int length, char c, StringBuffer sb) { - frontPadOn(string.toCharArray(), length, c, sb); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPad(int) - */ - public static char[] zeroPad(char[] string, int length) { - return frontPad(string, length, '0'); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOn(int, Writer) - */ - public static void zeroPadOn(char[] string, int length, Writer writer) { - frontPadOn(string, length, '0', writer); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOn(int, StringBuffer) - */ - public static void zeroPadOn(char[] string, int length, StringBuffer sb) { - frontPadOn(string, length, '0', sb); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPad(int, char) - */ - public static char[] frontPad(char[] string, int length, char c) { - int stringLength = string.length; - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - return string; - } - return frontPadInternal(string, length, c); - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOn(int, char, Writer) - */ - public static void frontPadOn(char[] string, int length, char c, Writer writer) { - int stringLength = string.length; - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - writeStringOn(string, writer); - } else { - frontPadOnInternal(string, length, c, writer); - } - } - - /** - * Pad the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, an IllegalArgumentException is thrown. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOn(int, char, StringBuffer) - */ - public static void frontPadOn(char[] string, int length, char c, StringBuffer sb) { - int stringLength = string.length; - if (stringLength > length) { - throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); - } - if (stringLength == length) { - sb.append(string); - } else { - frontPadOnInternal(string, length, c, sb); - } - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOrTruncate(int) - */ - public static String zeroPadOrTruncate(String string, int length) { - return frontPadOrTruncate(string, length, '0'); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOrTruncateOn(int, Writer) - */ - public static void zeroPadOrTruncateOn(String string, int length, Writer writer) { - frontPadOrTruncateOn(string, length, '0', writer); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOrTruncateOn(int, StringBuffer) - */ - public static void zeroPadOrTruncateOn(String string, int length, StringBuffer sb) { - frontPadOrTruncateOn(string, length, '0', sb); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOrTruncate(int, char) - */ - public static String frontPadOrTruncate(String string, int length, char c) { - int stringLength = string.length(); - if (stringLength == length) { - return string; - } - if (stringLength > length) { - return string.substring(stringLength - length); - } - return frontPadInternal(string, length, c); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOrTruncateOn(int, char, Writer) - */ - public static void frontPadOrTruncateOn(String string, int length, char c, Writer writer) { - frontPadOrTruncateOn(string.toCharArray(), length, c, writer); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOrTruncateOn(int, char, StringBuffer) - */ - public static void frontPadOrTruncateOn(String string, int length, char c, StringBuffer sb) { - frontPadOrTruncateOn(string.toCharArray(), length, c, sb); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOrTruncate(int) - */ - public static char[] zeroPadOrTruncate(char[] string, int length) { - return frontPadOrTruncate(string, length, '0'); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOrTruncateOn(int, Writer) - */ - public static void zeroPadOrTruncateOn(char[] string, int length, Writer writer) { - frontPadOrTruncateOn(string, length, '0', writer); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with zeros at the front. - * String#zeroPadOrTruncateOn(int, StringBuffer) - */ - public static void zeroPadOrTruncateOn(char[] string, int length, StringBuffer sb) { - frontPadOrTruncateOn(string, length, '0', sb); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOrTruncate(int, char) - */ - public static char[] frontPadOrTruncate(char[] string, int length, char c) { - int stringLength = string.length; - if (stringLength == length) { - return string; - } - if (stringLength > length) { - char[] result = new char[length]; - System.arraycopy(string, stringLength - length, result, 0, length); - return result; - } - return frontPadInternal(string, length, c); - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOrTruncateOn(int, char, Writer) - */ - public static void frontPadOrTruncateOn(char[] string, int length, char c, Writer writer) { - int stringLength = string.length; - if (stringLength == length) { - writeStringOn(string, writer); - } else if (stringLength > length) { - writeStringOn(string, stringLength - length, length, writer); - } else { - frontPadOnInternal(string, length, c, writer); - } - } - - /** - * Pad or truncate the specified string to the specified length. - * If the string is already the specified length, it is returned unchanged. - * If it is longer than the specified length, only the last part of the string is returned. - * If it is shorter than the specified length, it is padded with the - * specified character at the front. - * String#frontPadOrTruncateOn(int, char, StringBuffer) - */ - public static void frontPadOrTruncateOn(char[] string, int length, char c, StringBuffer sb) { - int stringLength = string.length; - if (stringLength == length) { - sb.append(string); - } else if (stringLength > length) { - sb.append(string, stringLength - length, length); - } else { - frontPadOnInternal(string, length, c, sb); - } - } - - /** - * Front-pad the specified string without validating the parms. - */ - private static String frontPadInternal(String string, int length, char c) { - return new String(frontPadInternal(string.toCharArray(), length, c)); - } - - /** - * Zero-pad the specified string without validating the parms. - */ - private static char[] frontPadInternal(char[] string, int length, char c) { - char[] result = new char[length]; - int stringLength = string.length; - int padLength = length - stringLength; - System.arraycopy(string, 0, result, padLength, stringLength); - Arrays.fill(result, 0, padLength, c); - return result; - } - - /** - * Pad the specified string without validating the parms. - */ - private static void frontPadOnInternal(char[] string, int length, char c, Writer writer) { - writeStringOn(CollectionTools.fill(new char[length - string.length], c), writer); - writeStringOn(string, writer); - } - - /** - * Pad the specified string without validating the parms. - */ - private static void frontPadOnInternal(char[] string, int length, char c, StringBuffer sb) { - sb.append(CollectionTools.fill(new char[length - string.length], c)); - sb.append(string); - } - - - // ********** wrapping/quoting ********** - - /** - * Wrap the specified string with double quotes. - */ - public static String quote(String string) { - return wrap(string, QUOTE); - } - - /** - * Wrap the specified string with double quotes. - */ - public static void quoteOn(String string, Writer writer) { - wrapOn(string, QUOTE, writer); - } - - /** - * Wrap the specified string with double quotes. - */ - public static void quoteOn(String string, StringBuffer sb) { - wrapOn(string, QUOTE, sb); - } - - /** - * Wrap each of the specified strings with double quotes. - */ - public static Iterator quote(Iterator strings) { - return new TransformationIterator(strings) { - @Override - protected String transform(String string) { - return StringTools.quote(string); - } - }; - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static String wrap(String string, char wrap) { - return new String(wrap(string.toCharArray(), wrap)); - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(String string, char wrap, Writer writer) { - wrapOn(string.toCharArray(), wrap, writer); - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(String string, char wrap, StringBuffer sb) { - wrapOn(string.toCharArray(), wrap, sb); - } - - /** - * Wrap each of the specified strings with the specified wrap; i.e. put a - * copy of the wrap at the front and back of the resulting string. - */ - public static Iterator wrap(Iterator strings, final char wrap) { - return new TransformationIterator(strings) { - @Override - protected String transform(String string) { - return StringTools.wrap(string, wrap); - } - }; - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static String wrap(String string, String wrap) { - return new String(wrap(string.toCharArray(), wrap.toCharArray())); - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(String string, String wrap, Writer writer) { - wrapOn(string.toCharArray(), wrap.toCharArray(), writer); - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(String string, String wrap, StringBuffer sb) { - wrapOn(string.toCharArray(), wrap.toCharArray(), sb); - } - - /** - * Wrap each of the specified strings with the specified wrap; i.e. put a - * copy of the wrap at the front and back of the resulting string. - */ - public static Iterator wrap(Iterator strings, final String wrap) { - return new TransformationIterator(strings) { - @Override - protected String transform(String string) { - return StringTools.wrap(string, wrap); - } - }; - } - - /** - * Wrap the specified string with double quotes. - */ - public static char[] quote(char[] string) { - return wrap(string, QUOTE); - } - - /** - * Wrap the specified string with double quotes. - */ - public static void quoteOn(char[] string, Writer writer) { - wrapOn(string, QUOTE, writer); - } - - /** - * Wrap the specified string with double quotes. - */ - public static void quoteOn(char[] string, StringBuffer sb) { - wrapOn(string, QUOTE, sb); - } - - /** - * Wrap each of the specified strings with double quotes. - */ - public static Iterator quoteCharArrays(Iterator strings) { - return new TransformationIterator(strings) { - @Override - protected char[] transform(char[] string) { - return StringTools.quote(string); - } - }; - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static char[] wrap(char[] string, char wrap) { - int len = string.length; - char[] result = new char[len+2]; - result[0] = wrap; - System.arraycopy(string, 0, result, 1, len); - result[len+1] = wrap; - return result; - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(char[] string, char wrap, Writer writer) { - writeCharOn(wrap, writer); - writeStringOn(string, writer); - writeCharOn(wrap, writer); - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(char[] string, char wrap, StringBuffer sb) { - sb.append(wrap); - sb.append(string); - sb.append(wrap); - } - - /** - * Wrap each of the specified strings with the specified wrap; i.e. put a - * copy of the wrap at the front and back of the resulting string. - */ - public static Iterator wrapCharArrays(Iterator strings, final char wrap) { - return new TransformationIterator(strings) { - @Override - protected char[] transform(char[] string) { - return StringTools.wrap(string, wrap); - } - }; - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static char[] wrap(char[] string, char[] wrap) { - int stringLength = string.length; - int wrapLength = wrap.length; - char[] result = new char[stringLength+(2*wrapLength)]; - System.arraycopy(wrap, 0, result, 0, wrapLength); - System.arraycopy(string, 0, result, wrapLength, stringLength); - System.arraycopy(wrap, 0, result, stringLength+wrapLength, wrapLength); - return result; - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(char[] string, char[] wrap, Writer writer) { - writeStringOn(wrap, writer); - writeStringOn(string, writer); - writeStringOn(wrap, writer); - } - - /** - * Wrap the specified string with the specified wrap; i.e. put a copy of - * the wrap at the front and back of the resulting string. - */ - public static void wrapOn(char[] string, char[] wrap, StringBuffer sb) { - sb.append(wrap); - sb.append(string); - sb.append(wrap); - } - - /** - * Wrap each of the specified strings with the specified wrap; i.e. put a - * copy of the wrap at the front and back of the resulting string. - */ - public static Iterator wrapCharArrays(Iterator strings, final char[] wrap) { - return new TransformationIterator(strings) { - @Override - protected char[] transform(char[] string) { - return StringTools.wrap(string, wrap); - } - }; - } - - - // ********** removing characters ********** - - /** - * Remove the first occurrence of the specified character - * from the specified string and return the result. - * String#removeFirstOccurrence(char) - */ - public static String removeFirstOccurrence(String string, char c) { - int index = string.indexOf(c); - if (index == -1) { - // character not found - return string; - } - if (index == 0) { - // character found at the front of string - return string.substring(1); - } - int last = string.length() - 1; - if (index == last) { - // character found at the end of string - return string.substring(0, last); - } - // character found somewhere in the middle of the string - return string.substring(0, index).concat(string.substring(index + 1)); - } - - /** - * Remove the first occurrence of the specified character - * from the specified string and print the result on the specified stream. - * String#removeFirstOccurrenceOn(char, Writer) - */ - public static void removeFirstOccurrenceOn(String string, char c, Writer writer) { - removeFirstOccurrenceOn(string.toCharArray(), c, writer); - } - - /** - * Remove the first occurrence of the specified character - * from the specified string and print the result on the specified stream. - * String#removeFirstOccurrenceOn(char, StringBuffer) - */ - public static void removeFirstOccurrenceOn(String string, char c, StringBuffer sb) { - removeFirstOccurrenceOn(string.toCharArray(), c, sb); - } - - /** - * Remove the first occurrence of the specified character - * from the specified string and return the result. - * String#removeFirstOccurrence(char) - */ - public static char[] removeFirstOccurrence(char[] string, char c) { - int index = CollectionTools.indexOf(string, c); - if (index == -1) { - // character not found - return string; - } - - int len = string.length - 1; - char[] result = new char[len]; - if (index == 0) { - // character found at the front of string - System.arraycopy(string, 1, result, 0, len); - } else if (index == len) { - // character found at the end of string - System.arraycopy(string, 0, result, 0, len); - } else { - // character found somewhere in the middle of the string - System.arraycopy(string, 0, result, 0, index); - System.arraycopy(string, index + 1, result, index, len - index); - } - return result; - } - - /** - * Remove the first occurrence of the specified character - * from the specified string and print the result on the specified stream. - * String#removeFirstOccurrenceOn(char, Writer) - */ - public static void removeFirstOccurrenceOn(char[] string, char c, Writer writer) { - int index = CollectionTools.indexOf(string, c); - if (index == -1) { - // character not found - writeStringOn(string, writer); - return; - } - - int len = string.length - 1; - if (index == 0) { - // character found at the front of string - writeStringOn(string, 1, len, writer); - } else if (index == len) { - // character found at the end of string - writeStringOn(string, 0, len, writer); - } else { - // character found somewhere in the middle of the string - writeStringOn(string, 0, index, writer); - writeStringOn(string, index + 1, len - index, writer); - } - } - - /** - * Remove the first occurrence of the specified character - * from the specified string and print the result on the specified stream. - * String#removeFirstOccurrenceOn(char, StringBuffer) - */ - public static void removeFirstOccurrenceOn(char[] string, char c, StringBuffer sb) { - int index = CollectionTools.indexOf(string, c); - if (index == -1) { - // character not found - sb.append(string); - return; - } - - int len = string.length - 1; - if (index == 0) { - // character found at the front of string - sb.append(string, 1, len); - } else if (index == len) { - // character found at the end of string - sb.append(string, 0, len); - } else { - // character found somewhere in the middle of the string - sb.append(string, 0, index); - sb.append(string, index + 1, len - index); - } - } - - /** - * Remove all occurrences of the specified character - * from the specified string and return the result. - * String#removeAllOccurrences(char) - */ - public static String removeAllOccurrences(String string, char c) { - return new String(removeAllOccurrences(string.toCharArray(), c)); - } - - /** - * Remove all occurrences of the specified character - * from the specified string and write the result to the specified stream. - * String#removeAllOccurrencesOn(char, Writer) - */ - public static void removeAllOccurrencesOn(String string, char c, Writer writer) { - removeAllOccurrencesOn(string.toCharArray(), c, writer); - } - - /** - * Remove all occurrences of the specified character - * from the specified string and write the result to the specified stream. - * String#removeAllOccurrencesOn(char, StringBuffer) - */ - public static void removeAllOccurrencesOn(String string, char c, StringBuffer sb) { - removeAllOccurrencesOn(string.toCharArray(), c, sb); - } - - /** - * Remove all occurrences of the specified character - * from the specified string and return the result. - * String#removeAllOccurrences(char) - */ - public static char[] removeAllOccurrences(char[] string, char c) { - StringBuffer sb = new StringBuffer(string.length); - removeAllOccurrencesOn(string, c, sb); - int len = sb.length(); - char[] result = new char[len]; - sb.getChars(0, len, result, 0); - return result; - } - - /** - * Remove all occurrences of the specified character - * from the specified string and write the result to the - * specified writer. - * String#removeAllOccurrencesOn(char, Writer) - */ - public static void removeAllOccurrencesOn(char[] string, char c, Writer writer) { - removeAllOccurrencesOnInternal(string, c, writer); - } - - private static void removeAllOccurrencesOnInternal(char[] string, char c, Writer writer) { - for (char d : string) { - if (d != c) { - writeCharOn(d, writer); - } - } - } - - /** - * Remove all occurrences of the specified character - * from the specified string and append the result to the - * specified string buffer. - * String#removeAllOccurrencesOn(char, StringBuffer) - */ - public static void removeAllOccurrencesOn(char[] string, char c, StringBuffer sb) { - for (char d : string) { - if (d != c) { - sb.append(d); - } - } - } - - /** - * Remove all the spaces from the specified string and return the result. - * String#removeAllSpaces() - */ - public static String removeAllSpaces(String string) { - return removeAllOccurrences(string, ' '); - } - - - // ********** common prefix ********** - - /** - * Return the length of the common prefix shared by the specified strings. - * String#commonPrefixLength(String) - */ - public static int commonPrefixLength(String s1, String s2) { - return commonPrefixLength(s1.toCharArray(), s2.toCharArray()); - } - - /** - * Return the length of the common prefix shared by the specified strings. - */ - public static int commonPrefixLength(char[] s1, char[] s2) { - return commonPrefixLengthInternal(s1, s2, Math.min(s1.length, s2.length)); - } - - /** - * Return the length of the common prefix shared by the specified strings; - * but limit the length to the specified maximum. - * String#commonPrefixLength(String, int) - */ - public static int commonPrefixLength(String s1, String s2, int max) { - return commonPrefixLength(s1.toCharArray(), s2.toCharArray(), max); - } - - /** - * Return the length of the common prefix shared by the specified strings; - * but limit the length to the specified maximum. - */ - public static int commonPrefixLength(char[] s1, char[] s2, int max) { - return commonPrefixLengthInternal(s1, s2, Math.min(max, Math.min(s1.length, s2.length))); - } - - /** - * Return the length of the common prefix shared by the specified strings; - * but limit the length to the specified maximum. Assume the specified - * maximum is less than the lengths of the specified strings. - */ - private static int commonPrefixLengthInternal(char[] s1, char[] s2, int max) { - for (int i = 0; i < max; i++) { - if (s1[i] != s2[i]) { - return i; - } - } - return max; // all the characters up to 'max' are the same - } - - - // ********** capitalization ********** - - /** - * no zero-length check or lower case check - */ - private static char[] capitalizeInternal(char[] string) { - string[0] = Character.toUpperCase(string[0]); - return string; - } - - /** - * Modify and return the specified string with - * its first letter capitalized. - */ - public static char[] capitalize(char[] string) { - if ((string.length == 0) || Character.isUpperCase(string[0])) { - return string; - } - return capitalizeInternal(string); - } - - /** - * Return the specified string with its first letter capitalized. - * String#capitalize() - */ - public static String capitalize(String string) { - if ((string.length() == 0) || Character.isUpperCase(string.charAt(0))) { - return string; - } - return new String(capitalizeInternal(string.toCharArray())); - } - - /** - * no zero-length check or upper case check - */ - private static void capitalizeOnInternal(char[] string, StringBuffer sb) { - sb.append(Character.toUpperCase(string[0])); - sb.append(string, 1, string.length - 1); - } - - /** - * Append the specified string to the specified string buffer - * with its first letter capitalized. - */ - public static void capitalizeOn(char[] string, StringBuffer sb) { - if (string.length == 0) { - return; - } - if (Character.isUpperCase(string[0])) { - sb.append(string); - } else { - capitalizeOnInternal(string, sb); - } - } - - /** - * Append the specified string to the specified string buffer - * with its first letter capitalized. - * String#capitalizeOn(StringBuffer) - */ - public static void capitalizeOn(String string, StringBuffer sb) { - if (string.length() == 0) { - return; - } - if (Character.isUpperCase(string.charAt(0))) { - sb.append(string); - } else { - capitalizeOnInternal(string.toCharArray(), sb); - } - } - - /** - * no zero-length check or upper case check - */ - private static void capitalizeOnInternal(char[] string, Writer writer) { - writeCharOn(Character.toUpperCase(string[0]), writer); - writeStringOn(string, 1, string.length - 1, writer); - } - - /** - * Append the specified string to the specified string buffer - * with its first letter capitalized. - */ - public static void capitalizeOn(char[] string, Writer writer) { - if (string.length == 0) { - return; - } - if (Character.isUpperCase(string[0])) { - writeStringOn(string, writer); - } else { - capitalizeOnInternal(string, writer); - } - } - - /** - * Append the specified string to the specified string buffer - * with its first letter capitalized. - * String#capitalizeOn(Writer) - */ - public static void capitalizeOn(String string, Writer writer) { - if (string.length() == 0) { - return; - } - if (Character.isUpperCase(string.charAt(0))) { - writeStringOn(string, writer); - } else { - capitalizeOnInternal(string.toCharArray(), writer); - } - } - - /** - * no zero-length check or lower case check - */ - private static char[] uncapitalizeInternal(char[] string) { - string[0] = Character.toLowerCase(string[0]); - return string; - } - - private static boolean stringNeedNotBeUncapitalized(char[] string) { - if (string.length == 0) { - return true; - } - if (Character.isLowerCase(string[0])) { - return true; - } - // if both the first and second characters are capitalized, - // return the string unchanged - if ((string.length > 1) - && Character.isUpperCase(string[1]) - && Character.isUpperCase(string[0])){ - return true; - } - return false; - } - - /** - * Modify and return the specified string with its - * first letter converted to lower case. - * (Unless both the first and second letters are upper case, - * in which case the string is returned unchanged.) - */ - public static char[] uncapitalize(char[] string) { - if (stringNeedNotBeUncapitalized(string)) { - return string; - } - return uncapitalizeInternal(string); - } - - private static boolean stringNeedNotBeUncapitalized(String string) { - if (string.length() == 0) { - return true; - } - if (Character.isLowerCase(string.charAt(0))) { - return true; - } - // if both the first and second characters are capitalized, - // return the string unchanged - if ((string.length() > 1) - && Character.isUpperCase(string.charAt(1)) - && Character.isUpperCase(string.charAt(0))){ - return true; - } - return false; - } - - /** - * Return the specified string with its first letter converted to lower case. - * (Unless both the first and second letters are upper case, - * in which case the string is returned unchanged.) - * String#uncapitalize() - */ - public static String uncapitalize(String string) { - if (stringNeedNotBeUncapitalized(string)) { - return string; - } - return new String(uncapitalizeInternal(string.toCharArray())); - } - - /** - * no zero-length check or lower case check - */ - private static void uncapitalizeOnInternal(char[] string, StringBuffer sb) { - sb.append(Character.toLowerCase(string[0])); - sb.append(string, 1, string.length - 1); - } - - /** - * Append the specified string to the specified string buffer - * with its first letter converted to lower case. - * (Unless both the first and second letters are upper case, - * in which case the string is returned unchanged.) - */ - public static void uncapitalizeOn(char[] string, StringBuffer sb) { - if (stringNeedNotBeUncapitalized(string)) { - sb.append(string); - } else { - uncapitalizeOnInternal(string, sb); - } - } - - /** - * Append the specified string to the specified string buffer - * with its first letter converted to lower case. - * (Unless both the first and second letters are upper case, - * in which case the string is returned unchanged.) - * String#uncapitalizeOn(StringBuffer) - */ - public static void uncapitalizeOn(String string, StringBuffer sb) { - if (stringNeedNotBeUncapitalized(string)) { - sb.append(string); - } else { - uncapitalizeOnInternal(string.toCharArray(), sb); - } - } - - /** - * no zero-length check or upper case check - */ - private static void uncapitalizeOnInternal(char[] string, Writer writer) { - writeCharOn(Character.toLowerCase(string[0]), writer); - writeStringOn(string, 1, string.length - 1, writer); - } - - /** - * Append the specified string to the specified string buffer - * with its first letter converted to lower case. - * (Unless both the first and second letters are upper case, - * in which case the string is returned unchanged.) - */ - public static void uncapitalizeOn(char[] string, Writer writer) { - if (stringNeedNotBeUncapitalized(string)) { - writeStringOn(string, writer); - } else { - uncapitalizeOnInternal(string, writer); - } - } - - /** - * Append the specified string to the specified string buffer - * with its first letter converted to lower case. - * (Unless both the first and second letters are upper case, - * in which case the string is returned unchanged.) - * String#uncapitalizeOn(Writer) - */ - public static void uncapitalizeOn(String string, Writer writer) { - if (stringNeedNotBeUncapitalized(string)) { - writeStringOn(string, writer); - } else { - uncapitalizeOnInternal(string.toCharArray(), writer); - } - } - - - // ********** #toString() helper methods ********** - - /** - * Build a "standard" #toString() result for the specified object - * and additional information: - * ClassName[00F3EE42] (add'l info) - */ - public static String buildToStringFor(Object o, Object additionalInfo) { - StringBuffer sb = new StringBuffer(); - buildSimpleToStringOn(o, sb); - sb.append(" ("); - sb.append(additionalInfo); - sb.append(')'); - return sb.toString(); - } - - /** - * Build a "standard" simple #toString() result for the specified object: - * ClassName[00F3EE42] - */ - public static String buildToStringFor(Object o) { - StringBuffer sb = new StringBuffer(); - buildSimpleToStringOn(o, sb); - return sb.toString(); - } - - /** - * Append a "standard" simple #toString() for the specified object to - * the specified string buffer: - * ClassName[00F3EE42] - */ - public static void buildSimpleToStringOn(Object o, StringBuffer sb) { - sb.append(ClassTools.toStringClassNameForObject(o)); - sb.append('['); - // use System#identityHashCode(Object), since Object#hashCode() may be overridden - sb.append(zeroPad(Integer.toHexString(System.identityHashCode(o)).toUpperCase(), 8)); - sb.append(']'); - } - - - // ********** queries ********** - - /** - * Return whether the specified string is null, empty, or contains - * only whitespace characters. - */ - public static boolean stringIsEmpty(String string) { - if ((string == null) || (string.length() == 0)) { - return true; - } - return stringIsEmptyInternal(string.toCharArray()); - } - - /** - * Return whether the specified string is null, empty, or contains - * only whitespace characters. - */ - public static boolean stringIsEmpty(char[] string) { - if ((string == null) || (string.length == 0)) { - return true; - } - return stringIsEmptyInternal(string); - } - - private static boolean stringIsEmptyInternal(char[] s) { - for (int i = s.length; i-- > 0; ) { - if ( ! Character.isWhitespace(s[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified strings are equal, ignoring case. - * Check for nulls. - */ - public static boolean stringsAreEqualIgnoreCase(String s1, String s2) { - if ((s1 == null) && (s2 == null)) { - return true; // both are null - } - if ((s1 == null) || (s2 == null)) { - return false; // one is null but the other is not - } - return s1.equalsIgnoreCase(s2); - } - - /** - * Return whether the specified strings are equal, ignoring case. - * Check for nulls. - */ - public static boolean stringsAreEqualIgnoreCase(char[] s1, char[] s2) { - if ((s1 == null) && (s2 == null)) { - return true; // both are null - } - if ((s1 == null) || (s2 == null)) { - return false; // one is null but the other is not - } - if (s1.length != s2.length) { - return false; - } - for (int i = s1.length; i-- > 0; ) { - if ( ! charactersAreEqualIgnoreCase(s1[i], s2[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified string starts with the specified prefix, - * ignoring case. - */ - public static boolean stringStartsWithIgnoreCase(char[] string, char[] prefix) { - if (string.length < prefix.length) { - return false; - } - for (int i = prefix.length; i-- > 0; ) { - if ( ! charactersAreEqualIgnoreCase(string[i], prefix[i])) { - return false; - } - } - return true; - } - - /** - * Return whether the specified string starts with the specified prefix, - * ignoring case. - */ - public static boolean stringStartsWithIgnoreCase(String string, String prefix) { - return string.regionMatches(true, 0, prefix, 0, prefix.length()); - } - - /** - * Return whether the specified characters are are equal, ignoring case. - * @see java.lang.String#regionMatches(boolean, int, String, int, int) - */ - public static boolean charactersAreEqualIgnoreCase(char c1, char c2) { - // something about the Georgian alphabet requires us to check lower case also - return (c1 == c2) - || (Character.toUpperCase(c1) == Character.toUpperCase(c2)) - || (Character.toLowerCase(c1) == Character.toLowerCase(c2)); - } - - // ********** conversions ********** - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - */ - public static String convertCamelCaseToAllCaps(String camelCaseString) { - return new String(convertCamelCaseToAllCaps(camelCaseString.toCharArray())); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - */ - public static char[] convertCamelCaseToAllCaps(char[] camelCaseString) { - int len = camelCaseString.length; - if (len == 0) { - return camelCaseString; - } - StringBuffer sb = new StringBuffer(len * 2); - convertCamelCaseToAllCapsOnInternal(camelCaseString, len, sb); - return convertToCharArray(sb); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - */ - public static void convertCamelCaseToAllCapsOn(String camelCaseString, StringBuffer sb) { - convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), sb); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - */ - public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, StringBuffer sb) { - int len = camelCaseString.length; - if (len != 0) { - convertCamelCaseToAllCapsOnInternal(camelCaseString, len, sb); - } - } - - private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int len, StringBuffer sb) { - char prev = 0; // assume 0 is not a valid char - char c = 0; - char next = camelCaseString[0]; - for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len! - c = next; - next = ((i == len) ? 0 : camelCaseString[i]); - if (camelCaseWordBreak(prev, c, next)) { - sb.append('_'); - } - sb.append(Character.toUpperCase(c)); - prev = c; - } - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - */ - public static void convertCamelCaseToAllCapsOn(String camelCaseString, Writer writer) { - convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), writer); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - */ - public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, Writer writer) { - int len = camelCaseString.length; - if (len != 0) { - convertCamelCaseToAllCapsOnInternal(camelCaseString, len, writer); - } - } - - private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int len, Writer writer) { - char prev = 0; // assume 0 is not a valid char - char c = 0; - char next = camelCaseString[0]; - for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len! - c = next; - next = ((i == len) ? 0 : camelCaseString[i]); - if (camelCaseWordBreak(prev, c, next)) { - writeCharOn('_', writer); - } - writeCharOn(Character.toUpperCase(c), writer); - prev = c; - } - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - * Limit the resulting string to the specified maximum length. - */ - public static String convertCamelCaseToAllCaps(String camelCaseString, int maxLength) { - return new String(convertCamelCaseToAllCaps(camelCaseString.toCharArray(), maxLength)); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - * Limit the resulting string to the specified maximum length. - */ - public static char[] convertCamelCaseToAllCaps(char[] camelCaseString, int maxLength) { - int len = camelCaseString.length; - if ((len == 0) || (maxLength == 0)) { - return camelCaseString; - } - StringBuffer sb = new StringBuffer(maxLength); - convertCamelCaseToAllCapsOnInternal(camelCaseString, maxLength, len, sb); - return convertToCharArray(sb); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - * Limit the resulting string to the specified maximum length. - */ - public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, StringBuffer sb) { - convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), maxLength, sb); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - * Limit the resulting string to the specified maximum length. - */ - public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, StringBuffer sb) { - int len = camelCaseString.length; - if ((len != 0) && (maxLength != 0)) { - convertCamelCaseToAllCapsOnInternal(camelCaseString, maxLength, len, sb); - } - } - - private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int maxLength, int len, StringBuffer sb) { - char prev = 0; // assume 0 is not a valid char - char c = 0; - char next = camelCaseString[0]; - for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len! - c = next; - next = ((i == len) ? 0 : camelCaseString[i]); - if (camelCaseWordBreak(prev, c, next)) { - sb.append('_'); - if (sb.length() == maxLength) { - return; - } - } - sb.append(Character.toUpperCase(c)); - if (sb.length() == maxLength) { - return; - } - prev = c; - } - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - * Limit the resulting string to the specified maximum length. - */ - public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, Writer writer) { - convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), maxLength, writer); - } - - /** - * Convert the specified "camel case" string to an "all caps" string: - * "largeProject" -> "LARGE_PROJECT" - * Limit the resulting string to the specified maximum length. - */ - public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, Writer writer) { - int len = camelCaseString.length; - if ((len != 0) && (maxLength != 0)) { - convertCamelCaseToAllCapsOnInternal(camelCaseString, maxLength, len, writer); - } - } - - private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int maxLength, int len, Writer writer) { - char prev = 0; // assume 0 is not a valid char - char c = 0; - char next = camelCaseString[0]; - int writerLength = 0; - for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len! - c = next; - next = ((i == len) ? 0 : camelCaseString[i]); - if (camelCaseWordBreak(prev, c, next)) { - writeCharOn('_', writer); - if (++writerLength == maxLength) { - return; - } - } - writeCharOn(Character.toUpperCase(c), writer); - if (++writerLength == maxLength) { - return; - } - prev = c; - } - } - - /** - * Return whether the specified series of characters occur at - * a "camel case" work break: - * "*aa" -> false - * "*AA" -> false - * "*Aa" -> false - * "AaA" -> false - * "AAA" -> false - * "aa*" -> false - * "AaA" -> false - * "aAa" -> true - * "AA*" -> false - * "AAa" -> true - * where '*' == any char - */ - private static boolean camelCaseWordBreak(char prev, char c, char next) { - if (prev == 0) { // start of string - return false; - } - if (Character.isLowerCase(c)) { - return false; - } - if (Character.isLowerCase(prev)) { - return true; - } - if (next == 0) { // end of string - return false; - } - return Character.isLowerCase(next); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "LargeProject" - * Capitalize the first letter. - */ - public static String convertUnderscoresToCamelCase(String underscoreString) { - return new String(convertUnderscoresToCamelCase(underscoreString.toCharArray())); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "LargeProject" - * Capitalize the first letter. - */ - public static char[] convertUnderscoresToCamelCase(char[] underscoreString) { - return convertUnderscoresToCamelCase(underscoreString, true); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "largeProject" - * Optionally capitalize the first letter. - */ - public static String convertUnderscoresToCamelCase(String underscoreString, boolean capitalizeFirstLetter) { - return new String(convertUnderscoresToCamelCase(underscoreString.toCharArray(), capitalizeFirstLetter)); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "largeProject" - * Optionally capitalize the first letter. - */ - public static char[] convertUnderscoresToCamelCase(char[] underscoreString, boolean capitalizeFirstLetter) { - int len = underscoreString.length; - if (len == 0) { - return underscoreString; - } - StringBuffer sb = new StringBuffer(len); - convertUnderscoresToCamelCaseOnInternal(underscoreString, capitalizeFirstLetter, len, sb); - return convertToCharArray(sb); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "largeProject" - * Optionally capitalize the first letter. - */ - public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, StringBuffer sb) { - convertUnderscoresToCamelCaseOn(underscoreString.toCharArray(), capitalizeFirstLetter, sb); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "largeProject" - * Optionally capitalize the first letter. - */ - public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, StringBuffer sb) { - int len = underscoreString.length; - if (len != 0) { - convertUnderscoresToCamelCaseOnInternal(underscoreString, capitalizeFirstLetter, len, sb); - } - } - - private static void convertUnderscoresToCamelCaseOnInternal(char[] underscoreString, boolean capitalizeFirstLetter, int len, StringBuffer sb) { - char prev = 0; - char c = 0; - boolean first = true; - for (int i = 0; i < len; i++) { - prev = c; - c = underscoreString[i]; - if (c == '_') { - continue; - } - if (first) { - first = false; - if (capitalizeFirstLetter) { - sb.append(Character.toUpperCase(c)); - } else { - sb.append(Character.toLowerCase(c)); - } - } else { - if (prev == '_') { - sb.append(Character.toUpperCase(c)); - } else { - sb.append(Character.toLowerCase(c)); - } - } - } - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "largeProject" - * Optionally capitalize the first letter. - */ - public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, Writer writer) { - convertUnderscoresToCamelCaseOn(underscoreString.toCharArray(), capitalizeFirstLetter, writer); - } - - /** - * Convert the specified "underscore" string to a "camel case" string: - * "LARGE_PROJECT" -> "largeProject" - * Optionally capitalize the first letter. - */ - public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, Writer writer) { - int len = underscoreString.length; - if (len != 0) { - convertUnderscoresToCamelCaseOnInternal(underscoreString, capitalizeFirstLetter, len, writer); - } - } - - private static void convertUnderscoresToCamelCaseOnInternal(char[] underscoreString, boolean capitalizeFirstLetter, int len, Writer writer) { - char prev = 0; - char c = 0; - boolean first = true; - for (int i = 0; i < len; i++) { - prev = c; - c = underscoreString[i]; - if (c == '_') { - continue; - } - if (first) { - first = false; - if (capitalizeFirstLetter) { - writeCharOn(Character.toUpperCase(c), writer); - } else { - writeCharOn(Character.toLowerCase(c), writer); - } - } else { - if (prev == '_') { - writeCharOn(Character.toUpperCase(c), writer); - } else { - writeCharOn(Character.toLowerCase(c), writer); - } - } - } - } - - - // ********** convenience ********** - - public static char[] convertToCharArray(StringBuffer sb) { - int len = sb.length(); - char[] result = new char[len]; - sb.getChars(0, len, result, 0); - return result; - } - - /** - * checked exceptions suck - */ - private static void writeStringOn(char[] string, Writer writer) { - try { - writer.write(string); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - /** - * checked exceptions suck - */ - private static void writeStringOn(char[] string, int off, int len, Writer writer) { - try { - writer.write(string, off, len); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - /** - * checked exceptions suck - */ - private static void writeStringOn(String string, Writer writer) { - try { - writer.write(string); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - /** - * checked exceptions suck - */ - private static void writeCharOn(char c, Writer writer) { - try { - writer.write(c); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private StringTools() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java deleted file mode 100644 index 52c002487a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -/** - * Used by various "pluggable" classes to transform objects. - * Transform an object of type T1 to an object of type T2. - */ -public interface Transformer { - - /** - * Return the transformed object. - * The semantics of "transform" is determined by the - * contract between the client and the server. - */ - T2 transform(T1 o); - - - final class Null implements Transformer { - @SuppressWarnings("unchecked") - public static final Transformer INSTANCE = new Null(); - @SuppressWarnings("unchecked") - public static Transformer instance() { - return INSTANCE; - } - // ensure single instance - private Null() { - super(); - } - // simply return the object, unchanged - @SuppressWarnings("unchecked") - public S2 transform(S1 o) { - return (S2) o; - } - @Override - public String toString() { - return "Transformer.Null"; - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java deleted file mode 100644 index fd637ebfa9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java +++ /dev/null @@ -1,182 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal; - -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; - -/** - * This encoder will replace any of a specified set of characters with an XML - * "character reference": '/' => "/" - */ -public final class XMLStringEncoder { - - /** The set of characters to be converted into XML character references. */ - private final char[] chars; - - /** Cache the value of the highest character in the set above. */ - private final char maxChar; - - - // ********** constructors/initialization ********** - - /** - * Construct an encoder that converts the specified set of characters - * into XML character references. - */ - public XMLStringEncoder(char[] chars) { - super(); - if (chars == null) { - throw new NullPointerException(); - } - // the ampersand must be included since it is the escape character - if (CollectionTools.contains(chars, '&')) { - this.chars = chars; - } else { - this.chars = CollectionTools.add(chars, '&'); - } - this.maxChar = this.calculateMaxInvalidFileNameChar(); - } - - /** - * Calculate the maximum value of the set of characters to be converted - * into XML character references. This will be used to short-circuit the - * search for a character in the set. - * @see #charIsToBeEncoded(char) - */ - private char calculateMaxInvalidFileNameChar() { - char[] localChars = this.chars; - char max = 0; - for (int i = localChars.length; i-- > 0; ) { - char c = localChars[i]; - if (max < c) { - max = c; - } - } - return max; - } - - - // ********** API ********** - - /** - * Return the specified string with any characters in the set - * replaced with XML character references. - */ - public String encode(String s) { - int len = s.length(); - // allow for a few encoded characters - StringBuffer sb = new StringBuffer(len + 20); - for (int i = 0; i < len; i++) { - this.appendCharacterTo(s.charAt(i), sb); - } - return sb.toString(); - } - - /** - * Return the specified string with any XML character references - * replaced by the characters themselves. - */ - public String decode(String s) { - StringBuffer sb = new StringBuffer(s.length()); - StringBuffer temp = new StringBuffer(); // performance tweak - this.decodeTo(new StringReader(s), sb, temp); - return sb.toString(); - } - - - // ********** internal methods ********** - - /** - * Append the specified character to the string buffer, - * converting it to an XML character reference if necessary. - */ - private void appendCharacterTo(char c, StringBuffer sb) { - if (this.charIsToBeEncoded(c)) { - this.appendCharacterReferenceTo(c, sb); - } else { - sb.append(c); - } - } - - /** - * Return whether the specified character is one of the characters - * to be converted to XML character references. - */ - private boolean charIsToBeEncoded(char c) { - return (c <= this.maxChar) && CollectionTools.contains(this.chars, c); - } - - /** - * Append the specified character's XML character reference to the - * specified string buffer (e.g. '/' => "/"). - */ - private void appendCharacterReferenceTo(char c, StringBuffer sb) { - sb.append("&#x"); - sb.append(Integer.toString(c, 16)); - sb.append(';'); - } - - private void decodeTo(Reader reader, StringBuffer sb, StringBuffer temp) { - try { - this.decodeTo_(reader, sb, temp); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - private void decodeTo_(Reader reader, StringBuffer sb, StringBuffer temp) throws IOException { - int c = reader.read(); - while (c != -1) { - if (c == '&') { - this.decodeCharacterReferenceTo(reader, sb, temp); - } else { - sb.append((char) c); - } - c = reader.read(); - } - reader.close(); - } - - private void decodeCharacterReferenceTo(Reader reader, StringBuffer sb, StringBuffer temp) throws IOException { - int c = reader.read(); - this.checkChar(c, '#'); - c = reader.read(); - this.checkChar(c, 'x'); - - temp.setLength(0); - c = reader.read(); - while (c != ';') { - this.checkEndOfStream(c); - temp.append((char) c); - c = reader.read(); - } - String charValue = temp.toString(); - if (charValue.length() == 0) { - throw new IllegalStateException("missing numeric string"); - } - sb.append((char) Integer.parseInt(charValue, 16)); - } - - private void checkChar(int c, int expected) { - this.checkEndOfStream(c); - if (c != expected) { - throw new IllegalStateException("expected '" + (char) expected + "', but encountered '" + (char) c + "'"); - } - } - - private void checkEndOfStream(int c) { - if (c == -1) { - throw new IllegalStateException("unexpected end of string"); - } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java deleted file mode 100644 index 2874af48ad..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * An ArrayIterator provides an Iterator - * for an array of objects of type E. - */ -public class ArrayIterator - implements Iterator -{ - final E[] array; // private-protected - int nextIndex; // private-protected - private final int maxIndex; - - /** - * Construct an iterator for the specified array. - */ - public ArrayIterator(E... array) { - this(array, 0, array.length); - } - - /** - * Construct an iterator for the specified array, - * starting at the specified start index and continuing for - * the specified length. - */ - public ArrayIterator(E[] array, int start, int length) { - if ((start < 0) || (start > array.length)) { - throw new IllegalArgumentException("start: " + start); - } - if ((length < 0) || (length > array.length - start)) { - throw new IllegalArgumentException("length: " + length); - } - this.array = array; - this.nextIndex = start; - this.maxIndex = start + length; - } - - public boolean hasNext() { - return this.nextIndex < this.maxIndex; - } - - public E next() { - if (this.hasNext()) { - return this.array[this.nextIndex++]; - } - throw new NoSuchElementException(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, CollectionTools.list(this.array)); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java deleted file mode 100644 index 5b70ed4721..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.ListIterator; -import java.util.NoSuchElementException; - -/** - * An ArrayListIterator provides a ListIterator - * for an array of objects. - * - * The name might be a bit confusing: - * This is a ListIterator for an Array; - * not an Iterator for an ArrayList. - */ -public class ArrayListIterator - extends ArrayIterator - implements ListIterator -{ - private final int minIndex; - - /** - * Construct a list iterator for the specified array. - */ - public ArrayListIterator(E... array) { - this(array, 0, array.length); - } - - /** - * Construct a list iterator for the specified array, - * starting at the specified start index and continuing for - * the specified length. - */ - public ArrayListIterator(E[] array, int start, int length) { - super(array, start, length); - this.minIndex = start; - } - - public int nextIndex() { - return this.nextIndex; - } - - public int previousIndex() { - return this.nextIndex - 1; - } - - public boolean hasPrevious() { - return this.nextIndex > this.minIndex; - } - - public E previous() { - if (this.hasPrevious()) { - return this.array[--this.nextIndex]; - } - throw new NoSuchElementException(); - } - - public void add(E e) { - throw new UnsupportedOperationException(); - } - - public void set(E e) { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return super.toString(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java deleted file mode 100644 index 0f7594f115..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A ChainIterator provides a pluggable Iterator - * that loops over a chain of arbitrarily linked objects. The chain - * should be null-terminated (i.e. a call to the nextLink(Object) - * method should return null when it is passed the last - * link of the chain). - * To use, supply a starting link and supply a Linker or - * subclass ChainIterator and override the - * nextLink(Object) method. - * The starting link will be the first object returned by the iterator. - * If the starting link is null, the iterator will be empty. - * Note that the iterator does not support null elements. - */ -public class ChainIterator - implements Iterator -{ - private E nextLink; - private final Linker linker; - - - /** - * Construct an iterator with the specified starting link - * and a linker that simply returns null, indicating the end of the chain. - * Use this constructor if you want to override the - * nextLink(Object) method instead of building - * a Linker. - */ - public ChainIterator(E startLink) { - this(startLink, Linker.Null.instance()); - } - - /** - * Construct an iterator with the specified starting link - * and linker. - */ - public ChainIterator(E startLink, Linker linker) { - super(); - this.nextLink = startLink; - this.linker = linker; - } - - public boolean hasNext() { - return this.nextLink != null; - } - - public E next() { - if (this.nextLink == null) { - throw new NoSuchElementException(); - } - E result = this.nextLink; - this.nextLink = this.nextLink(this.nextLink); - return result; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - /** - * Return the next link in the chain. - */ - protected E nextLink(E currentLink) { - return this.linker.nextLink(currentLink); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nextLink); - } - - - //********** inner classes ********** - - /** - * Used by ChainIterator to link - * the elements in the chain. - */ - public interface Linker { - - /** - * Return the next link in the chain. - */ - T nextLink(T currentLink); - - - final class Null implements Linker { - @SuppressWarnings("unchecked") - public static final Linker INSTANCE = new Null(); - @SuppressWarnings("unchecked") - public static Linker instance() { - return INSTANCE; - } - // ensure single instance - private Null() { - super(); - } - // simply return null, indicating the chain is ended - public S nextLink(S currentLink) { - return null; - } - @Override - public String toString() { - return "ChainIterator.Linker.Null"; - } - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java deleted file mode 100644 index a7df5c9b92..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Collection; -import java.util.Iterator; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A CloneIterator iterates over a copy of a collection, - * allowing for concurrent access to the original collection. - *

    - * The original collection passed to the CloneIterator's - * constructor should be synchronized; otherwise you run the risk of - * a corrupted collection. - *

    - * By default, a CloneIterator does not support the - * #remove() operation; this is because it does not have - * access to the original collection. But if the CloneIterator - * is supplied with an Mutator it will delegate the - * #remove() operation to the Mutator. - * Alternatively, a subclass can override the #remove(Object) - * method. - */ -public class CloneIterator - implements Iterator -{ - private final Iterator nestedIterator; - private E current; - private final Mutator mutator; - private boolean removeAllowed; - - - // ********** constructors ********** - - /** - * Construct an iterator on a copy of the specified collection. - * The #remove() method will not be supported, - * unless a subclass overrides the #remove(Object). - */ - public CloneIterator(Collection c) { - this(c, Mutator.ReadOnly.instance()); - } - - /** - * Construct an iterator on a copy of the specified collection. - * Use the specified mutator to remove objects from the - * original collection. - */ - @SuppressWarnings("unchecked") - public CloneIterator(Collection c, Mutator mutator) { - super(); - this.nestedIterator = new ArrayIterator((E[]) c.toArray()); - this.current = null; - this.mutator = mutator; - this.removeAllowed = false; - } - - - // ********** Iterator implementation ********** - - public boolean hasNext() { - return this.nestedIterator.hasNext(); - } - - public E next() { - this.current = this.nestedIterator.next(); - this.removeAllowed = true; - return this.current; - } - - public void remove() { - if ( ! this.removeAllowed) { - throw new IllegalStateException(); - } - this.remove(this.current); - this.removeAllowed = false; - } - - - // ********** internal methods ********** - - /** - * Remove the specified element from the original collection. - *

    - * This method can be overridden by a subclass as an - * alternative to building an Mutator. - */ - protected void remove(E e) { - this.mutator.remove(e); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - - - //********** member interface ********** - - /** - * Used by CloneIterator to remove - * elements from the original collection; since the iterator - * does not have direct access to the original collection. - */ - public interface Mutator { - - /** - * Remove the specified object from the original collection. - */ - void remove(T current); - - - final class ReadOnly implements Mutator { - @SuppressWarnings("unchecked") - public static final Mutator INSTANCE = new ReadOnly(); - @SuppressWarnings("unchecked") - public static Mutator instance() { - return INSTANCE; - } - // ensure single instance - private ReadOnly() { - super(); - } - // remove is not supported - public void remove(Object current) { - throw new UnsupportedOperationException(); - } - @Override - public String toString() { - return "CloneIterator.Mutator.ReadOnly"; - } - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java deleted file mode 100644 index 82d701b442..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java +++ /dev/null @@ -1,229 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.List; -import java.util.ListIterator; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A CloneListIterator iterates over a copy of a list, - * allowing for concurrent access to the original list. - *

    - * The original list passed to the CloneListIterator's - * constructor should be synchronized; otherwise you run the risk of - * a corrupted list. - *

    - * By default, a CloneListIterator does not support the - * modification operations; this is because it does not have - * access to the original list. But if the CloneListIterator - * is supplied with a Mutator it will delegate the - * modification operations to the Mutator. - * Alternatively, a subclass can override the modification methods. - */ -public class CloneListIterator - implements ListIterator -{ - private final ListIterator nestedListIterator; - private int cursor; - private String state; - private final Mutator mutator; - - private static final String UNKNOWN = "unknown"; - private static final String PREVIOUS = "previous"; - private static final String NEXT = "next"; - - - // ********** constructors ********** - - /** - * Construct a list iterator on a copy of the specified list. - * The modification methods will not be supported, - * unless a subclass overrides them. - */ - public CloneListIterator(List list) { - this(list, Mutator.ReadOnly.instance()); - } - - /** - * Construct a list iterator on a copy of the specified list. - * Use the specified list mutator to modify the original list. - */ - @SuppressWarnings("unchecked") - public CloneListIterator(List list, Mutator mutator) { - super(); - // build a copy of the list and keep it in synch with original (if the mutator allows changes) - // that way the nested list iterator will maintain some of our state - this.nestedListIterator = CollectionTools.list((E[]) list.toArray()).listIterator(); - this.mutator = mutator; - this.cursor = 0; - this.state = UNKNOWN; - } - - - // ********** ListIterator implementation ********** - - public boolean hasNext() { - return this.nestedListIterator.hasNext(); - } - - public E next() { - // allow the nested iterator to throw an exception before we modify the index - E next = this.nestedListIterator.next(); - this.cursor++; - this.state = NEXT; - return next; - } - - public void remove() { - // allow the nested iterator to throw an exception before we modify the original list - this.nestedListIterator.remove(); - if (this.state == PREVIOUS) { - this.remove(this.cursor); - } else { - this.cursor--; - this.remove(this.cursor); - } - } - - public int nextIndex() { - return this.nestedListIterator.nextIndex(); - } - - public int previousIndex() { - return this.nestedListIterator.previousIndex(); - } - - public boolean hasPrevious() { - return this.nestedListIterator.hasPrevious(); - } - - public E previous() { - // allow the nested iterator to throw an exception before we modify the index - E previous = this.nestedListIterator.previous(); - this.cursor--; - this.state = PREVIOUS; - return previous; - } - - public void add(E o) { - // allow the nested iterator to throw an exception before we modify the original list - this.nestedListIterator.add(o); - this.add(this.cursor, o); - this.cursor++; - } - - public void set(E o) { - // allow the nested iterator to throw an exception before we modify the original list - this.nestedListIterator.set(o); - if (this.state == PREVIOUS) { - this.set(this.cursor, o); - } else { - this.set(this.cursor - 1, o); - } - } - - - // ********** internal methods ********** - - /** - * Add the specified element to the original list. - *

    - * This method can be overridden by a subclass as an - * alternative to building a Mutator. - */ - protected void add(int index, E o) { - this.mutator.add(index, o); - } - - /** - * Remove the specified element from the original list. - *

    - * This method can be overridden by a subclass as an - * alternative to building a Mutator. - */ - protected void remove(int index) { - this.mutator.remove(index); - } - - /** - * Set the specified element in the original list. - *

    - * This method can be overridden by a subclass as an - * alternative to building a Mutator. - */ - protected void set(int index, E o) { - this.mutator.set(index, o); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - - - //********** member interface ********** - - /** - * Used by CloneListIterator to remove - * elements from the original list; since the list iterator - * does not have direct access to the original list. - */ - public interface Mutator { - - /** - * Add the specified object to the original list. - */ - void add(int index, T o); - - /** - * Remove the specified object from the original list. - */ - void remove(int index); - - /** - * Set the specified object in the original list. - */ - void set(int index, T o); - - - final class ReadOnly implements Mutator { - @SuppressWarnings("unchecked") - public static final Mutator INSTANCE = new ReadOnly(); - @SuppressWarnings("unchecked") - public static Mutator instance() { - return INSTANCE; - } - // ensure single instance - private ReadOnly() { - super(); - } - // add is not supported - public void add(int index, Object o) { - throw new UnsupportedOperationException(); - } - // remove is not supported - public void remove(int index) { - throw new UnsupportedOperationException(); - } - // set is not supported - public void set(int index, Object o) { - throw new UnsupportedOperationException(); - } - @Override - public String toString() { - return "CloneListIterator.Mutator.ReadOnly"; - } - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java deleted file mode 100644 index 40ae0cb879..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Collection; -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A CompositeIterator wraps a collection - * of Iterators and makes them appear to be a single - * Iterator. - */ -public class CompositeIterator - implements Iterator -{ - private final Iterator> iterators; - private Iterator currentIterator; - private Iterator lastIteratorToReturnNext; - - - /** - * Construct an iterator with the specified collection of iterators. - */ - public CompositeIterator(Collection> iterators) { - this(iterators.iterator()); - } - - /** - * Construct an iterator with the specified collection of iterators. - */ - public CompositeIterator(Iterator> iterators) { - super(); - this.iterators = iterators; - } - - /** - * Construct an iterator with the specified object prepended - * to the specified iterator. - */ - @SuppressWarnings("unchecked") - public CompositeIterator(E object, Iterator iterator) { - this(new SingleElementIterator(object), iterator); - } - - /** - * Construct an iterator with the specified object appended - * to the specified iterator. - */ - @SuppressWarnings("unchecked") - public CompositeIterator(Iterator iterator, E object) { - this(iterator, new SingleElementIterator(object)); - } - - /** - * Construct an iterator with the specified iterators. - */ - public CompositeIterator(Iterator... iterators) { - this(new ArrayIterator>(iterators)); - } - - public boolean hasNext() { - try { - this.loadCurrentIterator(); - } catch (NoSuchElementException ex) { - // this occurs if there are no iterators at all - return false; - } - return this.currentIterator.hasNext(); - } - - public E next() { - this.loadCurrentIterator(); - E result = this.currentIterator.next(); - - // the statement above will throw a NoSuchElementException - // if the current iterator is at the end of the line; - // so if we get here, we can set 'lastIteratorToReturnNext' - this.lastIteratorToReturnNext = this.currentIterator; - - return result; - } - - public void remove() { - if (this.lastIteratorToReturnNext == null) { - // CompositeIterator#next() has never been called - throw new IllegalStateException(); - } - this.lastIteratorToReturnNext.remove(); - } - - /** - * Load currentIterator with the first iterator that hasNext() - * or the final iterator if all the elements have already been retrieved. - */ - private void loadCurrentIterator() { - if (this.currentIterator == null) { - this.currentIterator = this.iterators.next(); - } - while (( ! this.currentIterator.hasNext()) && this.iterators.hasNext()) { - this.currentIterator = this.iterators.next(); - } - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.iterators); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java deleted file mode 100644 index 324d3c2f68..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java +++ /dev/null @@ -1,194 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A CompositeListIterator wraps a list - * of ListIterators and makes them appear to be a single - * ListIterator. - */ -public class CompositeListIterator - implements ListIterator -{ - private final ListIterator> iterators; - private ListIterator nextIterator; - private int nextIndex; - /** - * true if "next" was last returned; false if "previous" was last returned; - * this determines the effect of remove(Object) on nextIndex - */ - private boolean nextReturned; - private ListIterator lastIteratorToReturnElement; - - - /** - * Construct a list iterator with the specified list of list iterators. - */ - public CompositeListIterator(List> iterators) { - this(iterators.listIterator()); - } - - /** - * Construct a list iterator with the specified list of list iterators. - */ - public CompositeListIterator(ListIterator> iterators) { - super(); - this.iterators = iterators; - this.nextIndex = 0; - this.nextReturned = false; - } - - /** - * Construct a list iterator with the specified object prepended - * to the specified iterator. - */ - @SuppressWarnings("unchecked") - public CompositeListIterator(E object, ListIterator iterator) { - this(new SingleElementListIterator(object), iterator); - } - - /** - * Construct a list iterator with the specified object appended - * to the specified iterator. - */ - @SuppressWarnings("unchecked") - public CompositeListIterator(ListIterator iterator, E object) { - this(iterator, new SingleElementListIterator(object)); - } - - /** - * Construct a list iterator with the specified list iterators. - */ - public CompositeListIterator(ListIterator... iterators) { - this(new ArrayListIterator>(iterators)); - } - - public void add(E o) { - this.checkNextIterator(); - this.nextIterator.add(o); - this.nextIndex++; - } - - public boolean hasNext() { - try { - this.loadNextIterator(); - } catch (NoSuchElementException ex) { - // this occurs if there are no iterators at all - return false; - } - return this.nextIterator.hasNext(); - } - - public boolean hasPrevious() { - try { - this.loadPreviousIterator(); - } catch (NoSuchElementException ex) { - // this occurs if there are no iterators at all - return false; - } - return this.nextIterator.hasPrevious(); - } - - public E next() { - this.loadNextIterator(); - E result = this.nextIterator.next(); - - // the statement above will throw a NoSuchElementException - // if the current iterator is at the end of the line; - // so if we get here, we can set the lastIteratorToReturnElement - this.lastIteratorToReturnElement = this.nextIterator; - this.nextIndex++; - this.nextReturned = true; - - return result; - } - - public int nextIndex() { - return this.nextIndex; - } - - public E previous() { - this.loadPreviousIterator(); - E result = this.nextIterator.previous(); - - // the statement above will throw a NoSuchElementException - // if the current iterator is at the end of the line; - // so if we get here, we can set the lastIteratorToReturnElement - this.lastIteratorToReturnElement = this.nextIterator; - this.nextIndex--; - this.nextReturned = false; - - return result; - } - - public int previousIndex() { - return this.nextIndex - 1; - } - - public void remove() { - if (this.lastIteratorToReturnElement == null) { - throw new IllegalStateException(); - } - this.lastIteratorToReturnElement.remove(); - if (this.nextReturned) { - // decrement the index because the "next" element has moved forward in the list - this.nextIndex--; - } - } - - public void set(E e) { - if (this.lastIteratorToReturnElement == null) { - throw new IllegalStateException(); - } - this.lastIteratorToReturnElement.set(e); - } - - /** - * Load nextIterator with the first iterator that hasNext() - * or the final iterator if all the elements have already been retrieved. - */ - private void loadNextIterator() { - this.checkNextIterator(); - while (( ! this.nextIterator.hasNext()) && this.iterators.hasNext()) { - this.nextIterator = this.iterators.next(); - } - } - - /** - * Load nextIterator with the first iterator that hasPrevious() - * or the first iterator if all the elements have already been retrieved. - */ - private void loadPreviousIterator() { - this.checkNextIterator(); - while (( ! this.nextIterator.hasPrevious()) && this.iterators.hasPrevious()) { - this.nextIterator = this.iterators.previous(); - } - } - - /** - * If nextIterator is null, load it with the first iterator. - */ - private void checkNextIterator() { - if (this.nextIterator == null) { - this.nextIterator = this.iterators.next(); - } - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.iterators); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java deleted file mode 100644 index d1b989a946..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Enumeration; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A NullEnumeration is just that. - */ -public final class EmptyEnumeration - implements Enumeration -{ - - // singleton - @SuppressWarnings("unchecked") - private static EmptyEnumeration INSTANCE = new EmptyEnumeration(); - - /** - * Return the singleton. - */ - @SuppressWarnings("unchecked") - public static Enumeration instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EmptyEnumeration() { - super(); - } - - public boolean hasMoreElements() { - return false; - } - - public E nextElement() { - throw new NoSuchElementException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java deleted file mode 100644 index b560d45fcf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A NullIterator is just that. - */ -public final class EmptyIterator - implements Iterator -{ - - // singleton - @SuppressWarnings("unchecked") - private static EmptyIterator INSTANCE = new EmptyIterator(); - - /** - * Return the singleton. - */ - @SuppressWarnings("unchecked") - public static Iterator instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EmptyIterator() { - super(); - } - - public boolean hasNext() { - return false; - } - - public E next() { - throw new NoSuchElementException(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java deleted file mode 100644 index 0863b24463..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.ListIterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A NullListIterator is just that. - */ -public final class EmptyListIterator - implements ListIterator -{ - - // singleton - @SuppressWarnings("unchecked") - private static EmptyListIterator INSTANCE = new EmptyListIterator(); - - /** - * Return the singleton. - */ - @SuppressWarnings("unchecked") - public static ListIterator instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EmptyListIterator() { - super(); - } - - public void add(E e) { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - return false; - } - - public boolean hasPrevious() { - return false; - } - - public E next() { - throw new NoSuchElementException(); - } - - public int nextIndex() { - return 0; - } - - public E previous() { - throw new NoSuchElementException(); - } - - public int previousIndex() { - return -1; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - public void set(E e) { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java deleted file mode 100644 index a75710c4ef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Enumeration; -import java.util.Iterator; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * An EnumerationIterator wraps an - * Enumeration so that it can be treated like an - * Iterator. - */ -public class EnumerationIterator - implements Iterator -{ - private final Enumeration enumeration; - - /** - * Construct an iterator that wraps the specified enumeration. - */ - public EnumerationIterator(Enumeration enumeration) { - this.enumeration = enumeration; - } - - public boolean hasNext() { - return this.enumeration.hasMoreElements(); - } - - public E next() { - return this.enumeration.nextElement(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.enumeration); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java deleted file mode 100644 index eb0c970933..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A FilteringIterator wraps another Iterator - * and uses a Filter to determine which elements in the - * nested iterator are to be returned by calls to next(). - *

    - * As an alternative to building a Filter, a subclass - * of FilteringIterator can override the - * accept(Object) method. - *

    - * One, possibly undesirable, side-effect of using this iterator is that - * the nested iterator's next() method will be invoked - * before the filtered iterator's next() - * method is invoked. This is because the "next" element must be - * checked for whether it is to be accepted before the filtered iterator - * can determine whether it has a "next" element (i.e. that the - * hasNext() method should return true). - * This also prevents a filtered iterator from supporting the optional - * remove() method. - */ -public class FilteringIterator - implements Iterator -{ - private final Iterator nestedIterator; - // trust that the filter is correct - i.e. it will only accept elements of type E - @SuppressWarnings("unchecked") - private final Filter filter; - private E next; - private boolean done; - - - /** - * Construct an iterator with the specified nested - * iterator and a filter that simply accepts every object. - * Use this constructor if you want to override the - * accept(Object) method instead of building - * a Filter. - */ - public FilteringIterator(Iterator nestedIterator) { - this(nestedIterator, Filter.Null.instance()); - } - - /** - * Construct an iterator with the specified nested - * iterator and filter. - */ - @SuppressWarnings("unchecked") - public FilteringIterator(Iterator nestedIterator, Filter filter) { - super(); - this.nestedIterator = nestedIterator; - this.filter = filter; - this.loadNext(); - } - - public boolean hasNext() { - return ! this.done; - } - - public E next() { - if (this.done) { - throw new NoSuchElementException(); - } - E result = this.next; - this.loadNext(); - return result; - } - - /** - * Because we need to pre-load the next element - * to be returned, we cannot support the remove() - * method. - */ - public void remove() { - throw new UnsupportedOperationException(); - } - - /** - * Load next with the next valid entry from the nested - * iterator. If there are none, next is set to END. - */ - @SuppressWarnings("unchecked") - private void loadNext() { - this.done = true; - while (this.nestedIterator.hasNext() && (this.done)) { - Object o = this.nestedIterator.next(); - if (this.accept(o)) { - // assume that if the object was accepted it is of type E - this.next = (E) o; - this.done = false; - } else { - this.next = null; - this.done = true; - } - } - } - - /** - * Return whether the FilteringIterator - * should return the specified next element from a call to the - * next() method. - *

    - * This method can be overridden by a subclass as an - * alternative to building a Filter. - */ - @SuppressWarnings("unchecked") - protected boolean accept(Object o) { - return this.filter.accept(o); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nestedIterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java deleted file mode 100644 index 1542cf16a2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.NoSuchElementException; -import java.util.Set; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A GraphIterator is similar to a TreeIterator - * except that it cannot be assumed that all nodes assume a strict tree - * structure. For instance, in a tree, a node cannot be a descendent of - * itself, but a graph may have a cyclical structure. - * - * A GraphIterator simplifies the traversal of a - * graph of objects, where the objects' protocol(s) provides - * a method for getting the next collection of nodes in the graph, - * (or *neighbors*), but does not provide a method for getting *all* - * of the nodes in the graph. - * (e.g. a neighbor can return his neighbors, and those neighbors - * can return their neighbors, which might also include the original - * neighbor, but you only want to visit the original neighbor once.) - *

    - * If a neighbor has already been visited (determined by using - * equals(Object)), that neighbor is not visited again, - * nor are the neighbors of that object. - *

    - * It is up to the user of this class to ensure a *complete* graph. - *

    - * To use, supply:

      - *
    • either the initial node of the graph or an Iterator over an - * initial collection of graph nodes - *
    • a MisterRogers that tells who the neighbors are - * of each node - * (alternatively, subclass GraphIterator - * and override the neighbors(Object) method) - *
    - *

    - * remove() is not supported. This method, if - * desired, must be implemented by the user of this class. - */ -public class GraphIterator - implements Iterator -{ - private final Collection> iterators; - private final Set visitedNeighbors; - private final MisterRogers misterRogers; - - private Iterator currentIterator; - - private E nextNeighbor; - private boolean done; - - - /** - * Construct an iterator with the specified collection of roots - * and a mister rogers that simply returns an empty iterator - * for each of the roots. - * Use this constructor if you want to override the - * children(Object) method instead of building - * a MisterRogers. - */ - public GraphIterator(E... roots) { - this(new ArrayIterator(roots)); - } - - /** - * Construct an iterator with the specified collection of roots - * and a mister rogers that simply returns an empty iterator - * for each of the roots. - * Use this constructor if you want to override the - * children(Object) method instead of building - * a MisterRogers. - */ - public GraphIterator(Iterator roots) { - this(roots, MisterRogers.Null.instance()); - } - - /** - * Construct an iterator with the specified root - * and a mister rogers that simply returns an empty iterator - * for the root. - * Use this constructor if you want to override the - * children(Object) method instead of building - * a MisterRogers. - */ - public GraphIterator(E root) { - this(root, MisterRogers.Null.instance()); - } - - /** - * Construct an iterator with the specified root - * and mister rogers. - */ - public GraphIterator(E root, MisterRogers misterRogers) { - this(new SingleElementIterator(root), misterRogers); - } - - /** - * Construct an iterator with the specified roots - * and mister rogers. - */ - public GraphIterator(Iterator roots, MisterRogers misterRogers) { - super(); - this.currentIterator = roots; - // use a LinkedList since we will be pulling off the front and adding to the end - this.iterators = new LinkedList>(); - this.misterRogers = misterRogers; - this.visitedNeighbors = new HashSet(); - this.loadNextNeighbor(); - } - - /** - * Load next neighbor with the next entry from the current iterator. - * If the current iterator has none, load the next iterator. - * If there are no more, the 'done' flag is set. - */ - private void loadNextNeighbor() { - if (this.currentIterator == EmptyIterator.instance()) { - this.done = true; - } - else if (this.currentIterator.hasNext()) { - E nextPossibleNeighbor = this.currentIterator.next(); - if (this.visitedNeighbors.contains(nextPossibleNeighbor)) { - this.loadNextNeighbor(); // recurse - } else { - this.nextNeighbor = nextPossibleNeighbor; - this.visitedNeighbors.add(nextPossibleNeighbor); - this.iterators.add(this.neighbors(nextPossibleNeighbor)); - } - } - else { - for (Iterator> stream = this.iterators.iterator(); ! this.currentIterator.hasNext() && stream.hasNext(); ) { - this.currentIterator = stream.next(); - stream.remove(); - } - if ( ! this.currentIterator.hasNext()) { - this.currentIterator = EmptyIterator.instance(); - } - this.loadNextNeighbor(); // recurse - } - } - - public boolean hasNext() { - return ! this.done; - } - - public E next() { - if (this.done) { - throw new NoSuchElementException(); - } - E next = this.nextNeighbor; - this.loadNextNeighbor(); - return next; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - /** - * Return the immediate neighbors of the specified object. - */ - protected Iterator neighbors(E next) { - return this.misterRogers.neighbors(next); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.currentIterator); - } - - - //********** inner classes ********** - - /** - * Used by GraphIterator to retrieve - * the immediate neighbors of a node in the graph. - * "These are the people in your neighborhood..." - */ - public interface MisterRogers { - - /** - * Return the immediate neighbors of the specified object. - */ - Iterator neighbors(T next); - - - final class Null implements MisterRogers { - @SuppressWarnings("unchecked") - public static final MisterRogers INSTANCE = new Null(); - @SuppressWarnings("unchecked") - public static MisterRogers instance() { - return INSTANCE; - } - // ensure single instance - private Null() { - super(); - } - // return no neighbors - public Iterator neighbors(S next) { - return EmptyIterator.instance(); - } - @Override - public String toString() { - return "GraphIterator.MisterRogers.Null"; - } - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java deleted file mode 100644 index 55a4f08b70..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Enumeration; -import java.util.Iterator; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * An IteratorEnumeration wraps an - * Iterator so that it can be treated like an - * Enumeration. - */ -public class IteratorEnumeration - implements Enumeration -{ - private final Iterator iterator; - - /** - * Construct an enumeration that wraps the specified iterator. - */ - public IteratorEnumeration(Iterator iterator) { - super(); - this.iterator = iterator; - } - - public boolean hasMoreElements() { - return this.iterator.hasNext(); - } - - public E nextElement() { - return this.iterator.next(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.iterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java deleted file mode 100644 index 316aedcf63..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A PeekableIterator wraps another Iterator - * and allows a peek() at the next element to be - * returned by next(). - *

    - * One, possibly undesirable, side-effect of using this iterator is that - * the nested iterator's next() method will be invoked - * before the peekable iterator's next() - * method is invoked. This is because the "next" element must be - * pre-loaded for the peek() method. - * This also prevents a peekable iterator from supporting the optional - * remove() method. - */ - -public class PeekableIterator - implements Iterator -{ - private final Iterator nestedIterator; - private E next; - private boolean done; - - - /** - * Construct a peekable iterator that wraps the specified nested - * iterator. - */ - public PeekableIterator(Iterator nestedIterator) { - super(); - this.nestedIterator = nestedIterator; - this.done = false; - this.loadNext(); - } - - public boolean hasNext() { - return ! this.done; - } - - public E next() { - if (this.done) { - throw new NoSuchElementException(); - } - E result = this.next; - this.loadNext(); - return result; - } - - /** - * Return the element that will be returned by the next call to the - * next() method, without advancing past it. - */ - public E peek() { - if (this.done) { - throw new NoSuchElementException(); - } - return this.next; - } - - /** - * Because we need to pre-load the next element - * to be returned, we cannot support the remove() - * method. - */ - public void remove() { - throw new UnsupportedOperationException(); - } - - /** - * Load next with the next entry from the nested - * iterator. If there are none, next is set to END. - */ - private void loadNext() { - if (this.nestedIterator.hasNext()) { - this.next = this.nestedIterator.next(); - } else { - this.next = null; - this.done = true; - } - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nestedIterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java deleted file mode 100644 index df0a51333d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Collection; -import java.util.Iterator; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A ReadOnlyIterator wraps another Iterator - * and removes support for #remove(). - */ -public class ReadOnlyIterator - implements Iterator -{ - private final Iterator nestedIterator; - - /** - * Construct an iterator on the specified collection that - * disallows removes. - */ - public ReadOnlyIterator(Collection c) { - this(c.iterator()); - } - - /** - * Construct an iterator with the specified nested iterator - * and disallow removes. - */ - public ReadOnlyIterator(Iterator nestedIterator) { - super(); - this.nestedIterator = nestedIterator; - } - - public boolean hasNext() { - // delegate to the nested iterator - return this.nestedIterator.hasNext(); - } - - public E next() { - // delegate to the nested iterator - return this.nestedIterator.next(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nestedIterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java deleted file mode 100644 index c3b2591f44..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.List; -import java.util.ListIterator; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A ReadOnlyListIterator wraps another - * ListIterator and removes support for: - * #remove() - * #set(Object) - * #add(Object) - */ -public class ReadOnlyListIterator - implements ListIterator -{ - private final ListIterator nestedListIterator; - - - /** - * Construct an iterator on the specified list that - * disallows removes, sets, and adds. - */ - public ReadOnlyListIterator(List list) { - this(list.listIterator()); - } - - /** - * Construct an iterator on the specified list iterator that - * disallows removes, sets, and adds. - */ - public ReadOnlyListIterator(ListIterator nestedListIterator) { - super(); - this.nestedListIterator = nestedListIterator; - } - - public boolean hasNext() { - // delegate to the nested iterator - return this.nestedListIterator.hasNext(); - } - - public E next() { - // delegate to the nested iterator - return this.nestedListIterator.next(); - } - - public boolean hasPrevious() { - // delegate to the nested iterator - return this.nestedListIterator.hasPrevious(); - } - - public E previous() { - // delegate to the nested iterator - return this.nestedListIterator.previous(); - } - - public int nextIndex() { - // delegate to the nested iterator - return this.nestedListIterator.nextIndex(); - } - - public int previousIndex() { - // delegate to the nested iterator - return this.nestedListIterator.previousIndex(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - public void set(E o) { - throw new UnsupportedOperationException(); - } - - public void add(E o) { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nestedListIterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java deleted file mode 100644 index a8da8442ab..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A ResultSetIterator wraps a ResultSet - * and transforms its rows for client consumption. Subclasses can override - * #buildNext(ResultSet) to build the expected object from - * the current row of the result set. - *

    - * To use, supply:

      - *
    • a ResultSet - *
    • an Adapter that converts a row in the ResultSet - * into the desired object - * (alternatively, subclass ResultSetIterator - * and override the buildNext(ResultSet) method) - *
    - *

    - */ -public class ResultSetIterator - implements Iterator -{ - private final ResultSet resultSet; - private final Adapter adapter; - private E next; - private boolean done; - - - /** - * Construct an iterator on the specified result set that returns - * the objects produced by the specified adapter. - */ - public ResultSetIterator(ResultSet resultSet, Adapter adapter) { - super(); - this.resultSet = resultSet; - this.adapter = adapter; - this.done = false; - this.next = this.buildNext(); - } - - /** - * Construct an iterator on the specified result set that returns - * the first object in each row of the result set. - */ - public ResultSetIterator(ResultSet resultSet) { - this(resultSet, Adapter.Default.instance()); - } - - /** - * Build the next object for the iterator to return. - * Close the result set when we reach the end. - */ - private E buildNext() { - try { - if (this.resultSet.next()) { - return this.buildNext(this.resultSet); - } - this.resultSet.close(); - this.done = true; - return null; - } catch (SQLException ex) { - throw new RuntimeException(ex); - } - } - - /** - * By default, return the first object in the current row - * of the result set. Any SQLExceptions will - * be caught and wrapped in a RuntimeException. - */ - protected E buildNext(ResultSet rs) throws SQLException { - return this.adapter.buildNext(rs); - } - - public boolean hasNext() { - return ! this.done; - } - - public E next() { - if (this.done) { - throw new NoSuchElementException(); - } - E temp = this.next; - this.next = this.buildNext(); - return temp; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.resultSet); - } - - - // ********** interface ********** - - /** - * Used by ResultSetIterator to convert a - * ResultSet's current row into the next object - * to be returned by the Iterator. - */ - public interface Adapter { - - /** - * Return an object corresponding to the result set's - * "current" row. Any SQLExceptions will - * be caught and wrapped in a RuntimeException. - * @see java.sql.ResultSet - */ - T buildNext(ResultSet rs) throws SQLException; - - - final class Default implements Adapter { - @SuppressWarnings("unchecked") - public static final Adapter INSTANCE = new Default(); - @SuppressWarnings("unchecked") - public static Adapter instance() { - return INSTANCE; - } - // ensure single instance - private Default() { - super(); - } - // return the first object in the current row of the result set - @SuppressWarnings("unchecked") - public S buildNext(ResultSet rs) throws SQLException { - // result set columns are indexed starting with 1 - return (S) rs.getObject(1); - } - @Override - public String toString() { - return "ResultSetIterator.Adapter.Default"; - } - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java deleted file mode 100644 index 75fd9d80fd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A SingleElementIterator holds a single element - * and returns it with the first call to next(), at - * which point it will return false to any subsequent - * call to hasNext(). - *

    - * A SingleElementIterator is equivalent to the - * Iterator returned by: - * java.util.Collections.singleton(element).iterator() - */ -public class SingleElementIterator - implements Iterator -{ - private final E element; - private boolean done; - - - /** - * Construct an iterator that returns only the specified element. - */ - public SingleElementIterator(E element) { - super(); - this.element = element; - this.done = false; - } - - public boolean hasNext() { - return ! this.done; - } - - public E next() { - if (this.done) { - throw new NoSuchElementException(); - } - this.done = true; - return this.element; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.element); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java deleted file mode 100644 index 799cb72aef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.ListIterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A SingleElementListIterator holds a single element - * and returns it with the first call to next(), at - * which point it will return false to any subsequent - * call to hasNext(). Likewise, it will return false - * to a call to hasPrevious() until a call to next(), - * at which point a call to previous() will return the - * single element. - *

    - * A SingleElementListIterator is equivalent to the - * Iterator returned by: - * java.util.Collections.singletonList(element).listIterator() - */ -public class SingleElementListIterator - implements ListIterator -{ - private final E element; - private boolean hasNext; - - - /** - * Construct a list iterator that returns only the specified element. - */ - public SingleElementListIterator(E element) { - super(); - this.element = element; - this.hasNext = true; - } - - public boolean hasNext() { - return this.hasNext; - } - - public E next() { - if (this.hasNext) { - this.hasNext = false; - return this.element; - } - throw new NoSuchElementException(); - } - - public int nextIndex() { - return this.hasNext ? 0 : 1; - } - - public boolean hasPrevious() { - return ! this.hasNext; - } - - public E previous() { - if (this.hasNext) { - throw new NoSuchElementException(); - } - this.hasNext = true; - return this.element; - } - - public int previousIndex() { - return this.hasNext ? -1 : 0; - } - - public void add(E e) { - throw new UnsupportedOperationException(); - } - - public void set(E e) { - throw new UnsupportedOperationException(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.element); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java deleted file mode 100644 index cffb59a2e9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Iterator; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.Transformer; - - -/** - * A TransformationIterator wraps another Iterator - * and transforms its results for client consumption. To use, supply a - * Transformer or subclass TransformationIterator - * and override the transform(Object) method. - * Objects of type E1 are transformed into objects of type E2; - * i.e. the iterator returns objects of type E2. - */ -public class TransformationIterator - implements Iterator -{ - private final Iterator nestedIterator; - private final Transformer transformer; - - - /** - * Construct an iterator with the specified nested iterator - * and a transformer that simply returns the object, unchanged. - * Use this constructor if you want to override the - * transform(Object) method instead of building - * a Transformer. - */ - public TransformationIterator(Iterator nestedIterator) { - this(nestedIterator, Transformer.Null.instance()); - } - - /** - * Construct an iterator with the specified nested iterator - * and transformer. - */ - public TransformationIterator(Iterator nestedIterator, Transformer transformer) { - super(); - this.nestedIterator = nestedIterator; - this.transformer = transformer; - } - - public boolean hasNext() { - // delegate to the nested iterator - return this.nestedIterator.hasNext(); - } - - public E2 next() { - // transform the object returned by the nested iterator before returning it - return this.transform(this.nestedIterator.next()); - } - - public void remove() { - // delegate to the nested iterator - this.nestedIterator.remove(); - } - - /** - * Transform the specified object and return the result. - */ - protected E2 transform(E1 next) { - return this.transformer.transform(next); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nestedIterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java deleted file mode 100644 index 329f3ff142..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.ListIterator; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.Transformer; - -/** - * A TransformationListIterator wraps another ListIterator - * and transforms it results for client consumption. To use, supply a - * Transformer or subclass TransformationIterator - * and override the transform(Object) method. - * - * The methods set(Object) and add(Object) - * are left unsupported in this class. - */ -public class TransformationListIterator - implements ListIterator -{ - private final ListIterator nestedIterator; - private final Transformer transformer; - - - /** - * Construct an iterator with the specified nested iterator - * and a transformer that simply returns the object, unchanged. - * Use this constructor if you want to override the - * transform(Object) method instead of building - * a Transformer. - */ - public TransformationListIterator(ListIterator nestedIterator) { - this(nestedIterator, Transformer.Null.instance()); - } - - /** - * Construct an iterator with the specified nested iterator - * and transformer. - */ - public TransformationListIterator(ListIterator nestedIterator, Transformer transformer) { - super(); - this.nestedIterator = nestedIterator; - this.transformer = transformer; - } - - public boolean hasNext() { - // delegate to the nested iterator - return this.nestedIterator.hasNext(); - } - - public E2 next() { - // transform the object returned by the nested iterator before returning it - return this.transform(this.nestedIterator.next()); - } - - public int nextIndex() { - // delegate to the nested iterator - return this.nestedIterator.nextIndex(); - } - - public boolean hasPrevious() { - // delegate to the nested iterator - return this.nestedIterator.hasPrevious(); - } - - public E2 previous() { - // transform the object returned by the nested iterator before returning it - return this.transform(this.nestedIterator.previous()); - } - - public int previousIndex() { - // delegate to the nested iterator - return this.nestedIterator.previousIndex(); - } - - public void add(E2 o) { - throw new UnsupportedOperationException(); - } - - public void set(E2 o) { - throw new UnsupportedOperationException(); - } - - public void remove() { - // delegate to the nested iterator - this.nestedIterator.remove(); - } - - /** - * Transform the specified object and return the result. - */ - protected E2 transform(E1 next) { - return this.transformer.transform(next); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.nestedIterator); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java deleted file mode 100644 index 432c54a7a1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.internal.iterators; - -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * A TreeIterator simplifies the traversal of a - * tree of objects, where the objects' protocol(s) provides - * a method for getting the immediate children of the given - * node but does not provide a method for getting all the - * descendants (children, grandchildren, etc.) of the given node. - *

    - * To use, supply:

      - *
    • either the root element of the tree or, if the tree has - * multiple roots, an Iterator over the set of roots - *
    • a Midwife that delivers the children - * of each child - * (alternatively, subclass TreeIterator - * and override the children(Object) method) - *
    - *

    - */ -public class TreeIterator - implements Iterator -{ - private final Collection> iterators; - private final Midwife midwife; - private Iterator currentIterator; - - - /** - * Construct an iterator with the specified collection of roots - * and a midwife that simply returns an empty iterator - * for each of the roots. - * Use this constructor if you want to override the - * children(Object) method instead of building - * a Midwife. - */ - public TreeIterator(Iterator roots) { - this(roots, Midwife.Null.instance()); - } - - /** - * Construct an iterator with the specified root - * and a midwife that simply returns an empty iterator - * for the root. - * Use this constructor if you want to override the - * children(Object) method instead of building - * a Midwife. - */ - public TreeIterator(E root) { - this(root, Midwife.Null.instance()); - } - - /** - * Construct an iterator with the specified root - * and midwife. - */ - public TreeIterator(E root, Midwife midwife) { - this(new SingleElementIterator(root), midwife); - } - - /** - * Construct an iterator with the specified roots - * and midwife. - */ - public TreeIterator(Iterator roots, Midwife midwife) { - super(); - this.currentIterator = roots; - // use a LinkedList since we will be pulling off the front and adding to the end - this.iterators = new LinkedList>(); - this.midwife = midwife; - } - - public boolean hasNext() { - if (this.currentIterator.hasNext()) { - return true; - } - for (Iterator iterator : this.iterators) { - if (iterator.hasNext()) { - return true; - } - } - return false; - } - - public E next() { - if (this.currentIterator.hasNext()) { - return this.nextInternal(); - } - for (Iterator> stream = this.iterators.iterator(); stream.hasNext(); ) { - this.currentIterator = stream.next(); - if (this.currentIterator.hasNext()) { - break; - } - stream.remove(); - } - return this.nextInternal(); - } - - /** - * Fetch the children of the next node before returning it. - */ - private E nextInternal() { - E next = this.currentIterator.next(); - this.iterators.add(this.children(next)); - return next; - } - - public void remove() { - this.currentIterator.remove(); - } - - /** - * Return the immediate children of the specified object. - */ - protected Iterator children(E next) { - return this.midwife.children(next); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.currentIterator); - } - - - //********** inner classes ********** - - /** - * Used by TreeIterator to retrieve - * the immediate children of a node in the tree. - */ - public interface Midwife { - - /** - * Return the immediate children of the specified object. - */ - Iterator children(T o); - - - final class Null implements Midwife { - @SuppressWarnings("unchecked") - public static final Midwife INSTANCE = new Null(); - @SuppressWarnings("unchecked") - public static Midwife instance() { - return INSTANCE; - } - // ensure single instance - private Null() { - super(); - } - // return no neighbors - public Iterator children(S next) { - return EmptyIterator.instance(); - } - @Override - public String toString() { - return "TreeIterator.Midwife.Null"; - } - } - - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.core.tests/.classpath deleted file mode 100644 index db34e47716..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore deleted file mode 100644 index ba077a4031..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.project b/jpa/tests/org.eclipse.jpt.core.tests/.project deleted file mode 100644 index 08395a8e86..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.core.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 88638b5d88..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:10:20 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index a2f6604d54..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:58:31 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF deleted file mode 100644 index be27b103ef..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,25 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.core.tests -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.emf.ecore, - org.eclipse.emf.ecore.xmi, - org.eclipse.jdt.core, - org.eclipse.jem, - org.eclipse.jpt.core, - org.eclipse.jpt.utility, - org.eclipse.wst.common.emf, - org.eclipse.wst.common.project.facet.core, - org.junit -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.jpt.core.tests.internal;x-internal:=true, - org.eclipse.jpt.core.tests.internal.content.java.mappings;x-internal:=true, - org.eclipse.jpt.core.tests.internal.jdtutility;x-internal:=true, - org.eclipse.jpt.core.tests.internal.model;x-internal:=true, - org.eclipse.jpt.core.tests.internal.platform;x-internal:=true, - org.eclipse.jpt.core.tests.internal.projects;x-internal:=true diff --git a/jpa/tests/org.eclipse.jpt.core.tests/about.html b/jpa/tests/org.eclipse.jpt.core.tests/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/tests/org.eclipse.jpt.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.core.tests/build.properties deleted file mode 100644 index 9bf11f791e..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle. - initial API and implementation -############################################################################### -javacSource = 1.5 -javacTarget = 1.5 -bin.includes = .,\ - META-INF/,\ - about.html,\ - test.xml,\ - plugin.properties -source.. = src/ -output.. = bin/ diff --git a/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties deleted file mode 100644 index 6ebf8dbed1..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2007 Oracle. All rights reserved. This -# program and the accompanying materials are made available under the terms of -# the Eclipse Public License v1.0 which accompanies this distribution, and is -# available at http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: Oracle. - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName=Java Persistence API Core Tests -providerName=Eclipse.org diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java deleted file mode 100644 index baf5150f80..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal; - -import junit.framework.Test; -import junit.framework.TestSuite; -import org.eclipse.jpt.core.tests.internal.content.java.mappings.JptCoreContentJavaMappingsTests; -import org.eclipse.jpt.core.tests.internal.jdtutility.JptCoreJdtUtilityTests; -import org.eclipse.jpt.core.tests.internal.model.JptCoreModelTests; -import org.eclipse.jpt.core.tests.internal.platform.JptCorePlatformTests; - -/** - * Runs all JPT Core Tests - */ -public class JptCoreTests { - - public static Test suite() { - TestSuite suite = new TestSuite(JptCoreTests.class.getName()); - suite.addTest(JptCoreContentJavaMappingsTests.suite()); - suite.addTest(JptCoreModelTests.suite()); - suite.addTest(JptCoreJdtUtilityTests.suite()); - suite.addTest(JptCorePlatformTests.suite()); - return suite; - } - - private JptCoreTests() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java deleted file mode 100644 index ac9e78a7d6..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.tests.internal; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.AssertionFailedException; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -/** - * Copied from org.eclipse.wst.common.tests - */ -public class ProjectUtility { - public static IProject[] getAllProjects() { - IProject[] projects = new IProject[0]; - try { - projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - } catch (AssertionFailedException ex) { - // Catch Malformed tree exception that occurs from time to time... - } - return projects; - } - public static void deleteAllProjects() throws Exception { - //closing projects and tread work in here is a hack because of a BeanInfo bug holding - //onto jars loaded in another VM - -// for (int i = 0; i < projects.length; i++) { -// if (projects[i].exists()) { -// projects[i].close(null); // This should signal the extra VM to kill itself -// } -// } - // Thread.yield(); // give the VM a chance to die - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - - public void run(IProgressMonitor monitor) { - IProject[] projects = getAllProjects(); - for (int i = 0; i < projects.length; i++) { - IProject project = projects[i]; - boolean success = false; - Exception lastException = null; - // Don't make 2^12 is about 4 seconds which is the max we - // will wait for the VM to die - for (int j = 0; j < 13 && !success; j++) { - try { - if (project.exists()) { - project.delete(true, true, null); - ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null); - } - success = true; - } catch (Exception e) { - lastException = e; - if (project.exists()) { - try { - project.close(null); - project.open(null); - } catch (Exception e2) { - // do nothing - } - } - try { - Thread.sleep((int) Math.pow(2, j)); - } catch (InterruptedException e1) { - // do nothing - } // if the VM isn't dead, try sleeping - } - } - if (!success && lastException != null) { - //Logger.getLogger().log("Problem while deleting: " + lastException.getMessage()); -// Assert.fail("Caught Exception=" + -// lastException.getMessage() + " when deleting project=" + project.getName()); - } - } - } - }; - try { - ResourcesPlugin.getWorkspace().run(runnable, null); - } catch (CoreException ce) { - // do nothing - } - //verifyNoProjects(); - } -} \ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java deleted file mode 100644 index bbf7a950dd..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.content.java.mappings; - -import java.util.Iterator; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping; -import org.eclipse.jpt.core.internal.content.java.mappings.JPA; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; - -public class JavaEntityTests extends JpaJavaTestCase { - - public JavaEntityTests(String name) { - super(name); - } - - private void createTestEntity1() throws CoreException { - this.createTestType(new DefaultAnnotationWriter() { - @Override - public Iterator imports() { - return new ArrayIterator(JPA.ENTITY); - } - @Override - public void appendTypeAnnotationTo(StringBuffer sb) { - sb.append("@Entity"); - } - }); - this.synchPersistenceXml(); - } - - public void testGetName() throws Exception { - this.createTestEntity1(); - IJavaTypeMapping typeMapping = this.javaPersistentTypeNamed(FULLY_QUALIFIED_TYPE_NAME).getMapping(); - assertEquals(TYPE_NAME, typeMapping.getName()); - } - -// TODO we can only execute 1 test for now... -// public void testGetKey() throws Exception { -// this.createTestEntity1(); -// IJavaTypeMapping typeMapping = this.javaPersistentTypeNamed(FULLY_QUALIFIED_TYPE_NAME).getMapping(); -// assertEquals(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, typeMapping.getKey()); -// } -// -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java deleted file mode 100644 index ba028e9704..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.content.java.mappings; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.content.java.JavaPersistentType; -import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob; -import org.eclipse.jpt.core.tests.internal.jdtutility.AnnotationTestCase; -import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject; -import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject; -import org.eclipse.jpt.utility.internal.ClassTools; - -public abstract class JpaJavaTestCase extends AnnotationTestCase { - - public JpaJavaTestCase(String name) { - super(name); - } - - @Override - protected TestJavaProject buildJavaProject(String projectName, boolean autoBuild) throws Exception { - return new TestJpaProject(projectName, autoBuild); - } - - protected TestJpaProject jpaProject() { - return (TestJpaProject) this.javaProject; - } - - protected JavaPersistentType javaPersistentTypeNamed(String typeName) { - for (IJpaFile jpaFile : this.jpaProject().getJpaProject().jpaFiles(JavaCore.JAVA_SOURCE_CONTENT_TYPE)) { - JpaCompilationUnit cu = (JpaCompilationUnit) jpaFile.getContent(); - for (JavaPersistentType pt : cu.getTypes()) { - if (pt.fullyQualifiedTypeName().equals(typeName)) { - return pt; - } - } - } - throw new IllegalArgumentException("missing type: " + typeName); - } - - protected Type typeNamed(String typeName) { - return this.javaPersistentTypeNamed(typeName).getType(); - } - - protected void synchPersistenceXml() { - SynchronizeClassesJob job = new SynchronizeClassesJob(this.jpaProject().getProject().getFile("src/META-INF/persistence.xml")); - ClassTools.executeMethod(job, "run", IProgressMonitor.class, new NullProgressMonitor()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java deleted file mode 100644 index ddbb6bd094..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.content.java.mappings; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class JptCoreContentJavaMappingsTests { - - public static Test suite() { - TestSuite suite = new TestSuite(JptCoreContentJavaMappingsTests.class.getName()); -// suite.addTestSuite(JavaEntityTests.class); - return suite; - } - - private JptCoreContentJavaMappingsTests() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java deleted file mode 100644 index 87d6169bac..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java +++ /dev/null @@ -1,429 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import java.util.Iterator; -import java.util.List; -import junit.framework.TestCase; -import org.eclipse.core.runtime.CoreException; -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.Annotation; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.NumberLiteral; -import org.eclipse.jdt.core.dom.SimpleName; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jdt.core.dom.StringLiteral; -import org.eclipse.jpt.core.internal.jdtutility.FieldAttribute; -import org.eclipse.jpt.core.internal.jdtutility.MethodAttribute; -import org.eclipse.jpt.core.internal.jdtutility.Type; -import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject; -import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; -import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; - -/** - * Provide an easy(?) way to build an annotated source file. - * The type must be created by calling one of the #createType() methods - * before calling any of the various helper methods (i.e. the type is *not* - * created during #setUp()). - */ -public abstract class AnnotationTestCase extends TestCase { - protected TestJavaProject javaProject; - - protected static final String CR = System.getProperty("line.separator"); - protected static final String PROJECT_NAME = "AnnotationTestProject"; - protected static final String PACKAGE_NAME = "test"; - protected static final String TYPE_NAME = "AnnotationTestType"; - protected static final String FULLY_QUALIFIED_TYPE_NAME = PACKAGE_NAME + "." + TYPE_NAME; - protected static final String FILE_NAME = TYPE_NAME + ".java"; - - protected static final String[] EMPTY_STRING_ARRAY = new String[0]; - - - // ********** TestCase behavior ********** - - protected AnnotationTestCase(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.javaProject = this.buildJavaProject(PROJECT_NAME, false); // false = no auto-build - } - - protected TestJavaProject buildJavaProject(String projectName, boolean autoBuild) throws Exception { - return new TestJavaProject(projectName, autoBuild); // false = no auto-build - } - - @Override - protected void tearDown() throws Exception { -// this.dumpSource(); - this.javaProject.dispose(); - this.javaProject = null; - super.tearDown(); - } - - protected void dumpSource() throws Exception { - System.out.println("*** " + this.getName() + " ****"); - System.out.println(this.source()); - System.out.println(); - } - - - // ********** type creation ********** - - /** - * create an un-annotated type - */ - protected IType createTestType() throws CoreException { - return this.createTestType(new DefaultAnnotationWriter()); - } - - /** - * shortcut for simply adding an annotation to the 'id' field - */ - protected IType createTestType(final String annotationImport, final String idFieldAnnotation) throws CoreException { - return this.createTestType(new DefaultAnnotationWriter() { - @Override - public Iterator imports() { - return (annotationImport == null) ? - EmptyIterator.instance() - : - new SingleElementIterator(annotationImport); - } - @Override - public void appendIdFieldAnnotationTo(StringBuffer sb) { - sb.append(idFieldAnnotation); - } - }); - } - - /** - * shortcut for simply adding a fully-qualified annotation to the 'id' field - */ - protected IType createTestType(final String idFieldAnnotation) throws CoreException { - return this.createTestType(null, idFieldAnnotation); - } - - protected IType createTestType(AnnotationWriter annotationWriter) throws CoreException { - return this.javaProject.createType(PACKAGE_NAME, FILE_NAME, this.createSourceWriter(annotationWriter)); - } - - protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter) { - return new AnnotatedSourceWriter(annotationWriter); - } - - protected void appendSourceTo(StringBuffer sb, AnnotationWriter annotationWriter) { - sb.append(CR); - for (Iterator stream = annotationWriter.imports(); stream.hasNext(); ) { - sb.append("import "); - sb.append(stream.next()); - sb.append(";"); - sb.append(CR); - } - annotationWriter.appendTypeAnnotationTo(sb); - sb.append(CR); - sb.append("public class ").append(TYPE_NAME).append(" {").append(CR); - sb.append(CR); - sb.append(" "); - annotationWriter.appendIdFieldAnnotationTo(sb); - sb.append(CR); - sb.append(" private int id;").append(CR); - sb.append(CR); - sb.append(" "); - annotationWriter.appendNameFieldAnnotationTo(sb); - sb.append(CR); - sb.append(" private String name;").append(CR); - sb.append(CR); - sb.append(" "); - annotationWriter.appendGetIdMethodAnnotationTo(sb); - sb.append(CR); - sb.append(" public int getId() {").append(CR); - sb.append(" return this.id;").append(CR); - sb.append(" }").append(CR); - sb.append(CR); - sb.append(" "); - annotationWriter.appendSetIdMethodAnnotationTo(sb); - sb.append(CR); - sb.append(" public void setId(int id) {").append(CR); - sb.append(" this.id = id;").append(CR); - sb.append(" }").append(CR); - sb.append(CR); - sb.append(" "); - annotationWriter.appendGetNameMethodAnnotationTo(sb); - sb.append(CR); - sb.append(" public String getName() {").append(CR); - sb.append(" return this.name;").append(CR); - sb.append(" }").append(CR); - sb.append(CR); - sb.append(" "); - annotationWriter.appendSetNameMethodAnnotationTo(sb); - sb.append(CR); - sb.append(" public void setTestField(String testField) {").append(CR); - sb.append(" this.testField = testField;").append(CR); - sb.append(" }").append(CR); - sb.append(CR); - sb.append("}").append(CR); - } - - - // ********** queries ********** - - protected IType jdtType() throws JavaModelException { - return this.javaProject.findType(FULLY_QUALIFIED_TYPE_NAME); - } - - protected Type testType() throws JavaModelException { - return new Type(this.jdtType()); - } - - protected FieldAttribute idField() throws JavaModelException { - return this.fieldNamed("id"); - } - - protected FieldAttribute nameField() throws JavaModelException { - return this.fieldNamed("name"); - } - - protected FieldAttribute fieldNamed(String fieldName) throws JavaModelException { - return new FieldAttribute(this.jdtType().getField(fieldName)); - } - - protected MethodAttribute idGetMethod() throws JavaModelException { - return this.methodNamed("getId"); - } - - protected MethodAttribute nameGetMethod() throws JavaModelException { - return this.methodNamed("getName"); - } - - protected MethodAttribute methodNamed(String methodName) throws JavaModelException { - return this.method(methodName, EMPTY_STRING_ARRAY); - } - - protected MethodAttribute method(String methodName, String[] parameterTypeSignatures) throws JavaModelException { - return new MethodAttribute(this.jdtType().getMethod(methodName, parameterTypeSignatures)); - } - - protected String source() throws JavaModelException { - return this.jdtType().getOpenable().getBuffer().getContents(); - } - - - // ********** test validation ********** - - protected void assertSourceContains(String s) throws JavaModelException { - String source = this.source(); - boolean found = source.indexOf(s) > -1; - if ( ! found) { - String msg = "source does not contain the expected string: " + s + " (see System console)"; - System.out.println("*** " + this.getName() + " ****"); - System.out.println(msg); - System.out.println(source); - System.out.println(); - fail(msg); - } - } - - protected void assertSourceDoesNotContain(String s) throws JavaModelException { - String source = this.source(); - int pos = source.indexOf(s); - if (pos != -1) { - String msg = "unexpected string in source (position: " + pos + "): " + s + " (see System console)"; - System.out.println("*** " + this.getName() + " ****"); - System.out.println(msg); - System.out.println(source); - System.out.println(); - fail(msg); - } - } - - - // ********** manipulate annotations ********** - - /** - * Return the *first* member value pair for the specified annotation element - * with the specified name. - * Return null if the annotation has no such element. - */ - protected MemberValuePair memberValuePair(NormalAnnotation annotation, String elementName) { - for (MemberValuePair pair : this.values(annotation)) { - if (pair.getName().getFullyQualifiedName().equals(elementName)) { - return pair; - } - } - return null; - } - - @SuppressWarnings("unchecked") - protected List values(NormalAnnotation na) { - return na.values(); - } - - /** - * check for null member value pair - */ - protected Expression valueInternal(MemberValuePair pair) { - return (pair == null) ? null : pair.getValue(); - } - - /** - * Return the value of the *first* annotation element - * with the specified name. - * Return null if the annotation has no such element. - */ - protected Expression annotationElementValue(NormalAnnotation annotation, String elementName) { - return this.valueInternal(this.memberValuePair(annotation, elementName)); - } - - /** - * Return the value of the *first* annotation element - * with the specified name. - * Return null if the annotation has no such element. - */ - protected Expression annotationElementValue(SingleMemberAnnotation annotation, String elementName) { - return elementName.equals("value") ? annotation.getValue() : null; - } - - /** - * Return the value of the *first* annotation element - * with the specified name. - * Return null if the annotation has no such element. - * (An element name of "value" will return the value of a single - * member annotation.) - */ - protected Expression annotationElementValue(Annotation annotation, String elementName) { - if (annotation.isNormalAnnotation()) { - return this.annotationElementValue((NormalAnnotation) annotation, elementName); - } - if (annotation.isSingleMemberAnnotation()) { - return this.annotationElementValue((SingleMemberAnnotation) annotation, elementName); - } - return null; - } - - /** - * Build a number literal and set its initial value to the specified literal. - */ - protected NumberLiteral newNumberLiteral(AST ast, int value) { - return ast.newNumberLiteral(Integer.toString(value)); - } - - /** - * Build a string literal and set its initial value. - */ - protected StringLiteral newStringLiteral(AST ast, String value) { - StringLiteral stringLiteral = ast.newStringLiteral(); - stringLiteral.setLiteralValue(value); - return stringLiteral; - } - - protected MemberValuePair newMemberValuePair(AST ast, SimpleName name, Expression value) { - MemberValuePair pair = ast.newMemberValuePair(); - pair.setName(name); - pair.setValue(value); - return pair; - } - - protected MemberValuePair newMemberValuePair(AST ast, String name, Expression value) { - return this.newMemberValuePair(ast, ast.newSimpleName(name), value); - } - - protected MemberValuePair newMemberValuePair(AST ast, String name, String value) { - return this.newMemberValuePair(ast, name, this.newStringLiteral(ast, value)); - } - - protected MemberValuePair newMemberValuePair(AST ast, String name, int value) { - return this.newMemberValuePair(ast, name, this.newNumberLiteral(ast, value)); - } - - /** - * Add the specified member value pair to the specified annotation. - * Return the resulting annotation. - */ - protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, MemberValuePair pair) { - this.values(annotation).add(pair); - return annotation; - } - - /** - * Add the specified member value pair to the specified annotation. - * Return the resulting annotation. - */ - protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, int value) { - return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value)); - } - - /** - * Add the specified member value pair to the specified annotation. - * Return the resulting annotation. - */ - protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, String value) { - return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value)); - } - - - // ********** member classes ********** - - public interface AnnotationWriter { - Iterator imports(); - void appendTypeAnnotationTo(StringBuffer sb); - void appendIdFieldAnnotationTo(StringBuffer sb); - void appendNameFieldAnnotationTo(StringBuffer sb); - void appendGetIdMethodAnnotationTo(StringBuffer sb); - void appendSetIdMethodAnnotationTo(StringBuffer sb); - void appendGetNameMethodAnnotationTo(StringBuffer sb); - void appendSetNameMethodAnnotationTo(StringBuffer sb); - } - - public static class DefaultAnnotationWriter implements AnnotationWriter { - public Iterator imports() {return EmptyIterator.instance();} - public void appendTypeAnnotationTo(StringBuffer sb) {/* do nothing */} - public void appendIdFieldAnnotationTo(StringBuffer sb) {/* do nothing */} - public void appendNameFieldAnnotationTo(StringBuffer sb) {/* do nothing */} - public void appendGetIdMethodAnnotationTo(StringBuffer sb) {/* do nothing */} - public void appendSetIdMethodAnnotationTo(StringBuffer sb) {/* do nothing */} - public void appendGetNameMethodAnnotationTo(StringBuffer sb) {/* do nothing */} - public void appendSetNameMethodAnnotationTo(StringBuffer sb) {/* do nothing */} - } - - public static class AnnotationWriterWrapper implements AnnotationWriter { - private final AnnotationWriter aw; - public AnnotationWriterWrapper(AnnotationWriter aw) { - super(); - this.aw = aw; - } - public Iterator imports() {return aw.imports();} - public void appendTypeAnnotationTo(StringBuffer sb) {aw.appendTypeAnnotationTo(sb);} - public void appendIdFieldAnnotationTo(StringBuffer sb) {aw.appendIdFieldAnnotationTo(sb);} - public void appendNameFieldAnnotationTo(StringBuffer sb) {aw.appendNameFieldAnnotationTo(sb);} - public void appendGetIdMethodAnnotationTo(StringBuffer sb) {aw.appendGetIdMethodAnnotationTo(sb);} - public void appendSetIdMethodAnnotationTo(StringBuffer sb) {aw.appendSetIdMethodAnnotationTo(sb);} - public void appendGetNameMethodAnnotationTo(StringBuffer sb) {aw.appendGetNameMethodAnnotationTo(sb);} - public void appendSetNameMethodAnnotationTo(StringBuffer sb) {aw.appendSetNameMethodAnnotationTo(sb);} - } - - public class AnnotatedSourceWriter implements SourceWriter { - private AnnotationWriter annotationWriter; - public AnnotatedSourceWriter(AnnotationWriter annotationWriter) { - super(); - this.annotationWriter = annotationWriter; - } - public void appendSourceTo(StringBuffer sb) { - AnnotationTestCase.this.appendSourceTo(sb, this.annotationWriter); - } - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java deleted file mode 100644 index 10a259ccf7..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java +++ /dev/null @@ -1,728 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.StringLiteral; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; - -public class CombinationIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase { - - public CombinationIndexedDeclarationAnnotationAdapterTests(String name) { - super(name); - } - - private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception { - this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }"); - } - - public void testGetAnnotation1() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isNormalAnnotation()); - } - - public void testGetAnnotation2() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotation3() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isNormalAnnotation()); - } - - public void testGetAnnotation4() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotation5() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isNormalAnnotation()); - String value = ((StringLiteral) ((MemberValuePair) ((NormalAnnotation) annotation).values().get(0)).getValue()).getLiteralValue(); - assertEquals("ADDRESS_ID2", value); - } - - public void testGetAnnotation6() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotation7() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isNormalAnnotation()); - String value = ((StringLiteral) ((MemberValuePair) ((NormalAnnotation) annotation).values().get(0)).getValue()).getLiteralValue(); - assertEquals("ADDRESS_ID2", value); - } - - public void testGetAnnotation8() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testRemoveAnnotation1() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.removeAnnotation(); - this.assertSourceDoesNotContain("JoinColumn"); - } - - public void testRemoveAnnotation2() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.removeAnnotation(); - this.assertSourceDoesNotContain("JoinColumns"); - this.assertSourceDoesNotContain("JoinColumn"); - } - - public void testRemoveAnnotation3() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.removeAnnotation(); - this.assertSourceDoesNotContain("JoinColumns"); - this.assertSourceDoesNotContain("ADDRESS_ID2"); - this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")"); - } - - public void testRemoveAnnotation4() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.removeAnnotation(); - this.assertSourceDoesNotContain("JoinColumns"); - this.assertSourceDoesNotContain("ADDRESS_ID2"); - this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")"); - } - - public void testRemoveAnnotation5() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "String comment(); JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(comment=\"test\",columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.removeAnnotation(); - this.assertSourceContains("@annot.JoinColumns(comment=\"test\",columns=@annot.JoinColumn(name=\"ADDRESS_ID1\"))"); - } - - public void testRemoveAnnotation6() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns(null)"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.removeAnnotation(); - this.assertSourceContains("@annot.JoinColumns(null)"); - } - - public void testRemoveAnnotation12() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID0\")"; - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(expected); - this.assertSourceDoesNotContain("JoinColumns"); - } - - public void testRemoveAnnotation13() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({null, @annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - this.assertSourceContains("@annot.JoinColumn"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain("JoinColumn"); - } - - public void testRemoveAnnotation14() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), null})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID0\")"; - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation15() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})"); - String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})"; - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation16() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})"); - String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})"; - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 3); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation17() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({null, null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - this.assertSourceContains("@annot.JoinColumn"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain("JoinColumn"); - } - - public void testNewMarkerAnnotation1() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType(); - this.assertSourceDoesNotContain("JoinColumn"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("JoinColumn"); - this.assertSourceDoesNotContain("JoinColumns"); - } - - public void testNewMarkerAnnotation2() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn"); - this.assertSourceDoesNotContain("JoinColumns"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@JoinColumns(columns={@JoinColumn,@JoinColumn})"); - } - - public void testNewMarkerAnnotation3() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn," + CR + " @JoinColumn})"); - } - - public void testNewMarkerAnnotation4() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn(77)"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("JoinColumn"); - this.assertSourceDoesNotContain("JoinColumns"); - this.assertSourceDoesNotContain("77"); - } - - public void testNewMarkerAnnotation5() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 0); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@annot.JoinColumns(columns=@JoinColumn)"); - this.assertSourceDoesNotContain("77"); - } - - public void testNewMarkerAnnotation6() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})"); - } - - public void testNewMarkerAnnotation7() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn(77)"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@JoinColumns(columns={@JoinColumn(77),@JoinColumn})"); - } - - public void testNewMarkerAnnotation8() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(77),@annot.JoinColumn(88)})"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})"); - } - - public void testNewMarkerAnnotation9() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)"); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@JoinColumns(columns={@JoinColumn(text=\"blah\", num=42),@JoinColumn})"); - } - - public void testNewMarkerAnnotation23() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)"); - String expected = "@JoinColumns(columns={@JoinColumn(text=\"blah\", num=42),null,@JoinColumn})"; - this.assertSourceDoesNotContain(expected); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation24() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)"); - String expected1 = "@JoinColumns({"; - String expected2 = "@JoinColumn(text=\"blah\", num=42),null,"; - String expected3 = "@JoinColumn})"; - this.assertSourceDoesNotContain(expected1); - this.assertSourceDoesNotContain(expected2); - this.assertSourceDoesNotContain(expected3); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 2); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected1); - this.assertSourceContains(expected2); - this.assertSourceContains(expected3); - } - - public void testNewMarkerAnnotation25() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - String expected1 = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split - String expected2 = "@JoinColumn})"; - this.assertSourceDoesNotContain(expected1); - this.assertSourceDoesNotContain(expected2); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 4); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected1); - this.assertSourceContains(expected2); - } - - public void testNewMarkerAnnotation26() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - String expected1 = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split - String expected2 = "@JoinColumn})"; - this.assertSourceDoesNotContain(expected1); - this.assertSourceDoesNotContain(expected2); - DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 4); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected1); - this.assertSourceContains(expected2); - } - - public void testMoveAnnotation1() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")"); - String expected = "@JoinColumns(columns={null,@JoinColumn(name=\"ADDRESS_ID0\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 0); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(1); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation2() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID1\")"; - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - this.assertSourceDoesNotContain("JoinColumns"); - } - - public void testMoveAnnotation2a() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID1\")"; - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 1); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - this.assertSourceDoesNotContain("JoinColumns"); - } - - public void testMoveAnnotation3() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})"); - String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 3); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation4() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID4\")})"); - String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 3); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation5() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 2); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(3); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation6() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID0\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 0); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(3); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation7() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 3); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation8() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})"); - String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})"; - this.assertSourceDoesNotContain(expected); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 3); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation9() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})"; - this.createTestType(expected); // the source should be unchanged - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 0); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(3); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation10() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID0\")"; - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 2); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(1); - this.assertSourceContains(expected); - this.assertSourceDoesNotContain("@annot.JoinColumns"); - } - - public void testMoveAnnotation10a() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();"); - this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID0\")"; - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "value", 2); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(1); - this.assertSourceContains(expected); - this.assertSourceDoesNotContain("@annot.JoinColumns"); - } - - public void testMoveAnnotation11() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")"); - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 1); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceDoesNotContain("JoinColumn"); - } - - public void testMoveAnnotation12() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})"); - String expected = "@JoinColumn(name=\"ADDRESS_ID2\")"; - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 2); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - this.assertSourceDoesNotContain("@annot.JoinColumns"); - } - - public void testMoveAnnotation13() throws Exception { - this.createAnnotationAndMembers("JoinColumn", "String name();"); - this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();"); - this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})"); - String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})"; - IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter( - "annot.JoinColumn", "annot.JoinColumns", "columns", 3); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java deleted file mode 100644 index 5176595367..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java +++ /dev/null @@ -1,164 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import org.eclipse.jdt.core.Signature; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.FieldAttribute; -import org.eclipse.jpt.core.internal.jdtutility.JDTTools; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; - -public class JDTToolsTests extends AnnotationTestCase { - - public JDTToolsTests(String name) { - super(name); - } - - public void testResolveSignature1() throws Exception { - this.verifyResolveSignature("String", "java.lang.String"); - } - - public void testResolveSignature2() throws Exception { - this.verifyResolveSignature("List", null); - } - - public void testResolveSignature3() throws Exception { - this.verifyResolveSignature("int", "int"); - } - - public void testResolveSignature4() throws Exception { - this.verifyResolveSignature("void", "void"); - } - - public void testResolveSignature5() throws Exception { - this.verifyResolveSignature("int[]", "int[]"); - } - - public void testResolveSignature6() throws Exception { - this.verifyResolveSignature("String[]", "java.lang.String[]"); - } - - public void testResolveSignature7() throws Exception { - this.verifyResolveSignature("java.util.List[][][]", "java.util.List[][][]"); - } - - public void testResolveSignature8a() throws Exception { - // inner class - this.verifyResolveSignature("java.util.Map.Entry", "java.util.Map.Entry"); - } - - public void testResolveSignature8b() throws Exception { - // inner class - this.createTestType("java.util.Map", ""); - this.verifyResolveSignature2("Map.Entry", "java.util.Map.Entry"); - } - - public void testResolveSignature8c() throws Exception { - // inner class - this.createTestType("java.util.Map.Entry", ""); - this.verifyResolveSignature2("Entry", "java.util.Map.Entry"); - } - - public void testResolveSignature9() throws Exception { - // inner class - this.verifyResolveSignature("Character.Subset", "java.lang.Character.Subset"); - } - - public void testResolveSignature10() throws Exception { - // generic type - this.verifyResolveSignature("java.util.List", "java.util.List"); // ???? - } - - public void testResolveSignature11() throws Exception { - // annotation - this.createTestType("java.lang.annotation.Target", ""); - this.verifyResolveSignature2("Target", "java.lang.annotation.Target"); - } - - public void testResolveSignature12() throws Exception { - this.createTestType("java.lang.annotation.ElementType", ""); - this.verifyResolveSignature2("ElementType", "java.lang.annotation.ElementType"); - } - - private void verifyResolveSignature(String unresolvedTypeName, String expected) throws Exception { - this.createTestType(); - this.verifyResolveSignature2(unresolvedTypeName, expected); - } - - private void verifyResolveSignature2(String unresolvedTypeName, String expected) throws Exception { - String signature = Signature.createTypeSignature(unresolvedTypeName, false); - String actual = JDTTools.resolveSignature(signature, this.jdtType()); - assertEquals(expected, actual); - } - - - private void createEnumAndMembers(String enumName, String enumBody) throws Exception { - this.javaProject.createType("enums", enumName + ".java", "public enum " + enumName + " { " + enumBody + " }"); - } - - private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception { - this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }"); - } - - public void testResolveEnum1() throws Exception { - this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ"); - this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();"); - - this.createTestType("@annot.TestAnnotation(foo=enums.TestEnum.BAZ)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo"); - FieldAttribute field = this.idField(); - - String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea)); - assertEquals("enums.TestEnum.BAZ", actual); - } - - public void testResolveEnum2() throws Exception { - this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ"); - this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();"); - - this.createTestType("static enums.TestEnum.BAZ", "@annot.TestAnnotation(foo=BAZ)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo"); - FieldAttribute field = this.idField(); - - String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea)); - assertEquals("enums.TestEnum.BAZ", actual); - } - - public void testResolveEnum3() throws Exception { - this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ"); - this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();"); - - this.createTestType("static enums.TestEnum.*", "@annot.TestAnnotation(foo=BAZ)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo"); - FieldAttribute field = this.idField(); - - String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea)); - assertEquals("enums.TestEnum.BAZ", actual); - } - - public void testResolveEnum4() throws Exception { - this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ"); - this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();"); - - this.createTestType("enums.TestEnum", "@annot.TestAnnotation(foo=TestEnum.BAZ)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo"); - FieldAttribute field = this.idField(); - - String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea)); - assertEquals("enums.TestEnum.BAZ", actual); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java deleted file mode 100644 index a6a0fb6b52..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class JptCoreJdtUtilityTests { - - public static Test suite() { - TestSuite suite = new TestSuite(JptCoreJdtUtilityTests.class.getName()); - suite.addTestSuite(MemberAnnotationElementAdapterTests.class); - suite.addTestSuite(CombinationIndexedDeclarationAnnotationAdapterTests.class); - suite.addTestSuite(JDTToolsTests.class); - suite.addTestSuite(NestedDeclarationAnnotationAdapterTests.class); - suite.addTestSuite(NestedIndexedDeclarationAnnotationAdapterTests.class); - suite.addTestSuite(SimpleDeclarationAnnotationAdapterTests.class); - suite.addTestSuite(TypeTests.class); - return suite; - } - - private JptCoreJdtUtilityTests() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java deleted file mode 100644 index a13cf24929..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java +++ /dev/null @@ -1,615 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import java.util.Arrays; -import org.eclipse.jdt.core.dom.ArrayInitializer; -import org.eclipse.jdt.core.dom.BooleanLiteral; -import org.eclipse.jdt.core.dom.CharacterLiteral; -import org.eclipse.jdt.core.dom.NumberLiteral; -import org.eclipse.jdt.core.dom.TypeLiteral; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.jdtutility.ASTNodeTextRange; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.BooleanStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.CharacterStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumArrayDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NestedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.NumberStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.PrimitiveTypeStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.internal.jdtutility.StringArrayExpressionConverter; - -public class MemberAnnotationElementAdapterTests extends AnnotationTestCase { - - public MemberAnnotationElementAdapterTests(String name) { - super(name); - } - - private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception { - this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }"); - } - - private void createEnum(String enumName, String enumBody) throws Exception { - this.javaProject.createType("enums", enumName + ".java", "public enum " + enumName + " { " + enumBody + " }"); - } - - public void testGetValue1() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - this.createTestType("@annot.Foo(bar=\"xxx\")"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("xxx", aea.getValue()); - } - - public void testGetValue2() throws Exception { - this.createAnnotationAndMembers("Foo", "int bar();"); - this.createTestType("@annot.Foo(bar=48)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", NumberStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("48", aea.getValue()); - } - - public void testGetValue3() throws Exception { - this.createAnnotationAndMembers("Foo", "char bar();"); - this.createTestType("@annot.Foo(bar='c')"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", CharacterStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("c", aea.getValue()); - } - - public void testGetValue4() throws Exception { - this.createAnnotationAndMembers("Foo", "boolean bar();"); - this.createTestType("@annot.Foo(bar=false)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("false", aea.getValue()); - } - - public void testGetValue5() throws Exception { - this.createAnnotationAndMembers("Baz", "boolean fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))"); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("false", aea.getValue()); - } - - public void testGetValue6() throws Exception { - this.createAnnotationAndMembers("Foo", "boolean value();"); - this.createTestType("@annot.Foo(false)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("false", aea.getValue()); - } - - public void testGetValueNull1() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - this.createTestType("@annot.Foo"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testGetValueNull2() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - this.createTestType(); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testGetValueNull3() throws Exception { - this.createAnnotationAndMembers("Baz", "String fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz))"); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa3, "fred"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testASTNode1() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - String value = "\"xxx\""; - String element = "bar=" + value; - String annotation = "@annot.Foo(" + element + ")"; - this.createTestType(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - ITextRange textRange = new ASTNodeTextRange(aea.astNode()); - assertEquals(this.source().indexOf(value), textRange.getOffset()); - assertEquals(value.length(), textRange.getLength()); - assertEquals(7, textRange.getLineNumber()); - } - - public void testASTNode2() throws Exception { - this.createAnnotationAndMembers("Baz", "boolean fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - String value = "false"; - String element = "fred=" + value; - String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(" + element + ")))"; - this.createTestType(annotation); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("false", aea.getValue()); - ITextRange textRange = new ASTNodeTextRange(aea.astNode()); - assertEquals(value.length(), textRange.getLength()); - } - - public void testASTNode3() throws Exception { - this.createAnnotationAndMembers("Foo", "String value();"); - String element = "\"xxx\""; - String annotation = "@annot.Foo(" + element + ")"; - this.createTestType(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - ITextRange textRange = new ASTNodeTextRange(aea.astNode()); - assertEquals(this.source().indexOf(element), textRange.getOffset()); - assertEquals(element.length(), textRange.getLength()); - } - - public void testASTNode4() throws Exception { - this.createAnnotationAndMembers("Foo", "String value();"); - String annotation = "@annot.Foo"; - this.createTestType(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - ITextRange textRange = new ASTNodeTextRange(aea.astNode()); - assertEquals(this.source().indexOf(annotation), textRange.getOffset()); - assertEquals(annotation.length(), textRange.getLength()); - } - - public void testSetValue1() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - String annotation = "@annot.Foo(bar=\"xxx\")"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue(null); - this.assertSourceDoesNotContain("Foo"); - } - - public void testSetValue2() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - String annotation = "@annot.Foo(bar=\"xxx\")"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar", false); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue(null); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@Foo"); - } - - public void testSetValue3() throws Exception { - this.createAnnotationAndMembers("Baz", "boolean fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue(null); - this.assertSourceDoesNotContain(annotation); - this.assertSourceDoesNotContain("Foo"); - this.assertSourceDoesNotContain("Bar"); - } - - public void testSetValue3a() throws Exception { - this.createAnnotationAndMembers("Baz", "boolean fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar", false); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz", false); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue(null); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@annot.Foo(@Bar)"); - } - - public void testSetValue4() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - this.createTestType(); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("xxx"); - this.assertSourceContains("@Foo(bar=\"xxx\")"); - } - - public void testSetValue5() throws Exception { - this.createAnnotationAndMembers("Baz", "boolean fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("true"); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=true)))"); - } - - public void testSetValue6() throws Exception { - this.createAnnotationAndMembers("Baz", "boolean fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType(); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", BooleanStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("true"); - this.assertSourceContains("@Foo(@Bar(jimmy=@Baz(fred=true)))"); - } - - public void testSetValue7() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - String annotation = "@annot.Foo(bar=\"xxx\")"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("yyy"); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@annot.Foo(bar=\"yyy\")"); - } - - public void testSetValue8() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar();"); - String annotation = "@annot.Foo"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("xxx"); - this.assertSourceContains("@Foo(bar=\"xxx\")"); - } - - public void testSetValue9() throws Exception { - this.createAnnotationAndMembers("Foo", "String value(); String bar();"); - String annotation = "@annot.Foo(\"zzz\")"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("xxx"); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@Foo(value=\"zzz\", bar=\"xxx\")"); - } - - public void testSetValue10() throws Exception { - this.createAnnotationAndMembers("Foo", "String bar(); String baz();"); - String annotation = "@annot.Foo(bar=\"xxx\")"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "baz"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("yyy"); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@annot.Foo(bar=\"xxx\", baz = \"yyy\")"); - } - - public void testSetValue11() throws Exception { - this.createAnnotationAndMembers("Baz", "int fred();"); - this.createAnnotationAndMembers("Bar", "annot.Baz[] jimmy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - String annotation = "@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=2), @annot.Baz(fred=3)}))"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "jimmy", 2, "annot.Baz"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa3, "fred", NumberStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - assertEquals("2", aea.getValue()); - aea.setValue("48"); - this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=48), @annot.Baz(fred=3)}))"); - } - - public void testSetValue12() throws Exception { - this.createAnnotationAndMembers("Foo", "String value();"); - String annotation = "@annot.Foo"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("xxx"); - this.assertSourceContains("@Foo(\"xxx\")"); - } - - public void testSetValue13() throws Exception { - this.createAnnotationAndMembers("Foo", "String value();"); - String annotation = "@annot.Foo(\"zzz\")"; - this.createTestType(annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - - aea.setValue("xxx"); - this.assertSourceDoesNotContain(annotation); - this.assertSourceContains("@annot.Foo(\"xxx\")"); - } - - public void testSimpleTypeLiteral1() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType("@annot.Foo(bar=java.lang.Object.class)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", SimpleTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("java.lang.Object", aea.getValue()); - } - - public void testSimpleTypeLiteral2() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType(); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", SimpleTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - aea.setValue("java.lang.Object"); - this.assertSourceContains("@Foo(bar=java.lang.Object.class)"); - } - - public void testSimpleTypeLiteral3() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType("@annot.Foo(bar=int.class)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", SimpleTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testSimpleTypeLiteral4() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType("@annot.Foo(bar=java.util.Map.Entry.class)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", SimpleTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("java.util.Map.Entry", aea.getValue()); - } - - public void testPrimitiveTypeLiteral1() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType("@annot.Foo(bar=int.class)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", PrimitiveTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("int", aea.getValue()); - } - - public void testPrimitiveTypeLiteral2() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType(); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", PrimitiveTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - aea.setValue("int"); - this.assertSourceContains("@Foo(bar=int.class)"); - } - - public void testPrimitiveTypeLiteral3() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType("@annot.Foo(bar=java.lang.Object.class)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", PrimitiveTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testPrimitiveTypeLiteral4() throws Exception { - this.createAnnotationAndMembers("Foo", "Class bar();"); - this.createTestType("@annot.Foo(bar=void.class)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", PrimitiveTypeStringExpressionConverter.instance()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("void", aea.getValue()); - } - - public void testGetValueEnum1() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();"); - this.createTestType("@annot.Foo(bar=enums.TestEnum.XXX)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("enums.TestEnum.XXX", aea.getValue()); - } - - public void testGetValueEnum2() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();"); - this.createTestType("static enums.TestEnum.XXX", "@annot.Foo(bar=XXX)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("enums.TestEnum.XXX", aea.getValue()); - } - - public void testGetValueEnum3() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();"); - this.createTestType("@annot.Foo"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testGetValueEnum4() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();"); - this.createTestType("enums.TestEnum", "@annot.Foo(bar=TestEnum.XXX)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertEquals("enums.TestEnum.XXX", aea.getValue()); - } - - public void testSetValueEnum1() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();"); - String annotation = "@annot.Foo(bar=XXX)"; - this.createTestType("static enums.TestEnum.XXX", annotation); - this.assertSourceContains(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - aea.setValue(null); - this.assertSourceDoesNotContain("Foo"); - } - - public void testSetValueEnum2() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();"); - String annotation = "@Foo(bar=XXX)"; - this.createTestType(); - this.assertSourceDoesNotContain(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - aea.setValue("enums.TestEnum.XXX"); - this.assertSourceContains("import static enums.TestEnum.XXX;"); - this.assertSourceContains(annotation); - } - - public void testGetValueStringArray() throws Exception { - this.createAnnotationAndMembers("Foo", "String[] bar();"); - this.createTestType("@annot.Foo(bar={\"string0\", \"string1\"})"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", StringArrayExpressionConverter.forStringLiterals()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertTrue(Arrays.equals(new String[] {"string0", "string1"}, aea.getValue())); - } - - public void testGetValueNullStringArray() throws Exception { - this.createAnnotationAndMembers("Foo", "String[] bar();"); - this.createTestType("@annot.Foo()"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", StringArrayExpressionConverter.forStringLiterals()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testSetValueStringArray() throws Exception { - this.createAnnotationAndMembers("Foo", "String[] bar();"); - String annotation = "@Foo(bar={\"string0\",\"string1\"})"; - this.createTestType(); - this.assertSourceDoesNotContain(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new ConversionDeclarationAnnotationElementAdapter(daa, "bar", StringArrayExpressionConverter.forStringLiterals()); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - aea.setValue(new String[] {"string0", "string1"}); - this.assertSourceContains(annotation); - } - - public void testGetValueEnumArray() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();"); - this.createTestType("@annot.Foo(bar={enums.TestEnum.XXX, enums.TestEnum.YYY})"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"}, aea.getValue())); - } - - public void testGetValueNullEnumArray() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();"); - this.createTestType("@annot.Foo()"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - assertNull(aea.getValue()); - } - - public void testSetValueEnumArray() throws Exception { - this.createEnum("TestEnum", "XXX, YYY, ZZZ"); - this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();"); - String annotation = "@Foo(bar={XXX,YYY})"; - this.createTestType(); - this.assertSourceDoesNotContain(annotation); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationElementAdapter daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar"); - AnnotationElementAdapter aea = new MemberAnnotationElementAdapter(this.idField(), daea); - aea.setValue(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"}); - this.assertSourceContains("import static enums.TestEnum.XXX;"); - this.assertSourceContains("import static enums.TestEnum.YYY;"); - this.assertSourceContains(annotation); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java deleted file mode 100644 index e82d42c7c4..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java +++ /dev/null @@ -1,763 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jdt.core.dom.StringLiteral; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ModifiedDeclaration; -import org.eclipse.jpt.core.internal.jdtutility.NestedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; - -public class NestedDeclarationAnnotationAdapterTests extends AnnotationTestCase { - - public NestedDeclarationAnnotationAdapterTests(String name) { - super(name); - } - - private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception { - this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }"); - } - - public void testGetAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar)"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - } - - public void testGetAnnotation2() throws Exception { - this.createAnnotationAndMembers("Baz", "String value();"); - this.createAnnotationAndMembers("Bar", "annot.Baz yana();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar(yana=@annot.Baz))"); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "nestedAnnotation", "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "yana", "annot.Baz"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - } - - public void testGetAnnotationNull1() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo()"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull2() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType(); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull3() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "String nestedAnnotation();"); - this.createTestType("@annot.Foo(nestedAnnotation=\"annot.Bar\")"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull4() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Bar2", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();"); - this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar2)"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testRemoveAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - String na = "@annot.Foo(nestedAnnotation=@annot.Bar)"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain(na); - this.assertSourceDoesNotContain("Foo"); - } - - public void testRemoveAnnotation1a() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - String na = "@annot.Foo(nestedAnnotation=@annot.Bar)"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar", false); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain(na); - this.assertSourceContains("Foo"); - } - - public void testRemoveAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain("Foo"); - } - - public void testRemoveAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "String nestedAnnotation();"); - String na = "@annot.Foo(nestedAnnotation=\"annot.Bar\")"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(na); - } - - public void testRemoveAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Bar2", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();"); - String na = "@annot.Foo(nestedAnnotation=@annot.Bar2)"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(na); - } - - public void testRemoveAnnotation5() throws Exception { - this.createAnnotationAndMembers("Baz", "String value();"); - this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();"); - String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar"); - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain(na); - this.assertSourceDoesNotContain("Foo"); - this.assertSourceDoesNotContain("Bar"); - this.assertSourceDoesNotContain("Baz"); - } - - public void testRemoveAnnotation5a() throws Exception { - this.createAnnotationAndMembers("Baz", "String value();"); - this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();"); - String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar", false); - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz", false); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain(na); - this.assertSourceContains("@annot.Foo(nestedAnnotation1=@Bar)"); - } - - public void testNewMarkerAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@Foo(nestedAnnotation=@Bar)"); - } - - public void testNewMarkerAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@Foo(@Bar)"); - } - - public void testNewMarkerAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(nestedAnnotation=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "Object value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@annot.Foo(@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", value = @Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewSingleMemberAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration); - } - }); - this.assertSourceContains("@Foo(nestedAnnotation=@Bar(\"test string literal\"))"); - } - - void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) aa.getAnnotation(); - assertNull(annotation); - - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration); - } - }); - this.assertSourceContains("@Foo(@Bar(\"test string literal\"))"); - } - - void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(nestedAnnotation=@Bar(\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(@Bar(\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar(\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "Object value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@annot.Foo(@Bar(\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String xxx();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewSingleMemberAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value(); String xxx();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", value = @Bar(\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewNormalAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration); - } - }); - this.assertSourceContains("@Foo(nestedAnnotation=@Bar(yyy=\"test string literal\"))"); - } - - void editNewNormalAnnotation1(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration); - } - }); - this.assertSourceContains("@Foo(@Bar(yyy=\"test string literal\"))"); - } - - void editNewNormalAnnotation2(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(nestedAnnotation=@Bar(yyy=\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation3(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar value();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(@Bar(yyy=\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation4(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar(yyy=\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation5(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "Object value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@annot.Foo(@Bar(yyy=\"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation6(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(yyy = \"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation7(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - - public void testNewNormalAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "String yyy();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", value = @Bar(yyy = \"test string literal\"))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation8(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "yyy", "test string literal"); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java deleted file mode 100644 index e361b43ff7..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java +++ /dev/null @@ -1,2209 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.NumberLiteral; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ModifiedDeclaration; -import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; - -public class NestedIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase { - - public NestedIndexedDeclarationAnnotationAdapterTests(String name) { - super(name); - } - - private void createAnnotation(String annotationName) throws Exception { - this.createAnnotationAndMembers(annotationName, ""); - } - - private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception { - this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }"); - } - - public void testGetAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})"); - // 0 - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - - // 1 - daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 1, "annot.Bar"); - aa = new MemberAnnotationAdapter(this.idField(), daa); - annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isSingleMemberAnnotation()); - } - - public void testGetAnnotation2() throws Exception { - this.createAnnotation("Baz"); - this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana=@annot.Baz))"); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - } - - public void testGetAnnotation3() throws Exception { - this.createAnnotation("Baz"); - this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))"); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - - // name mismatch - daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz"); - aa = new MemberAnnotationAdapter(this.idField(), daa3); - annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull1() throws Exception { - this.createAnnotation("Bar"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo()"); - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull2() throws Exception { - this.createAnnotation("Bar"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull3() throws Exception { - this.createAnnotation("Bar"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=\"annot.Bar\")"); - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull4() throws Exception { - this.createAnnotation("NotBar"); - this.createAnnotation("Bar"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull5() throws Exception { - this.createAnnotationAndMembers("Bar", "String value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})"); - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull6() throws Exception { - this.createAnnotation("Xyz"); - this.createAnnotation("Baz"); - this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))"); - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar"); - DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testRemoveAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1)})"; - String expected = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain("Foo"); - } - - public void testRemoveAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={\"annot.Bar1\", \"annot.Bar2\", \"annot.Bar3\"})"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(na); - } - - public void testRemoveAnnotation4() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.NotBar(0), @annot.NotBar(1)})"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(na); - } - - public void testRemoveAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations=@annot.Bar)"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - assertNull(aa.getAnnotation()); - this.assertSourceDoesNotContain(na); - this.assertSourceDoesNotContain("Foo"); - } - - public void testRemoveAnnotation5a() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations=@annot.Bar)"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar", false); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertTrue(aa1.getAnnotation().isMarkerAnnotation()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains("import annot.Foo;"); - this.assertSourceContains("@Foo"); - } - - public void testRemoveAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations=\"annot.Bar\")"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(na); - } - - public void testRemoveAnnotation7() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations=@annot.NotBar)"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.removeAnnotation(); - this.assertSourceContains(na); - } - - public void testRemoveAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertTrue(aa1.getAnnotation().isNormalAnnotation()); - assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})"); - } - - public void testRemoveAnnotation9() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertTrue(aa1.getAnnotation().isSingleMemberAnnotation()); - assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains("@annot.Foo({@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})"); - } - - public void testRemoveAnnotation10() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})"; - String expected = "@annot.Foo({null, @annot.Bar(1)})"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 0, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation11() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})"; - String expected = "@annot.Foo(@annot.Bar(0))"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation12() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})"; - String expected = "@annot.Foo(@annot.Bar(0))"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation13() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({null, @annot.Bar(1)})"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - this.assertSourceDoesNotContain("Foo"); - } - - public void testRemoveAnnotation14() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), null})"; - String expected = "@annot.Foo(@annot.Bar(0))"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation15() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})"; - String expected = "@annot.Foo({@annot.Bar(0), null, null, @annot.Bar(3)})"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation16() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})"; - String expected = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 3, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation17() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})"; - String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation18() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})"; - this.createTestType(na); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 1, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - this.assertSourceDoesNotContain("Foo"); - } - - public void testRemoveAnnotation19() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), null})"; - String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation20() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})"; - String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, null, @annot.Bar(3)})"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testRemoveAnnotation21() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})"; - String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})"; - this.createTestType(na); - this.assertSourceDoesNotContain(expected); - this.assertSourceContains(na); - - DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1); - DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 3, "annot.Bar"); - AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2); - Annotation annotation = aa2.getAnnotation(); - assertNotNull(annotation); - - aa2.removeAnnotation(); - assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType()); - this.assertSourceDoesNotContain(na); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@Foo(nestedAnnotations=@Bar)"); - } - - public void testNewMarkerAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType(); - this.assertSourceDoesNotContain("Foo"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@Foo(@Bar)"); - } - - public void testNewMarkerAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(nestedAnnotations=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@annot.Foo(@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", value = @Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation9() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - assertNull(aa.getAnnotation()); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar})"); - } - - public void testNewMarkerAnnotation10() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(\"something\")"); - this.assertSourceDoesNotContain("Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar})"); - } - - public void testNewMarkerAnnotation11() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({\"one\", \"two\"})"); - String expected = "@annot.Foo({@Bar, \"two\"})"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation12() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({\"one\", \"two\"})"); - this.assertSourceDoesNotContain("Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("Bar})"); // split line - } - - public void testNewMarkerAnnotation13() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(7)"); - String expected = "@annot.Foo(@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation14() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(7)"); - this.assertSourceDoesNotContain("Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar})"); - } - - public void testNewMarkerAnnotation15() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(@annot.NotBar)"); - String expected = "@annot.Foo(@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation16() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(@annot.Bar(55))"); - String expected = "@annot.Foo({@annot.Bar(55),@Bar})"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation17() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})"); - String expected = "@annot.Foo(nestedAnnotations={@Bar})"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation18() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})"); - this.assertSourceDoesNotContain("Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("Bar})"); // split line - } - - public void testNewMarkerAnnotation19() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=\"something\")"); - String expected = "@annot.Foo(nestedAnnotations=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation20() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - String expected = "@annot.Foo(nestedAnnotations=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation21() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar})"); - } - - public void testNewMarkerAnnotation22() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))"); - String expected = "@annot.Foo(nestedAnnotations=@Bar)"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation23() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))"); - String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(88),null,@Bar})"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation24() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(@annot.Bar(88))"); - String expected = "@annot.Foo({@annot.Bar(88),null,@Bar})"; - this.assertSourceDoesNotContain(expected); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected); - } - - public void testNewMarkerAnnotation25() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77)})"); - String expected1 = "@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split - String expected2 = "@Bar})"; - this.assertSourceDoesNotContain(expected1); - this.assertSourceDoesNotContain(expected2); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 4, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected1); - this.assertSourceContains(expected2); - } - - public void testNewMarkerAnnotation26() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(88), @annot.Bar(77)})"); - String expected1 = "@annot.Foo({@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split - String expected2 = "@Bar})"; - this.assertSourceDoesNotContain(expected1); - this.assertSourceDoesNotContain(expected2); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 4, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - aa.newMarkerAnnotation(); - this.assertSourceContains(expected1); - this.assertSourceContains(expected2); - } - - public void testNewSingleMemberAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - this.assertSourceDoesNotContain("@Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration); - } - }); - this.assertSourceContains("@Foo(nestedAnnotations=@Bar(88))"); - } - - void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType(); - this.assertSourceDoesNotContain("@Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration); - } - }); - this.assertSourceContains("@Foo(@Bar(88))"); - } - - void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(nestedAnnotations=@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@annot.Foo(@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", value = @Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation9() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newSingleMemberAnnotation(); - this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar(MISSING)})"); // ??? - } - - public void testNewSingleMemberAnnotation10() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(\"something\")"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newSingleMemberAnnotation(); - this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar(MISSING)})"); // ??? - } - - public void testNewSingleMemberAnnotation11() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({\"one\", \"two\"})"); - String expected = "@annot.Foo({@Bar(88), \"two\"})"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation11(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation11(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation12() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({\"one\", \"two\"})"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newSingleMemberAnnotation(); - this.assertSourceContains("@Bar(MISSING)})"); // split line - } - - public void testNewSingleMemberAnnotation13() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(7)"); - String expected = "@annot.Foo(@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation13(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation13(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation14() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(7)"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newSingleMemberAnnotation(); - this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar(MISSING)})"); - } - - public void testNewSingleMemberAnnotation15() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(@annot.NotBar)"); - String expected = "@annot.Foo(@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation15(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation15(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation16() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(@annot.Bar(55))"); - String expected = "@annot.Foo({@annot.Bar(55),@Bar(88)})"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation16(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation16(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation17() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})"); - String expected = "@annot.Foo(nestedAnnotations={@Bar(88)})"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation17(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation17(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation18() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newSingleMemberAnnotation(); - this.assertSourceContains("@Bar(MISSING)})"); // ??? - } - - public void testNewSingleMemberAnnotation19() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=\"something\")"); - String expected = "@annot.Foo(nestedAnnotations=@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation19(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation19(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation20() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - String expected = "@annot.Foo(nestedAnnotations=@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation20(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation20(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewSingleMemberAnnotation21() throws Exception { - this.createAnnotationAndMembers("NotBar", "int value();"); - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newSingleMemberAnnotation(); - this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar(MISSING)})"); - } - - public void testNewSingleMemberAnnotation22() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))"); - String expected = "@annot.Foo(nestedAnnotations=@Bar(88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation22(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewSingleMemberAnnotation22(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - SingleMemberAnnotation annotation = daa.newSingleMemberAnnotation(declaration); - NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral(); - numberLiteral.setToken("88"); - annotation.setValue(numberLiteral); - } - - public void testNewNormalAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - this.assertSourceDoesNotContain("@Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration); - } - }); - this.assertSourceContains("@Foo(nestedAnnotations=@Bar(xxx=88))"); - } - - void editNewNormalAnnotation1(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType(); - this.assertSourceDoesNotContain("@Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration); - } - }); - this.assertSourceContains("@Foo(@Bar(xxx=88))"); - } - - void editNewNormalAnnotation2(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(nestedAnnotations=@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation3(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();"); - this.createTestType("@annot.Foo"); - String expected = "@Foo(@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation4(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation5(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(\"something\")"); - String expected = "@annot.Foo(@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation6(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(xxx = 88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation7(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value(); String xxx();"); - this.createTestType("@annot.Foo(xxx=\"something\")"); - String expected = "@annot.Foo(xxx=\"something\", value = @Bar(xxx = 88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation8(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation9() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();"); - this.createTestType(); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newNormalAnnotation(); - this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar()})"); - } - - public void testNewNormalAnnotation10() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();"); - this.createTestType("@annot.Foo(\"something\")"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newNormalAnnotation(); - this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar()})"); - } - - public void testNewNormalAnnotation11() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({\"one\", \"two\"})"); - String expected = "@annot.Foo({@Bar(xxx=88), \"two\"})"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation11(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation11(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation12() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo({\"one\", \"two\"})"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newNormalAnnotation(); - this.assertSourceContains("@Bar()})"); // split line - } - - public void testNewNormalAnnotation13() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(7)"); - String expected = "@annot.Foo(@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation13(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation13(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation14() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(7)"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newNormalAnnotation(); - this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar()})"); - } - - public void testNewNormalAnnotation15() throws Exception { - this.createAnnotationAndMembers("NotBar", "int xxx();"); - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] value();"); - this.createTestType("@annot.Foo(@annot.NotBar)"); - String expected = "@annot.Foo(@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation15(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation15(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation16() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(@annot.Bar(55))"); - String expected = "@annot.Foo({@annot.Bar(55),@Bar(xxx=88)})"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation16(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation16(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation17() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})"); - String expected = "@annot.Foo(nestedAnnotations={@Bar(xxx=88)})"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation17(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation17(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation18() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newNormalAnnotation(); - this.assertSourceContains("@Bar()})"); // split line - } - - public void testNewNormalAnnotation19() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=\"something\")"); - String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation19(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation19(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation20() throws Exception { - this.createAnnotationAndMembers("NotBar", "int xxx();"); - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation20(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation20(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testNewNormalAnnotation21() throws Exception { - this.createAnnotationAndMembers("NotBar", "int xxx();"); - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)"); - this.assertSourceDoesNotContain("@Bar"); - - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newNormalAnnotation(); - this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar()})"); - } - - public void testNewNormalAnnotation22() throws Exception { - this.createAnnotationAndMembers("Bar", "int xxx();"); - this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();"); - this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))"); - String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))"; - this.assertSourceDoesNotContain(expected); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation22(declaration); - } - }); - this.assertSourceContains(expected); - } - - void editNewNormalAnnotation22(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar"); - NormalAnnotation annotation = daa.newNormalAnnotation(declaration); - this.addMemberValuePair(annotation, "xxx", 88); - } - - public void testMoveAnnotation1() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(@annot.Bar(00))"); - String expected = "@annot.Foo({null,@annot.Bar(00)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(1); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation2() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({null, @annot.Bar(11)})"); - String expected = "@annot.Foo(@annot.Bar(11))"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation3() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33)})"); - String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation4() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33), @annot.Bar(44)})"); - String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation5() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})"); - String expected = "@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(22)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(3); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation6() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})"); - String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), @annot.Bar(00)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(3); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation7() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})"); - String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation8() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})"); - String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})"; - this.assertSourceDoesNotContain(expected); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation9() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})"; - this.createTestType(expected); // the source should be unchanged - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(3); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation10() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11)})"); - String expected = "@annot.Foo(@annot.Bar(00))"; - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - iaa.moveAnnotation(1); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation11() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo(@annot.Bar(00))"); - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceDoesNotContain("Foo"); - } - - public void testMoveAnnotation12() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), null, @annot.Bar(22)})"); - String expected = "@annot.Foo(@annot.Bar(22))"; - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - - public void testMoveAnnotation13() throws Exception { - this.createAnnotationAndMembers("Bar", "int value();"); - this.createAnnotationAndMembers("Foo", "annot.Bar[] value();"); - this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(33)})"); - String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11)})"; - - IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter( - new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar"); - IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa); - Annotation annotation = iaa.getAnnotation(); - assertNotNull(annotation); - - iaa.moveAnnotation(0); - this.assertSourceContains(expected); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java deleted file mode 100644 index 0e014b66b5..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java +++ /dev/null @@ -1,204 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.Expression; -import org.eclipse.jdt.core.dom.MemberValuePair; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.NumberLiteral; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; -import org.eclipse.jdt.core.dom.StringLiteral; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ModifiedDeclaration; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; - -public class SimpleDeclarationAnnotationAdapterTests extends AnnotationTestCase { - - public SimpleDeclarationAnnotationAdapterTests(String name) { - super(name); - } - - private void createAnnotation(String annotationName) throws Exception { - this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " {}"); - } - - public void testGetAnnotation1() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("@annot.Foo"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - } - - public void testGetAnnotation2() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("@annot.Foo(1) @annot.Foo(2)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isSingleMemberAnnotation()); - Expression value = ((SingleMemberAnnotation) annotation).getValue(); - assertEquals(ASTNode.NUMBER_LITERAL, value.getNodeType()); - assertEquals("1", ((NumberLiteral) value).getToken()); - } - - public void testGetAnnotation3() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("annot.Foo", "@Foo"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - assertEquals("Foo", annotation.getTypeName().getFullyQualifiedName()); - assertTrue(annotation.isMarkerAnnotation()); - } - - public void testGetAnnotationNull1() throws Exception { - this.createAnnotation("Foo"); - this.createTestType(); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - } - - public void testGetAnnotationNull2() throws Exception { - this.createAnnotation("Foo"); - this.createAnnotation("Fop"); - this.createTestType("@annot.Fop"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - this.assertSourceContains("@annot.Fop"); - } - - public void testGetAnnotationNull3() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("@annot.Foo"); - // un-qualified name - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - this.assertSourceContains("@annot.Foo"); - } - - public void testRemoveAnnotation1() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("@annot.Foo"); - this.assertSourceContains("@annot.Foo"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain("@annot.Foo"); - } - - public void testRemoveAnnotation2() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("@annot.Foo(1) @annot.Foo(2)"); - this.assertSourceContains("@annot.Foo(1) @annot.Foo(2)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.removeAnnotation(); - this.assertSourceDoesNotContain("@annot.Foo(1)"); - this.assertSourceContains("@annot.Foo(2)"); - } - - public void testNewMarkerAnnotation1() throws Exception { - this.createAnnotation("Foo"); - this.createTestType(); - this.assertSourceDoesNotContain("@annot.Foo"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("import annot.Foo;"); - this.assertSourceContains("@Foo"); - } - - public void testNewMarkerAnnotation2() throws Exception { - this.createAnnotation("Foo"); - this.createTestType("@annot.Foo(88)"); - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa); - Annotation annotation = aa.getAnnotation(); - assertNotNull(annotation); - - aa.newMarkerAnnotation(); - this.assertSourceContains("import annot.Foo;"); - this.assertSourceContains("@Foo"); - this.assertSourceDoesNotContain("@annot.Foo(88)"); - } - - public void testNewSingleMemberAnnotation() throws Exception { - this.createAnnotation("Foo"); - this.createTestType(); - this.assertSourceDoesNotContain("@Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - SimpleDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation(declaration); - } - }); - this.assertSourceContains("import annot.Foo;"); - this.assertSourceContains("@Foo(\"test string literal\")"); - } - - void editNewSingleMemberAnnotation(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newSingleMemberAnnotation(declaration); - StringLiteral stringLiteral = annotation.getAST().newStringLiteral(); - stringLiteral.setLiteralValue("test string literal"); - annotation.setValue(stringLiteral); - } - - public void testNewNormalAnnotation() throws Exception { - this.createAnnotation("Foo"); - this.createTestType(); - this.assertSourceDoesNotContain("@Foo"); - this.idField().edit(new Member.Editor() { - public void edit(ModifiedDeclaration declaration) { - SimpleDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation(declaration); - } - }); - this.assertSourceContains("import annot.Foo;"); - this.assertSourceContains("@Foo(bar=\"test string literal\")"); - } - - void editNewNormalAnnotation(ModifiedDeclaration declaration) { - DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo"); - NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration); - assertNull(annotation); - annotation = daa.newNormalAnnotation(declaration); - MemberValuePair mvp = this.newMemberValuePair(annotation.getAST(), "bar", "test string literal"); - this.values(annotation).add(mvp); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java deleted file mode 100644 index 637115678b..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.jdtutility; - -import org.eclipse.jdt.core.IType; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.jdtutility.Type; - -public class TypeTests extends AnnotationTestCase { - - private IType jdtType; - private Type testType; - - - public TypeTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.jdtType = this.createTestType(); - this.testType = new Type(this.jdtType); - } - - @Override - protected void tearDown() throws Exception { - this.testType = null; - this.jdtType = null; - super.tearDown(); - } - - public void testGetJdtMember() throws Exception { - assertEquals(this.jdtType, this.testType.getJdtMember()); - } - - public void testIsAbstract() throws Exception { - assertFalse(this.testType.isAbstract()); - } - - public void testTopLevelDeclaringType() throws Exception { - assertEquals(this.testType, this.testType.topLevelDeclaringType()); - } - - public void testGetDeclaringType() throws Exception { - assertNull(this.testType.getDeclaringType()); - } - - public void testGetName() throws Exception { - assertEquals(TYPE_NAME, this.testType.getName()); - } - - public void testTextRange() throws Exception { - String source = this.jdtType.getOpenable().getBuffer().getContents(); - ITextRange textRange = this.testType.textRange(); - String body = source.substring(textRange.getOffset()); - assertTrue(body.startsWith("public class " + TYPE_NAME)); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java deleted file mode 100644 index d7d2ffe080..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.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.core.tests.internal.model; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class JptCoreModelTests { - - public static Test suite() { - TestSuite suite = new TestSuite(JptCoreModelTests.class.getPackage().getName()); - suite.addTestSuite(ModelInitializationTests.class); - return suite; - } - - private JptCoreModelTests() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java deleted file mode 100644 index 620ec258a1..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.model; - -import junit.framework.TestCase; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.jpt.core.internal.IJpaModel; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JptCorePlugin; -import org.eclipse.jpt.core.tests.internal.ProjectUtility; -import org.eclipse.jpt.core.tests.internal.projects.TestFacetedProject; -import org.eclipse.jpt.utility.internal.ClassTools; -import org.eclipse.jpt.utility.internal.CollectionTools; - -public class ModelInitializationTests extends TestCase { - private IJpaModel jpaModel; - - - public ModelInitializationTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - ProjectUtility.deleteAllProjects(); - this.jpaModel = JptCorePlugin.getJpaModel(); - } - - @Override - protected void tearDown() throws Exception { - ProjectUtility.deleteAllProjects(); - this.jpaModel = null; - super.tearDown(); - } - - /** - * Builds a project with the java and utility facets installed, and with - * pre-existing entities added. - */ - private TestFacetedProject buildTestProject() throws CoreException { - TestFacetedProject testProject = new TestFacetedProject(ClassTools.shortClassNameForObject(this), true); - testProject.installFacet("jst.java", "5.0"); - testProject.installFacet("jst.utility", "1.0"); - testProject.createFile( - new Path("src/test.pkg/TestEntity.java"), - "package test.pkg; @Entity public class TestEntity {}"); - testProject.createFile( - new Path("src/test.pkg/TestEntity2.java"), - "package test.pkg; @Entity public class TestEntity2 {}"); - return testProject; - } - - public void testBasic() { - assertNotNull(this.jpaModel); - } - - public void testFacetInstallation() throws CoreException { - TestFacetedProject testProject = buildTestProject(); - assertNull(this.jpaModel.getJpaProject(testProject.getProject())); - testProject.installFacet("jpt.jpa", "1.0"); - assertEquals(1, CollectionTools.size(this.jpaModel.jpaProjects())); - IJpaProject jpaProject = this.jpaModel.getJpaProject(testProject.getProject()); - assertNotNull(jpaProject); - assertEquals(4, CollectionTools.size(jpaProject.jpaFiles())); - assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity.java")))); - assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity2.java")))); - } - - public void testProjectOpening() throws CoreException { - TestFacetedProject testProject = buildTestProject(); - testProject.installFacet("jpt.jpa", "1.0"); - testProject.close(); - assertTrue(! testProject.getProject().isOpen()); - testProject.open(); - IJpaProject jpaProject = this.jpaModel.getJpaProject(testProject.getProject()); - assertNotNull(jpaProject); - assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity.java")))); - assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity2.java")))); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java deleted file mode 100644 index 94c306e4f0..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.eclipse.jpt.core.tests.internal.platform; - -import java.io.IOException; -import junit.framework.TestCase; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jpt.core.internal.IJpaFile; -import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; -import org.eclipse.jpt.core.internal.content.orm.OrmFactory; -import org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal; -import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode; -import org.eclipse.jpt.core.internal.content.persistence.JavaClassRef; -import org.eclipse.jpt.core.internal.content.persistence.Persistence; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceFactory; -import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode; -import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject; -import org.eclipse.jpt.utility.internal.CollectionTools; - -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(); - 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 { - jpaProject.dispose(); - 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(); - Persistence 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 {}" - ); - JavaClassRef javaClassRef = PersistenceFactory.eINSTANCE.createJavaClassRef(); - javaClassRef.setJavaClass(PACKAGE_NAME + ".JavaEntity"); - persistence.getPersistenceUnits().get(0).getClasses().add(javaClassRef); - persistence.eResource().save(null); - - assertEquals(2, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME))); - } -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java deleted file mode 100644 index 589e63112e..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.platform; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class JptCorePlatformTests -{ - public static Test suite() { - TestSuite suite = new TestSuite(JptCorePlatformTests.class.getName()); -// suite.addTestSuite(BaseJpaPlatformTests.class); - return suite; - } - - private JptCorePlatformTests() { - super(); - throw new UnsupportedOperationException(); - } -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java deleted file mode 100644 index 6b638fa21b..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.projects; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; - -public class TestFacetedProject extends TestPlatformProject { - private IFacetedProject facetedProject; - - - // ********** constructors/initialization ********** - - public TestFacetedProject(String projectName) throws CoreException { - this(projectName, true); - } - - public TestFacetedProject(String projectName, boolean autoBuild) throws CoreException { - super(projectName, autoBuild); - this.facetedProject = this.createFacetedProject(); - } - - private IFacetedProject createFacetedProject() throws CoreException { - return ProjectFacetsManager.create(this.getProject(), true, null); // true = "convert if necessary" - } - - - // ********** public methods ********** - - public IFacetedProject getFacetedProject() { - return this.facetedProject; - } - - public void installFacet(String facetName, String versionName) throws CoreException { - IProjectFacetVersion facetVersion = ProjectFacetsManager.getProjectFacet(facetName).getVersion(versionName); - this.facetedProject.installProjectFacet(facetVersion, null, null); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java deleted file mode 100644 index a19529b0e1..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.projects; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.search.IJavaSearchConstants; -import org.eclipse.jdt.core.search.SearchEngine; -import org.eclipse.jdt.core.search.SearchPattern; -import org.eclipse.jdt.core.search.TypeNameRequestor; -import org.eclipse.jpt.utility.internal.CollectionTools; - -/** - * This builds and holds a "Java" project. - * Support for adding packages and types. - */ -public class TestJavaProject extends TestFacetedProject { - - private IJavaProject javaProject; - private IPackageFragmentRoot sourceFolder; - - - // ********** constructors/initialization ********** - - public TestJavaProject() throws CoreException { - this("TestJavaProject"); - } - - public TestJavaProject(String projectName) throws CoreException { - this(projectName, false); - } - - public TestJavaProject(String projectName, boolean autoBuild) throws CoreException { - super(projectName, autoBuild); - this.installFacet("jst.java", "5.0"); - this.javaProject = JavaCore.create(this.getProject()); - this.sourceFolder = this.javaProject.getPackageFragmentRoot(this.getProject().getFolder("src")); - } - - protected void addJar(String jarPath) throws JavaModelException { - this.addClasspathEntry(JavaCore.newLibraryEntry(new Path(jarPath), null, null)); - } - - private void addClasspathEntry(IClasspathEntry entry) throws JavaModelException { - this.javaProject.setRawClasspath(CollectionTools.add(this.javaProject.getRawClasspath(), entry), null); - } - - - // ********** public methods ********** - - public IPackageFragment createPackage(String packageName) throws CoreException { - return this.sourceFolder.createPackageFragment(packageName, false, null); // false = "no force" - } - - /** - * The source should NOT contain a package declaration; - * it will be added here. - */ - public IType createType(String packageName, String compilationUnitName, String source) throws CoreException { - return this.createType(this.createPackage(packageName), compilationUnitName, new SimpleSourceWriter(source)); - } - - /** - * The source should NOT contain a package declaration; - * it will be added here. - */ - public IType createType(String packageName, String compilationUnitName, SourceWriter sourceWriter) throws CoreException { - return this.createType(this.createPackage(packageName), compilationUnitName, sourceWriter); - } - - /** - * The source should NOT contain a package declaration; - * it will be added here. - */ - public IType createType(IPackageFragment packageFragment, String compilationUnitName, SourceWriter sourceWriter) throws CoreException { - StringBuffer sb = new StringBuffer(2000); - sb.append("package ").append(packageFragment.getElementName()).append(";").append(CR); - sb.append(CR); - sourceWriter.appendSourceTo(sb); - String source = sb.toString(); - ICompilationUnit cu = packageFragment.createCompilationUnit(compilationUnitName, source, false, null); // false = "no force" - return cu.findPrimaryType(); - } - - public IType findType(String fullyQualifiedName) throws JavaModelException { - return this.javaProject.findType(fullyQualifiedName); - } - - @Override - public void dispose() throws CoreException { - this.waitForIndexer(); - this.sourceFolder = null; - this.javaProject = null; - super.dispose(); - } - - - // ********** internal methods ********** - - private void waitForIndexer() throws JavaModelException { - new SearchEngine().searchAllTypeNames( - null, - SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE, - null, - SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE, - IJavaSearchConstants.CLASS, - SearchEngine.createJavaSearchScope(new IJavaElement[0]), - new TypeNameRequestor() {/* do nothing */}, - IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, - null - ); - } - - - // ********** member classes ********** - - public interface SourceWriter { - void appendSourceTo(StringBuffer sb); - } - - public class SimpleSourceWriter implements SourceWriter { - private final String source; - public SimpleSourceWriter(String source) { - super(); - this.source = source; - } - public void appendSourceTo(StringBuffer sb) { - sb.append(source); - } - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java deleted file mode 100644 index 68f01e8f2b..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.projects; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jpt.core.internal.IJpaProject; -import org.eclipse.jpt.core.internal.JptCorePlugin; - -public class TestJpaProject extends TestJavaProject { - private IJpaProject jpaProject; - - public static final String JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar"; - - // ********** constructors/initialization ********** - - public TestJpaProject() throws CoreException { - this("TestJpaProject"); - } - - public TestJpaProject(String projectName) throws CoreException { - this(projectName, false); - } - - public TestJpaProject(String projectName, boolean autoBuild) throws CoreException { - super(projectName, autoBuild); - this.installFacet("jst.utility", "1.0"); - this.installFacet("jpt.jpa", "1.0"); - this.addJar(this.jarName()); - this.jpaProject = JptCorePlugin.getJpaProject(this.getProject()); - } - - protected String jarName() { - String jarName = System.getProperty(JAR_NAME_SYSTEM_PROPERTY); - if (jarName == null) { - throw new RuntimeException("missing Java system property: \"" + JAR_NAME_SYSTEM_PROPERTY + "\""); - } - return jarName; - } - - - // ********** public methods ********** - - public IJpaProject getJpaProject() { - return this.jpaProject; - } - - @Override - public void dispose() throws CoreException { - this.jpaProject = null; - super.dispose(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java deleted file mode 100644 index 7fbca7957d..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.tests.internal.projects; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspaceDescription; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jpt.utility.internal.CollectionTools; - -/** - * This builds and holds a "general" project. - * Support for adding natures, folders, and files. - */ -public class TestPlatformProject { - - private final IProject project; - - /** carriage return */ - public static final String CR = System.getProperty("line.separator"); - - - // ********** constructors/initialization ********** - - public TestPlatformProject() throws CoreException { - this(false); - } - - public TestPlatformProject(boolean autoBuild) throws CoreException { - this("TestProject", autoBuild); - } - - public TestPlatformProject(String projectName, boolean autoBuild) throws CoreException { - super(); - this.setAutoBuild(autoBuild); // workspace-wide setting - this.project = this.createPlatformProject(projectName); - } - - private void setAutoBuild(boolean autoBuild) throws CoreException { - IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription(); - description.setAutoBuilding(autoBuild); - ResourcesPlugin.getWorkspace().setDescription(description); - } - - private IProject createPlatformProject(String projectName) throws CoreException { - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - p.create(null); - p.open(null); - return p; - } - - - // ********** public methods ********** - - public IProject getProject() { - return this.project; - } - - public void addProjectNature(String natureID) throws CoreException { - IProjectDescription description = this.project.getDescription(); - description.setNatureIds((String[]) CollectionTools.add(description.getNatureIds(), natureID)); - this.project.setDescription(description, null); - } - - public void removeProjectNature(String natureID) throws CoreException { - IProjectDescription description = this.project.getDescription(); - description.setNatureIds((String[]) CollectionTools.removeAllOccurrences(description.getNatureIds(), natureID)); - this.project.setDescription(description, null); - } - - /** - * Create a folder with the specified name directly under the project. - */ - public IFolder createFolder(String folderName) throws CoreException { - return this.createFolder(this.project, new Path(folderName)); - } - - /** - * Create a folder in the specified container with the specified name. - */ - public IFolder createFolder(IContainer container, String folderName) throws CoreException { - return this.createFolder(container, new Path(folderName)); - } - - /** - * Create a folder in the specified container with the specified path. - */ - public IFolder createFolder(IContainer container, IPath folderPath) throws CoreException { - IFolder folder = container.getFolder(folderPath); - if ( ! folder.exists()) { - folder.create(false, true, null); // false = "no force"; true = "local" - } - return folder; - } - - /** - * Create a file with the specified name and content directly under the project. - */ - public IFile createFile(String fileName, String content) throws CoreException { - return this.createFile(this.project, fileName, content); - } - - /** - * Create a file in the specified container with the specified name and content. - */ - public IFile createFile(IContainer container, String fileName, String content) throws CoreException { - return createFile(container, new Path(fileName), content); - } - - /** - * Create a file in the project with the specified [relative] path - * and content. - */ - public IFile createFile(IPath filePath, String content) throws CoreException { - return this.createFile(this.project, filePath, content); - } - - /** - * Create a file in the specified container with the specified path and content. - */ - public IFile createFile(IContainer container, IPath filePath, String content) throws CoreException { - return this.createFile(container, filePath, new ByteArrayInputStream(content.getBytes())); - } - - /** - * Create a file in the specified container with the specified path and contents. - */ - public IFile createFile(IContainer container, IPath filePath, InputStream content) throws CoreException { - int len = filePath.segmentCount() - 1; - for (int i = 0; i < len; i++) { - container = container.getFolder(new Path(filePath.segment(i))); - if ( ! container.exists()) { - ((IFolder) container).create(true, true, null); // true = "force"; true = "local" - } - } - - IFile file = container.getFile(new Path(filePath.lastSegment())); - if (file.exists()) { - file.delete(true, null); // true = "force" - } - file.create(content, true, null); // true = "force" - return file; - } - - public void open() throws CoreException { - this.project.open(null); - waitForJobs(); - } - - public void close() throws CoreException { - this.project.close(null); - waitForJobs(); - } - - public void dispose() throws CoreException { - this.project.delete(true, true, null); // true = "delete content"; true = "force" - for (int i = 1; this.project.exists(); i++) { - waitForJobs(); - System.out.println("Project still exists: " + i); - } - } - - - // ********** static methods ********** - - /** - * Wait until all background tasks are complete. - */ - public static void waitForJobs() { - while (Job.getJobManager().currentJob() != null) { - try { - Thread.sleep(100); // let other threads get something done - } catch (InterruptedException ex) { - throw new RuntimeException(ex); - } - } - } - -} diff --git a/jpa/tests/org.eclipse.jpt.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.core.tests/test.xml deleted file mode 100644 index 702dee3626..0000000000 --- a/jpa/tests/org.eclipse.jpt.core.tests/test.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.classpath b/jpa/tests/org.eclipse.jpt.db.tests/.classpath deleted file mode 100644 index 751c8f2e50..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore deleted file mode 100644 index ba077a4031..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.project b/jpa/tests/org.eclipse.jpt.db.tests/.project deleted file mode 100644 index f5b0127a1e..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.db.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF deleted file mode 100644 index eb01aca9ac..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName -Bundle-SymbolicName: org.eclipse.jpt.db.tests -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin -Bundle-Localization: plugin -Eclipse-LazyStart: false -Require-Bundle: org.eclipse.core.runtime, - org.junit, - org.eclipse.datatools.connectivity, - org.eclipse.datatools.connectivity.db.generic, - org.eclipse.jpt.utility, - org.eclipse.jpt.db -Export-Package: org.eclipse.jpt.db.tests.internal.platforms diff --git a/jpa/tests/org.eclipse.jpt.db.tests/build.properties b/jpa/tests/org.eclipse.jpt.db.tests/build.properties deleted file mode 100644 index cd0d010fd1..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - plugin.properties diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties deleted file mode 100644 index 6101413bc8..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties +++ /dev/null @@ -1,30 +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 -############################################################################### -# Platform Property names & Default -# -# profileName - jpatest -# profileDescription - JDBC Profile for JPA Testing -# userName - jpatest -# userPassword - (empty) -# databasedriverJarList - (mandatory) -# databaseName - testdb -# databaseUrl - (mandatory) -# -profileName = derby101 -profileDescription = Derby Embedded JDBC Profile for Testing -# set user name -userName = jpatest -userPassword = -# set path to Derby driver here (example: databasedriverJarList = c:/derbydb/lib/derby.jar ) -databasedriverJarList = -databaseName = testdb -# set database URL here (example: databaseUrl = jdbc:derby:c:/derbydb/testdb;create=true ) -databaseUrl = diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties deleted file mode 100644 index 498fc7deb5..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### -# Platform Property names & Default -# -# profileName - jpatest -# profileDescription - JDBC Profile for JPA Testing -# userName - jpatest -# userPassword - (empty) -# databasedriverJarList - jar list separate by comma (mandatory) -# databaseName - testdb -# databaseUrl - (mandatory) -# -profileName = oracleXE10g -profileDescription = XE 10g Release 2 (10.2) Thin JDBC Profile for Testing -userName = scott -userPassword = tiger -# set path to Oracle driver here (example: databasedriverJarList = c:/oracle/jdbc/lib/ojdbc14.jar ) -databasedriverJarList = -databaseName = testdb -# set database URL here (example: databaseUrl = jdbc:oracle:thin:@localhost:1521:testdb ) -databaseUrl = diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties deleted file mode 100644 index 3207919153..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### -# Platform Property names & Default -# -# profileName - jpatest -# profileDescription - JDBC Profile for JPA Testing -# userName - jpatest -# userPassword - (empty) -# databasedriverJarList - jar list separate by comma (mandatory) -# databaseName - testdb -# databaseUrl - (mandatory) -# -profileName = oracle9i -profileDescription = Oracle Thin JDBC Profile for Testing -userName = scott -userPassword = tiger -# set path to Oracle driver here (example: databasedriverJarList = c:/oracle/jdbc/lib/ojdbc14.jar ) -databasedriverJarList = -databaseName = testdb -# set database URL here (example: databaseUrl = jdbc:oracle:thin:@server:1521:testdb ) -databaseUrl = diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties deleted file mode 100644 index 8451351e83..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties +++ /dev/null @@ -1,30 +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 -############################################################################### -# Platform Property names & Default -# -# profileName - jpatest -# profileDescription - JDBC Profile for JPA Testing -# userName - jpatest -# userPassword - (empty) -# databasedriverJarList - (mandatory) -# databaseName - testdb -# databaseUrl - (mandatory) -# -profileName = sqlserver2005 -profileDescription = MS SQL Server 2005 JDBC Profile for Testing -# set user name -userName = -userPassword = -# set path to Derby driver here (example: databasedriverJarList = c:/sqlserver/lib/sqljdbc.jar ) -databasedriverJarList = -databaseName = testdb -# set database URL here (example: databaseUrl = jdbc:sqlserver://localhost:1433;databaseName=testdb ) -databaseUrl = diff --git a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties deleted file mode 100644 index b04fe27976..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################### -# Copyright (c) 2007 Oracle. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle - initial API and implementation -############################################################################### -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = JPA DB Tests -providerName = Eclipse.org - diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java deleted file mode 100644 index 2326ea3d94..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal; - -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.swingui.TestRunner; -import org.eclipse.jpt.db.tests.internal.platforms.AllPlatformTests; -import org.eclipse.jpt.utility.internal.ClassTools; - -/** - * JptDbTests - */ -public class JptDbTests { - - public static void main( String[] args) { - TestRunner.main( new String[] { "-c", JptDbTests.class.getName()}); - } - - public static Test suite() { - TestSuite suite = new TestSuite( ClassTools.packageNameFor( JptDbTests.class)); - - suite.addTest( AllPlatformTests.suite()); - - return suite; - } - - private JptDbTests() { - super(); - throw new UnsupportedOperationException(); - } -} diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java deleted file mode 100644 index dfced34598..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * JptDbTestsPlugin - */ -public class JptDbTestsPlugin extends Plugin { - - // The shared instance - private static JptDbTestsPlugin plugin; - - public static final String BUNDLE_ID = "org.eclipse.jpt.db.tests"; //$NON-NLS-1$ - - /** - * Returns the shared instance - */ - public static JptDbTestsPlugin getDefault() { - return plugin; - } - - /** - * The constructor - */ - public JptDbTestsPlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } -} diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java deleted file mode 100644 index af9c4233cc..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal.platforms; - -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.swingui.TestRunner; -import org.eclipse.jpt.utility.internal.ClassTools; - -/** - * AllPlatformTests - */ -public class AllPlatformTests { - - public static void main( String[] args) { - TestRunner.main( new String[] { "-c", AllPlatformTests.class.getName()}); - } - - public static Test suite() { - TestSuite suite = new TestSuite( ClassTools.packageNameFor( AllPlatformTests.class)); - - // TODO - Uncomment the platform to test. -// suite.addTest( Derby101Tests.suite()); -// suite.addTest( Oracle9iTests.suite()); -// suite.addTest( Oracle10gTests.suite()); -// suite.addTest( SQLServer2005Tests.suite()); - - return suite; - } - - private AllPlatformTests() { - super(); - } - -} \ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java deleted file mode 100644 index 46deffc7a6..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java +++ /dev/null @@ -1,385 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal.platforms; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.NoSuchElementException; -import java.util.Properties; -import junit.framework.Assert; -import junit.framework.TestCase; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -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.db.generic.IDBDriverDefinitionConstants; -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.internal.ConnectivityPlugin; -import org.eclipse.jpt.db.internal.Connection; -import org.eclipse.jpt.db.internal.ConnectionProfile; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; -import org.eclipse.jpt.db.internal.DTPConnectionProfileWrapper; -import org.eclipse.jpt.db.internal.Database; -import org.eclipse.jpt.db.internal.Schema; -import org.eclipse.jpt.db.internal.Table; -import org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Base class for all supported DTP platform. - */ -public abstract class DTPPlatformTests extends TestCase { - - protected ConnectionProfileRepository connectionRepository; - - private Properties platformProperties; - private String currentDbVendor; - private String currentDbVersion; - - private static final String PLATFORM_CONFIG_DIRECTORY = "config"; //$NON-NLS-1$ - - private static final String PROFILE_NAME_PROPERTY = "profileName"; //$NON-NLS-1$ - private static final String PROFILE_DESCRIPTION_PROPERTY = "profileDescription"; //$NON-NLS-1$ - private static final String USER_NAME_PROPERTY = "userName"; //$NON-NLS-1$ - private static final String USER_PASSWORD_PROPERTY = "userPassword"; //$NON-NLS-1$ - private static final String DB_DRIVER_JAR_PROPERTY = "databasedriverJarList"; //$NON-NLS-1$ - private static final String DB_NAME_PROPERTY = "databaseName"; //$NON-NLS-1$ - private static final String DB_URL_PROPERTY = "databaseUrl"; //$NON-NLS-1$ - - private static final String PROFILE_NAME_DEFAULT = "jpatest"; //$NON-NLS-1$ - private static final String PROFILE_DESCRIPTION_DEFAULT = "JDBC Profile for JPA Testing"; //$NON-NLS-1$ - private static final String USER_NAME_DEFAULT = "userName"; //$NON-NLS-1$ - private static final String USER_PASSWORD_DEFAULT = ""; //$NON-NLS-1$ - private static final String DB_NAME_DEFAULT = "testdb"; //$NON-NLS-1$ - - private static final String MISSING_PROPERTY_MESSAGE = "Enter missing property in platform config file (config/database.properties)"; - - public DTPPlatformTests( String name) { - super( name); - - this.connectionRepository = ConnectionProfileRepository.instance(); - } - - protected void setUp() throws Exception { - super.setUp(); - this.connectionRepository.initializeListeners(); - - if( this.platformIsNew()) { - this.loadPlatformProperties(); - - this.buildDriverDefinitionFile( IDriverMgmtConstants.DRIVER_FILE); - this.buildConnectionProfile( this.profileName()); - this.currentDbVendor = this.databaseVendor(); - this.currentDbVersion = this.databaseVersion(); - } - this.verifyProfileNamed( this.profileName()); - } - - protected void tearDown() throws Exception { - super.tearDown(); - - this.connectionRepository.disposeListeners(); - } - - // ********** tests ********** - - public void testConnection() throws Exception { - - this.connect(); - - this.verifyDatabaseVersionNumber(); - this.verifyConnection(); - this.verifyDatabaseContent(); - - this.disconnect(); - } - - public void testGetProfiles() { - // Getting the profile directly from DTP ProfileManager - IConnectionProfile[] profiles = ProfileManager.getInstance().getProfiles(); - Assert.assertNotNull( profiles); - Assert.assertTrue( profiles.length > 0); - } - - public void testGetProfilesByProvider() { - // Get Profiles By ProviderID - IConnectionProfile[] profiles = ProfileManager.getInstance().getProfileByProviderID( this.getProfile().getProviderId()); - Assert.assertNotNull( profiles); - Assert.assertTrue( profiles.length > 0); - } - - public void testGetProfileByName() { - // Get Profile By Name - IConnectionProfile dtpProfile = ProfileManager.getInstance().getProfileByName( this.profileName()); - Assert.assertNotNull( dtpProfile); - Assert.assertTrue( dtpProfile.getName().equals( this.profileName())); - } - - public void testGetProfileByInstanceId() { - // Get Profile By InstanceID - IConnectionProfile dtpProfile = ProfileManager.getInstance().getProfileByInstanceID( this.getProfile().getInstanceId()); - Assert.assertNotNull( dtpProfile); - Assert.assertTrue( dtpProfile.getName().equals( this.profileName())); - } - - // ********** internal tests ********** - - private void verifyDatabaseVersionNumber() { - Database database = this.getProfile().getDatabase(); - Assert.assertNotNull( database); - - String actualVersionNumber = database.getVersion(); - String expectedVersionNumber = this.databaseVersion(); - String errorMessage = "Expected version number: " + expectedVersionNumber + " but the actual version number was: " + actualVersionNumber; - assertTrue( errorMessage, actualVersionNumber.indexOf( expectedVersionNumber) != -1); - - String actualVendor = database.getVendor(); - String expectedVendor = this.databaseVendor(); - errorMessage = "Expected vendor: " + expectedVendor + " but the actual vendor was: " + actualVendor; - assertEquals( errorMessage, actualVendor, expectedVendor); - } - - private void verifyConnection() { - Connection connection = this.getProfile().getConnection(); - Assert.assertNotNull( connection); - - String actualFactory = connection.getFactoryId(); - String expectedFactory = DTPConnectionProfileWrapper.CONNECTION_TYPE; - String errorMessage = "Expected factory: " + expectedFactory + " but the actual factory was: " + actualFactory; - assertEquals( errorMessage, actualFactory, expectedFactory); - } - - private void verifyDatabaseContent() { - Database database = this.getProfile().getDatabase(); - Assert.assertTrue( database.schemataSize() > 0); - - Schema schema = database.schemaNamed( this.getProfile().getUserName()); - if( schema != null) { - Assert.assertTrue( schema.sequencesSize() >= 0); - - Object[] tableNames = CollectionTools.array( schema.tableNames()); - if( tableNames.length >= 1) { - Table table = schema.tableNamed(( String)tableNames[ 0]); - Assert.assertTrue( table.columnsSize() >= 0); - Assert.assertTrue( table.foreignKeyColumnsSize() >= 0); - Assert.assertTrue( table.foreignKeysSize() >= 0); - Assert.assertTrue( table.primaryKeyColumnsSize() >= 0); - } - } - } - - private void verifyProfileNamed( String profileName) { - - ConnectionProfile profile = this.getProfileNamed( profileName); - Assert.assertTrue( "ConnectionProfile not found", profileName.equals( profile.getName())); - } - - // ***** Platform specific behavior ***** - - protected abstract String databaseVendor(); - protected abstract String databaseVersion(); - - protected abstract String driverName(); - protected abstract String driverDefinitionType(); - protected abstract String driverDefinitionId(); - protected abstract String driverClass(); - - protected abstract String getConfigName(); - - // ***** Behavior ***** - - protected void connect() { - - this.getProfile().connect(); - Assert.assertTrue( "Connect failed.", this.getProfile().isConnected()); - } - - protected void disconnect() { - - this.getProfile().disconnect(); - Assert.assertFalse( "Disconnect failed.", this.getProfile().isConnected()); - } - - // ********** queries ********** - - protected Schema getSchemaNamed( String schemaName) { - - return this.getProfile().getDatabase().schemaNamed( schemaName); - } - - protected Collection getTables() { - - Schema schema = this.getSchemaNamed( this.getProfile().getUserName()); - if( schema == null) { - return new ArrayList(); - } - return CollectionTools.collection( schema.tables()); - } - - protected Table getTableNamed( String tableName) { - - Schema schema = this.getSchemaNamed( this.getProfile().getUserName()); - Assert.assertNotNull( schema); - - return schema.tableNamed( tableName); - } - - protected String providerId() { - return DTPConnectionProfileWrapper.CONNECTION_PROFILE_TYPE; - } - - protected String passwordIsSaved() { - return "true"; - } - - protected String profileName() { - return this.platformProperties.getProperty( PROFILE_NAME_PROPERTY, PROFILE_NAME_DEFAULT); - } - - protected String profileDescription() { - return this.platformProperties.getProperty( PROFILE_DESCRIPTION_PROPERTY, PROFILE_DESCRIPTION_DEFAULT); - } - - protected String userName() { - return this.platformProperties.getProperty( USER_NAME_PROPERTY, USER_NAME_DEFAULT); - } - - protected String userPassword() { - return this.platformProperties.getProperty( USER_PASSWORD_PROPERTY, USER_PASSWORD_DEFAULT); - } - - protected String databaseName() { - return this.platformProperties.getProperty( DB_NAME_PROPERTY, DB_NAME_DEFAULT); - } - - protected String databasedriverJarList() { - String dbDriverJarList = this.platformProperties.getProperty( DB_DRIVER_JAR_PROPERTY); - if ( StringTools.stringIsEmpty( dbDriverJarList)) { - throw new NoSuchElementException( MISSING_PROPERTY_MESSAGE); - } - return dbDriverJarList; - } - - protected String databaseUrl() { - String dbUrl = this.platformProperties.getProperty( DB_URL_PROPERTY); - if ( StringTools.stringIsEmpty( dbUrl)) { - throw new NoSuchElementException( MISSING_PROPERTY_MESSAGE); - } - return dbUrl; - } - - private ConnectionProfile getProfile() { - - return this.getProfileNamed( this.profileName()); - } - - protected ConnectionProfile getProfileNamed( String profileName) { - - return ConnectionProfileRepository.instance().profileNamed( profileName); - } - - private String getTestPluginBundleId() { - return JptDbTestsPlugin.BUNDLE_ID; - } - - private IPath getDriverDefinitionLocation() { - return ConnectivityPlugin.getDefault().getStateLocation(); - } - - private String getConfigPath() { - return this.getConfigDir() + "/" + this.getConfigName(); - } - - private String getConfigDir() { - return PLATFORM_CONFIG_DIRECTORY; - } - - private boolean platformIsNew() { - return( !this.databaseVendor().equals( this.currentDbVendor) || this.databaseVersion().equals( this.currentDbVersion)); - } - - private void loadPlatformProperties() throws IOException { - - if( this.platformProperties == null) { - URL configUrl = Platform.getBundle( this.getTestPluginBundleId()).getEntry( this.getConfigPath()); - - this.platformProperties = new Properties(); - this.platformProperties.load( configUrl.openStream()); - } - } - - private Properties buildDriverProperties() { - Properties driverProperties = new Properties(); - driverProperties.setProperty( DTPConnectionProfileWrapper.DRIVER_DEFINITION_TYPE_PROP_ID, this.driverDefinitionType()); - driverProperties.setProperty( DTPConnectionProfileWrapper.DRIVER_JAR_LIST_PROP_ID, this.databasedriverJarList()); - driverProperties.setProperty( IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.userName()); - driverProperties.setProperty( IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.driverClass()); - driverProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.databaseName()); - driverProperties.setProperty( IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.userPassword()); - driverProperties.setProperty( IDBDriverDefinitionConstants.URL_PROP_ID, this.databaseUrl()); - driverProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.databaseVendor()); - driverProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.databaseVersion()); - return driverProperties; - } - - private Properties buildBasicProperties() { - Properties basicProperties = new Properties(); - basicProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.databaseName()); - basicProperties.setProperty( IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.userName()); - basicProperties.setProperty( IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.userPassword()); - basicProperties.setProperty( DTPConnectionProfileWrapper.DRIVER_DEFINITION_PROP_ID, this.driverDefinitionId()); - - basicProperties.setProperty( IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.driverClass()); - basicProperties.setProperty( IDBDriverDefinitionConstants.URL_PROP_ID, this.databaseUrl()); - basicProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.databaseVendor()); - basicProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.databaseVersion()); - - basicProperties.setProperty( DTPConnectionProfileWrapper.DATABASE_SAVE_PWD_PROP_ID, this.passwordIsSaved()); - return basicProperties; - } - - private void buildConnectionProfile( String profileName) throws ConnectionProfileException { - - ProfileManager profileManager = ProfileManager.getInstance(); - Assert.assertNotNull( profileManager); - IConnectionProfile profile = profileManager.getProfileByName( profileName); - if( profile == null) { - Properties basicProperties = buildBasicProperties(); - ProfileManager.getInstance().createProfile( profileName, this.profileDescription(), this.providerId(), basicProperties); - } - } - - private void buildDriverDefinitionFile( String driverFileName) throws CoreException { - - XMLFileManager.setStorageLocation( this.getDriverDefinitionLocation()); - XMLFileManager.setFileName( driverFileName); - IPropertySet[] propsets = new IPropertySet[ 1]; - String driverName = this.driverName(); - String driverId = this.driverDefinitionId(); - PropertySetImpl propertySet = new PropertySetImpl( driverName, driverId); - propertySet.setProperties( driverId, this.buildDriverProperties()); - propsets[ 0] = propertySet; - - XMLFileManager.saveNamedPropertySet( propsets); - - File driverDefinitioneFile = this.getDriverDefinitionLocation().append( driverFileName).toFile(); - Assert.assertTrue( driverDefinitioneFile.exists()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java deleted file mode 100644 index 7e510cfd43..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal.platforms; - -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.swingui.TestRunner; - -/** - * Derby 10.1 Embedded Driver Test - */ -public class Derby101Tests extends DTPPlatformTests { - - public static void main( String[] args) { - TestRunner.main( new String[] { "-c", Derby101Tests.class.getName()}); - } - - public static Test suite() { - return new TestSuite( Derby101Tests.class); - } - - public Derby101Tests( String name) { - super( name); - } - - protected String databaseVendor() { - return "Derby"; - } - - protected String databaseVersion() { - return "10.1"; - } - - protected String providerId() { - return "org.eclipse.datatools.connectivity.db.derby.embedded.connectionProfile"; - } - - protected String driverName() { - return "Derby Embedded JDBC Driver"; - } - - protected String driverDefinitionType() { - return "org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate"; - } - - protected String driverDefinitionId() { - return "DriverDefn.Derby Embedded JDBC Driver"; - } - - protected String driverClass() { - return "org.apache.derby.jdbc.EmbeddedDriver"; - } - - protected String getConfigName() { - return "derby101.properties"; - } -} diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java deleted file mode 100644 index 70d3a3d55f..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal.platforms; - -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.swingui.TestRunner; - -/** - * Oracle 10g Thin Driver Test - */ -public class Oracle10gTests extends DTPPlatformTests { - - public static void main( String[] args) { - TestRunner.main( new String[] { "-c", Oracle10gTests.class.getName()}); - } - - public static Test suite() { - return new TestSuite( Oracle10gTests.class); - } - - public Oracle10gTests( String name) { - super( name); - } - - protected String databaseVendor() { - return "Oracle"; - } - - protected String databaseVersion() { - return "10"; - } - - protected String driverClass() { - return "oracle.jdbc.OracleDriver"; - } - - protected String driverDefinitionId() { - return "DriverDefn.Oracle Thin Driver"; - } - - protected String driverDefinitionType() { - return "org.eclipse.datatools.enablement.oracle.10.driverTemplate"; - } - - protected String driverName() { - return "Oracle 10g Thin Driver"; - } - - protected String getConfigName() { - return "oracle10g.properties"; - } -} diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java deleted file mode 100644 index 3923081244..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0, which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.db.tests.internal.platforms; - -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.swingui.TestRunner; - -/** - * Oracle 9i Thin Driver Test - */ -public class Oracle9iTests extends DTPPlatformTests { - - public static void main( String[] args) { - TestRunner.main( new String[] { "-c", Oracle9iTests.class.getName()}); - } - - public static Test suite() { - return new TestSuite( Oracle9iTests.class); - } - - public Oracle9iTests( String name) { - super( name); - } - - protected String databaseVendor() { - return "Oracle"; - } - - protected String databaseVersion() { - return "9"; - } - - protected String driverClass() { - return "oracle.jdbc.OracleDriver"; - } - - protected String driverDefinitionId() { - return "DriverDefn.Oracle Thin Driver"; - } - - protected String driverDefinitionType() { - return "org.eclipse.datatools.enablement.oracle.9.driverTemplate"; - } - - protected String driverName() { - return "Oracle 9i Thin Driver"; - } - - protected String getConfigName() { - return "oracle9i.properties"; - } -} diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java deleted file mode 100644 index a0f5034f6d..0000000000 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java +++ /dev/null @@ -1,64 +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.db.tests.internal.platforms; - -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.swingui.TestRunner; - -/** - * SQL Server 2005 Driver Test - */ -public class SQLServer2005Tests extends DTPPlatformTests { - - public static void main( String[] args) { - TestRunner.main( new String[] { "-c", SQLServer2005Tests.class.getName()}); - } - - public static Test suite() { - return new TestSuite( SQLServer2005Tests.class); - } - - public SQLServer2005Tests( String name) { - super( name); - } - - protected String databaseVendor() { - return "SQLServer"; - } - - protected String databaseVersion() { - return "2005"; - } - - protected String providerId() { - return "org.eclipse.datatools.connectivity.db.generic.connectionProfile"; - } - - protected String driverName() { - return "Microsoft SQL Server 2005 JDBC Driver"; - } - - protected String driverDefinitionType() { - return "org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate"; - } - - protected String driverDefinitionId() { - return "DriverDefn.Microsoft SQL Server 2005 JDBC Driver"; - } - - protected String driverClass() { - return "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - } - - protected String getConfigName() { - return "sqlserver2005.properties"; - } -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath b/jpa/tests/org.eclipse.jpt.utility.tests/.classpath deleted file mode 100644 index 304e86186a..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore deleted file mode 100644 index ba077a4031..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.project b/jpa/tests/org.eclipse.jpt.utility.tests/.project deleted file mode 100644 index aa5271e003..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.jpt.utility.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index c74f41d1cd..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 27 15:11:44 EDT 2007 -eclipse.preferences.version=1 -encoding/=ISO-8859-1 diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 84b5c4c710..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Sun May 27 14:55:58 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 1870613633..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/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.utility.tests -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Require-Bundle: org.eclipse.jpt.utility, - org.junit;bundle-version="[3.0.0,4.0.0)" -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.jpt.utility.tests.internal;x-internal:=true, - org.eclipse.jpt.utility.tests.internal.iterators;x-internal:=true diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/about.html b/jpa/tests/org.eclipse.jpt.utility.tests/about.html deleted file mode 100644 index 9e73bdabb6..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/about.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -About - - - - - -

    About This Content

    - -

    June 06, 2007

    - -

    License

    - -

    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 -http://www.eclipse.org/org/documents/epl-v10.php. -For purposes of the EPL, "Program" will mean the Content.

    - -

    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 -http://www.eclipse.org/.

    - - - diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/build.properties b/jpa/tests/org.eclipse.jpt.utility.tests/build.properties deleted file mode 100644 index ebe9c08ef9..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2007 Oracle. All rights reserved. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0, which accompanies this distribution -# and is available at http://www.eclipse.org/legal/epl-v10.html. -# -# Contributors: -# Oracle - initial API and implementation -################################################################################ -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - about.html,\ - test.xml,\ - plugin.properties diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties deleted file mode 100644 index 9995768587..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2007 Oracle. All rights reserved. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0, which accompanies this distribution -# and is available at http://www.eclipse.org/legal/epl-v10.html. -# -# Contributors: -# Oracle - initial API and implementation -################################################################################ -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Java Persistence API Utility Tests -providerName = Eclipse.org - diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java deleted file mode 100644 index ed3e6f2814..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.BitTools; - -public class BitToolsTests extends TestCase { - - public BitToolsTests(String name) { - super(name); - } - - public void testAllFlagsAreSetIntInt() { - assertTrue(BitTools.allFlagsAreSet(0x0003, 0x0001)); - assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0001)); - assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0101)); - assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0103)); - - assertFalse(BitTools.allFlagsAreSet(0x0303, 0x1103)); - assertFalse(BitTools.allFlagsAreSet(0x0000, 0x1103)); - } - - public void testAllFlagsAreSetIntIntArray() { - assertTrue(BitTools.allFlagsAreSet(0x0003, new int[] { 0x0001 })); - assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0001 })); - assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0001 })); - assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0002, 0x0001 })); - - assertFalse(BitTools.allFlagsAreSet(0x0303, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 })); - assertFalse(BitTools.allFlagsAreSet(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 })); - } - - public void testAnyFlagsAreSetIntInt() { - assertTrue(BitTools.anyFlagsAreSet(0x0003, 0x0001)); - assertTrue(BitTools.anyFlagsAreSet(0xFFFF, 0x0001)); - assertTrue(BitTools.anyFlagsAreSet(0x0003, 0xFFFF)); - - assertFalse(BitTools.anyFlagsAreSet(0x0303, 0x1010)); - assertFalse(BitTools.anyFlagsAreSet(0x0000, 0xFFFF)); - } - - public void testAnyFlagsAreSetIntIntArray() { - assertTrue(BitTools.anyFlagsAreSet(0x0003, new int[] { 0x0001 })); - assertTrue(BitTools.anyFlagsAreSet(0xFFFF, new int[] { 0x0001 })); - assertTrue(BitTools.anyFlagsAreSet(0x0303, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F })); - - assertFalse(BitTools.anyFlagsAreSet(0x0303, new int[] { 0x1000, 0x0010 })); - assertFalse(BitTools.anyFlagsAreSet(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F })); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java deleted file mode 100644 index 504b621daa..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java +++ /dev/null @@ -1,548 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; -import java.util.Map.Entry; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.ClassTools; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -public class ClassToolsTests extends TestCase { - - private static String testStaticField; - - public ClassToolsTests(String name) { - super(name); - } - - /** - * Return the compiler-generated class name. The Eclipse compiler generates - * "local" classes with names in the form "com.foo.Outer$1$Local"; while the - * JDK compiler generates "com.foo.Outer$1Local". There might be other - * differences.... ~bjv - */ - public static String compilerDependentClassNameFor(String className) { - int index = className.indexOf("$1$"); - if (index == -1) { - return className; - } - try { - Class.forName(className); - } catch (ClassNotFoundException ex) { - return className.substring(0, index + 2) + className.substring(index + 3); - } - return className; - } - - private static String munge(String className) { - return compilerDependentClassNameFor(className); - } - - public void testAllFields() { - int fieldCount = 0; - fieldCount += java.util.Vector.class.getDeclaredFields().length; - fieldCount += java.util.AbstractList.class.getDeclaredFields().length; - fieldCount += java.util.AbstractCollection.class.getDeclaredFields().length; - fieldCount += java.lang.Object.class.getDeclaredFields().length; - Field[] fields = ClassTools.allFields(java.util.Vector.class); - assertEquals(fieldCount, fields.length); - assertTrue(CollectionTools.contains(this.names(fields), "modCount")); - assertTrue(CollectionTools.contains(this.names(fields), "serialVersionUID")); - assertTrue(CollectionTools.contains(this.names(fields), "capacityIncrement")); - assertTrue(CollectionTools.contains(this.names(fields), "elementCount")); - assertTrue(CollectionTools.contains(this.names(fields), "elementData")); - assertTrue(fields[0].isAccessible()); - } - - public void testAllMethods() { - int methodCount = 0; - methodCount += java.util.Vector.class.getDeclaredMethods().length; - methodCount += java.util.AbstractList.class.getDeclaredMethods().length; - methodCount += java.util.AbstractCollection.class.getDeclaredMethods().length; - methodCount += java.lang.Object.class.getDeclaredMethods().length; - Method[] methods = ClassTools.allMethods(java.util.Vector.class); - assertEquals(methodCount, methods.length); - assertTrue(CollectionTools.contains(this.names(methods), "wait")); - assertTrue(CollectionTools.contains(this.names(methods), "addElement")); - assertTrue(methods[0].isAccessible()); - } - - public void testNewInstanceClass() { - Vector v = ClassTools.newInstance(java.util.Vector.class); - assertNotNull(v); - assertEquals(0, v.size()); - } - - public void testNewInstanceClassClassObject() { - int initialCapacity = 200; - Vector v = ClassTools.newInstance(java.util.Vector.class, int.class, new Integer(initialCapacity)); - assertNotNull(v); - assertEquals(0, v.size()); - Object[] elementData = (Object[]) ClassTools.getFieldValue(v, "elementData"); - assertEquals(initialCapacity, elementData.length); - } - - public void testNewInstanceClassClassArrayObjectArray() { - int initialCapacity = 200; - Class[] parmTypes = new Class[1]; - parmTypes[0] = int.class; - Object[] parms = new Object[1]; - parms[0] = new Integer(initialCapacity); - Vector v = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms); - assertNotNull(v); - assertEquals(0, v.size()); - Object[] elementData = (Object[]) ClassTools.getFieldValue(v, "elementData"); - assertEquals(initialCapacity, elementData.length); - - parms[0] = new Integer(-1); - boolean exCaught = false; - try { - v = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms); - } catch (RuntimeException ex) { - exCaught = true; - } - assertTrue("RuntimeException not thrown", exCaught); - - parmTypes[0] = java.lang.String.class; - parms[0] = "foo"; - exCaught = false; - try { - v = ClassTools.attemptNewInstance(java.util.Vector.class, parmTypes, parms); - } catch (NoSuchMethodException ex) { - exCaught = true; - } - assertTrue("NoSuchMethodException not thrown", exCaught); - } - - public void testGetFieldValue() { - int initialCapacity = 200; - Vector v = new Vector(initialCapacity); - Object[] elementData = (Object[]) ClassTools.getFieldValue(v, "elementData"); - assertEquals(initialCapacity, elementData.length); - - // test inherited field - Integer modCountInteger = (Integer) ClassTools.getFieldValue(v, "modCount"); - int modCount = modCountInteger.intValue(); - assertEquals(0, modCount); - - boolean exCaught = false; - Object bogusFieldValue = null; - try { - bogusFieldValue = ClassTools.attemptToGetFieldValue(v, "bogusField"); - } catch (NoSuchFieldException ex) { - exCaught = true; - } - assertTrue("NoSuchFieldException not thrown: " + bogusFieldValue, exCaught); - } - - public void testExecuteMethodObjectString() { - Vector v = new Vector(); - int size = ((Integer) ClassTools.executeMethod(v, "size")).intValue(); - assertEquals(0, size); - - v.addElement("foo"); - size = ((Integer) ClassTools.executeMethod(v, "size")).intValue(); - assertEquals(1, size); - } - - public void testExecuteMethodObjectStringClassObject() { - Vector v = new Vector(); - boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", Object.class, "foo")).booleanValue(); - assertTrue(booleanResult); - assertTrue(v.contains("foo")); - Object voidResult = ClassTools.executeMethod(v, "addElement", Object.class, "bar"); - assertNull(voidResult); - } - - public void testExecuteMethodObjectStringClassArrayObjectArray() { - Vector v = new Vector(); - Class[] parmTypes = new Class[1]; - parmTypes[0] = java.lang.Object.class; - Object[] parms = new Object[1]; - parms[0] = "foo"; - boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", parmTypes, parms)).booleanValue(); - assertTrue(booleanResult); - assertTrue(v.contains("foo")); - - boolean exCaught = false; - Object bogusMethodReturnValue = null; - try { - bogusMethodReturnValue = ClassTools.attemptToExecuteMethod(v, "bogusMethod", parmTypes, parms); - } catch (NoSuchMethodException ex) { - exCaught = true; - } - assertTrue("NoSuchMethodException not thrown: " + bogusMethodReturnValue, exCaught); - } - - public void testExecuteStaticMethodClassString() { - Double randomObject = (Double) ClassTools.executeStaticMethod(java.lang.Math.class, "random"); - assertNotNull(randomObject); - double random = randomObject.doubleValue(); - assertTrue(random >= 0); - assertTrue(random < 1); - } - - public void testExecuteStaticMethodClassStringClassObject() { - String s = (String) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", boolean.class, Boolean.TRUE); - assertNotNull(s); - assertEquals("true", s); - } - - public void testExecuteStaticMethodClassStringClassArrayObjectArray() { - Class[] parmTypes = new Class[1]; - parmTypes[0] = boolean.class; - Object[] parms = new Object[1]; - parms[0] = Boolean.TRUE; - String s = (String) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", parmTypes, parms); - assertNotNull(s); - assertEquals("true", s); - - boolean exCaught = false; - Object bogusStaticMethodReturnValue = null; - try { - bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "bogusStaticMethod", parmTypes, parms); - } catch (NoSuchMethodException ex) { - exCaught = true; - } - assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught); - - // test non-static method - exCaught = false; - try { - bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "toString"); - } catch (NoSuchMethodException ex) { - exCaught = true; - } - assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught); - } - - public void testSetFieldValue() { - Vector v = new Vector(); - Object[] newElementData = new Object[5]; - newElementData[0] = "foo"; - ClassTools.setFieldValue(v, "elementData", newElementData); - ClassTools.setFieldValue(v, "elementCount", new Integer(1)); - // test inherited field - ClassTools.setFieldValue(v, "modCount", new Integer(1)); - assertTrue(v.contains("foo")); - - boolean exCaught = false; - try { - ClassTools.attemptToSetFieldValue(v, "bogusField", "foo"); - } catch (NoSuchFieldException ex) { - exCaught = true; - } - assertTrue("NoSuchFieldException not thrown", exCaught); - } - - public void testSetStaticFieldValue() { - ClassTools.setStaticFieldValue(this.getClass(), "testStaticField", "new value"); - assertEquals(testStaticField, "new value"); - - boolean exCaught = false; - try { - ClassTools.attemptToSetStaticFieldValue(this.getClass(), "bogusStaticField", "new value"); - } catch (NoSuchFieldException ex) { - exCaught = true; - } - assertTrue("NoSuchFieldException not thrown", exCaught); - } - - public void testShortName() { - assertEquals("Vector", ClassTools.shortClassNameForObject(new java.util.Vector())); - assertEquals("Vector", ClassTools.shortNameFor(java.util.Vector.class)); - } - - public void testNestedName() { - Map map = new HashMap(); - map.put("foo", "bar"); - Entry entry = map.entrySet().iterator().next(); - assertEquals("Entry", ClassTools.nestedClassNameForObject(entry)); - assertEquals("Entry", ClassTools.nestedNameFor(java.util.Map.Entry.class)); - } - - public void testPackageName() { - assertEquals("java.util", ClassTools.packageNameFor(java.util.Vector.class)); - assertEquals("java.util", ClassTools.packageNameFor(java.util.Map.Entry.class)); - } - - public void testArrayDepthFor() { - assertEquals(0, ClassTools.arrayDepthFor(java.util.Vector.class)); - assertEquals(0, ClassTools.arrayDepthFor(int.class)); - assertEquals(0, ClassTools.arrayDepthFor(void.class)); - assertEquals(1, ClassTools.arrayDepthFor(java.util.Vector[].class)); - assertEquals(1, ClassTools.arrayDepthFor(int[].class)); - assertEquals(3, ClassTools.arrayDepthFor(java.util.Vector[][][].class)); - assertEquals(3, ClassTools.arrayDepthFor(int[][][].class)); - } - - public void testArrayDepthForObject() { - assertEquals(0, ClassTools.arrayDepthForObject(new java.util.Vector())); - assertEquals(1, ClassTools.arrayDepthForObject(new java.util.Vector[0])); - assertEquals(1, ClassTools.arrayDepthForObject(new int[0])); - assertEquals(3, ClassTools.arrayDepthForObject(new java.util.Vector[0][0][0])); - assertEquals(3, ClassTools.arrayDepthForObject(new int[0][0][0])); - } - - public void testArrayDepthForClassNamed() { - assertEquals(0, ClassTools.arrayDepthForClassNamed(java.util.Vector.class.getName())); - assertEquals(0, ClassTools.arrayDepthForClassNamed(int.class.getName())); - assertEquals(0, ClassTools.arrayDepthForClassNamed(void.class.getName())); - assertEquals(1, ClassTools.arrayDepthForClassNamed(java.util.Vector[].class.getName())); - assertEquals(1, ClassTools.arrayDepthForClassNamed(int[].class.getName())); - assertEquals(3, ClassTools.arrayDepthForClassNamed(java.util.Vector[][][].class.getName())); - assertEquals(3, ClassTools.arrayDepthForClassNamed(int[][][].class.getName())); - } - - public void testElementTypeFor() { - assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector.class)); - assertEquals(int.class, ClassTools.elementTypeFor(int.class)); - assertEquals(void.class, ClassTools.elementTypeFor(void.class)); - assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[].class)); - assertEquals(int.class, ClassTools.elementTypeFor(int[].class)); - assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[][][].class)); - assertEquals(int.class, ClassTools.elementTypeFor(int[][][].class)); - } - - public void testElementTypeForObject() { - assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector())); - assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0])); - assertEquals(int.class, ClassTools.elementTypeForObject(new int[0])); - assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0][0][0])); - assertEquals(int.class, ClassTools.elementTypeForObject(new int[0][0][0])); - } - - public void testElementTypeNameFor() { - assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector.class)); - assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int.class)); - assertEquals(void.class.getName(), ClassTools.elementTypeNameFor(void.class)); - assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[].class)); - assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[].class)); - assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[][][].class)); - assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[][][].class)); - } - - public void testElementTypeNameForClassNamed() { - assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector.class.getName())); - assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int.class.getName())); - assertEquals(void.class.getName(), ClassTools.elementTypeNameForClassNamed(void.class.getName())); - assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[].class.getName())); - assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[].class.getName())); - assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[][][].class.getName())); - assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[][][].class.getName())); - } - - public void testClassCodes() { - assertEquals("byte", ClassTools.classNameForCode('B')); - assertEquals("char", ClassTools.classNameForCode('C')); - assertEquals("double", ClassTools.classNameForCode('D')); - assertEquals("float", ClassTools.classNameForCode('F')); - assertEquals("int", ClassTools.classNameForCode('I')); - assertEquals("long", ClassTools.classNameForCode('J')); - assertEquals("short", ClassTools.classNameForCode('S')); - assertEquals("boolean", ClassTools.classNameForCode('Z')); - assertEquals("void", ClassTools.classNameForCode('V')); - - boolean exCaught = false; - try { - ClassTools.classNameForCode('X'); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue("IllegalArgumentException not thrown", exCaught); - } - - public void testClassNamedIsTopLevel() throws Exception { - assertTrue(ClassTools.classNamedIsTopLevel(java.util.Map.class.getName())); // top-level - assertFalse(ClassTools.classNamedIsTopLevel(java.util.Map.Entry.class.getName())); // member - assertFalse(ClassTools.classNamedIsTopLevel(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local - assertFalse(ClassTools.classNamedIsTopLevel(Class.forName("java.util.Vector$1").getName())); // anonymous - - Object[] array = new java.util.Map[0]; // top-level - assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName())); - array = new java.util.Map.Entry[0]; // member - assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName())); - Class localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local - array = (Object[]) Array.newInstance(localClass, 0); - assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName())); - Class anonClass = Class.forName("java.util.Vector$1"); // local - array = (Object[]) Array.newInstance(anonClass, 0); - assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName())); - } - - public void testClassNamedIsMember() throws Exception { - assertFalse(ClassTools.classNamedIsMember(java.util.Map.class.getName())); // top-level - assertTrue(ClassTools.classNamedIsMember(java.util.Map.Entry.class.getName())); // member - assertFalse(ClassTools.classNamedIsMember(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local - assertFalse(ClassTools.classNamedIsMember(Class.forName("java.util.Vector$1").getName())); // anonymous - - Object[] array = new java.util.Map[0]; // top-level - assertFalse(ClassTools.classNamedIsMember(array.getClass().getName())); - array = new java.util.Map.Entry[0]; // member - assertFalse(ClassTools.classNamedIsMember(array.getClass().getName())); - Class localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local - array = (Object[]) Array.newInstance(localClass, 0); - assertFalse(ClassTools.classNamedIsMember(array.getClass().getName())); - Class anonClass = Class.forName("java.util.Vector$1"); // local - array = (Object[]) Array.newInstance(anonClass, 0); - assertFalse(ClassTools.classNamedIsMember(array.getClass().getName())); - - // test a few edge cases - assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1")); - assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1$aaa$bbb")); - assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a1$aaa")); - assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a")); - assertTrue(ClassTools.classNamedIsMember("java.util.Map$a12345$b12345")); - assertFalse(ClassTools.classNamedIsMember("java.util.Map$12345a")); - assertFalse(ClassTools.classNamedIsMember("java.util.Map$333")); - assertFalse(ClassTools.classNamedIsMember("java.util.Map3$333")); - } - - public void testClassNamedIsLocal() throws Exception { - class LocalClass { - void foo() { - System.getProperty("foo"); - } - } - new LocalClass().foo(); - assertFalse(ClassTools.classNamedIsLocal(java.util.Map.class.getName())); // top-level - assertFalse(ClassTools.classNamedIsLocal(java.util.Map.Entry.class.getName())); // member - assertTrue(ClassTools.classNamedIsLocal(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local - assertFalse(ClassTools.classNamedIsLocal(Class.forName("java.util.Vector$1").getName())); // anonymous - - Object[] array = new java.util.Map[0]; // top-level - assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName())); - array = new java.util.Map.Entry[0]; // member - assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName())); - Class localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local - array = (Object[]) Array.newInstance(localClass, 0); - assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName())); - Class anonClass = Class.forName("java.util.Vector$1"); // local - array = (Object[]) Array.newInstance(anonClass, 0); - assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName())); - - // test a few edge cases - assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1")); - assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1$aaa$bbb")); - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$11$aaa")); - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1$a")); // eclipse naming convention - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc")); // eclipse naming convention - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc1")); // eclipse naming convention - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1a")); // jdk naming convention - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc")); // jdk naming convention - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc1")); // jdk naming convention - assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a12345$b12345")); - assertTrue(ClassTools.classNamedIsLocal("java.util.Map$12345$a1234")); - assertFalse(ClassTools.classNamedIsLocal("java.util.Map$333")); - assertFalse(ClassTools.classNamedIsLocal("java.util.Map3$333")); - } - - public void testClassNamedIsAnonymous() throws Exception { - assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.class.getName())); // top-level - assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.Entry.class.getName())); // member - assertFalse(ClassTools.classNamedIsAnonymous(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local - assertTrue(ClassTools.classNamedIsAnonymous(Class.forName("java.util.Vector$1").getName())); // anonymous - - Object[] array = new java.util.Map[0]; // top-level - assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName())); - array = new java.util.Map.Entry[0]; // member - assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName())); - Class localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local - array = (Object[]) Array.newInstance(localClass, 0); - assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName())); - Class anonClass = Class.forName("java.util.Vector$1"); // local - array = (Object[]) Array.newInstance(anonClass, 0); - assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName())); - - // test a few edge cases - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1")); - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1$aaa$bbb")); - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a1$aaa")); - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1$a")); - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a")); - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a12345$b12345")); - assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$12345$a1234")); - assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map$333")); - assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map3$333")); - } - - public void testCodeForClass() { - assertEquals('I', ClassTools.codeForClass(int.class)); - assertEquals('B', ClassTools.codeForClass(byte.class)); - } - - public void testCodeForClassNamed() { - assertEquals('I', ClassTools.codeForClassNamed(int.class.getName())); - assertEquals('I', ClassTools.codeForClassNamed("int")); - assertEquals('B', ClassTools.codeForClassNamed(byte.class.getName())); - assertEquals('B', ClassTools.codeForClassNamed("byte")); - } - - public void testClassForTypeDeclaration() throws Exception { - assertEquals(int.class, ClassTools.classForTypeDeclaration("int", 0)); - assertEquals(int[].class, ClassTools.classForTypeDeclaration("int", 1)); - assertEquals(int[][][].class, ClassTools.classForTypeDeclaration("int", 3)); - - assertEquals(Object.class, ClassTools.classForTypeDeclaration("java.lang.Object", 0)); - assertEquals(Object[][][].class, ClassTools.classForTypeDeclaration("java.lang.Object", 3)); - - assertEquals(void.class, ClassTools.classForTypeDeclaration("void", 0)); - try { - ClassTools.classForTypeDeclaration(void.class.getName(), 1); - fail("should not get here..."); - } catch (ClassNotFoundException ex) { - // expected - } - } - - public void testClassNameForTypeDeclaration() throws Exception { - assertEquals(int.class.getName(), ClassTools.classNameForTypeDeclaration("int", 0)); - assertEquals(int[].class.getName(), ClassTools.classNameForTypeDeclaration("int", 1)); - assertEquals(int[][][].class.getName(), ClassTools.classNameForTypeDeclaration("int", 3)); - - assertEquals(Object.class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 0)); - assertEquals(Object[][][].class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 3)); - - assertEquals(void.class.getName(), ClassTools.classNameForTypeDeclaration("void", 0)); - try { - ClassTools.classNameForTypeDeclaration(void.class.getName(), 1); - fail("should not get here..."); - } catch (IllegalArgumentException ex) { - // expected - } - } - - private Iterator names(Field[] fields) { - return new TransformationIterator(CollectionTools.iterator(fields)) { - @Override - protected String transform(Field field) { - return field.getName(); - } - }; - } - - private Iterator names(Method[] methods) { - return new TransformationIterator(CollectionTools.iterator(methods)) { - @Override - protected String transform(Method method) { - return method.getName(); - } - }; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java deleted file mode 100644 index 54beea0c81..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java +++ /dev/null @@ -1,289 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.Classpath; -import org.eclipse.jpt.utility.internal.CollectionTools; - -public class ClasspathTests extends TestCase { - private static final String JAVA_HOME = System.getProperty("java.home"); - - public ClasspathTests(String name) { - super(name); - } - - public void testCompressed() { - String path = ""; - - // no changes - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;;C:\\jdk\\jaws.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - // no changes - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\..\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - path = new Classpath(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk1\\jdk2\\jdk3\\..\\..\\..\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path(); - assertEquals(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path); - - } - - public void testConvertToClassName() { - String fileName = "java/lang/String.class"; - File file = new File(fileName); - String className = Classpath.convertToClassName(file); - assertEquals(java.lang.String.class.getName(), className); - } - - public void testConvertToClass() throws ClassNotFoundException { - String fileName = "java/lang/String.class"; - File file = new File(fileName); - Class javaClass = Classpath.convertToClass(file); - assertEquals(java.lang.String.class, javaClass); - } - - public void testConvertToArchiveClassFileEntryName() { - String fileName = Classpath.convertToArchiveClassFileEntryName(java.lang.String.class); - assertEquals("java/lang/String.class", fileName); - } - - public void testConvertToClassFileName() { - char sc = File.separatorChar; - String fileName = Classpath.convertToClassFileName(java.lang.String.class); - assertEquals("java" + sc + "lang" + sc + "String.class", fileName); - } - - public void testConvertToJavaFileName() { - char sc = File.separatorChar; - String fileName = Classpath.convertToJavaFileName(java.lang.String.class.getName()); - assertEquals("java" + sc + "lang" + sc + "String.java", fileName); - } - - public void testConvertToURLs() { - URL[] entries = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).urls(); - int i = 0; - assertEquals(this.morphURL("/C:/jdk/rt.jar"), entries[i++].getPath()); - assertEquals(this.morphURL("/C:/jdk/i18n.jar"), entries[i++].getPath()); - assertEquals(this.morphURL("/C:/jdk/jaws.jar"), entries[i++].getPath()); - assertEquals(this.morphURL("/C:/foo/classes"), entries[i++].getPath()); - assertEquals(this.morphURL("/C:/bar/bar.jar"), entries[i++].getPath()); - assertEquals(i, entries.length); - } - - public void testEntries() { - Classpath cp = new Classpath(this.morph("C:\\jdk\\rt.jar;;.;C:\\jdk\\i18n.jar;;;C:\\jdk\\jaws.jar;;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\bar\\bar.jar;")); - Classpath.Entry[] entries = cp.getEntries(); - int i = 0; - assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName()); - assertEquals(this.morph("."), entries[i++].fileName()); - assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName()); - assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName()); - assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName()); - assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName()); - assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName()); - assertEquals(i, entries.length); - - cp = cp.compressed(); - entries = cp.getEntries(); - i = 0; - assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName()); - assertEquals(this.morph("."), entries[i++].fileName()); - assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName()); - assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName()); - assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName()); - assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName()); - assertEquals(i, entries.length); - } - - public void testEntryForFileNamed() { - Classpath.Entry entry = null; - - // in the middle - qualified - entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // in the middle - unqualified - entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;rt.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar"); - assertEquals("rt.jar", entry.fileName()); - - // at the beginning - qualified - entry = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // at the beginning - unqualified - entry = new Classpath(this.morph("rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar"); - assertEquals("rt.jar", entry.fileName()); - - // at the end - qualified - entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // at the end - unqualified - entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;rt.jar")).entryForFileNamed("rt.jar"); - assertEquals("rt.jar", entry.fileName()); - - // alone - qualified - entry = new Classpath(this.morph("C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // alone - unqualified - entry = new Classpath("rt.jar").entryForFileNamed("rt.jar"); - assertEquals("rt.jar", entry.fileName()); - - // trick entry at the beginning - entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // trick entry in the middle - entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // trick entry at the end - entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).entryForFileNamed("rt.jar"); - assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName()); - - // missing - entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).entryForFileNamed("rt.jar"); - assertEquals("path entry should not be found", null, entry); - - } - - public void testLocationForClass() { - Class javaClass = Classpath.class; - File entry = new File(Classpath.locationFor(javaClass)); - if (entry.isFile() || entry.isDirectory()) { - assertTrue(entry.exists()); - } - if (entry.isDirectory()) { - assertTrue(new File(entry, Classpath.convertToClassFileName(javaClass)).exists()); - } - } - - public void testRtJarName() throws IOException { - File rtFile = new File(Classpath.rtJarName()); - assertTrue("rt.jar does not exist", rtFile.exists()); - - JarFile rtJarFile = new JarFile(rtFile); - JarEntry entry = rtJarFile.getJarEntry("java/lang/Object.class"); - rtJarFile.close(); - assertTrue("bogus rt.jar", entry != null); - } - - public void testJREClassNames() { - assertTrue("Vector is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), java.util.Vector.class.getName())); - assertTrue("File is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), java.io.File.class.getName())); - } - - public void testJavaExtensionDirectoryNames() { - char sep = File.separatorChar; - String stdExtDirName = JAVA_HOME + sep + "lib" + sep + "ext"; - assertTrue("standard extension dir name missing: " + stdExtDirName, CollectionTools.contains(Classpath.javaExtensionDirectoryNames(), stdExtDirName)); - } - - public void testJavaExtensionDirectories() { - char sep = File.separatorChar; - File stdExtDir = new File(JAVA_HOME + sep + "lib" + sep + "ext"); - assertTrue("standard extension dir missing: " + stdExtDir.getParent(), CollectionTools.contains(Classpath.javaExtensionDirectories(), stdExtDir)); - } - - //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build) - //TODO Test should be revised to be compatible with IBM JDK - // public void testJavaExtensionClasspathEntries() { - // char sep = File.separatorChar; - // String jdk = System.getProperty("java.version"); - // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) { - // Collection jarNames = new ArrayList(); - // Classpath.Entry[] entries = Classpath.javaExtensionClasspath().getEntries(); - // for (int i = 0; i < entries.length; i++) { - // jarNames.add(entries[i].fileName()); - // } - // String stdExtJarName = JAVA_HOME + sep + "lib" + sep + "ext" + sep + "dnsns.jar"; - // assertTrue("jdk 1.4.x standard extension jar missing: " + stdExtJarName, jarNames.contains(stdExtJarName)); - // } else { - // fail("we need to update this test for the current jdk"); - // } - // } - - //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build) - //TODO Test should be revised to be compatible with IBM JDK - // public void testJavaExtensionClassNames() { - // String jdk = System.getProperty("java.version"); - // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) { - // String className = "sun.net.spi.nameservice.dns.DNSNameService"; - // assertTrue("jdk 1.4.x standard extension class missing: " + className, - // CollectionTools.contains(Classpath.javaExtensionClasspath().classNames(), className)); - // } else { - // fail("we need to update this test for the current jdk"); - // } - // } - - public void testJavaClasspathClassNames() { - String className = this.getClass().getName(); - ClassLoader cl = this.getClass().getClassLoader(); - // make sure we are running under the "normal" class loader; - // when the tests are executed as an ANT task, they are run under - // an ANT class loader and the "Java" classpath does not include this class - if (cl.getClass().getName().startsWith("sun.misc")) { - assertTrue("class missing: " + className, CollectionTools.contains(Classpath.javaClasspath().classNames(), className)); - } - } - - /** - * morph the specified path to a platform-independent path - */ - private String morph(String path) { - String result = path; - result = result.replace('\\', File.separatorChar); - result = result.replace(';', File.pathSeparatorChar); - if (!CollectionTools.contains(File.listRoots(), new File("C:\\"))) { - result = result.replaceAll("C:", ""); - } - return result; - } - - /** - * morph the specified URL to a platform-independent path - */ - private String morphURL(String url) { - String result = url; - if (!CollectionTools.contains(File.listRoots(), new File("C:\\"))) { - result = result.replaceAll("/C:", ""); - } - return result; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java deleted file mode 100644 index 027984029e..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java +++ /dev/null @@ -1,1972 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.Vector; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.Bag; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.HashBag; -import org.eclipse.jpt.utility.internal.Range; -import org.eclipse.jpt.utility.internal.ReverseComparator; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; - -public class CollectionToolsTests extends TestCase { - - public CollectionToolsTests(String name) { - super(name); - } - - public void testAddObjectArrayObject1() { - Object[] a = CollectionTools.add(this.buildObjectArray1(), "twenty"); - assertEquals(4, a.length); - assertTrue(CollectionTools.contains(a, "twenty")); - assertEquals("twenty", a[a.length-1]); - } - - public void testAddObjectArrayObject2() { - String[] a = CollectionTools.add(this.buildStringArray1(), "twenty"); - assertEquals(4, a.length); - assertTrue(CollectionTools.contains(a, "twenty")); - assertEquals("twenty", a[a.length-1]); - } - - public void testAddObjectArrayIntObject1() { - Object[] a = new Object[] { "a", "b", "c", "d" }; - a = CollectionTools.add(a, 2, "X"); - assertEquals(5, a.length); - assertTrue(CollectionTools.contains(a, "X")); - assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "c", "d" }, a)); - } - - public void testAddObjectArrayIntObject2() { - String[] a = new String[] { "a", "b", "c", "d" }; - a = CollectionTools.add(a, 2, "X"); - assertEquals(5, a.length); - assertTrue(CollectionTools.contains(a, "X")); - assertTrue(Arrays.equals(new String[] { "a", "b", "X", "c", "d" }, a)); - } - - public void testAddObjectArrayIntObjectException() { - Object[] a = new Object[] { "a", "b", "c", "d" }; - boolean exCaught = false; - try { - a = CollectionTools.add(a, 33, "X"); - } catch (IndexOutOfBoundsException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testAddCharArrayChar() { - char[] a = CollectionTools.add(this.buildCharArray(), 'd'); - assertEquals(4, a.length); - assertTrue(CollectionTools.contains(a, 'd')); - } - - public void testAddCharArrayIntChar() { - char[] a = new char[] { 'a', 'b', 'c', 'd' }; - a = CollectionTools.add(a, 2, 'X'); - assertEquals(5, a.length); - assertTrue(CollectionTools.contains(a, 'X')); - assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'c', 'd' }, a)); - } - - public void testAddIntArrayInt() { - int[] a = CollectionTools.add(this.buildIntArray(), 30); - assertEquals(4, a.length); - assertTrue(CollectionTools.contains(a, 30)); - } - - public void testAddIntArrayIntInt() { - int[] a = new int[] { 1, 2, 3, 4 }; - a = CollectionTools.add(a, 2, 99); - assertEquals(5, a.length); - assertTrue(CollectionTools.contains(a, 99)); - assertTrue(Arrays.equals(new int[] { 1, 2, 99, 3, 4 }, a)); - } - - public void testAddAllCollectionIterator1() { - List l1 = this.buildStringList1(); - List l2 = this.buildStringList2(); - Set s1 = this.buildStringSet1(); - List l3 = this.buildStringList1(); // same elements as s1 - - assertTrue(CollectionTools.addAll(l1, l2.iterator())); - assertEquals(6, l1.size()); - assertTrue(l1.containsAll(l2)); - - assertFalse(CollectionTools.addAll(s1, l3.iterator())); - assertEquals(3, s1.size()); - assertTrue(s1.containsAll(l3)); - } - - public void testAddAllCollectionIterator2() { - List l1 = this.buildObjectList1(); - List l2 = this.buildStringList2(); - Set s1 = this.buildObjectSet1(); - List l3 = this.buildStringList1(); // same elements as s1 - - assertTrue(CollectionTools.addAll(l1, l2.iterator())); - assertEquals(6, l1.size()); - assertTrue(l1.containsAll(l2)); - - assertFalse(CollectionTools.addAll(s1, l3.iterator())); - assertEquals(3, s1.size()); - assertTrue(s1.containsAll(l3)); - } - - public void testAddAllCollectionObjectArray1() { - List l = this.buildStringList1(); - String[] a = this.buildStringArray1(); - Set s = this.buildStringSet1(); - - assertTrue(CollectionTools.addAll(l, a)); - assertEquals(6, l.size()); - assertTrue(l.containsAll(CollectionTools.collection(a))); - - assertFalse(CollectionTools.addAll(s, a)); - assertEquals(3, s.size()); - assertTrue(s.containsAll(CollectionTools.collection(a))); - } - - public void testAddAllCollectionObjectArray2() { - List l = this.buildObjectList1(); - String[] a = this.buildStringArray1(); - Set s = this.buildObjectSet1(); - - assertTrue(CollectionTools.addAll(l, a)); - assertEquals(6, l.size()); - assertTrue(l.containsAll(CollectionTools.collection(a))); - - assertFalse(CollectionTools.addAll(s, a)); - assertEquals(3, s.size()); - assertTrue(s.containsAll(CollectionTools.collection(a))); - } - - public void testAddAllObjectArrayCollection1() { - String[] a = this.buildStringArray1(); - Collection c = this.buildStringList2(); - String[] newArray = CollectionTools.addAll(a, c); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, c)); - } - - public void testAddAllObjectArrayCollection2() { - Object[] a = this.buildObjectArray1(); - Collection c = this.buildStringList2(); - Object[] newArray = CollectionTools.addAll(a, c); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, c)); - } - - public void testAddAllObjectArrayIterator1() { - String[] a = this.buildStringArray1(); - Iterator i = this.buildStringList1().iterator(); - String[] newArray = CollectionTools.addAll(a, i); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1())); - } - - public void testAddAllObjectArrayIterator2() { - String[] a = this.buildStringArray1(); - Iterator i = this.buildObjectList1().iterator(); - Object[] newArray = CollectionTools.addAll(a, i); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1())); - } - - public void testAddAllObjectArrayObjectArray1() { - Object[] a1 = this.buildObjectArray1(); - Object[] a2 = this.buildObjectArray2(); - Object[] newArray = CollectionTools.addAll(a1, a2); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, a1)); - assertTrue(CollectionTools.containsAll(newArray, a2)); - } - - public void testAddAllObjectArrayObjectArray2() { - String[] a1 = this.buildStringArray1(); - String[] a2 = this.buildStringArray2(); - String[] newArray = CollectionTools.addAll(a1, a2); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, a1)); - assertTrue(CollectionTools.containsAll(newArray, a2)); - } - - public void testAddAllObjectArrayObjectArray3() { - Object[] a1 = this.buildObjectArray1(); - String[] a2 = this.buildStringArray2(); - Object[] newArray = CollectionTools.addAll(a1, a2); - - assertEquals(6, newArray.length); - assertTrue(CollectionTools.containsAll(newArray, a1)); - assertTrue(CollectionTools.containsAll(newArray, a2)); - } - - public void testAddAllObjectArrayIntObjectArray1() { - Object[] a = new Object[] { "a", "b", "c", "d" }; - a = CollectionTools.addAll(a, 2, new Object[] { "X", "X", "X" }); - assertEquals(7, a.length); - assertTrue(CollectionTools.contains(a, "X")); - assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a)); - } - - public void testAddAllObjectArrayIntObjectArray2() { - String[] a = new String[] { "a", "b", "c", "d" }; - a = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" }); - assertEquals(7, a.length); - assertTrue(CollectionTools.contains(a, "X")); - assertTrue(Arrays.equals(new String[] { "a", "b", "X", "X", "X", "c", "d" }, a)); - } - - public void testAddAllObjectArrayIntObjectArray3() { - Object[] a = new Object[] { "a", "b", "c", "d" }; - a = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" }); - assertEquals(7, a.length); - assertTrue(CollectionTools.contains(a, "X")); - assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a)); - } - - public void testAddAllCharArrayCharArray() { - char[] a = CollectionTools.addAll(this.buildCharArray(), new char[] { 'd', 'e' }); - assertEquals(5, a.length); - assertTrue(CollectionTools.contains(a, 'd')); - assertTrue(CollectionTools.contains(a, 'e')); - } - - public void testAddAllCharArrayIntCharArray() { - char[] a = new char[] { 'a', 'b', 'c', 'd' }; - a = CollectionTools.addAll(a, 2, new char[] { 'X', 'X', 'X' }); - assertEquals(7, a.length); - assertTrue(CollectionTools.contains(a, 'X')); - assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'X', 'X', 'c', 'd' }, a)); - } - - public void testAddAllIntArrayIntArray() { - int[] a = CollectionTools.addAll(this.buildIntArray(), new int[] { 30, 40 }); - assertEquals(5, a.length); - assertTrue(CollectionTools.contains(a, 30)); - assertTrue(CollectionTools.contains(a, 40)); - } - - public void testAddAllIntArrayIntIntArray() { - int[] a = new int[] { 1, 2, 3, 4 }; - a = CollectionTools.addAll(a, 2, new int[] { 99, 99, 99 }); - assertEquals(7, a.length); - assertTrue(CollectionTools.contains(a, 99)); - assertTrue(Arrays.equals(new int[] { 1, 2, 99, 99, 99, 3, 4 }, a)); - } - - public void testArrayIterator() { - Object[] a = CollectionTools.array(this.buildStringList1().iterator()); - assertEquals(3, a.length); - assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator())); - } - - public void testArrayIteratorObjectArray1() { - String[] a = CollectionTools.array(this.buildStringList1().iterator(), new String[0]); - assertEquals(3, a.length); - assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator())); - } - - public void testArrayIteratorObjectArray2() { - Object[] a = CollectionTools.array(this.buildStringList1().iterator(), new Object[0]); - assertEquals(3, a.length); - assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator())); - } - - public void testBagEnumeration1() { - Bag b = CollectionTools.bag(this.buildStringVector1().elements()); - assertEquals(3, b.size()); - assertTrue(b.containsAll(this.buildStringVector1())); - } - - public void testBagEnumeration2() { - Bag b = CollectionTools.bag(this.buildStringVector1().elements()); - assertEquals(3, b.size()); - assertTrue(b.containsAll(this.buildStringVector1())); - } - - public void testBagIterator1() { - Bag b = CollectionTools.bag(this.buildStringList1().iterator()); - assertEquals(3, b.size()); - assertTrue(b.containsAll(this.buildStringList1())); - } - - public void testBagIterator2() { - Collection c = new ArrayList(); - c.add("zero"); - c.add("one"); - c.add("two"); - c.add("three"); - Bag b = CollectionTools.bag(c.iterator()); - assertEquals(4, b.size()); - assertTrue(b.containsAll(c)); - } - - public void testBagObjectArray1() { - Bag b = CollectionTools.bag(this.buildStringArray1()); - assertEquals(3, b.size()); - assertTrue(CollectionTools.containsAll(b, this.buildStringArray1())); - } - - public void testBagObjectArray2() { - Bag b = CollectionTools.bag("foo", "bar", "baz"); - assertEquals(3, b.size()); - assertTrue(CollectionTools.containsAll(b, new Object[]{"foo", "bar", "baz"})); - } - - public void testCollectionEnumeration1() { - Collection c = CollectionTools.collection(this.buildStringVector1().elements()); - assertEquals(3, c.size()); - assertTrue(c.containsAll(this.buildStringVector1())); - } - - public void testCollectionEnumeration2() { - Collection c = CollectionTools.collection(this.buildStringVector1().elements()); - assertEquals(3, c.size()); - assertTrue(c.containsAll(this.buildStringVector1())); - } - - public void testCollectionIterator1() { - Collection c = CollectionTools.collection(this.buildStringList1().iterator()); - assertEquals(3, c.size()); - assertTrue(c.containsAll(this.buildStringList1())); - } - - public void testCollectionIterator2() { - Collection c = CollectionTools.collection(this.buildStringList1().iterator()); - assertEquals(3, c.size()); - assertTrue(c.containsAll(this.buildStringList1())); - } - - public void testCollectionObjectArray() { - Collection c = CollectionTools.collection(this.buildStringArray1()); - assertEquals(3, c.size()); - assertTrue(CollectionTools.containsAll(c, this.buildStringArray1())); - } - - public void testContainsEnumerationObject1() { - Vector v = this.buildStringVector1(); - assertTrue(CollectionTools.contains(v.elements(), "one")); - assertFalse(CollectionTools.contains(v.elements(), null)); - v.add(null); - assertTrue(CollectionTools.contains(v.elements(), null)); - } - - public void testContainsEnumerationObject2() { - Vector c = new Vector(); - c.add("zero"); - c.add("one"); - c.add("two"); - c.add("three"); - String one = "one"; - assertTrue(CollectionTools.contains(c.elements(), one)); - assertFalse(CollectionTools.contains(c.elements(), null)); - c.add(null); - assertTrue(CollectionTools.contains(c.elements(), null)); - } - - public void testContainsIteratorObject1() { - Collection c = this.buildStringList1(); - assertTrue(CollectionTools.contains(c.iterator(), "one")); - assertFalse(CollectionTools.contains(c.iterator(), null)); - c.add(null); - assertTrue(CollectionTools.contains(c.iterator(), null)); - } - - public void testContainsIteratorObject2() { - Collection c = new HashBag(); - c.add("zero"); - c.add("one"); - c.add("two"); - c.add("three"); - String one = "one"; - assertTrue(CollectionTools.contains(c.iterator(), one)); - assertFalse(CollectionTools.contains(c.iterator(), null)); - c.add(null); - assertTrue(CollectionTools.contains(c.iterator(), null)); - } - - public void testContainsObjectArrayObject() { - Object[] a = this.buildObjectArray1(); - assertTrue(CollectionTools.contains(a, "one")); - assertFalse(CollectionTools.contains(a, null)); - Object[] a2 = CollectionTools.add(a, null); - assertTrue(CollectionTools.contains(a2, null)); - } - - public void testContainsCharArrayChar() { - char[] a = this.buildCharArray(); - assertTrue(CollectionTools.contains(a, 'a')); - assertFalse(CollectionTools.contains(a, 'z')); - char[] a2 = CollectionTools.add(a, 'z'); - assertTrue(CollectionTools.contains(a2, 'z')); - } - - public void testContainsIntArrayInt() { - int[] a = this.buildIntArray(); - assertTrue(CollectionTools.contains(a, 10)); - assertFalse(CollectionTools.contains(a, 55)); - int[] a2 = CollectionTools.add(a, 55); - assertTrue(CollectionTools.contains(a2, 55)); - } - - public void testContainsAllCollectionIterator1() { - assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildStringList1().iterator())); - } - - public void testContainsAllCollectionIterator2() { - Collection c1 = new ArrayList(); - c1.add("zero"); - c1.add("one"); - c1.add("two"); - Collection c2 = new ArrayList(); - c2.add("two"); - c2.add("zero"); - c2.add("one"); - assertTrue(CollectionTools.containsAll(c1, c2.iterator())); - } - - public void testContainsAllCollectionObjectArray1() { - assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildObjectArray1())); - } - - public void testContainsAllCollectionObjectArray2() { - Object[] a = new Object[] { "zero", "one", "two" }; - assertTrue(CollectionTools.containsAll(this.buildStringList1(), a)); - } - - public void testContainsAllIteratorCollection1() { - assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1())); - } - - public void testContainsAllIteratorCollection2() { - Collection c1 = new ArrayList(); - c1.add("zero"); - c1.add("one"); - c1.add("two"); - Collection c2 = new ArrayList(); - c2.add("zero"); - c2.add("one"); - c2.add("two"); - assertTrue(CollectionTools.containsAll(c1.iterator(), c2)); - } - - public void testContainsAllIteratorIterator1() { - assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1().iterator())); - } - - public void testContainsAllIteratorIterator2() { - Collection c1 = new ArrayList(); - c1.add("zero"); - c1.add("one"); - c1.add("two"); - Collection c2 = new ArrayList(); - c2.add("zero"); - c2.add("one"); - c2.add("two"); - assertTrue(CollectionTools.containsAll(c1.iterator(), c2.iterator())); - } - - public void testContainsAllIteratorObjectArray() { - assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray1())); - } - - public void testContainsAllObjectArrayCollection() { - assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1())); - } - - public void testContainsAllObjectArrayIterator() { - assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1().iterator())); - } - - public void testContainsAllObjectArrayObjectArray() { - assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray1())); - } - - public void testContainsAllCharArrayCharArray() { - assertTrue(CollectionTools.containsAll(this.buildCharArray(), this.buildCharArray())); - } - - public void testContainsAllIntArrayIntArray() { - assertTrue(CollectionTools.containsAll(this.buildIntArray(), this.buildIntArray())); - } - - public void testDiffEnd() { - String a = "a"; - String b = "b"; - String c = "c"; - String d = "d"; - String e = "e"; - String a_ = new String("a"); - String b_ = new String("b"); - String c_ = new String("c"); - String d_ = new String("d"); - String e_ = new String("e"); - assertTrue((a != a_) && a.equals(a_)); - assertTrue((b != b_) && b.equals(b_)); - assertTrue((c != c_) && c.equals(c_)); - assertTrue((d != d_) && d.equals(d_)); - assertTrue((e != e_) && e.equals(e_)); - String[] array1; - String[] array2; - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(-1, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a }; - array2 = new String[] { a_ }; - assertEquals(-1, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[0]; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[0]; - assertEquals(4, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[0]; - array2 = new String[0]; - assertEquals(-1, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, a_, d_, e_ }; - assertEquals(2, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, c_, d_, e_ }; - assertEquals(0, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a, b, c, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(3, CollectionTools.diffEnd(array1, array2)); - - String c__ = new String(c); - assertTrue((c != c__) && c.equals(c_)); - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c__, d_, e_ }; - assertEquals(-1, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(2, CollectionTools.diffEnd(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, null, d_, e_ }; - assertEquals(-1, CollectionTools.diffEnd(array1, array2)); - } - - public void testDiffRange() { - String a = "a"; - String b = "b"; - String c = "c"; - String d = "d"; - String e = "e"; - String a_ = a; - String b_ = b; - String c_ = c; - String d_ = d; - String e_ = e; - assertTrue((a == a_) && a.equals(a_)); - assertTrue((b == b_) && b.equals(b_)); - assertTrue((c == c_) && c.equals(c_)); - assertTrue((d == d_) && d.equals(d_)); - assertTrue((e == e_) && e.equals(e_)); - String[] array1; - String[] array2; - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a }; - array2 = new String[] { a_ }; - assertEquals(new Range(1, -1), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, d_, e_ }; - assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2)); - - array1 = new String[0]; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[0]; - assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2)); - - array1 = new String[0]; - array2 = new String[0]; - assertEquals(new Range(0, -1), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, a_, d_, e_ }; - assertEquals(new Range(0, 2), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, c_, d_, e_ }; - assertEquals(new Range(0, 0), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a, b, c, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(new Range(3, 3), CollectionTools.diffRange(array1, array2)); - - String c__ = new String(c); - assertTrue((c != c__) && c.equals(c_)); - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c__, d_, e_ }; - assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(2, 2), CollectionTools.diffRange(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, null, d_, e_ }; - assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2)); - } - - public void testDiffStart() { - String a = "a"; - String b = "b"; - String c = "c"; - String d = "d"; - String e = "e"; - String a_ = new String("a"); - String b_ = new String("b"); - String c_ = new String("c"); - String d_ = new String("d"); - String e_ = new String("e"); - assertTrue((a != a_) && a.equals(a_)); - assertTrue((b != b_) && b.equals(b_)); - assertTrue((c != c_) && c.equals(c_)); - assertTrue((d != d_) && d.equals(d_)); - assertTrue((e != e_) && e.equals(e_)); - String[] array1; - String[] array2; - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(5, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a }; - array2 = new String[] { a_ }; - assertEquals(1, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, c, d }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(4, CollectionTools.diffStart(array1, array2)); - - array1 = new String[0]; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(0, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[0]; - assertEquals(0, CollectionTools.diffStart(array1, array2)); - - array1 = new String[0]; - array2 = new String[0]; - assertEquals(0, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, e_, c_, d_ }; - assertEquals(2, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, c, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(3, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, c_, d_, e_ }; - assertEquals(0, CollectionTools.diffStart(array1, array2)); - - String c__ = new String(c); - assertTrue((c != c__) && c.equals(c__)); - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c__, d_, e_ }; - assertEquals(5, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(2, CollectionTools.diffStart(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, null, d_, e_ }; - assertEquals(5, CollectionTools.diffStart(array1, array2)); - } - - public void testEqualsListIteratorListIterator() { - List list1 = new ArrayList(); - list1.add("1000"); - list1.add("2000"); - list1.add("3000"); - list1.add("4000"); - - List list2 = new ArrayList(); - for (int i = 0; i < list1.size(); i++) { - list2.add(String.valueOf((i + 1) * 1000)); - } - assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator())); - assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator())); - } - - public void testGetListIteratorInt() { - List list = this.buildStringList1(); - String o = CollectionTools.get(list.listIterator(), 1); - assertEquals("one", o); - list.add(null); - o = CollectionTools.get(list.listIterator(), list.size() - 1); - assertNull(o); - - boolean exCaught = false; - try { - CollectionTools.get(list.listIterator(), list.size()); - } catch (IndexOutOfBoundsException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testIdenticalObjectArrayObjectArray() { - Object[] a1 = new Object[4]; - for (int i = 0; i < a1.length; i++) { - a1[i] = String.valueOf(i * 1000); - } - - Object[] a2 = new Object[a1.length]; - for (int i = 0; i < a2.length; i++) { - a2[i] = a1[i]; - } - - assertTrue(CollectionTools.identical(a1, a2)); - a2[2] = "2000"; - assertFalse(CollectionTools.identical(a1, a2)); - assertTrue(Arrays.equals(a1, a2)); - } - - public void testIdenticalListIteratorListIterator() { - List list1 = new ArrayList(); - list1.add("0"); - list1.add("1"); - list1.add("2"); - list1.add("3"); - - List list2 = new ArrayList(); - for (String s : list1) { - list2.add(s); - } - assertTrue(CollectionTools.identical(list1.listIterator(), list2.listIterator())); - assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator())); - } - - public void testIdentityDiffEnd() { - String a = "a"; - String b = "b"; - String c = "c"; - String d = "d"; - String e = "e"; - String a_ = a; - String b_ = b; - String c_ = c; - String d_ = d; - String e_ = e; - assertTrue((a == a_) && a.equals(a_)); - assertTrue((b == b_) && b.equals(b_)); - assertTrue((c == c_) && c.equals(c_)); - assertTrue((d == d_) && d.equals(d_)); - assertTrue((e == e_) && e.equals(e_)); - String[] array1; - String[] array2; - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a }; - array2 = new String[] { a_ }; - assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[0]; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[0]; - assertEquals(4, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[0]; - array2 = new String[0]; - assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, a_, d_, e_ }; - assertEquals(2, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, c_, d_, e_ }; - assertEquals(0, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a, b, c, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(3, CollectionTools.identityDiffEnd(array1, array2)); - - String c__ = new String(c); - assertTrue((c != c__) && c.equals(c_)); - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c__, d_, e_ }; - assertEquals(2, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(2, CollectionTools.identityDiffEnd(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, null, d_, e_ }; - assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2)); - } - - public void testIdentityDiffRange() { - String a = "a"; - String b = "b"; - String c = "c"; - String d = "d"; - String e = "e"; - String a_ = a; - String b_ = b; - String c_ = c; - String d_ = d; - String e_ = e; - assertTrue((a == a_) && a.equals(a_)); - assertTrue((b == b_) && b.equals(b_)); - assertTrue((c == c_) && c.equals(c_)); - assertTrue((d == d_) && d.equals(d_)); - assertTrue((e == e_) && e.equals(e_)); - String[] array1; - String[] array2; - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(5, -1), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a }; - array2 = new String[] { a_ }; - assertEquals(new Range(1, -1), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, d_, e_ }; - assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[0]; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[0]; - assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[0]; - array2 = new String[0]; - assertEquals(new Range(0, -1), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { b_, c_, a_, d_, e_ }; - assertEquals(new Range(0, 2), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, c_, d_, e_ }; - assertEquals(new Range(0, 0), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a, b, c, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(new Range(3, 3), CollectionTools.identityDiffRange(array1, array2)); - - String c__ = new String(c); - assertTrue((c != c__) && c.equals(c_)); - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c__, d_, e_ }; - assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, null, d_, e_ }; - assertEquals(new Range(5, -1), CollectionTools.identityDiffRange(array1, array2)); - } - - public void testIdentityDiffStart() { - String a = "a"; - String b = "b"; - String c = "c"; - String d = "d"; - String e = "e"; - String a_ = a; - String b_ = b; - String c_ = c; - String d_ = d; - String e_ = e; - assertTrue((a == a_) && a.equals(a_)); - assertTrue((b == b_) && b.equals(b_)); - assertTrue((c == c_) && c.equals(c_)); - assertTrue((d == d_) && d.equals(d_)); - assertTrue((e == e_) && e.equals(e_)); - String[] array1; - String[] array2; - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(5, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a }; - array2 = new String[] { a_ }; - assertEquals(1, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, c, d }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(4, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(4, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[0]; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(0, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[0]; - assertEquals(0, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[0]; - array2 = new String[0]; - assertEquals(0, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, e_, c_, d_ }; - assertEquals(2, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, c, e }; - array2 = new String[] { a_, b_, c_, d_ }; - assertEquals(3, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { b, c, d, e }; - array2 = new String[] { a_, c_, d_, e_ }; - assertEquals(0, CollectionTools.identityDiffStart(array1, array2)); - - String c__ = new String(c); - assertTrue((c != c__) && c.equals(c_)); - array1 = new String[] { a, b, c, d, e }; - array2 = new String[] { a_, b_, c__, d_, e_ }; - assertEquals(2, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, c_, d_, e_ }; - assertEquals(2, CollectionTools.identityDiffStart(array1, array2)); - - array1 = new String[] { a, b, null, d, e }; - array2 = new String[] { a_, b_, null, d_, e_ }; - assertEquals(5, CollectionTools.identityDiffStart(array1, array2)); - } - - public void testIndexOfListIteratorObject1() { - List list = this.buildStringList1(); - assertEquals(1, CollectionTools.indexOf(list.listIterator(), "one")); - list.add(null); - assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null)); - } - - public void testIndexOfListIteratorObject2() { - List list = new ArrayList(); - list.add("0"); - list.add("1"); - list.add("2"); - list.add("3"); - - String one = "1"; - assertEquals(1, CollectionTools.indexOf(list.listIterator(), one)); - list.add(null); - assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null)); - } - - public void testIndexOfObjectArrayObject() { - Object[] a = this.buildObjectArray1(); - assertEquals(1, CollectionTools.indexOf(a, "one")); - a = CollectionTools.add(a, null); - assertEquals(a.length - 1, CollectionTools.indexOf(a, null)); - } - - public void testIndexOfCharArrayChar() { - char[] a = this.buildCharArray(); - assertEquals(1, CollectionTools.indexOf(a, 'b')); - a = CollectionTools.add(a, 'd'); - assertEquals(a.length - 1, CollectionTools.indexOf(a, 'd')); - } - - public void testIndexOfIntArrayInt() { - int[] a = this.buildIntArray(); - assertEquals(1, CollectionTools.indexOf(a, 10)); - a = CollectionTools.add(a, 30); - assertEquals(a.length - 1, CollectionTools.indexOf(a, 30)); - } - - public void testInsertionIndexOfListComparable() { - List list = Arrays.asList(new String[] { "A", "C", "D" }); - assertEquals(1, CollectionTools.insertionIndexOf(list, "B")); - - list = Arrays.asList(new String[] { "A", "B", "C", "D" }); - assertEquals(2, CollectionTools.insertionIndexOf(list, "B")); - - list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" }); - assertEquals(4, CollectionTools.insertionIndexOf(list, "B")); - - list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" }); - assertEquals(6, CollectionTools.insertionIndexOf(list, "E")); - - list = Arrays.asList(new String[] { "B", "B", "B", "C", "D" }); - assertEquals(0, CollectionTools.insertionIndexOf(list, "A")); - - list = Arrays.asList(new String[] { "A", "A", "B", "B", "C", "D" }); - assertEquals(2, CollectionTools.insertionIndexOf(list, "A")); - } - - public void testInsertionIndexOfListObjectComparator() { - Comparator c = new ReverseComparator(); - List list = Arrays.asList(new String[] { "D", "C", "A" }); - assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c)); - - list = Arrays.asList(new String[] { "D", "C", "B", "A" }); - assertEquals(3, CollectionTools.insertionIndexOf(list, "B", c)); - - list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" }); - assertEquals(5, CollectionTools.insertionIndexOf(list, "B", c)); - - list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" }); - assertEquals(0, CollectionTools.insertionIndexOf(list, "E", c)); - - list = Arrays.asList(new String[] { "D", "C", "B", "B", "B" }); - assertEquals(5, CollectionTools.insertionIndexOf(list, "A", c)); - - list = Arrays.asList(new String[] { "D", "C", "B", "B", "A", "A" }); - assertEquals(6, CollectionTools.insertionIndexOf(list, "A", c)); - } - - public void testInsertionIndexOfObjectArrayComparable() { - String[] a = new String[] { "A", "C", "D" }; - assertEquals(1, CollectionTools.insertionIndexOf(a, "B")); - - a = new String[] { "A", "B", "C", "D" }; - assertEquals(2, CollectionTools.insertionIndexOf(a, "B")); - - a = new String[] { "A", "B", "B", "B", "C", "D" }; - assertEquals(4, CollectionTools.insertionIndexOf(a, "B")); - - a = new String[] { "A", "B", "B", "B", "C", "D" }; - assertEquals(6, CollectionTools.insertionIndexOf(a, "E")); - - a = new String[] { "B", "B", "B", "C", "D" }; - assertEquals(0, CollectionTools.insertionIndexOf(a, "A")); - - a = new String[] { "A", "A", "B", "B", "C", "D" }; - assertEquals(2, CollectionTools.insertionIndexOf(a, "A")); - } - - public void testInsertionIndexOfObjectArrayObjectComparator() { - Comparator c = new ReverseComparator(); - String[] a = new String[] { "D", "C", "A" }; - assertEquals(2, CollectionTools.insertionIndexOf(a, "B", c)); - - a = new String[] { "D", "C", "B", "A" }; - assertEquals(3, CollectionTools.insertionIndexOf(a, "B", c)); - - a = new String[] { "D", "C", "B", "B", "B", "A" }; - assertEquals(5, CollectionTools.insertionIndexOf(a, "B", c)); - - a = new String[] { "D", "C", "B", "B", "B", "A" }; - assertEquals(0, CollectionTools.insertionIndexOf(a, "E", c)); - - a = new String[] { "D", "C", "B", "B", "B" }; - assertEquals(5, CollectionTools.insertionIndexOf(a, "A", c)); - - a = new String[] { "D", "C", "B", "B", "A", "A" }; - assertEquals(6, CollectionTools.insertionIndexOf(a, "A", c)); - } - - public void testIteratorObjectArray() { - String[] a = this.buildStringArray1(); - int i = 0; - for (Iterator stream = CollectionTools.iterator(a); stream.hasNext(); i++) { - assertEquals(a[i], stream.next()); - } - } - - public void testLastIndexOfListIteratorObject() { - List list = this.buildStringList1(); - assertEquals(1, CollectionTools.lastIndexOf(list.listIterator(), "one")); - list.add(null); - assertEquals(list.size() - 1, CollectionTools.lastIndexOf(list.listIterator(), null)); - } - - public void testLastIndexOfObjectArrayObject() { - Object[] a = this.buildObjectArray1(); - assertEquals(1, CollectionTools.lastIndexOf(a, "one")); - a = CollectionTools.add(a, null); - assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, null)); - } - - public void testLastIndexOfCharArrayChar() { - char[] a = this.buildCharArray(); - assertEquals(1, CollectionTools.lastIndexOf(a, 'b')); - a = CollectionTools.add(a, 'd'); - assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 'd')); - } - - public void testLastIndexOfIntArrayInt() { - int[] a = this.buildIntArray(); - assertEquals(1, CollectionTools.lastIndexOf(a, 10)); - a = CollectionTools.add(a, 30); - assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 30)); - } - - public void testListIterator1() { - List list = CollectionTools.list(this.buildStringList1().iterator()); - assertEquals(this.buildStringList1(), list); - } - - public void testListIterator2() { - List list1 = new ArrayList(); - list1.add("0"); - list1.add("1"); - list1.add("2"); - list1.add("3"); - - List list2 = CollectionTools.list(list1.iterator()); - assertEquals(list1, list2); - } - - public void testListObjectArray() { - List list = CollectionTools.list(this.buildStringArray1()); - assertEquals(this.buildStringList1(), list); - } - - public void testListIteratorObjectArray() { - String[] a = this.buildStringArray1(); - int i = 0; - for (ListIterator stream = CollectionTools.listIterator(a); stream.hasNext(); i++) { - assertEquals(a[i], stream.next()); - } - } - - public void testListIteratorObjectArrayInt() { - String[] a = this.buildStringArray1(); - int i = 1; - for (ListIterator stream = CollectionTools.listIterator(a, 1); stream.hasNext(); i++) { - assertEquals(a[i], stream.next()); - } - } - - public void testMaxCharArray() { - assertEquals('c', CollectionTools.max(this.buildCharArray())); - } - - public void testMaxIntArray() { - assertEquals(20, CollectionTools.max(this.buildIntArray())); - } - - public void testMinCharArray() { - assertEquals('a', CollectionTools.min(this.buildCharArray())); - } - - public void testMinIntArray() { - assertEquals(0, CollectionTools.min(this.buildIntArray())); - } - - public void testRemoveAllObjectArrayObjectArray() { - String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" }; - String[] a2 = new String[] { "E", "B" }; - String[] a3 = CollectionTools.removeAll(a1, a2); - assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3)); - } - - public void testRemoveAllCharArrayCharArray() { - char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' }; - char[] a2 = new char[] { 'E', 'B' }; - assertTrue(Arrays.equals(new char[] { 'A', 'A', 'C', 'C', 'D', 'D', 'F', 'F' }, CollectionTools.removeAll(a1, a2))); - } - - public void testRemoveAllIntArrayIntArray() { - int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 }; - int[] a2 = new int[] { 5, 2 }; - assertTrue(Arrays.equals(new int[] { 1, 1, 3, 3, 4, 4, 6, 6 }, CollectionTools.removeAll(a1, a2))); - } - - public void testRemoveObjectArrayObject1() { - Object[] a = this.buildObjectArray1(); - a = CollectionTools.add(a, "three"); - a = CollectionTools.add(a, "four"); - a = CollectionTools.add(a, "five"); - - assertEquals(6, a.length); - assertTrue(CollectionTools.contains(a, "three")); - a = CollectionTools.remove(a, "three"); - assertEquals(5, a.length); - assertFalse(CollectionTools.contains(a, "three")); - assertTrue(CollectionTools.contains(a, "four")); - assertTrue(CollectionTools.contains(a, "five")); - } - - public void testRemoveObjectArrayObject2() { - String[] a = this.buildStringArray1(); - a = CollectionTools.add(a, "three"); - a = CollectionTools.add(a, "four"); - a = CollectionTools.add(a, "five"); - - assertEquals(6, a.length); - assertTrue(CollectionTools.contains(a, "three")); - a = CollectionTools.remove(a, "three"); - assertEquals(5, a.length); - assertFalse(CollectionTools.contains(a, "three")); - assertTrue(CollectionTools.contains(a, "four")); - assertTrue(CollectionTools.contains(a, "five")); - } - - public void testRemoveCharArrayChar() { - char[] a = this.buildCharArray(); - a = CollectionTools.add(a, 'd'); - a = CollectionTools.add(a, 'e'); - a = CollectionTools.add(a, 'f'); - - assertEquals(6, a.length); - assertTrue(CollectionTools.contains(a, 'd')); - a = CollectionTools.remove(a, 'd'); - assertEquals(5, a.length); - assertFalse(CollectionTools.contains(a, 'd')); - assertTrue(CollectionTools.contains(a, 'e')); - assertTrue(CollectionTools.contains(a, 'f')); - } - - public void testRemoveIntArrayInt() { - int[] a = this.buildIntArray(); - a = CollectionTools.add(a, 30); - a = CollectionTools.add(a, 40); - a = CollectionTools.add(a, 50); - - assertEquals(6, a.length); - assertTrue(CollectionTools.contains(a, 30)); - a = CollectionTools.remove(a, 30); - assertEquals(5, a.length); - assertFalse(CollectionTools.contains(a, 30)); - assertTrue(CollectionTools.contains(a, 40)); - assertTrue(CollectionTools.contains(a, 50)); - } - - public void testRemoveAllCollectionIterator1() { - Collection c = this.buildStringList1(); - assertTrue(CollectionTools.removeAll(c, this.buildStringList1().iterator())); - assertEquals(0, c.size()); - assertFalse(c.contains("one")); - assertFalse(c.contains("two")); - assertFalse(c.contains("three")); - - c = this.buildStringList1(); - assertFalse(CollectionTools.removeAll(c, this.buildStringList2().iterator())); - assertEquals(this.buildStringList1().size(), c.size()); - assertEquals(this.buildStringList1(), c); - } - - public void testRemoveAllCollectionIterator2() { - Collection c = new ArrayList(); - c.add("a"); - c.add("a"); - c.add("b"); - c.add("c"); - c.add("d"); - c.add("d"); - String[] a = new String[] { "a", "d" }; - assertTrue(CollectionTools.removeAll(c, new ArrayIterator(a))); - assertEquals(2, c.size()); - assertFalse(c.contains("a")); - assertTrue(c.contains("b")); - assertTrue(c.contains("c")); - assertFalse(c.contains("d")); - - assertFalse(CollectionTools.removeAll(c, new ArrayIterator(a))); - } - - public void testRemoveAllCollectionIterator3() { - Collection c = new ArrayList(); - c.add("a"); - c.add("a"); - c.add("b"); - c.add("c"); - c.add("d"); - c.add("d"); - String[] a = new String[] { "a", "d" }; - assertTrue(CollectionTools.removeAll(c, new ArrayIterator(a))); - assertEquals(2, c.size()); - assertFalse(c.contains("a")); - assertTrue(c.contains("b")); - assertTrue(c.contains("c")); - assertFalse(c.contains("d")); - - assertFalse(CollectionTools.removeAll(c, new ArrayIterator(a))); - } - - public void testRemoveAllCollectionObjectArray1() { - Collection c = this.buildStringList1(); - assertTrue(CollectionTools.removeAll(c, this.buildObjectArray1())); - assertEquals(0, c.size()); - assertFalse(c.contains("one")); - assertFalse(c.contains("two")); - assertFalse(c.contains("three")); - - c = this.buildStringList1(); - assertFalse(CollectionTools.removeAll(c, this.buildObjectArray2())); - assertEquals(this.buildStringList1().size(), c.size()); - assertEquals(this.buildStringList1(), c); - } - - public void testRemoveAllCollectionObjectArray2() { - Collection c = new ArrayList(); - c.add("a"); - c.add("a"); - c.add("b"); - c.add("c"); - c.add("d"); - c.add("d"); - String[] a = new String[] { "a", "d" }; - assertTrue(CollectionTools.removeAll(c, a)); - assertEquals(2, c.size()); - assertFalse(c.contains("a")); - assertTrue(c.contains("b")); - assertTrue(c.contains("c")); - assertFalse(c.contains("d")); - - assertFalse(CollectionTools.removeAll(c, a)); - } - - public void testRemoveAllCollectionObjectArray3() { - Collection c = new ArrayList(); - c.add("a"); - c.add("b"); - c.add("c"); - c.add("d"); - c.add("a"); - c.add("d"); - c.add("d"); - c.add("a"); - c.add("c"); - String[] a = new String[] { "a", "d" }; - assertTrue(CollectionTools.removeAll(c, a)); - assertEquals(3, c.size()); - assertFalse(c.contains("a")); - assertTrue(c.contains("b")); - assertTrue(c.contains("c")); - assertFalse(c.contains("d")); - - assertFalse(CollectionTools.removeAll(c, a)); - } - - public void testRemoveAllOccurrencesCollectionObject() { - Collection c = this.buildStringList1(); - assertEquals(3, c.size()); - assertFalse(CollectionTools.removeAllOccurrences(c, "three")); - assertTrue(CollectionTools.removeAllOccurrences(c, "two")); - assertFalse(CollectionTools.removeAllOccurrences(c, "two")); - assertEquals(2, c.size()); - - c.add("five"); - c.add("five"); - c.add("five"); - assertEquals(5, c.size()); - assertTrue(CollectionTools.removeAllOccurrences(c, "five")); - assertFalse(CollectionTools.removeAllOccurrences(c, "five")); - assertEquals(2, c.size()); - - c.add(null); - c.add(null); - c.add(null); - assertEquals(5, c.size()); - assertTrue(CollectionTools.removeAllOccurrences(c, null)); - assertFalse(CollectionTools.removeAllOccurrences(c, null)); - assertEquals(2, c.size()); - } - - public void testRemoveAllOccurrencesObjectArrayObject() { - String[] a = this.buildStringArray1(); - assertEquals(3, a.length); - a = CollectionTools.removeAllOccurrences(a, "three"); - assertEquals(3, a.length); - a = CollectionTools.removeAllOccurrences(a, "two"); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, "two"); - assertEquals(2, a.length); - - a = CollectionTools.add(a, "five"); - a = CollectionTools.add(a, "five"); - a = CollectionTools.add(a, "five"); - assertEquals(5, a.length); - a = CollectionTools.removeAllOccurrences(a, "five"); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, "five"); - assertEquals(2, a.length); - - a = CollectionTools.add(a, null); - a = CollectionTools.add(a, null); - a = CollectionTools.add(a, null); - assertEquals(5, a.length); - a = CollectionTools.removeAllOccurrences(a, null); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, null); - assertEquals(2, a.length); - } - - public void testRemoveAllOccurrencesCharArrayChar() { - char[] a = this.buildCharArray(); - assertEquals(3, a.length); - a = CollectionTools.removeAllOccurrences(a, 'd'); - assertEquals(3, a.length); - a = CollectionTools.removeAllOccurrences(a, 'b'); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, 'b'); - assertEquals(2, a.length); - - a = CollectionTools.add(a, 'g'); - a = CollectionTools.add(a, 'g'); - a = CollectionTools.add(a, 'g'); - assertEquals(5, a.length); - a = CollectionTools.removeAllOccurrences(a, 'g'); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, 'g'); - assertEquals(2, a.length); - } - - public void testRemoveAllOccurrencesIntArrayInt() { - int[] a = this.buildIntArray(); - assertEquals(3, a.length); - a = CollectionTools.removeAllOccurrences(a, 55); - assertEquals(3, a.length); - a = CollectionTools.removeAllOccurrences(a, 10); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, 10); - assertEquals(2, a.length); - - a = CollectionTools.add(a, 77); - a = CollectionTools.add(a, 77); - a = CollectionTools.add(a, 77); - assertEquals(5, a.length); - a = CollectionTools.removeAllOccurrences(a, 77); - assertEquals(2, a.length); - a = CollectionTools.removeAllOccurrences(a, 77); - assertEquals(2, a.length); - } - - public void testRemoveElementAtIndexObjectArrayInt() { - String[] a = new String[] { "A", "B", "A", "C", "A", "D" }; - a = CollectionTools.removeElementAtIndex(a, 3); - assertTrue(Arrays.equals(new String[] { "A", "B", "A", "A", "D" }, a)); - } - - public void testRemoveElementAtIndexCharArrayInt() { - char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' }; - a = CollectionTools.removeElementAtIndex(a, 3); - assertTrue(Arrays.equals(new char[] { 'A', 'B', 'A', 'A', 'D' }, a)); - } - - public void testRemoveElementAtIndexIntArrayInt() { - int[] a = new int[] { 8, 6, 7, 33, 2, 11 }; - a = CollectionTools.removeElementAtIndex(a, 3); - assertTrue(Arrays.equals(new int[] { 8, 6, 7, 2, 11 }, a)); - } - - public void testReplaceAllObjectArray1() { - Object[] a = new Object[] { "A", "B", "A", "C", "A", "D" }; - a = CollectionTools.replaceAll(a, "A", "Z"); - assertTrue(Arrays.equals(new Object[] { "Z", "B", "Z", "C", "Z", "D" }, a)); - } - - public void testReplaceAllObjectArray2() { - String[] a = new String[] { "A", "B", "A", "C", "A", "D" }; - a = CollectionTools.replaceAll(a, "A", "Z"); - assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a)); - } - - public void testReplaceAllCharArray() { - char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' }; - a = CollectionTools.replaceAll(a, 'A', 'Z'); - assertTrue(Arrays.equals(new char[] { 'Z', 'B', 'Z', 'C', 'Z', 'D' }, a)); - } - - public void testReplaceAllIntArray() { - int[] a = new int[] { 0, 1, 0, 7, 0, 99 }; - a = CollectionTools.replaceAll(a, 0, 13); - assertTrue(Arrays.equals(new int[] { 13, 1, 13, 7, 13, 99 }, a)); - } - - public void testRetainAllCollectionIterator1() { - Collection c = this.buildStringList1(); - assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator())); - assertEquals(this.buildStringList1().size(), c.size()); - assertEquals(this.buildStringList1(), c); - - assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator())); - assertEquals(0, c.size()); - assertFalse(c.contains("one")); - assertFalse(c.contains("two")); - assertFalse(c.contains("three")); - } - - public void testRetainAllCollectionIterator2() { - Collection c1 = new ArrayList(); - c1.add("zero"); - c1.add("one"); - c1.add("two"); - - Collection c2 = new ArrayList(); - c2.add("zero"); - c2.add("one"); - c2.add("two"); - - assertFalse(CollectionTools.retainAll(c1, c2.iterator())); - assertEquals(c2.size(), c1.size()); - assertEquals(c2, c1); - - Collection c3 = new ArrayList(); - c3.add("three"); - c3.add("four"); - c3.add("five"); - - assertTrue(CollectionTools.retainAll(c1, c3.iterator())); - assertEquals(0, c1.size()); - assertFalse(c1.contains("one")); - assertFalse(c1.contains("two")); - assertFalse(c1.contains("three")); - } - - public void testRetainAllCollectionObjectArray() { - Collection c = this.buildStringList1(); - assertFalse(CollectionTools.retainAll(c, this.buildObjectArray1())); - assertEquals(this.buildStringList1().size(), c.size()); - assertEquals(this.buildStringList1(), c); - - assertTrue(CollectionTools.retainAll(c, this.buildObjectArray2())); - assertEquals(0, c.size()); - assertFalse(c.contains("one")); - assertFalse(c.contains("two")); - assertFalse(c.contains("three")); - } - - public void testRetainAllObjectArrayObjectArray() { - String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" }; - Object[] a2 = new Object[] { "E", "B", new Integer(7) }; - assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, a2))); - } - - public void testRetainAllCharArrayCharArray() { - char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' }; - char[] a2 = new char[] { 'E', 'B' }; - assertTrue(Arrays.equals(new char[] { 'B', 'B', 'E', 'E' }, CollectionTools.retainAll(a1, a2))); - } - - public void testRetainAllIntArrayIntArray() { - int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 }; - int[] a2 = new int[] { 5, 2 }; - assertTrue(Arrays.equals(new int[] { 2, 2, 5, 5 }, CollectionTools.retainAll(a1, a2))); - } - - public void testReverseObjectArray1() { - Object[] a = this.buildObjectArray1(); - a = CollectionTools.reverse(a); - assertEquals("two", a[0]); - assertEquals("one", a[1]); - assertEquals("zero", a[2]); - } - - public void testReverseObjectArray2() { - String[] a = this.buildStringArray1(); - a = CollectionTools.reverse(a); - assertEquals("two", a[0]); - assertEquals("one", a[1]); - assertEquals("zero", a[2]); - } - - public void testReverseCharArray() { - char[] a = this.buildCharArray(); - a = CollectionTools.reverse(a); - assertEquals('c', a[0]); - assertEquals('b', a[1]); - assertEquals('a', a[2]); - } - - public void testReverseIntArray() { - int[] a = this.buildIntArray(); - a = CollectionTools.reverse(a); - assertEquals(20, a[0]); - assertEquals(10, a[1]); - assertEquals(0, a[2]); - } - - public void testReverseListIterator1() { - List actual = CollectionTools.reverseList(this.buildStringList1().iterator()); - List expected = this.buildStringList1(); - Collections.reverse(expected); - assertEquals(expected, actual); - } - - public void testReverseListIterator2() { - List actual = CollectionTools.reverseList(this.buildStringList1().iterator()); - List expected = this.buildObjectList1(); - Collections.reverse(expected); - assertEquals(expected, actual); - } - - public void testRotateObjectArray() { - String[] a = this.buildStringArray1(); - a = CollectionTools.rotate(a); - assertEquals("two", a[0]); - assertEquals("zero", a[1]); - assertEquals("one", a[2]); - } - - public void testRotateObjectArrayInt() { - String[] a = this.buildStringArray1(); - a = CollectionTools.rotate(a, 2); - assertEquals("one", a[0]); - assertEquals("two", a[1]); - assertEquals("zero", a[2]); - } - - public void testRotateCharArray() { - char[] a = this.buildCharArray(); - a = CollectionTools.rotate(a); - assertEquals('c', a[0]); - assertEquals('a', a[1]); - assertEquals('b', a[2]); - } - - public void testRotateCharArrayInt() { - char[] a = this.buildCharArray(); - a = CollectionTools.rotate(a, 2); - assertEquals('b', a[0]); - assertEquals('c', a[1]); - assertEquals('a', a[2]); - } - - public void testRotateIntArray() { - int[] a = this.buildIntArray(); - a = CollectionTools.rotate(a); - assertEquals(20, a[0]); - assertEquals(0, a[1]); - assertEquals(10, a[2]); - } - - public void testRotateIntArrayInt() { - int[] a = this.buildIntArray(); - a = CollectionTools.rotate(a, 2); - assertEquals(10, a[0]); - assertEquals(20, a[1]); - assertEquals(0, a[2]); - } - - public void testSetIterator1() { - assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator())); - } - - public void testSetIterator2() { - Set set1 = new HashSet(); - set1.add("0"); - set1.add("1"); - set1.add("2"); - set1.add("3"); - - Set set2 = CollectionTools.set(set1.iterator()); - assertEquals(set1, set2); - } - - public void testSetObjectArray() { - assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().toArray())); - } - - public void testShuffleObjectArray() { - String[] array1 = this.buildStringArray1(); - String[] array2 = CollectionTools.shuffle(this.buildStringArray1()); - assertEquals(array1.length, array2.length); - assertTrue(CollectionTools.containsAll(array1, array2)); - } - - public void testShuffleCharArray() { - char[] array1 = this.buildCharArray(); - char[] array2 = CollectionTools.shuffle(this.buildCharArray()); - assertEquals(array1.length, array2.length); - assertTrue(CollectionTools.containsAll(array1, array2)); - } - - public void testShuffleIntArray() { - int[] array1 = this.buildIntArray(); - int[] array2 = CollectionTools.shuffle(this.buildIntArray()); - assertEquals(array1.length, array2.length); - assertTrue(CollectionTools.containsAll(array1, array2)); - } - - public void testSingletonIterator1() { - Iterator stream = CollectionTools.singletonIterator("foo"); - assertTrue(stream.hasNext()); - assertEquals("foo", stream.next()); - } - - public void testSingletonIterator2() { - Iterator stream = CollectionTools.singletonIterator("foo"); - assertTrue(stream.hasNext()); - assertEquals("foo", stream.next()); - } - - public void testSingletonIterator3() { - Iterator stream = CollectionTools.singletonIterator((Object) "foo"); - assertTrue(stream.hasNext()); - assertEquals("foo", stream.next()); - } - - public void testSizeIterator() { - assertEquals(3, CollectionTools.size(this.buildObjectList1().iterator())); - } - - public void testSortedSetIterator1() { - assertEquals(this.buildSortedStringSet1(), CollectionTools.set(this.buildSortedStringSet1().iterator())); - } - - public void testSortedSetIterator2() { - SortedSet ss1 = new TreeSet(); - ss1.add("0"); - ss1.add("2"); - ss1.add("3"); - ss1.add("1"); - - SortedSet set2 = CollectionTools.sortedSet(ss1.iterator()); - assertEquals(ss1, set2); - } - - public void testSortedSetObjectArray() { - assertEquals(this.buildSortedStringSet1(), CollectionTools.set(this.buildSortedStringSet1().toArray())); - } - - public void testSwapObjectArray() { - String[] a = this.buildStringArray1(); - a = CollectionTools.swap(a, 1, 2); - assertEquals("zero", a[0]); - assertEquals("two", a[1]); - assertEquals("one", a[2]); - } - - public void testSwapCharArray() { - char[] a = this.buildCharArray(); - a = CollectionTools.swap(a, 1, 2); - assertEquals('a', a[0]); - assertEquals('c', a[1]); - assertEquals('b', a[2]); - } - - public void testSwapIntArray() { - int[] a = this.buildIntArray(); - a = CollectionTools.swap(a, 1, 2); - assertEquals(0, a[0]); - assertEquals(20, a[1]); - assertEquals(10, a[2]); - } - - public void testRemoveDuplicateElementsList() { - List list = this.buildStringVector1(); - list.add("zero"); - list.add("zero"); - list.add("two"); - list.add("zero"); - list = CollectionTools.removeDuplicateElements(list); - int i = 0; - assertEquals("zero", list.get(i++)); - assertEquals("one", list.get(i++)); - assertEquals("two", list.get(i++)); - assertEquals(i, list.size()); - } - - public void testRemoveDuplicateElementsObjectArray1() { - List list = this.buildStringVector1(); - list.add("zero"); - list.add("zero"); - list.add("two"); - list.add("zero"); - String[] array = CollectionTools.removeDuplicateElements(list.toArray(new String[list.size()])); - int i = 0; - assertEquals("zero", array[i++]); - assertEquals("one", array[i++]); - assertEquals("two", array[i++]); - assertEquals(i, array.length); - } - - public void testRemoveDuplicateElementsObjectArray2() { - List list = this.buildStringVector1(); - list.add("zero"); - list.add("zero"); - list.add("two"); - list.add("zero"); - String[] array = CollectionTools.removeDuplicateElements(list.toArray(new String[list.size()])); - int i = 0; - assertEquals("zero", array[i++]); - assertEquals("one", array[i++]); - assertEquals("two", array[i++]); - assertEquals(i, array.length); - } - - public void testVectorIterator1() { - Vector v = CollectionTools.vector(this.buildStringList1().iterator()); - assertEquals(3, v.size()); - assertTrue(v.containsAll(this.buildStringList1())); - } - - public void testVectorIterator2() { - Vector v = CollectionTools.vector(this.buildStringList1().iterator()); - assertEquals(3, v.size()); - assertTrue(v.containsAll(this.buildStringList1())); - } - - public void testVectorObjectArray() { - Vector v = CollectionTools.vector(this.buildStringArray1()); - assertEquals(3, v.size()); - assertTrue(v.containsAll(this.buildStringList1())); - } - - private Object[] buildObjectArray1() { - return new Object[] { "zero", "one", "two" }; - } - - private String[] buildStringArray1() { - return new String[] { "zero", "one", "two" }; - } - - private char[] buildCharArray() { - return new char[] { 'a', 'b', 'c' }; - } - - private int[] buildIntArray() { - return new int[] { 0, 10, 20 }; - } - - private Object[] buildObjectArray2() { - return new Object[] { "three", "four", "five" }; - } - - private String[] buildStringArray2() { - return new String[] { "three", "four", "five" }; - } - - private Vector buildStringVector1() { - Vector v = new Vector(); - this.addToCollection1(v); - return v; - } - - private List buildStringList1() { - List l = new ArrayList(); - this.addToCollection1(l); - return l; - } - - private List buildObjectList1() { - List l = new ArrayList(); - this.addToCollection1(l); - return l; - } - - private void addToCollection1(Collection c) { - c.add("zero"); - c.add("one"); - c.add("two"); - } - - private List buildStringList2() { - List l = new ArrayList(); - this.addToCollection2(l); - return l; - } - - private void addToCollection2(Collection c) { - c.add("three"); - c.add("four"); - c.add("five"); - } - - private Set buildStringSet1() { - Set s = new HashSet(); - this.addToCollection1(s); - return s; - } - - private Set buildObjectSet1() { - Set s = new HashSet(); - this.addToCollection1(s); - return s; - } - - private SortedSet buildSortedStringSet1() { - SortedSet s = new TreeSet(); - this.addToCollection1(s); - return s; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java deleted file mode 100644 index adcccf0992..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java +++ /dev/null @@ -1,594 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.Reader; -import java.io.Writer; -import java.lang.reflect.InvocationTargetException; -import java.net.URL; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.ClassTools; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.FileTools; - -public class FileToolsTests extends TestCase { - private File tempDir; - - public FileToolsTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.tempDir = this.buildTempDir(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - this.deleteDir(this.tempDir); - } - - public void testFilesIn() { - Collection files = CollectionTools.collection(FileTools.filesIn(this.tempDir.getPath())); - assertEquals("invalid file count", 3, files.size()); - } - - public void testDirectoriesIn() { - Collection files = CollectionTools.collection(FileTools.directoriesIn(this.tempDir.getPath())); - assertEquals("invalid directory count", 2, files.size()); - } - - public void testFilesInTree() { - Collection files = CollectionTools.collection(FileTools.filesInTree(this.tempDir.getPath())); - assertEquals("invalid file count", 9, files.size()); - } - - public void testDirectoriesInTree() { - Collection files = CollectionTools.collection(FileTools.directoriesInTree(this.tempDir.getPath())); - assertEquals("invalid directory count", 3, files.size()); - } - - public void testDeleteDirectory() throws IOException { - // build another temporary directory just for this test - File dir = this.buildTempDir(); - assertTrue("temporary directory not created", dir.exists()); - FileTools.deleteDirectory(dir.getPath()); - assertFalse("temporary directory not deleted", dir.exists()); - } - - public void testDeleteDirectoryContents() throws IOException { - // build another temporary directory just for this test - File dir = this.buildTempDir(); - assertTrue("temporary directory not created", dir.exists()); - FileTools.deleteDirectoryContents(dir.getPath()); - assertTrue("temporary directory should not have been deleted", dir.exists()); - assertTrue("temporary directory contents not deleted", dir.listFiles().length == 0); - dir.delete(); - } - - public void testCopyToFile() throws IOException { - File destFile = new File(this.tempDir, "destfile.txt"); - this.copyToFile(destFile, "testCopyToFile"); - } - - public void testCopyToPreExistingFile() throws IOException { - File destFile = new File(this.tempDir, "destfile.txt"); - Writer writer = new OutputStreamWriter(new FileOutputStream(destFile)); - writer.write("this text should be replaced..."); - writer.close(); - this.copyToFile(destFile, "testCopyToPreExistingFile"); - } - - private void copyToFile(File destFile, String writeString) throws IOException { - File sourceFile = new File(this.tempDir, "sourcefile.txt"); - char[] readBuffer = new char[writeString.length()]; - - Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile)); - writer.write(writeString); - writer.close(); - - FileTools.copyToFile(sourceFile, destFile); - - Reader reader = new InputStreamReader(new FileInputStream(destFile)); - reader.read(readBuffer); - reader.close(); - String readString = new String(readBuffer); - assertEquals(writeString, readString); - } - - public void testCopyToDirectory() throws IOException { - File sourceFile = new File(this.tempDir, "sourcefile.txt"); - String writeString = "testCopyToDirectory"; - - File destDir = new File(this.tempDir, "destdir"); - destDir.mkdir(); - File destFile = new File(destDir, "sourcefile.txt"); - char[] readBuffer = new char[writeString.length()]; - - Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile)); - writer.write(writeString); - writer.close(); - - FileTools.copyToDirectory(sourceFile, destDir); - - Reader reader = new InputStreamReader(new FileInputStream(destFile)); - reader.read(readBuffer); - reader.close(); - String readString = new String(readBuffer); - assertEquals(writeString, readString); - } - - public void testFilter() throws IOException { - String prefix = "XXXtestFileXXX"; - File testFile1 = new File(this.tempDir, prefix + "1"); - testFile1.createNewFile(); - File testFile2 = new File(this.tempDir, prefix + "2"); - testFile2.createNewFile(); - - FileFilter filter = this.buildFileFilter(prefix); - Iterator filteredFilesIterator = FileTools.filter(FileTools.filesIn(this.tempDir), filter); - Collection filteredFiles = CollectionTools.collection(filteredFilesIterator); - assertEquals(2, filteredFiles.size()); - assertTrue(filteredFiles.contains(testFile1)); - assertTrue(filteredFiles.contains(testFile2)); - } - - private FileFilter buildFileFilter(final String prefix) { - return new FileFilter() { - public boolean accept(File file) { - return file.getName().startsWith(prefix); - } - }; - } - - public void testStripExtension() { - assertEquals("foo", FileTools.stripExtension("foo.xml")); - assertEquals("foo.bar", FileTools.stripExtension("foo.bar.xml")); - assertEquals("foo", FileTools.stripExtension("foo")); - assertEquals("foo", FileTools.stripExtension("foo.")); - } - - public void testExtension() { - assertEquals(".xml", FileTools.extension("foo.xml")); - assertEquals(".xml", FileTools.extension("foo.bar.xml")); - assertEquals("", FileTools.extension("foo")); - assertEquals("", FileTools.extension("foo,xml")); - assertEquals(".", FileTools.extension("foo.")); - } - - public void testEmptyTemporaryDirectory() throws IOException { - File tempDir1 = FileTools.temporaryDirectory(); - File testFile1 = new File(tempDir1, "junk"); - testFile1.createNewFile(); - - File tempDir2 = FileTools.emptyTemporaryDirectory(); - assertEquals(tempDir1, tempDir2); - assertTrue(tempDir2.isDirectory()); - assertEquals(0, tempDir2.listFiles().length); - tempDir2.delete(); - } - - public void testCanonicalFileName() { - File file1 = new File("foo"); - file1 = new File(file1, "bar"); - file1 = new File(file1, "baz"); - file1 = new File(file1, ".."); - file1 = new File(file1, ".."); - file1 = new File(file1, "bar"); - file1 = new File(file1, "baz"); - File file2 = new File(System.getProperty("user.dir")); - file2 = new File(file2, "foo"); - file2 = new File(file2, "bar"); - file2 = new File(file2, "baz"); - File file3 = FileTools.canonicalFile(file1); - assertEquals(file2, file3); - } - - private boolean isExecutingOnWindows() { - return this.isExecutingOn("Windows"); - } - - // private boolean isExecutingOnLinux() { - // return this.isExecutingOn("Linux"); - // } - // - private boolean isExecutingOn(String osName) { - return System.getProperty("os.name").indexOf(osName) != -1; - } - - public void testPathFiles() { - File[] expected; - File[] actual; - - if (this.isExecutingOnWindows()) { - expected = new File[] { new File("C:/"), new File("C:/foo"), new File("C:/foo/bar"), new File("C:/foo/bar/baz.txt") }; - actual = this.pathFiles(new File("C:/foo/bar/baz.txt")); - assertTrue(Arrays.equals(expected, actual)); - } - - expected = new File[] { new File("/"), new File("/foo"), new File("/foo/bar"), new File("/foo/bar/baz.txt") }; - actual = this.pathFiles(new File("/foo/bar/baz.txt")); - assertTrue(Arrays.equals(expected, actual)); - - expected = new File[] { new File("foo"), new File("foo/bar"), new File("foo/bar/baz.txt") }; - actual = this.pathFiles(new File("foo/bar/baz.txt")); - assertTrue(Arrays.equals(expected, actual)); - - expected = new File[] { new File(".."), new File("../foo"), new File("../foo/bar"), new File("../foo/bar/baz.txt") }; - actual = this.pathFiles(new File("../foo/bar/baz.txt")); - assertTrue(Arrays.equals(expected, actual)); - - expected = new File[] { new File("."), new File("./foo"), new File("./foo/bar"), new File("./foo/bar/baz.txt") }; - actual = this.pathFiles(new File("./foo/bar/baz.txt")); - assertTrue(Arrays.equals(expected, actual)); - } - - private File[] pathFiles(File file) { - return (File[]) ClassTools.executeStaticMethod(FileTools.class, "pathFiles", File.class, file); - } - - public void testRelativeParentFile() { - assertEquals(new File(".."), this.relativeParentFile(1)); - assertEquals(new File("../.."), this.relativeParentFile(2)); - assertEquals(new File("../../.."), this.relativeParentFile(3)); - - boolean exCaught = false; - try { - File file = this.relativeParentFile(0); - fail("invalid return: " + file); - } catch (RuntimeException ex) { - if (ex.getCause() instanceof InvocationTargetException) { - InvocationTargetException ite = (InvocationTargetException) ex.getCause(); - if (ite.getTargetException() instanceof IllegalArgumentException) { - exCaught = true; - } - } - } - assertTrue(exCaught); - } - - private File relativeParentFile(int len) { - return (File) ClassTools.executeStaticMethod(FileTools.class, "relativeParentFile", int.class, new Integer(len)); - } - - public void testConvertToRelativeFile() { - String prefix = this.isExecutingOnWindows() ? "C:" : ""; - File file; - File dir; - File relativeFile; - - if (this.isExecutingOnWindows()) { - // on Windows, a drive must be specified for a file to be absolute (i.e. not relative) - this.verifyUnchangedRelativeFile("/dir1/dir2/file.txt", "C:/dir1/dir2"); - // different drives - this.verifyUnchangedRelativeFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2"); - } - this.verifyUnchangedRelativeFile("dir1/dir2/file.txt", prefix + "/dir1/dir2"); - this.verifyUnchangedRelativeFile("./dir1/dir2/file.txt", prefix + "/dir1/dir2"); - this.verifyUnchangedRelativeFile("../../dir1/dir2/file.txt", prefix + "/dir1/dir2"); - - file = new File(prefix + "/dir1/dir2"); - dir = new File(prefix + "/dir1/dir2"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("."), relativeFile); - - file = new File(prefix + "/dir1/dir2/file.txt"); - dir = new File(prefix + "/dir1/dir2"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("file.txt"), relativeFile); - - file = new File(prefix + "/dir1/dir2/../dir2/file.txt"); - dir = new File(prefix + "/dir1/dir2"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("file.txt"), relativeFile); - - file = new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt"); - dir = new File(prefix + "/dir1/dir2"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("dir3/dir4/dir5/file.txt"), relativeFile); - - file = new File(prefix + "/dir1/dir2/file.txt"); - dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("../../../file.txt"), relativeFile); - - file = new File(prefix + "/dir1/dir2/file.txt"); - dir = new File(prefix + "/dir1/dir2/dir3"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("../file.txt"), relativeFile); - - file = new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt"); - dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("../../../dirA/dirB/dirC/file.txt"), relativeFile); - - file = new File(prefix + "/dir1/dir2"); - dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("../../.."), relativeFile); - - file = new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar"); - dir = new File(prefix + "/My Documents/My Workspace/Project 1"); - relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(new File("lib/toplink.jar"), relativeFile); - } - - private void verifyUnchangedRelativeFile(String fileName, String dirName) { - File file = new File(fileName); - File dir = new File(dirName); - File relativeFile = FileTools.convertToRelativeFile(file, dir); - assertEquals(file, relativeFile); - } - - public void testConvertToAbsoluteFile() { - String prefix = this.isExecutingOnWindows() ? "C:" : ""; - File file; - File dir; - File absoluteFile; - - if (this.isExecutingOnWindows()) { - // on Windows, a drive must be specified for a file to be absolute (i.e. not relative) - this.verifyUnchangedAbsoluteFile("C:/dir1/dir2/file.txt", "C:/dir1/dir2"); - // different drives - this.verifyUnchangedAbsoluteFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2"); - } - this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/file.txt", prefix + "/dir1/dir2"); - this.verifyUnchangedAbsoluteFile(prefix + "/./dir1/dir2/file.txt", prefix + "/dir1/dir2"); - this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/../../dir1/dir2/file.txt", prefix + "/dir1/dir2"); - - file = new File("."); - dir = new File(prefix + "/dir1/dir2"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile); - - file = new File("./file.txt"); - dir = new File(prefix + "/dir1/dir2"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile); - - file = new File("file.txt"); - dir = new File(prefix + "/dir1/dir2"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile); - - file = new File("../dir2/file.txt"); - dir = new File(prefix + "/dir1/dir2"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile); - - file = new File("dir3/dir4/dir5/file.txt"); - dir = new File(prefix + "/dir1/dir2"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt"), absoluteFile); - - file = new File("../../../file.txt"); - dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile); - - // too many ".." directories will resolve to the root; - // this is consistent with Windows and Linux command shells - file = new File("../../../../../../../../file.txt"); - dir = new File(prefix + "/dir1/dir2"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/file.txt"), absoluteFile); - - file = new File("../file.txt"); - dir = new File(prefix + "/dir1/dir2/dir3"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile); - - file = new File("../../../dirA/dirB/dirC/file.txt"); - dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt"), absoluteFile); - - file = new File("../../.."); - dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile); - - file = new File("lib/toplink.jar"); - dir = new File(prefix + "/My Documents/My Workspace/Project 1"); - absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar"), absoluteFile); - } - - public void testFileNameIsReserved() { - boolean expected = this.isExecutingOnWindows(); - assertEquals(expected, FileTools.fileNameIsReserved("CON")); - assertEquals(expected, FileTools.fileNameIsReserved("con")); - assertEquals(expected, FileTools.fileNameIsReserved("cON")); - assertEquals(expected, FileTools.fileNameIsReserved("AUX")); - assertEquals(expected, FileTools.fileNameIsReserved("COM3")); - assertEquals(expected, FileTools.fileNameIsReserved("LPT3")); - assertEquals(expected, FileTools.fileNameIsReserved("nUL")); - assertEquals(expected, FileTools.fileNameIsReserved("Prn")); - } - - public void testFileHasAnyReservedComponents() { - boolean expected = this.isExecutingOnWindows(); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("C:/CON"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("/con/foo"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/temp/cON"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("bar//baz//AUX"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("COM3//ttt"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("d:/LPT3/xxx"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/my docs and stuff/tuesday/nUL"))); - assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("Prn"))); - } - - public void testShortenFileNameFile() { - if (this.isExecutingOnWindows()) { - this.verifyShortenFileNameFileWin(); - } else { - this.verifyShortenFileNameFileNonWin(); - } - } - - private void verifyShortenFileNameFileWin() { - File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt"); - String fileName = FileTools.shortenFileName(file); - assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName); - assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - - file = new File("C:/"); - fileName = FileTools.shortenFileName(file); - assertEquals("C:\\", fileName); - assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - } - - private void verifyShortenFileNameFileNonWin() { - File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt"); - String fileName = FileTools.shortenFileName(file); - assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName); - assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - - file = new File("/home"); - fileName = FileTools.shortenFileName(file); - assertEquals("/home", fileName); - assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - } - - public void testShortenFileNameFileInt() { - if (this.isExecutingOnWindows()) { - this.verifyShortenFileNameFileIntWin(); - } else { - this.verifyShortenFileNameFileIntNonWin(); - } - } - - private void verifyShortenFileNameFileIntWin() { - File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt"); - String fileName = FileTools.shortenFileName(file, 31); - assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName); - assertEquals(31, fileName.length()); - - file = new File("C:/This is the file name.txt"); - fileName = FileTools.shortenFileName(file, 10); - assertEquals("C:\\This is the file name.txt", fileName); - assertEquals(28, fileName.length()); - } - - private void verifyShortenFileNameFileIntNonWin() { - File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt"); - String fileName = FileTools.shortenFileName(file, 31); - assertEquals("/home/.../desktop/Project/Text.txt", fileName); - assertEquals(34, fileName.length()); - - file = new File("/This is the file name.txt"); - fileName = FileTools.shortenFileName(file, 10); - assertEquals("/This is the file name.txt", fileName); - assertEquals(26, fileName.length()); - } - - public void testShortenFileNameURL() throws Exception { - if (this.isExecutingOnWindows()) { - this.verifyShortenFileNameURLWin(); - } else { - this.verifyShortenFileNameURLNonWin(); - } - } - - private void verifyShortenFileNameURLWin() throws Exception { - URL url = new URL("file", "", "C:/Documents and Settings/Administrator/Desktop/Project/Text.txt"); - String fileName = FileTools.shortenFileName(url); - assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName); - assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - } - - private void verifyShortenFileNameURLNonWin() throws Exception { - URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt"); - String fileName = FileTools.shortenFileName(url); - assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName); - assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH); - } - - public void testShortenFileNameURLInt() throws Exception { - if (this.isExecutingOnWindows()) { - this.verifyShortenFileNameURLIntWin(); - } else { - this.verifyShortenFileNameURLIntNonWin(); - } - } - - private void verifyShortenFileNameURLIntWin() throws Exception { - URL url = new URL("file", "", "/C:/Documents and Settings/Administrator/Desktop/Project/Text.txt"); - String fileName = FileTools.shortenFileName(url, 31); - assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName); - assertEquals(31, fileName.length()); - } - - private void verifyShortenFileNameURLIntNonWin() throws Exception { - URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt"); - String fileName = FileTools.shortenFileName(url, 31); - assertEquals("/home/.../desktop/Project/Text.txt", fileName); - assertEquals(34, fileName.length()); - } - - private void verifyUnchangedAbsoluteFile(String fileName, String dirName) { - File file = new File(fileName); - File dir = new File(dirName); - File absoluteFile = FileTools.convertToAbsoluteFile(file, dir); - assertEquals(file, absoluteFile); - } - - private File buildTempDir() throws IOException { - // build a new directory for each test, to prevent any cross-test effects - File dir = FileTools.newTemporaryDirectory(ClassTools.shortClassNameForObject(this) + "." + this.getName()); - - File file0a = new File(dir, "file0a"); - file0a.createNewFile(); - File file0b = new File(dir, "file0b"); - file0b.createNewFile(); - File file0c = new File(dir, "file0c"); - file0c.createNewFile(); - - File subdir1 = new File(dir, "subdir1"); - subdir1.mkdir(); - File file1a = new File(subdir1, "file1a"); - file1a.createNewFile(); - File file1b = new File(subdir1, "file1b"); - file1b.createNewFile(); - - File subdir2 = new File(dir, "subdir2"); - subdir2.mkdir(); - File file2a = new File(subdir2, "file2a"); - file2a.createNewFile(); - File file2b = new File(subdir2, "file2b"); - file2b.createNewFile(); - - File subdir3 = new File(subdir2, "subdir3"); - subdir3.mkdir(); - File file3a = new File(subdir3, "file3a"); - file3a.createNewFile(); - File file3b = new File(subdir3, "file3b"); - file3b.createNewFile(); - - return dir; - } - - private void deleteDir(File dir) { - FileTools.deleteDirectory(dir); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java deleted file mode 100644 index 51120c9eb2..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java +++ /dev/null @@ -1,448 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.ConcurrentModificationException; -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.Bag; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.HashBag; - -public class HashBagTests extends TestCase { - private HashBag bag; - - public HashBagTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.bag = this.buildBag(); - } - - private HashBag buildBag() { - HashBag b = new HashBag(); - b.add(null); - b.add(new String("one")); - b.add(new String("two")); - b.add(new String("two")); - b.add(new String("three")); - b.add(new String("three")); - b.add(new String("three")); - b.add(new String("four")); - b.add(new String("four")); - b.add(new String("four")); - b.add(new String("four")); - return b; - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - private Collection buildCollection() { - Collection c = new ArrayList(); - c.add(new String("foo")); - c.add(new String("foo")); - c.add(new String("bar")); - c.add(new String("bar")); - c.add(new String("bar")); - return c; - } - - public void testCtorCollection() { - Collection c = this.buildCollection(); - Bag b = new HashBag(c); - for (String s : c) { - assertTrue("missing element", b.contains(s)); - } - } - - public void testCtorIntFloat() { - boolean exCaught; - - exCaught = false; - try { - this.bag = new HashBag(-20, 0.66f); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue("IllegalArgumentException not thrown", exCaught); - - exCaught = false; - try { - this.bag = new HashBag(20, -0.66f); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue("IllegalArgumentException not thrown", exCaught); - } - - public void testAdd() { - // the other adds took place in setUp - assertTrue("incorrect return value", this.bag.add("five")); - - assertTrue("missing element", this.bag.contains("one")); - assertTrue("missing element", this.bag.contains("two")); - assertTrue("missing element", this.bag.contains("three")); - assertTrue("missing element", this.bag.contains("four")); - assertTrue("missing element", this.bag.contains("five")); - } - - public void testAddAll() { - Collection c = this.buildCollection(); - assertTrue("incorrect return value", this.bag.addAll(c)); - for (String s : c) { - assertTrue("missing element", this.bag.contains(s)); - } - } - - public void testClear() { - assertTrue("missing element", this.bag.contains("one")); - assertTrue("missing element", this.bag.contains("two")); - assertTrue("missing element", this.bag.contains("three")); - assertTrue("missing element", this.bag.contains("four")); - assertTrue("missing element", this.bag.contains(null)); - assertEquals("invalid size", 11, this.bag.size()); - this.bag.clear(); - assertFalse("malingering element", this.bag.contains("one")); - assertFalse("malingering element", this.bag.contains("two")); - assertFalse("malingering element", this.bag.contains("three")); - assertFalse("malingering element", this.bag.contains("four")); - assertFalse("malingering element", this.bag.contains(null)); - assertEquals("invalid size", 0, this.bag.size()); - } - - public void testClone() { - Bag bag2 = this.bag.clone(); - assertTrue("bad clone", this.bag != bag2); - assertEquals("bad clone", this.bag, bag2); - assertTrue("bad clone", this.bag.hashCode() == bag2.hashCode()); - } - - public void testContains() { - assertTrue("missing element", this.bag.contains(null)); - assertTrue("missing element", this.bag.contains("one")); - assertTrue("missing element", this.bag.contains("two")); - assertTrue("missing element", this.bag.contains("three")); - assertTrue("missing element", this.bag.contains("four")); - assertTrue("missing element", this.bag.contains(new String("four"))); - assertTrue("missing element", this.bag.contains("fo" + "ur")); - assertFalse("element found", this.bag.contains("five")); - } - - public void testContainsAll() { - Collection c = new ArrayList(); - c.add(null); - c.add(new String("one")); - c.add(new String("two")); - c.add(new String("three")); - c.add(new String("four")); - assertTrue("missing element(s)", this.bag.containsAll(c)); - } - - public void testCount() { - assertEquals("bad count", 0, this.bag.count("zero")); - assertEquals("bad count", 1, this.bag.count("one")); - assertEquals("bad count", 2, this.bag.count("two")); - assertEquals("bad count", 3, this.bag.count("three")); - assertEquals("bad count", 4, this.bag.count("four")); - assertEquals("bad count", 0, this.bag.count("five")); - } - - public void testEquals() { - Bag bag2 = this.buildBag(); - assertEquals("bags are not equal", this.bag, bag2); - bag2.add("five"); - assertFalse("bags are equal", this.bag.equals(bag2)); - Collection c = new ArrayList(this.bag); - assertFalse("bags are not equal to collections", this.bag.equals(c)); - } - - public void testHashCode() { - Bag bag2 = this.buildBag(); - assertEquals("bad hash code", this.bag.hashCode(), bag2.hashCode()); - } - - public void testIsEmpty() { - assertFalse("bag is empty", this.bag.isEmpty()); - this.bag.clear(); - assertTrue("bag is not empty", this.bag.isEmpty()); - this.bag.add("foo"); - assertFalse("bag is empty", this.bag.isEmpty()); - } - - public void testEmptyIterator() { - this.bag.clear(); - Iterator iterator = this.bag.iterator(); - assertFalse("iterator is not empty", iterator.hasNext()); - - boolean exCaught = false; - Object element = null; - try { - element = iterator.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + element, exCaught); - - exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - - public void testIterator() { - int i = 0; - Iterator iterator = this.bag.iterator(); - assertTrue("iterator is empty", iterator.hasNext()); - while (iterator.hasNext()) { - iterator.next(); - i++; - } - assertEquals("invalid hasNext() loop", 11, i); - assertFalse("iterator should be empty now", iterator.hasNext()); - - boolean exCaught = false; - Object element = null; - try { - element = iterator.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + element, exCaught); - - iterator.remove(); - assertEquals("iterator did not remove element", 10, this.bag.size()); - - exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - - // start over - iterator = this.bag.iterator(); - this.bag.add("five"); - exCaught = false; - try { - iterator.next(); - } catch (ConcurrentModificationException ex) { - exCaught = true; - } - assertTrue("ConcurrentModificationException not thrown", exCaught); - } - - public void testUniqueIterator() { - int i = 0; - Iterator iterator = this.bag.uniqueIterator(); - assertTrue("iterator is empty", iterator.hasNext()); - while (iterator.hasNext()) { - iterator.next(); - i++; - } - assertEquals("invalid hasNext() loop", 5, i); - assertFalse("iterator should be empty now", iterator.hasNext()); - - boolean exCaught = false; - Object element = null; - try { - element = iterator.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + element, exCaught); - - // start over - iterator = this.bag.uniqueIterator(); - Object next = null; - while (iterator.hasNext() && !"four".equals(next)) { - next = iterator.next(); - } - iterator.remove(); - assertEquals("iterator did not remove all copies of element", 7, this.bag.size()); - - exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - - // start over - iterator = this.bag.uniqueIterator(); - this.bag.add("five"); - exCaught = false; - try { - iterator.next(); - } catch (ConcurrentModificationException ex) { - exCaught = true; - } - assertTrue("ConcurrentModificationException not thrown", exCaught); - } - - public void testHashingDistribution() throws Exception { - Bag bigBag = new HashBag(); - for (int i = 0; i < 10000; i++) { - bigBag.add("object" + i); - } - - java.lang.reflect.Field field = bigBag.getClass().getDeclaredField("table"); - field.setAccessible(true); - Object[] table = (Object[]) field.get(bigBag); - int bucketCount = table.length; - int filledBucketCount = 0; - for (Object o : table) { - if (o != null) { - filledBucketCount++; - } - } - float loadFactor = ((float) filledBucketCount) / ((float) bucketCount); - assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20); - assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75); - } - - public void testRemove() { - assertTrue("incorrect return value", this.bag.remove("one")); - assertFalse("element still present", this.bag.contains("one")); - assertFalse("incorrect return value", this.bag.remove("one")); - - assertTrue("incorrect return value", this.bag.remove("two")); - assertTrue("incorrect return value", this.bag.remove("two")); - assertFalse("element still present", this.bag.contains("one")); - assertFalse("incorrect return value", this.bag.remove("one")); - } - - public void testRemoveAll() { - Collection c = new ArrayList(); - c.add("one"); - c.add("three"); - assertTrue("incorrect return value", this.bag.removeAll(c)); - assertFalse("element still present", this.bag.contains("one")); - assertFalse("element still present", this.bag.contains("three")); - assertFalse("incorrect return value", this.bag.remove("one")); - assertFalse("incorrect return value", this.bag.remove("three")); - assertFalse("incorrect return value", this.bag.removeAll(c)); - } - - public void testRetainAll() { - Collection c = new ArrayList(); - c.add("one"); - c.add("three"); - assertTrue("incorrect return value", this.bag.retainAll(c)); - assertTrue("element removed", this.bag.contains("one")); - assertTrue("element removed", this.bag.contains("three")); - assertFalse("element still present", this.bag.contains("two")); - assertFalse("element still present", this.bag.contains("four")); - assertFalse("incorrect return value", this.bag.remove("two")); - assertFalse("incorrect return value", this.bag.remove("four")); - assertFalse("incorrect return value", this.bag.retainAll(c)); - } - - public void testSize() { - assertTrue("incorrect size", this.bag.size() == 11); - this.bag.add("five"); - this.bag.add("five"); - this.bag.add("five"); - this.bag.add("five"); - this.bag.add("five"); - assertEquals("incorrect size", 16, this.bag.size()); - } - - public void testSerialization() throws Exception { - Bag bag2 = TestTools.serialize(this.bag); - - assertTrue("same object?", this.bag != bag2); - assertEquals("incorrect size", 11, bag2.size()); - assertEquals("unequal bag", this.bag, bag2); - // look for similar elements - assertTrue("missing element", bag2.contains(null)); - assertTrue("missing element", bag2.contains("one")); - assertTrue("missing element", bag2.contains("two")); - assertTrue("missing element", bag2.contains("three")); - assertTrue("missing element", bag2.contains("four")); - - int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0; - for (String s : bag2) { - if (s == null) { - nullCount++; - } else if (s.equals("one")) { - oneCount++; - } else if (s.equals("two")) { - twoCount++; - } else if (s.equals("three")) { - threeCount++; - } else if (s.equals("four")) { - fourCount++; - } - } - assertEquals("bad element count", 1, nullCount); - assertEquals("bad element count", 1, oneCount); - assertEquals("bad element count", 2, twoCount); - assertEquals("bad element count", 3, threeCount); - assertEquals("bad element count", 4, fourCount); - } - - public void testToArray() { - Object[] a = this.bag.toArray(); - assertEquals("incorrect length", 11, a.length); - assertTrue("missing element", CollectionTools.contains(a, null)); - assertTrue("missing element", CollectionTools.contains(a, "one")); - assertTrue("missing element", CollectionTools.contains(a, "two")); - assertTrue("missing element", CollectionTools.contains(a, "three")); - assertTrue("missing element", CollectionTools.contains(a, "four")); - } - - public void testToArrayObjectArray() { - String[] a = new String[12]; - a[11] = "not null"; - String[] b = this.bag.toArray(a); - assertEquals("different array", a, b); - assertEquals("incorrect length", 12, a.length); - assertTrue("missing element", CollectionTools.contains(a, null)); - assertTrue("missing element", CollectionTools.contains(a, "one")); - assertTrue("missing element", CollectionTools.contains(a, "two")); - assertTrue("missing element", CollectionTools.contains(a, "three")); - assertTrue("missing element", CollectionTools.contains(a, "four")); - assertTrue("missing null element", a[11] == null); - } - - public void testToString() { - String s = this.bag.toString(); - assertTrue("invalid string prefix", s.startsWith("[")); - assertTrue("invalid string suffix", s.endsWith("]")); - int commaCount = 0; - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == ',') { - commaCount++; - } - } - assertEquals("invalid number of commas", 10, commaCount); - assertTrue("missing element toString()", s.indexOf("one") != -1); - assertTrue("missing element toString()", s.indexOf("two") != -1); - assertTrue("missing element toString()", s.indexOf("three") != -1); - assertTrue("missing element toString()", s.indexOf("four") != -1); - assertTrue("missing element toString()", s.indexOf("null") != -1); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java deleted file mode 100644 index c96213249b..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.io.StringWriter; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.IndentingPrintWriter; - -public class IndentingPrintWriterTests extends TestCase { - StringWriter sw1; - StringWriter sw2; - IndentingPrintWriter ipw1; - IndentingPrintWriter ipw2; - - static final String CR = System.getProperty("line.separator"); - - public IndentingPrintWriterTests(String name) { - super(name); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - this.sw1 = new StringWriter(); - this.ipw1 = new IndentingPrintWriter(this.sw1); - this.sw2 = new StringWriter(); - this.ipw2 = new IndentingPrintWriter(this.sw2, " "); // indent with 4 spaces instead of a tab - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - public void testIndent() { - assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel()); - this.ipw1.indent(); - assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel()); - } - - public void testUndent() { - assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel()); - this.ipw1.indent(); - assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel()); - this.ipw1.undent(); - assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel()); - } - - public void testIncrementIndentLevel() { - assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel()); - this.ipw1.incrementIndentLevel(); - assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel()); - } - - public void testDecrementIndentLevel() { - assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel()); - this.ipw1.incrementIndentLevel(); - assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel()); - this.ipw1.decrementIndentLevel(); - assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel()); - } - - public void testPrintTab() { - String expected = "foo0" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "\t\tfoo2" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "foo0" + CR; - - this.ipw1.println("foo0"); - this.ipw1.indent(); - this.ipw1.println("foo1"); - this.ipw1.println("foo1"); - this.ipw1.indent(); - this.ipw1.println("foo2"); - this.ipw1.undent(); - this.ipw1.println("foo1"); - this.ipw1.println("foo1"); - this.ipw1.undent(); - this.ipw1.println("foo0"); - - assertEquals("bogus output", expected, this.sw1.toString()); - } - - public void testPrintSpaces() { - String expected = "foo0" + CR + " foo1" + CR + " foo1" + CR + " foo2" + CR + " foo1" + CR + " foo1" + CR + "foo0" + CR; - - this.ipw2.println("foo0"); - this.ipw2.indent(); - this.ipw2.println("foo1"); - this.ipw2.println("foo1"); - this.ipw2.indent(); - this.ipw2.println("foo2"); - this.ipw2.undent(); - this.ipw2.println("foo1"); - this.ipw2.println("foo1"); - this.ipw2.undent(); - this.ipw2.println("foo0"); - - assertEquals("bogus output", expected, this.sw2.toString()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java deleted file mode 100644 index 40f152dfa9..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.sql.Types; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.JDBCType; - -public class JDBCTypeTests extends TestCase { - - public JDBCTypeTests(String name) { - super(name); - } - - public void testTypesSize() { - assertEquals(Types.class.getDeclaredFields().length, JDBCType.types().length); - } - - public void testName() { - JDBCType jdbcType; - jdbcType = JDBCType.type(Types.VARCHAR); - assertEquals("VARCHAR", jdbcType.getName()); - - jdbcType = JDBCType.type(Types.INTEGER); - assertEquals("INTEGER", jdbcType.getName()); - } - - public void testCode() { - JDBCType jdbcType; - jdbcType = JDBCType.type(Types.VARCHAR); - assertEquals(Types.VARCHAR, jdbcType.getCode()); - - jdbcType = JDBCType.type(Types.INTEGER); - assertEquals(Types.INTEGER, jdbcType.getCode()); - } - - public void testInvalidTypeCode() throws Exception { - boolean exCaught = false; - try { - JDBCType jdbcType = JDBCType.type(55); - fail("invalid JDBCType: " + jdbcType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testInvalidTypeName() throws Exception { - boolean exCaught = false; - try { - JDBCType jdbcType = JDBCType.type("VARCHAR2"); - fail("invalid JDBCType: " + jdbcType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java deleted file mode 100644 index 1a0c0b826f..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java +++ /dev/null @@ -1,250 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.JavaType; - -public class JavaTypeTests extends TestCase { - - public JavaTypeTests(String name) { - super(name); - } - - public void testInvalidElementTypeNull() throws Exception { - boolean exCaught = false; - try { - JavaType javaType = new JavaType(null, 0); - fail("invalid JavaType: " + javaType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testInvalidElementTypeEmpty() throws Exception { - boolean exCaught = false; - try { - JavaType javaType = new JavaType("", 0); - fail("invalid JavaType: " + javaType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testInvalidElementTypeArray() throws Exception { - boolean exCaught = false; - try { - JavaType javaType = new JavaType(java.lang.Object[].class.getName(), 0); - fail("invalid JavaType: " + javaType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testInvalidArrayDepthNegative() throws Exception { - boolean exCaught = false; - try { - JavaType javaType = new JavaType(java.lang.Object.class.getName(), -2); - fail("invalid JavaType: " + javaType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testInvalidVoidArray() throws Exception { - boolean exCaught = false; - try { - JavaType javaType = new JavaType(void.class.getName(), 2); - fail("invalid JavaType: " + javaType); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testElementTypeName() throws Exception { - JavaType javaType; - javaType = new JavaType(java.lang.Object.class); - assertEquals("java.lang.Object", javaType.getElementTypeName()); - - javaType = new JavaType(java.lang.Object[].class); - assertEquals("java.lang.Object", javaType.getElementTypeName()); - - javaType = new JavaType(int.class); - assertEquals("int", javaType.getElementTypeName()); - - javaType = new JavaType(int[].class); - assertEquals("int", javaType.getElementTypeName()); - - javaType = new JavaType(void.class); - assertEquals("void", javaType.getElementTypeName()); - - javaType = new JavaType(java.util.Map.Entry.class); - assertEquals("java.util.Map$Entry", javaType.getElementTypeName()); - - javaType = new JavaType(java.util.Map.Entry[][].class); - assertEquals("java.util.Map$Entry", javaType.getElementTypeName()); - } - - public void testArrayDepth() throws Exception { - JavaType javaType; - javaType = new JavaType(java.lang.Object.class); - assertEquals(0, javaType.getArrayDepth()); - - javaType = new JavaType(java.lang.Object[].class); - assertEquals(1, javaType.getArrayDepth()); - - javaType = new JavaType(int.class); - assertEquals(0, javaType.getArrayDepth()); - - javaType = new JavaType(int[].class); - assertEquals(1, javaType.getArrayDepth()); - - javaType = new JavaType(void.class); - assertEquals(0, javaType.getArrayDepth()); - - javaType = new JavaType(java.util.Map.Entry.class); - assertEquals(0, javaType.getArrayDepth()); - - javaType = new JavaType(java.util.Map.Entry[][].class); - assertEquals(2, javaType.getArrayDepth()); - } - - public void testIsArray() throws Exception { - JavaType javaType; - javaType = new JavaType(java.lang.Object.class); - assertFalse(javaType.isArray()); - - javaType = new JavaType(java.lang.Object[].class); - assertTrue(javaType.isArray()); - - javaType = new JavaType(int.class); - assertFalse(javaType.isArray()); - - javaType = new JavaType(int[].class); - assertTrue(javaType.isArray()); - - javaType = new JavaType(void.class); - assertFalse(javaType.isArray()); - - javaType = new JavaType(java.util.Map.Entry.class); - assertFalse(javaType.isArray()); - - javaType = new JavaType(java.util.Map.Entry[][].class); - assertTrue(javaType.isArray()); - } - - public void testJavaClass() throws Exception { - this.verifyJavaClass(java.lang.Object.class); - this.verifyJavaClass(java.lang.Object[].class); - this.verifyJavaClass(int.class); - this.verifyJavaClass(int[].class); - this.verifyJavaClass(void.class); - this.verifyJavaClass(java.util.Map.Entry.class); - this.verifyJavaClass(java.util.Map.Entry[][].class); - } - - private void verifyJavaClass(Class javaClass) throws Exception { - JavaType javaType = new JavaType(javaClass); - assertEquals(javaClass, javaType.javaClass()); - } - - public void testJavaClassName() throws Exception { - JavaType javaType; - javaType = new JavaType(java.lang.Object.class); - assertEquals("java.lang.Object", javaType.javaClassName()); - - javaType = new JavaType(java.lang.Object[].class); - assertEquals("[Ljava.lang.Object;", javaType.javaClassName()); - - javaType = new JavaType(int.class); - assertEquals("int", javaType.javaClassName()); - - javaType = new JavaType(int[].class); - assertEquals("[I", javaType.javaClassName()); - - javaType = new JavaType(void.class); - assertEquals("void", javaType.javaClassName()); - - javaType = new JavaType(java.util.Map.Entry.class); - assertEquals("java.util.Map$Entry", javaType.javaClassName()); - - javaType = new JavaType(java.util.Map.Entry[][].class); - assertEquals("[[Ljava.util.Map$Entry;", javaType.javaClassName()); - } - - public void testDescribes() throws Exception { - this.verifyDescribes(java.lang.Object.class); - this.verifyDescribes(java.lang.Object[].class); - this.verifyDescribes(int.class); - this.verifyDescribes(int[].class); - this.verifyDescribes(void.class); - this.verifyDescribes(java.util.Map.Entry.class); - this.verifyDescribes(java.util.Map.Entry[][].class); - } - - private void verifyDescribes(Class javaClass) throws Exception { - JavaType javaType = new JavaType(javaClass); - assertTrue(javaType.describes(javaClass)); - } - - public void testDeclaration() throws Exception { - JavaType javaType; - javaType = new JavaType(java.lang.Object.class); - assertEquals("java.lang.Object", javaType.declaration()); - - javaType = new JavaType(java.lang.Object[].class); - assertEquals("java.lang.Object[]", javaType.declaration()); - - javaType = new JavaType(int.class); - assertEquals("int", javaType.declaration()); - - javaType = new JavaType(int[].class); - assertEquals("int[]", javaType.declaration()); - - javaType = new JavaType(void.class); - assertEquals("void", javaType.declaration()); - - javaType = new JavaType(java.util.Map.Entry.class); - assertEquals("java.util.Map.Entry", javaType.declaration()); - - javaType = new JavaType(java.util.Map.Entry[][].class); - assertEquals("java.util.Map.Entry[][]", javaType.declaration()); - } - - public void testIsPrimitive() throws Exception { - JavaType javaType; - javaType = new JavaType(java.lang.Object.class); - assertFalse(javaType.isPrimitive()); - - javaType = new JavaType(java.lang.Object[].class); - assertFalse(javaType.isPrimitive()); - - javaType = new JavaType(int.class); - assertTrue(javaType.isPrimitive()); - - javaType = new JavaType(int[].class); - assertFalse(javaType.isPrimitive()); - - javaType = new JavaType(void.class); - assertTrue(javaType.isPrimitive()); - - javaType = new JavaType(java.util.Map.Entry.class); - assertFalse(javaType.isPrimitive()); - - javaType = new JavaType(java.util.Map.Entry[][].class); - assertFalse(javaType.isPrimitive()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java deleted file mode 100644 index 82143f3bb4..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import junit.framework.Test; -import junit.framework.TestSuite; -import org.eclipse.jpt.utility.internal.ClassTools; -import org.eclipse.jpt.utility.tests.internal.iterators.JptUtilityIteratorsTests; - -/** - * decentralize test creation code - */ -public class JptUtilityTests { - - public static Test suite() { - TestSuite suite = new TestSuite(ClassTools.packageNameFor(JptUtilityTests.class)); - - suite.addTest(JptUtilityIteratorsTests.suite()); - - suite.addTestSuite(BitToolsTests.class); - suite.addTestSuite(ClasspathTests.class); - suite.addTestSuite(ClassToolsTests.class); - suite.addTestSuite(CollectionToolsTests.class); - suite.addTestSuite(FileToolsTests.class); - suite.addTestSuite(HashBagTests.class); - suite.addTestSuite(IndentingPrintWriterTests.class); - suite.addTestSuite(JavaTypeTests.class); - suite.addTestSuite(JDBCTypeTests.class); - suite.addTestSuite(NameToolsTests.class); - suite.addTestSuite(ReverseComparatorTests.class); - suite.addTestSuite(StringToolsTests.class); - suite.addTestSuite(XMLStringEncoderTests.class); - - return suite; - } - - private JptUtilityTests() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java deleted file mode 100644 index 164fa49e03..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.NameTools; - -public class NameToolsTests extends TestCase { - - public NameToolsTests(String name) { - super(name); - } - - public void testStringAbsentIgnoreCase() { - List colorCollection = this.buildColorCollection(); - String returned = NameTools.uniqueNameForIgnoreCase("Taupe", colorCollection); - assertEquals("Taupe", returned); - } - - public void testStringPresentCaseDiffers() { - List colorCollection = this.buildColorCollection(); - String returned = NameTools.uniqueNameFor("green", colorCollection); - assertEquals("green", returned); - } - - public void testStringPresentIgnoreCase() { - List colorCollection = this.buildColorCollection(); - String returned = NameTools.uniqueNameForIgnoreCase("green", colorCollection); - assertEquals("green2", returned); - } - - public void testStringPresentWithAppendices() { - List colorCollection = this.buildColorCollection(); - colorCollection.add("Red1"); - colorCollection.add("red2"); - String returned = NameTools.uniqueNameForIgnoreCase("red", colorCollection); - colorCollection.remove("Red1"); - colorCollection.remove("red2"); - assertEquals("red3", returned); - } - - private List buildColorCollection() { - List colorCollection = new ArrayList(); - colorCollection.add("Red"); - colorCollection.add("Orange"); - colorCollection.add("Yellow"); - colorCollection.add("Green"); - colorCollection.add("Blue"); - colorCollection.add("Indigo"); - colorCollection.add("Violet"); - return colorCollection; - } - - public void testUniqueNameForCollection1() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("Oracle Corporation"); - strings.add("Oracle2"); - strings.add("oracle1"); - strings.add("Oracl"); - - assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings)); - assertEquals("Test", NameTools.uniqueNameFor("Test", strings)); - - assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings)); - assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings)); - assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings)); - } - - public void testUniqueNameForCollection2() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("oracle"); - strings.add("Oracle2"); - strings.add("Oracle1"); - - assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings)); - assertEquals("Test", NameTools.uniqueNameFor("Test", strings)); - - strings.add("Oracle Corporation"); - assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings)); - assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings)); - assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings)); - } - - public void testUniqueNameForCollection3() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("Oracle"); - strings.add("Oracle2"); - strings.add("Oracle1"); - - assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings)); - } - - public void testUniqueNameForIterator1() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("Oracle Corporation"); - strings.add("Oracle2"); - strings.add("oracle1"); - strings.add("Oracl"); - - assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator())); - assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator())); - - assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator())); - assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator())); - assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator())); - } - - public void testUniqueNameForIterator2() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("oracle"); - strings.add("Oracle2"); - strings.add("Oracle1"); - - assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator())); - assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator())); - - strings.add("Oracle Corporation"); - assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator())); - assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator())); - assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator())); - } - - public void testUniqueNameForIterator3() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("Oracle"); - strings.add("Oracle2"); - strings.add("Oracle1"); - - assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator())); - } - - public void testUniqueJavaNameForCollection() { - Collection strings = new ArrayList(); - strings.add("Oracle"); - strings.add("Oracle"); - strings.add("Oracle2"); - strings.add("Oracle1"); - - assertEquals("private2", NameTools.uniqueJavaNameFor("private", strings.iterator())); - assertEquals("class2", NameTools.uniqueJavaNameFor("class", strings.iterator())); - } - - public void testBuildQualifiedDatabaseObjectName() { - assertEquals("catalog.schema.name", NameTools.buildQualifiedDatabaseObjectName("catalog", "schema", "name")); - assertEquals("catalog..name", NameTools.buildQualifiedDatabaseObjectName("catalog", null, "name")); - assertEquals("schema.name", NameTools.buildQualifiedDatabaseObjectName(null, "schema", "name")); - assertEquals("name", NameTools.buildQualifiedDatabaseObjectName(null, null, "name")); - } - - public void testJavaReservedWords() { - assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "class")); - assertFalse(CollectionTools.contains(NameTools.javaReservedWords(), "Class")); - assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "private")); - } - - public void testconvertToJavaIdentifierString() { - assertEquals("foo", NameTools.convertToJavaIdentifier("foo")); - assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1")); - assertEquals("Private", NameTools.convertToJavaIdentifier("private")); - assertEquals("_foo", NameTools.convertToJavaIdentifier("1foo")); - assertEquals("foo_", NameTools.convertToJavaIdentifier("foo%")); - assertEquals("foo__bar__", NameTools.convertToJavaIdentifier("foo bar ")); - } - - public void testconvertToJavaIdentifierStringChar() { - assertEquals("foo", NameTools.convertToJavaIdentifier("foo", '$')); - assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1", '$')); - assertEquals("Private", NameTools.convertToJavaIdentifier("private", '$')); - assertEquals("$foo", NameTools.convertToJavaIdentifier("1foo", '$')); - assertEquals("foo$", NameTools.convertToJavaIdentifier("foo%", '$')); - assertEquals("foo$$bar$$", NameTools.convertToJavaIdentifier("foo bar ", '$')); - - boolean exCaught = false; - try { - String s = NameTools.convertToJavaIdentifier("1foo", '7'); - fail("invalid string: \"" + s + "\""); - } catch (IllegalArgumentException ex) { - if (ex.getMessage().indexOf('7') != -1) { - exCaught = true; - } - } - assertTrue(exCaught); - - exCaught = false; - try { - String s = NameTools.convertToJavaIdentifier("foo%", '^'); - fail("invalid string: \"" + s + "\""); - } catch (IllegalArgumentException ex) { - if (ex.getMessage().indexOf('^') != -1) { - exCaught = true; - } - } - assertTrue(exCaught); - - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java deleted file mode 100644 index d7f2cce428..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.Range; - -public class RangeTests extends TestCase { - - public RangeTests(String name) { - super(name); - } - - public void testIncludes() { - Range range = new Range(5, 17); - assertFalse(range.includes(-55)); - assertFalse(range.includes(0)); - assertFalse(range.includes(4)); - assertTrue(range.includes(5)); - assertTrue(range.includes(6)); - assertTrue(range.includes(16)); - assertTrue(range.includes(17)); - assertFalse(range.includes(18)); - assertFalse(range.includes(200)); - } - - public void testEquals() { - Range range1 = new Range(5, 17); - Range range2 = new Range(5, 17); - assertNotSame(range1, range2); - assertEquals(range1, range1); - assertEquals(range1, range2); - assertEquals(range2, range1); - assertEquals(range1.hashCode(), range2.hashCode()); - - range2 = new Range(17, 5); - assertFalse(range1.equals(range2)); - assertFalse(range2.equals(range1)); - // although they are unequal, they can have the same hash code - assertEquals(range1.hashCode(), range2.hashCode()); - - range2 = new Range(5, 15); - assertFalse(range1.equals(range2)); - assertFalse(range2.equals(range1)); - } - - public void testClone() { - Range range1 = new Range(5, 17); - Range range2 = range1.clone(); - assertNotSame(range1, range2); - assertEquals(range1, range1); - assertEquals(range1, range2); - assertEquals(range2, range1); - assertEquals(range1.hashCode(), range2.hashCode()); - } - - public void testSerialization() throws Exception { - Range range1 = new Range(5, 17); - Range range2 = TestTools.serialize(range1); - assertNotSame(range1, range2); - assertEquals(range1, range1); - assertEquals(range1, range2); - assertEquals(range2, range1); - assertEquals(range1.hashCode(), range2.hashCode()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java deleted file mode 100644 index 7ae00fdc2e..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.ReverseComparator; - -public class ReverseComparatorTests extends TestCase { - private Comparator naturalReverseComparator; - private Comparator customComparator; - private Comparator customReverseComparator; - - public ReverseComparatorTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.naturalReverseComparator = new ReverseComparator(); - this.customComparator = this.buildCustomComparator(); - this.customReverseComparator = new ReverseComparator(this.customComparator); - } - - private Comparator buildCustomComparator() { - return new Comparator() { - public int compare(String s1, String s2) { - String lower1 = s1.toLowerCase(); - String lower2 = s2.toLowerCase(); - int result = lower1.compareTo(lower2); - if (result == 0) { - return s1.compareTo(s2); // use case to differentiate "equal" strings - } - return result; - } - }; - } - - private List buildUnsortedList() { - List result = new ArrayList(); - result.add("T"); - result.add("Z"); - result.add("Y"); - result.add("M"); - result.add("m"); - result.add("a"); - result.add("B"); - result.add("b"); - result.add("A"); - return result; - } - - private List buildNaturallySortedList() { - List result = new ArrayList(this.buildUnsortedList()); - Collections.sort(result); - return result; - } - - private List buildCustomSortedList() { - List result = new ArrayList(this.buildUnsortedList()); - Collections.sort(result, this.customComparator); - return result; - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - public void testNatural() { - List list = this.buildUnsortedList(); - Collections.sort(list, this.naturalReverseComparator); - this.verifyList(this.buildNaturallySortedList(), list); - } - - public void testCustom() { - List list = this.buildUnsortedList(); - Collections.sort(list, this.customReverseComparator); - this.verifyList(this.buildCustomSortedList(), list); - } - - private void verifyList(List normal, List reverse) { - int size = normal.size(); - int max = size - 1; - for (int i = 0; i < size; i++) { - assertEquals(normal.get(i), reverse.get(max - i)); - } - } -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java deleted file mode 100644 index 454cb81651..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java +++ /dev/null @@ -1,833 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.io.StringWriter; -import java.io.Writer; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.StringTools; - -public class StringToolsTests extends TestCase { - - public StringToolsTests(String name) { - super(name); - } - - // ********** padding/truncating ********** - - public void testPad() { - assertEquals("fred", StringTools.pad("fred", 4)); - assertEquals("fred ", StringTools.pad("fred", 6)); - boolean exThrown = false; - try { - assertEquals("fr", StringTools.pad("fred", 2)); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testPadCharArray() { - assertEquals("fred", new String(StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 4))); - assertEquals("fred ", new String(StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 6))); - boolean exThrown = false; - try { - assertEquals("fr", new String(StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 2))); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testPadOnWriter() { - Writer writer; - writer = new StringWriter(); - StringTools.padOn("fred", 4, writer); - assertEquals("fred", writer.toString()); - - writer = new StringWriter(); - StringTools.padOn("fred", 6, writer); - assertEquals("fred ", writer.toString()); - - writer = new StringWriter(); - boolean exThrown = false; - try { - StringTools.padOn("fred", 2, writer); - fail(); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testPadOnStringBuffer() { - StringBuffer sb; - sb = new StringBuffer(); - StringTools.padOn("fred", 4, sb); - assertEquals("fred", sb.toString()); - - sb = new StringBuffer(); - StringTools.padOn("fred", 6, sb); - assertEquals("fred ", sb.toString()); - - sb = new StringBuffer(); - boolean exThrown = false; - try { - StringTools.padOn("fred", 2, sb); - fail(); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testPadOrTruncate() { - assertEquals("fred", StringTools.padOrTruncate("fred", 4)); - assertEquals("fred ", StringTools.padOrTruncate("fred", 6)); - assertEquals("fr", StringTools.padOrTruncate("fred", 2)); - } - - public void testPadOrTruncateCharArray() { - assertEquals("fred", new String(StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 4))); - assertEquals("fred ", new String(StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 6))); - assertEquals("fr", new String(StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 2))); - } - - public void testPadOrTruncateOnWriter() { - this.verifyPadOrTruncateOnWriter("fred", "fred", 4); - this.verifyPadOrTruncateOnWriter("fred ", "fred", 6); - this.verifyPadOrTruncateOnWriter("fr", "fred", 2); - } - - private void verifyPadOrTruncateOnWriter(String expected, String string, int length) { - Writer writer = new StringWriter(); - StringTools.padOrTruncateOn(string, length, writer); - assertEquals(expected, writer.toString()); - } - - public void testPadOrTruncateOnStringBuffer() { - this.verifyPadOrTruncateOnStringBuffer("fred", "fred", 4); - this.verifyPadOrTruncateOnStringBuffer("fred ", "fred", 6); - this.verifyPadOrTruncateOnStringBuffer("fr", "fred", 2); - } - - private void verifyPadOrTruncateOnStringBuffer(String expected, String string, int length) { - StringBuffer sb = new StringBuffer(); - StringTools.padOrTruncateOn(string, length, sb); - assertEquals(expected, sb.toString()); - } - - public void testZeroPad() { - assertEquals("1234", StringTools.zeroPad("1234", 4)); - assertEquals("001234", StringTools.zeroPad("1234", 6)); - boolean exThrown = false; - try { - assertEquals("12", StringTools.zeroPad("1234", 2)); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testZeroPadCharArray() { - assertEquals("1234", new String(StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 4))); - assertEquals("001234", new String(StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 6))); - boolean exThrown = false; - try { - assertEquals("12", new String(StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 2))); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testZeroPadOnWriter() { - Writer writer; - writer = new StringWriter(); - StringTools.zeroPadOn("1234", 4, writer); - assertEquals("1234", writer.toString()); - - writer = new StringWriter(); - StringTools.zeroPadOn("1234", 6, writer); - assertEquals("001234", writer.toString()); - - writer = new StringWriter(); - boolean exThrown = false; - try { - StringTools.zeroPadOn("1234", 2, writer); - fail(); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testZeroPadOnStringBuffer() { - StringBuffer sb; - sb = new StringBuffer(); - StringTools.zeroPadOn("1234", 4, sb); - assertEquals("1234", sb.toString()); - - sb = new StringBuffer(); - StringTools.zeroPadOn("1234", 6, sb); - assertEquals("001234", sb.toString()); - - sb = new StringBuffer(); - boolean exThrown = false; - try { - StringTools.zeroPadOn("1234", 2, sb); - fail(); - } catch (IllegalArgumentException ex) { - exThrown = true; - } - assertTrue(exThrown); - } - - public void testZeroPadOrTruncate() { - assertEquals("1234", StringTools.zeroPadOrTruncate("1234", 4)); - assertEquals("001234", StringTools.zeroPadOrTruncate("1234", 6)); - assertEquals("34", StringTools.zeroPadOrTruncate("1234", 2)); - } - - public void testZeroPadOrTruncateCharArray() { - assertEquals("1234", new String(StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 4))); - assertEquals("001234", new String(StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 6))); - assertEquals("34", new String(StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 2))); - } - - public void testZeroPadOrTruncateOnWriter() { - this.verifyZeroPadOrTruncateOnWriter("1234", "1234", 4); - this.verifyZeroPadOrTruncateOnWriter("001234", "1234", 6); - this.verifyZeroPadOrTruncateOnWriter("34", "1234", 2); - } - - private void verifyZeroPadOrTruncateOnWriter(String expected, String string, int length) { - Writer writer = new StringWriter(); - StringTools.zeroPadOrTruncateOn(string, length, writer); - assertEquals(expected, writer.toString()); - } - - public void testZeroPadOrTruncateOnStringBuffer() { - this.verifyZeroPadOrTruncateOnStringBuffer("1234", "1234", 4); - this.verifyZeroPadOrTruncateOnStringBuffer("001234", "1234", 6); - this.verifyZeroPadOrTruncateOnStringBuffer("34", "1234", 2); - } - - private void verifyZeroPadOrTruncateOnStringBuffer(String expected, String string, int length) { - StringBuffer sb = new StringBuffer(); - StringTools.zeroPadOrTruncateOn(string, length, sb); - assertEquals(expected, sb.toString()); - } - - // ********** wrapping ********** - - public void testWrap() { - this.verifyWrap("Employee", "123", "123Employee123"); - this.verifyWrap("123", "123", "123123123"); - this.verifyWrap("", "123", "123123"); - } - - private void verifyWrap(String string, String wrap, String expectedString) { - assertEquals(expectedString, StringTools.wrap(string, wrap)); - } - - public void testWrapOnWriter() { - this.verifyWrapOnWriter("Employee", "123", "123Employee123"); - this.verifyWrapOnWriter("123", "123", "123123123"); - this.verifyWrapOnWriter("", "123", "123123"); - } - - private void verifyWrapOnWriter(String string, String wrap, String expectedString) { - Writer writer = new StringWriter(); - StringTools.wrapOn(string, wrap, writer); - assertEquals(expectedString, writer.toString()); - } - - public void testWrapOnStringBuffer() { - this.verifyWrapOnStringBuffer("Employee", "123", "123Employee123"); - this.verifyWrapOnStringBuffer("123", "123", "123123123"); - this.verifyWrapOnStringBuffer("", "123", "123123"); - } - - private void verifyWrapOnStringBuffer(String string, String wrap, String expectedString) { - StringBuffer sb = new StringBuffer(); - StringTools.wrapOn(string, wrap, sb); - assertEquals(expectedString, sb.toString()); - } - - public void testQuote() { - this.verifyQuote("Employee", "\"Employee\""); - this.verifyQuote("123", "\"123\""); - this.verifyQuote("", "\"\""); - } - - private void verifyQuote(String string, String expectedString) { - assertEquals(expectedString, StringTools.quote(string)); - } - - public void testQuoteOnWriter() { - this.verifyQuoteOnWriter("Employee", "\"Employee\""); - this.verifyQuoteOnWriter("123", "\"123\""); - this.verifyQuoteOnWriter("", "\"\""); - } - - private void verifyQuoteOnWriter(String string, String expectedString) { - Writer writer = new StringWriter(); - StringTools.quoteOn(string, writer); - assertEquals(expectedString, writer.toString()); - } - - public void testQuoteOnStringBuffer() { - this.verifyQuoteOnStringBuffer("Employee", "\"Employee\""); - this.verifyQuoteOnStringBuffer("123", "\"123\""); - this.verifyQuoteOnStringBuffer("", "\"\""); - } - - private void verifyQuoteOnStringBuffer(String string, String expectedString) { - StringBuffer sb = new StringBuffer(); - StringTools.quoteOn(string, sb); - assertEquals(expectedString, sb.toString()); - } - - // ********** removing characters ********** - - public void testRemoveFirstOccurrence() { - this.verifyRemoveFirstOccurrence("Emplo&yee", '&', "Employee"); - this.verifyRemoveFirstOccurrence("Emplo&yee&", '&', "Employee&"); - this.verifyRemoveFirstOccurrence("Employee &Foo", '&', "Employee Foo"); - this.verifyRemoveFirstOccurrence("Employee&", '&', "Employee"); - this.verifyRemoveFirstOccurrence("&Employee", '&', "Employee"); - } - - private void verifyRemoveFirstOccurrence(String string, char charToRemove, String expectedString) { - assertEquals(expectedString, StringTools.removeFirstOccurrence(string, charToRemove)); - } - - public void testRemoveFirstOccurrenceCharArray() { - this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee", '&', "Employee"); - this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee&", '&', "Employee&"); - this.verifyRemoveFirstOccurrenceCharArray("Employee &Foo", '&', "Employee Foo"); - this.verifyRemoveFirstOccurrenceCharArray("Employee&", '&', "Employee"); - this.verifyRemoveFirstOccurrenceCharArray("&Employee", '&', "Employee"); - } - - private void verifyRemoveFirstOccurrenceCharArray(String string, char charToRemove, String expectedString) { - assertEquals(expectedString, new String(StringTools.removeFirstOccurrence(string.toCharArray(), charToRemove))); - } - - public void testRemoveFirstOccurrenceOnWriter() { - this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee", '&', "Employee"); - this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee&", '&', "Employee&"); - this.verifyRemoveFirstOccurrenceOnWriter("Employee &Foo", '&', "Employee Foo"); - this.verifyRemoveFirstOccurrenceOnWriter("Employee&", '&', "Employee"); - this.verifyRemoveFirstOccurrenceOnWriter("&Employee", '&', "Employee"); - } - - private void verifyRemoveFirstOccurrenceOnWriter(String string, char charToRemove, String expectedString) { - Writer writer = new StringWriter(); - StringTools.removeFirstOccurrenceOn(string, charToRemove, writer); - assertEquals(expectedString, writer.toString()); - } - - public void testRemoveFirstOccurrenceOnStringBuffer() { - this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee", '&', "Employee"); - this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee&", '&', "Employee&"); - this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee &Foo", '&', "Employee Foo"); - this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee&", '&', "Employee"); - this.verifyRemoveFirstOccurrenceOnStringBuffer("&Employee", '&', "Employee"); - } - - private void verifyRemoveFirstOccurrenceOnStringBuffer(String string, char charToRemove, String expectedString) { - StringBuffer sb = new StringBuffer(); - StringTools.removeFirstOccurrenceOn(string, charToRemove, sb); - assertEquals(expectedString, sb.toString()); - } - - public void testRemoveAllOccurrences() { - this.verifyRemoveAllOccurrences("Employee Fred", ' ', "EmployeeFred"); - this.verifyRemoveAllOccurrences(" Employee ", ' ', "Employee"); - this.verifyRemoveAllOccurrences("Employee Foo", ' ', "EmployeeFoo"); - this.verifyRemoveAllOccurrences(" Emp loyee Foo", ' ', "EmployeeFoo"); - } - - private void verifyRemoveAllOccurrences(String string, char charToRemove, String expectedString) { - assertEquals(expectedString, StringTools.removeAllOccurrences(string, charToRemove)); - } - - public void testRemoveAllOccurrencesCharArray() { - this.verifyRemoveAllOccurrencesCharArray("Employee Fred", ' ', "EmployeeFred"); - this.verifyRemoveAllOccurrencesCharArray(" Employee ", ' ', "Employee"); - this.verifyRemoveAllOccurrencesCharArray("Employee Foo", ' ', "EmployeeFoo"); - this.verifyRemoveAllOccurrencesCharArray(" Emp loyee Foo", ' ', "EmployeeFoo"); - } - - private void verifyRemoveAllOccurrencesCharArray(String string, char charToRemove, String expectedString) { - assertEquals(expectedString, new String(StringTools.removeAllOccurrences(string.toCharArray(), charToRemove))); - } - - public void testRemoveAllOccurrencesOnWriter() { - this.verifyRemoveAllOccurrencesOnWriter("Employee Fred", ' ', "EmployeeFred"); - this.verifyRemoveAllOccurrencesOnWriter(" Employee ", ' ', "Employee"); - this.verifyRemoveAllOccurrencesOnWriter("Employee Foo", ' ', "EmployeeFoo"); - this.verifyRemoveAllOccurrencesOnWriter(" Emp loyee Foo", ' ', "EmployeeFoo"); - } - - private void verifyRemoveAllOccurrencesOnWriter(String string, char charToRemove, String expectedString) { - Writer writer = new StringWriter(); - StringTools.removeAllOccurrencesOn(string, charToRemove, writer); - assertEquals(expectedString, writer.toString()); - } - - public void testRemoveAllOccurrencesOnStringBuffer() { - this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Fred", ' ', "EmployeeFred"); - this.verifyRemoveAllOccurrencesOnStringBuffer(" Employee ", ' ', "Employee"); - this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Foo", ' ', "EmployeeFoo"); - this.verifyRemoveAllOccurrencesOnStringBuffer(" Emp loyee Foo", ' ', "EmployeeFoo"); - } - - private void verifyRemoveAllOccurrencesOnStringBuffer(String string, char charToRemove, String expectedString) { - StringBuffer sb = new StringBuffer(); - StringTools.removeAllOccurrencesOn(string, charToRemove, sb); - assertEquals(expectedString, sb.toString()); - } - - // ********** common prefix ********** - - public void testCommonPrefixLength() { - assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "fooBBB")); - assertEquals(3, StringTools.commonPrefixLength("foo", "fooBBB")); - assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "foo")); - assertEquals(3, StringTools.commonPrefixLength("foo", "foo")); - } - - public void testCommonPrefixLengthMax() { - assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "fooBBB", 2)); - assertEquals(2, StringTools.commonPrefixLength("foo", "fooBBB", 2)); - assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "foo", 2)); - assertEquals(2, StringTools.commonPrefixLength("foo", "foo", 2)); - } - - // ********** capitalization ********** - - public void testCapitalizeCharArray() { - this.verifyCapitalizeCharArray("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' }); - this.verifyCapitalizeCharArray("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' }); - this.verifyCapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' }); - this.verifyCapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' }); - this.verifyCapitalizeCharArray("", new char[0]); - this.verifyCapitalizeCharArray("A", new char[] { 'a' }); - this.verifyCapitalizeCharArray("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' }); - } - - private void verifyCapitalizeCharArray(String expected, char[] string) { - assertEquals(expected, new String(StringTools.capitalize(string))); - } - - public void testCapitalizeString() { - this.verifyCapitalizeString("Oracle", "Oracle"); - this.verifyCapitalizeString("Oracle", "oracle"); - this.verifyCapitalizeString(" ", " "); - this.verifyCapitalizeString("ORACLE", "ORACLE"); - this.verifyCapitalizeString("", ""); - this.verifyCapitalizeString("A", "a"); - this.verifyCapitalizeString("\u00C9cole", "\u00E9cole"); // �cole->�COLE - } - - private void verifyCapitalizeString(String expected, String string) { - assertEquals(expected, StringTools.capitalize(string)); - } - - public void testCapitalizeOnCharArrayStringBuffer() { - this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' }); - this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' }); - this.verifyCapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' }); - this.verifyCapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' }); - this.verifyCapitalizeOnCharArrayStringBuffer("", new char[0]); - this.verifyCapitalizeOnCharArrayStringBuffer("A", new char[] { 'a' }); - this.verifyCapitalizeOnCharArrayStringBuffer("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' }); - } - - private void verifyCapitalizeOnCharArrayStringBuffer(String expected, char[] string) { - StringBuffer sb = new StringBuffer(); - StringTools.capitalizeOn(string, sb); - assertEquals(expected, sb.toString()); - } - - public void testCapitalizeOnStringStringBuffer() { - this.verifyCapitalizeOnStringStringBuffer("Oracle", "Oracle"); - this.verifyCapitalizeOnStringStringBuffer("Oracle", "oracle"); - this.verifyCapitalizeOnStringStringBuffer(" ", " "); - this.verifyCapitalizeOnStringStringBuffer("ORACLE", "ORACLE"); - this.verifyCapitalizeOnStringStringBuffer("", ""); - this.verifyCapitalizeOnStringStringBuffer("A", "a"); - this.verifyCapitalizeOnStringStringBuffer("\u00C9cole", "\u00E9cole"); // �cole->�COLE - } - - private void verifyCapitalizeOnStringStringBuffer(String expected, String string) { - StringBuffer sb = new StringBuffer(); - StringTools.capitalizeOn(string, sb); - assertEquals(expected, sb.toString()); - } - - public void testCapitalizeOnCharArrayWriter() { - this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' }); - this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' }); - this.verifyCapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' }); - this.verifyCapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' }); - this.verifyCapitalizeOnCharArrayWriter("", new char[0]); - this.verifyCapitalizeOnCharArrayWriter("A", new char[] { 'a' }); - this.verifyCapitalizeOnCharArrayWriter("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' }); - } - - private void verifyCapitalizeOnCharArrayWriter(String expected, char[] string) { - Writer writer = new StringWriter(); - StringTools.capitalizeOn(string, writer); - assertEquals(expected, writer.toString()); - } - - public void testCapitalizeOnStringWriter() { - this.verifyCapitalizeOnStringWriter("Oracle", "Oracle"); - this.verifyCapitalizeOnStringWriter("Oracle", "oracle"); - this.verifyCapitalizeOnStringWriter(" ", " "); - this.verifyCapitalizeOnStringWriter("ORACLE", "ORACLE"); - this.verifyCapitalizeOnStringWriter("", ""); - this.verifyCapitalizeOnStringWriter("A", "a"); - this.verifyCapitalizeOnStringWriter("\u00C9cole", "\u00E9cole"); // �cole->�COLE - } - - private void verifyCapitalizeOnStringWriter(String expected, String string) { - Writer writer = new StringWriter(); - StringTools.capitalizeOn(string, writer); - assertEquals(expected, writer.toString()); - } - - public void testUnapitalizeCharArray() { - this.verifyUncapitalizeCharArray("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' }); - this.verifyUncapitalizeCharArray("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' }); - this.verifyUncapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' }); - this.verifyUncapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' }); - this.verifyUncapitalizeCharArray("", new char[0]); - this.verifyUncapitalizeCharArray("a", new char[] { 'A' }); - this.verifyUncapitalizeCharArray("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' }); - } - - private void verifyUncapitalizeCharArray(String expected, char[] string) { - assertEquals(expected, new String(StringTools.uncapitalize(string))); - } - - public void testUncapitalizeString() { - this.verifyUncapitalizeString("oracle", "Oracle"); - this.verifyUncapitalizeString("oracle", "oracle"); - this.verifyUncapitalizeString(" ", " "); - this.verifyUncapitalizeString("ORACLE", "ORACLE"); - this.verifyUncapitalizeString("", ""); - this.verifyUncapitalizeString("a", "A"); - this.verifyUncapitalizeString("\u00E9cole", "\u00C9cole"); // �cole->�COLE - } - - private void verifyUncapitalizeString(String expected, String string) { - assertEquals(expected, StringTools.uncapitalize(string)); - } - - public void testUncapitalizeOnCharArrayStringBuffer() { - this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' }); - this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' }); - this.verifyUncapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' }); - this.verifyUncapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' }); - this.verifyUncapitalizeOnCharArrayStringBuffer("", new char[0]); - this.verifyUncapitalizeOnCharArrayStringBuffer("a", new char[] { 'A' }); - this.verifyUncapitalizeOnCharArrayStringBuffer("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' }); - } - - private void verifyUncapitalizeOnCharArrayStringBuffer(String expected, char[] string) { - StringBuffer sb = new StringBuffer(); - StringTools.uncapitalizeOn(string, sb); - assertEquals(expected, sb.toString()); - } - - public void testUncapitalizeOnStringStringBuffer() { - this.verifyUncapitalizeOnStringStringBuffer("oracle", "Oracle"); - this.verifyUncapitalizeOnStringStringBuffer("oracle", "oracle"); - this.verifyUncapitalizeOnStringStringBuffer(" ", " "); - this.verifyUncapitalizeOnStringStringBuffer("ORACLE", "ORACLE"); - this.verifyUncapitalizeOnStringStringBuffer("", ""); - this.verifyUncapitalizeOnStringStringBuffer("a", "A"); - this.verifyUncapitalizeOnStringStringBuffer("\u00E9cole", "\u00C9cole"); // �cole->�COLE - } - - private void verifyUncapitalizeOnStringStringBuffer(String expected, String string) { - StringBuffer sb = new StringBuffer(); - StringTools.uncapitalizeOn(string, sb); - assertEquals(expected, sb.toString()); - } - - public void testUncapitalizeOnCharArrayWriter() { - this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' }); - this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' }); - this.verifyUncapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' }); - this.verifyUncapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' }); - this.verifyUncapitalizeOnCharArrayWriter("", new char[0]); - this.verifyUncapitalizeOnCharArrayWriter("a", new char[] { 'A' }); - this.verifyUncapitalizeOnCharArrayWriter("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' }); - } - - private void verifyUncapitalizeOnCharArrayWriter(String expected, char[] string) { - Writer writer = new StringWriter(); - StringTools.uncapitalizeOn(string, writer); - assertEquals(expected, writer.toString()); - } - - public void testUncapitalizeOnStringWriter() { - this.verifyUncapitalizeOnStringWriter("oracle", "Oracle"); - this.verifyUncapitalizeOnStringWriter("oracle", "oracle"); - this.verifyUncapitalizeOnStringWriter(" ", " "); - this.verifyUncapitalizeOnStringWriter("ORACLE", "ORACLE"); - this.verifyUncapitalizeOnStringWriter("", ""); - this.verifyUncapitalizeOnStringWriter("a", "A"); - this.verifyUncapitalizeOnStringWriter("\u00E9cole", "\u00C9cole"); // �cole->�COLE - } - - private void verifyUncapitalizeOnStringWriter(String expected, String string) { - Writer writer = new StringWriter(); - StringTools.uncapitalizeOn(string, writer); - assertEquals(expected, writer.toString()); - } - - // ********** queries ********** - - public void testStringIsEmptyString() { - assertTrue(StringTools.stringIsEmpty((String) null)); - assertTrue(StringTools.stringIsEmpty("")); - assertTrue(StringTools.stringIsEmpty(" ")); - assertTrue(StringTools.stringIsEmpty(" \t\t ")); - assertTrue(StringTools.stringIsEmpty(" \t\t " + StringTools.CR)); - } - - public void testStringIsEmptyCharArray() { - assertTrue(StringTools.stringIsEmpty((char[]) null)); - this.verifyStringIsEmptyCharArray(""); - this.verifyStringIsEmptyCharArray(" \t\t "); - this.verifyStringIsEmptyCharArray(" "); - this.verifyStringIsEmptyCharArray(" \t\t " + StringTools.CR); - } - - private void verifyStringIsEmptyCharArray(String string) { - assertTrue(StringTools.stringIsEmpty(string.toCharArray())); - } - - public void testStringsAreEqualIgnoreCaseStringString() { - assertTrue(StringTools.stringsAreEqualIgnoreCase((String) null, (String) null)); - assertFalse(StringTools.stringsAreEqualIgnoreCase(null, "asdf")); - assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf", null)); - assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "asdf")); - assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "ASDF")); - } - - public void testStringsAreEqualIgnoreCaseCharArrayCharArray() { - assertTrue(StringTools.stringsAreEqualIgnoreCase((char[]) null, (char[]) null)); - assertFalse(StringTools.stringsAreEqualIgnoreCase((char[]) null, "asdf".toCharArray())); - assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), (char[]) null)); - assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "asdf".toCharArray())); - assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray())); - } - - public void testStringStartsWithIgnoreCaseStringString() { - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "as")); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "aS")); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "")); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "A")); - - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "bsdf")); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "g")); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdg")); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfg")); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfgggggg")); - } - - public void testStringStartsWithIgnoreCaseCharArrayCharArray() { - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "as".toCharArray())); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "aS".toCharArray())); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "".toCharArray())); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "A".toCharArray())); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray())); - assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdf".toCharArray())); - - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "bsdf".toCharArray())); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "g".toCharArray())); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdg".toCharArray())); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfg".toCharArray())); - assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfgggggg".toCharArray())); - } - - public void testCharactersAreEqualIgnoreCase() { - assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'a')); - assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'A')); - assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'a')); - assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'A')); - - assertFalse(StringTools.charactersAreEqualIgnoreCase('a', 'b')); - assertFalse(StringTools.charactersAreEqualIgnoreCase('A', 'b')); - } - - // ********** conversions ********** - - public void testConvertCamelCaseToAllCaps() { - assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test")); - assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST")); - assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest")); - assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest")); - assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTESTTest")); - assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest")); - assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT")); - } - - public void testConvertCamelCaseToAllCapsOnWriter() { - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "test"); - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "TEST"); - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "testTest"); - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "TestTest"); - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "testTESTTest"); - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "TestTESTTest"); - this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST_T", "TestTESTTestT"); - } - - private void verifyConvertCamelCaseToAllCapsOnWriter(String expected, String string) { - Writer writer = new StringWriter(); - StringTools.convertCamelCaseToAllCapsOn(string, writer); - assertEquals(expected, writer.toString()); - } - - public void testConvertCamelCaseToAllCapsMaxLength() { - assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 44)); - assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 4)); - assertEquals("TES", StringTools.convertCamelCaseToAllCaps("test", 3)); - assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST", 5)); - assertEquals("TE", StringTools.convertCamelCaseToAllCaps("TEST", 2)); - assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest", 9)); - assertEquals("TEST_TES", StringTools.convertCamelCaseToAllCaps("testTest", 8)); - assertEquals("TEST_T", StringTools.convertCamelCaseToAllCaps("testTest", 6)); - assertEquals("TEST_", StringTools.convertCamelCaseToAllCaps("testTest", 5)); - assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("testTest", 4)); - assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 9)); - assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 1100)); - assertEquals("TEST_TEST_", StringTools.convertCamelCaseToAllCaps("testTESTTest", 10)); - assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest", 14)); - assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 16)); - assertEquals("TEST_TEST_TEST_", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 15)); - } - - public void testConvertCamelCaseToAllCapsMaxLengthOnWriter() { - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 44); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 4); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TES", "test", 3); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "TEST", 5); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TE", "TEST", 2); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "testTest", 9); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TES", "testTest", 8); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_T", "testTest", 6); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_", "testTest", 5); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "testTest", 4); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 9); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 1100); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_", "testTESTTest", 10); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST", "TestTESTTest", 14); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_T", "TestTESTTestT", 16); - this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_", "TestTESTTestT", 15); - } - - private void verifyConvertCamelCaseToAllCapsMaxLengthOnWriter(String expected, String string, int max) { - Writer writer = new StringWriter(); - StringTools.convertCamelCaseToAllCapsOn(string, max, writer); - assertEquals(expected, writer.toString()); - } - - public void testConvertUnderscoresToCamelCase() { - assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST", false)); - assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST_", false)); - assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST____", false)); - assertEquals("Test", StringTools.convertUnderscoresToCamelCase("TEST", true)); - assertEquals("test", StringTools.convertUnderscoresToCamelCase("TeST", false)); - assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", false)); - assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST___TEST", false)); - assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", true)); - assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", false)); - assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", true)); - assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", false)); - assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", false)); - assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", false)); - assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", true)); - assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", true)); - assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", true)); - } - - public void testConvertUnderscoresToCamelCaseLowercase() { - assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false)); - assertEquals("test", StringTools.convertUnderscoresToCamelCase("test_", false)); - assertEquals("test", StringTools.convertUnderscoresToCamelCase("test____", false)); - assertEquals("Test", StringTools.convertUnderscoresToCamelCase("test", true)); - assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false)); - assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test_test", false)); - assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test___test", false)); - assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("test_test", true)); - assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", false)); - assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", true)); - assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", false)); - assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", false)); - assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", false)); - assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", true)); - assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", true)); - assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", true)); - } - - public void testConvertUnderscoresToCamelCaseOnWriter() { - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST_", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST____", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "TEST", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TeST", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST_TEST", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST___TEST", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "TEST_TEST", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "TEST_TEST_TEST", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "TEST_TEST_TEST", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "TEST_TEST_TEST_T", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_TEST_TEST_TEST_T", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__TEST_TEST_TEST_T", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "TEST_TEST_TEST_T", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_TEST_TEST_TEST_T", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__TEST_TEST_TEST_T", true); - } - - public void testConvertUnderscoresToCamelCaseOnWriterLowercase() { - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test_", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test____", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "test", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test_test", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test___test", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "test_test", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "test_test_test", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "test_test_test", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "test_test_test_t", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_test_test_test_t", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__test_test_test_t", false); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "test_test_test_t", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_test_test_test_t", true); - this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__test_test_test_t", true); - } - - private void verifyConvertUnderscoresToCamelCaseOnWriter(String expected, String string, boolean capitalizeFirstLetter) { - Writer writer = new StringWriter(); - StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, writer); - assertEquals(expected, writer.toString()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java deleted file mode 100644 index 04a3d84786..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java +++ /dev/null @@ -1,161 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import junit.framework.TestCase; -import junit.framework.TestFailure; -import junit.framework.TestResult; - -/** - * various tools that can be used by test cases - */ -public final class TestTools { - - /** - * test an object's implementation of Serializable by serializing the - * specified object to a byte array; then de-serializing the byte array and - * returning the resultant object - */ - public static T serialize(T o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baOutStream = new ByteArrayOutputStream(2000); - ObjectOutputStream outStream = new ObjectOutputStream(baOutStream); - outStream.writeObject(o); - outStream.close(); - - ByteArrayInputStream baInStream = new ByteArrayInputStream(baOutStream.toByteArray()); - ObjectInputStream inStream = new ObjectInputStream(baInStream); - T o2 = readObject(inStream); - inStream.close(); - - return o2; - } - - @SuppressWarnings("unchecked") - private static T readObject(ObjectInput objectInput) throws IOException, ClassNotFoundException { - return (T) objectInput.readObject(); - } - - /** - * some tests require access to the Web (e.g. any tests that parse an XML - * document that specifies a DTD or Schema that is loaded from the Web); use - * this method to configure the JDK proxy settings - */ - public static void setUpOracleProxy() { - System.setProperty("http.proxyHost", "www-proxy.us.oracle.com"); - System.setProperty("http.proxyPort", "80"); - } - - /** - * some tests require access to the Web (e.g. any tests that parse an XML - * document that specifies a DTD or Schema that is loaded from the Web); use - * this method to configure the JDK proxy settings via the command-line - */ - public static String[] buildOracleProxyCommandLineOptions() { - return new String[] { "-Dhttp.proxyHost=www-proxy.us.oracle.com", "-Dhttp.proxyPort=80" }; - } - - /** - * redirect std out and std err to the specified stream - */ - public static void redirectSystemStreamsTo(OutputStream outputStream) { - redirectSystemStreamsTo(new PrintStream(outputStream)); - } - - /** - * redirect std out and std err to the specified stream - */ - public static void redirectSystemStreamsTo(PrintStream printStream) { - System.setOut(printStream); - System.setErr(printStream); - } - - /** - * execute the specified test and dump the results to the console - */ - public static String execute(TestCase testCase) { - long start = System.currentTimeMillis(); - TestResult result = testCase.run(); - long end = System.currentTimeMillis(); - - StringWriter stringWriter = new StringWriter(); - PrintWriter writer = new PrintWriter(stringWriter); - writer.print(testCase.getName()); - writer.print(": "); - if (result.wasSuccessful()) { - writer.println("OK"); - } else { - TestFailure failure = null; - if (result.failures().hasMoreElements()) { - failure = (TestFailure) result.failures().nextElement(); - } else { - failure = (TestFailure) result.errors().nextElement(); - } - failure.thrownException().printStackTrace(writer); - } - writer.print("elapsed time: "); - long elapsed = end - start; - writer.print(elapsed / 1000L); - writer.println(" sec."); - return stringWriter.toString(); - } - - private static final Class TestCase_class = TestCase.class; - - /** - * Clear out all the instance variable of the specified test case, allowing - * the various test fixtures to be garbage-collected. Typically this is - * called in the #tearDown() method. - */ - public static void clear(TestCase testCase) throws IllegalAccessException { - for (Class tempClass = testCase.getClass(); tempClass != TestCase_class; tempClass = tempClass.getSuperclass()) { - Field[] fields = tempClass.getDeclaredFields(); - for (int i = fields.length; i-- > 0;) { - Field field = fields[i]; - // leave primitives alone - they don't get garbage-collected, and we can't set them to null... - if (field.getType().isPrimitive()) { - continue; - } - // leave static fields alone (?) - if (Modifier.isStatic(field.getModifiers())) { - continue; - } - field.setAccessible(true); - field.set(testCase, null); - } - } - } - - /** - * Workaround for a JUnit bug: JUnit does not configure the testing Thread - * with a context class loader. This should probably happen in - * TestRunner.doRunTest(Test), just before starting the thread. - */ - public static void setUpJUnitThreadContextClassLoader() { - Thread.currentThread().setContextClassLoader(TestTools.class.getClassLoader()); - } - - private TestTools() { - super(); - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java deleted file mode 100644 index 3b104b9b89..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal; - -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.FileTools; -import org.eclipse.jpt.utility.internal.XMLStringEncoder; - -public class XMLStringEncoderTests extends TestCase { - - public XMLStringEncoderTests(String name) { - super(name); - } - - public void testEncodeNoCharacterSequences() { - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - - String s = "foo"; - assertEquals(s, encoder.encode(s)); - - s = "123foo123"; - assertEquals(s, encoder.encode(s)); - } - - public void testEncodeCharacterSequences() { - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - - String s = "?foo?"; - String expected = "?foo?"; - assertEquals(expected, encoder.encode(s)); - - s = "?foo&123"; - expected = "?foo&123"; - assertEquals(expected, encoder.encode(s)); - } - - public void testDenormalizeValidFileName() { - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - - String s = "foo"; - assertEquals(s, encoder.decode(s)); - - s = "123foo123"; - assertEquals(s, encoder.decode(s)); - } - - public void testDenormalizeInvalidFileName() { - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - - String s = "?foo?"; - String expected = "?foo?"; - assertEquals(expected, encoder.decode(s)); - - s = "?foo&123"; - expected = "?foo&123"; - assertEquals(expected, encoder.decode(s)); - } - - public void testRoundTripNoCharacterSequences() { - this.verifyRoundTrip("foo"); - this.verifyRoundTrip("123foo456"); - } - - public void testRoundTripCharacterSequences() { - this.verifyRoundTrip("?foo?"); - this.verifyRoundTrip("?foo&123&&&&&&>>>>"); - } - - private void verifyRoundTrip(String s) { - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - String actual = encoder.encode(s); - assertEquals(s, encoder.decode(actual)); - } - - public void testInvalidCharacterSequence1() { - this.verifyIllegalStateException("foo&"); - } - - public void testInvalidCharacterSequence2() { - this.verifyIllegalStateException("foo&#"); - } - - public void testInvalidCharacterSequence3() { - this.verifyIllegalStateException("foo&#x"); - } - - public void testInvalidCharacterSequence4() { - this.verifyIllegalStateException("foo"); - } - - public void testInvalidCharacterSequence5() { - this.verifyIllegalStateException("foo&#x;"); - } - - public void testInvalidCharacterSequence6() { - this.verifyIllegalStateException("foo&A"); - } - - public void testInvalidCharacterSequence7() { - this.verifyIllegalStateException("foo&#A"); - } - - private void verifyIllegalStateException(String s) { - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - boolean exCaught = false; - try { - s = encoder.decode(s); - fail(s); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testInvalidCharacterSequence8() { - String s = "foo&#xZZZZ;"; - XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS); - boolean exCaught = false; - try { - s = encoder.decode(s); - fail(s); - } catch (NumberFormatException ex) { - exCaught = true; - } - assertTrue(exCaught); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java deleted file mode 100644 index d7cf76ad44..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.ArrayIterator; - -public class ArrayIteratorTests extends TestCase { - - public ArrayIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(this.buildArray().length, i); - } - - public void testNext() { - int i = 0; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - assertEquals("bogus element", ++i, Integer.parseInt(stream.next())); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - if (stream.next().equals("3")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testIllegalArgumentException() { - this.triggerIllegalArgumentException(-1, 1); - this.triggerIllegalArgumentException(8, 1); - this.triggerIllegalArgumentException(0, -1); - this.triggerIllegalArgumentException(0, 9); - } - - public void testGenerics() { - Integer[] integers = new Integer[3]; - integers[0] = 0; - integers[1] = 1; - integers[2] = 2; - int i = 0; - for (Iterator stream = new ArrayIterator(integers); stream.hasNext();) { - assertEquals(i++, stream.next().intValue()); - } - assertEquals(integers.length, i); - } - - public void testVarargs() { - int i = 0; - for (Iterator stream = new ArrayIterator(0, 1, 2); stream.hasNext();) { - assertEquals(i++, stream.next().intValue()); - } - assertEquals(3, i); - } - - public void triggerIllegalArgumentException(int start, int length) { - boolean exCaught = false; - Iterator stream = null; - try { - stream = this.buildIterator(start, length); - } catch (IllegalArgumentException ex) { - exCaught = true; - } - assertTrue("IllegalArgumentException not thrown: " + stream, exCaught); - } - - Iterator buildIterator() { - return this.buildIterator(this.buildArray()); - } - - Iterator buildIterator(String[] array) { - return new ArrayIterator(array); - } - - Iterator buildIterator(int start, int length) { - return this.buildIterator(this.buildArray(), start, length); - } - - Iterator buildIterator(String[] array, int start, int length) { - return new ArrayIterator(array, start, length); - } - - String[] buildArray() { - return new String[] { "1", "2", "3", "4", "5", "6", "7", "8" }; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java deleted file mode 100644 index 9d82950b94..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator; - -public class ArrayListIteratorTests extends ArrayIteratorTests { - - public ArrayListIteratorTests(String name) { - super(name); - } - - public void testHasPrevious() { - ListIterator stream = this.buildListIterator(); - while (stream.hasNext()) { - stream.next(); - } - int i = 0; - while (stream.hasPrevious()) { - stream.previous(); - i++; - } - assertEquals(this.buildArray().length, i); - } - - public void testPrevious() { - ListIterator stream = this.buildListIterator(); - while (stream.hasNext()) { - stream.next(); - } - int i = this.buildArray().length; - while (stream.hasPrevious()) { - assertEquals("bogus element", i--, Integer.parseInt(stream.previous())); - } - } - - public void testNextIndex() { - int i = 0; - ListIterator stream = this.buildListIterator(); - while (stream.hasNext()) { - assertEquals(i, stream.nextIndex()); - stream.next(); - i++; - } - assertEquals(i, stream.nextIndex()); - } - - public void testPreviousIndex() { - int i = 0; - ListIterator stream = this.buildListIterator(); - while (stream.hasNext()) { - assertEquals(i - 1, stream.previousIndex()); - stream.next(); - i++; - } - assertEquals(i - 1, stream.previousIndex()); - } - - @Override - public void testNoSuchElementException() { - boolean exCaught = false; - ListIterator stream = this.buildListIterator(); - String string = null; - try { - string = stream.previous(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testUnsupportedOperationExceptionAdd() { - boolean exCaught = false; - for (ListIterator stream = this.buildListIterator(); stream.hasNext();) { - if (stream.next().equals("3")) { - try { - stream.add("3.5"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testUnsupportedOperationExceptionSet() { - boolean exCaught = false; - for (ListIterator stream = this.buildListIterator(); stream.hasNext();) { - if (stream.next().equals("3")) { - try { - stream.set("three"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - @Override - public void testGenerics() { - Integer[] integers = new Integer[3]; - integers[0] = 0; - integers[1] = 1; - integers[2] = 2; - int i = 0; - for (Iterator stream = new ArrayListIterator(integers); stream.hasNext();) { - assertEquals(i++, stream.next().intValue()); - } - assertEquals(integers.length, i); - } - - @Override - public void testVarargs() { - int i = 0; - for (Iterator stream = new ArrayListIterator(0, 1, 2); stream.hasNext();) { - assertEquals(i++, stream.next().intValue()); - } - assertEquals(3, i); - } - - private ListIterator buildListIterator() { - return this.buildListIterator(this.buildArray()); - } - - private ListIterator buildListIterator(String[] array) { - return new ArrayListIterator(array); - } - - @Override - Iterator buildIterator(String[] array) { - return new ArrayListIterator(array); - } - - @Override - Iterator buildIterator(String[] array, int start, int length) { - return new ArrayListIterator(array, start, length); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java deleted file mode 100644 index 59cd3073b9..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.AbstractCollection; -import java.util.AbstractList; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Vector; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.ChainIterator; - -public class ChainIteratorTests extends TestCase { - private final static Class[] VECTOR_HIERARCHY = { Vector.class, AbstractList.class, AbstractCollection.class, Object.class }; - - public ChainIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator> stream = this.buildIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(VECTOR_HIERARCHY.length, i); - } - - public void testInnerHasNext() { - int i = 0; - for (Iterator> stream = this.buildInnerIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(VECTOR_HIERARCHY.length, i); - } - - public void testNext() { - int i = 0; - for (Iterator> stream = this.buildIterator(); stream.hasNext(); i++) { - assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next()); - } - } - - public void testInnerNext() { - int i = 0; - for (Iterator> stream = this.buildInnerIterator(); stream.hasNext(); i++) { - assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator> stream = this.buildIterator(); - Class javaClass = null; - while (stream.hasNext()) { - javaClass = stream.next(); - } - try { - javaClass = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + javaClass, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator> stream = this.buildIterator(); stream.hasNext();) { - if (stream.next() == AbstractCollection.class) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - private Iterator> buildIterator() { - return this.buildChainIterator(Vector.class, this.buildLinker()); - } - - private Iterator> buildInnerIterator() { - return this.buildInnerChainIterator(Vector.class); - } - - private Iterator> buildChainIterator(Class startLink, ChainIterator.Linker> linker) { - return new ChainIterator>(startLink, linker); - } - - private ChainIterator.Linker> buildLinker() { - // chain up the class's hierarchy - return new ChainIterator.Linker>() { - public Class nextLink(Class currentLink) { - return currentLink.getSuperclass(); - } - }; - } - - private Iterator> buildInnerChainIterator(Class startLink) { - // chain up the class's hierarchy - return new ChainIterator>(startLink) { - @Override - protected Class nextLink(Class currentLink) { - return currentLink.getSuperclass(); - } - }; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java deleted file mode 100644 index e3afdb585f..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java +++ /dev/null @@ -1,252 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.CloneIterator; -import org.eclipse.jpt.utility.tests.internal.TestTools; - -public class CloneIteratorTests extends TestCase { - Collection originalCollection; - - private boolean concurrentProblem; - private Collection concurrentCollection; - - public CloneIteratorTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.originalCollection = this.buildCollection(); - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - public void testHasNext() { - int originalSize = this.originalCollection.size(); - int i = 0; - for (Iterator stream = this.buildCloneIterator(); stream.hasNext();) { - stream.next(); - // should allow concurrent modification - this.originalCollection.add("foo"); - i++; - } - assertTrue(originalSize != this.originalCollection.size()); - assertEquals(originalSize, i); - } - - public void testNext() { - Iterator nestedIterator = this.originalCollection.iterator(); - for (Iterator stream = this.buildCloneIterator(); stream.hasNext();) { - assertEquals("bogus element", nestedIterator.next(), stream.next()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildCloneIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testRemoveDefault() { - boolean exCaught = false; - for (Iterator stream = this.buildCloneIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testRemoveEliminator() { - CloneIterator.Mutator eliminator = new CloneIterator.Mutator() { - public void remove(String current) { - CloneIteratorTests.this.originalCollection.remove(current); - } - }; - this.verifyRemove(new CloneIterator(this.originalCollection, eliminator)); - } - - public void testRemoveSubclass() { - this.verifyRemove(new CloneIterator(this.originalCollection) { - @Override - protected void remove(String current) { - CloneIteratorTests.this.originalCollection.remove(current); - } - }); - } - - /** - * Test concurrent access: First build a clone iterator in a separate thread - * that hangs momentarily during its construction; then modify the shared - * collection in this thread. This would cause a - * ConcurrentModificationException in the other thread if the clone iterator - * were not synchronized on the original collection. - */ - public void testConcurrentAccess() throws Exception { - SlowCollection slow = new SlowCollection(); - this.populateCollection(slow); - // using the unsynchronized collection will cause the test to fail - // this.originalCollection = slow; - this.originalCollection = Collections.synchronizedCollection(slow); - - this.concurrentProblem = false; - this.concurrentCollection = new ArrayList(); - Thread thread = new Thread(this.buildRunnable()); - thread.start(); - while (!slow.hasStartedClone()) { - // wait for the other thread to start the clone... - Thread.yield(); - } - // ...then sneak in an extra element - this.originalCollection.add("seventeen"); - while (thread.isAlive()) { - // wait for the other thread to finish - Thread.yield(); - } - assertFalse(this.concurrentProblem); - Collection expected = new ArrayList(); - this.populateCollection(expected); - assertEquals(expected, this.concurrentCollection); - } - - private Runnable buildRunnable() { - return new Runnable() { - public void run() { - CloneIteratorTests.this.loopWithCloneIterator(); - } - }; - } - - /** - * use a clone iterator to loop over the "slow" collection and copy its - * contents to the concurrent collection - */ - void loopWithCloneIterator() { - try { - for (Iterator stream = this.buildCloneIterator(); stream.hasNext();) { - this.concurrentCollection.add(stream.next()); - } - } catch (Throwable t) { - this.concurrentProblem = true; - } - } - - private void verifyRemove(Iterator iterator) { - Object removed = "three"; - assertTrue(this.originalCollection.contains(removed)); - // try to remove before calling #next() - boolean exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - while (iterator.hasNext()) { - if (iterator.next().equals(removed)) { - iterator.remove(); - // try to remove twice - exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - } - assertFalse(this.originalCollection.contains(removed)); - } - - private Iterator buildCloneIterator() { - return this.buildCloneIterator(this.originalCollection); - } - - private Iterator buildCloneIterator(Collection c) { - return new CloneIterator(c); - } - - private Collection buildCollection() { - Collection c = this.buildEmptyCollection(); - this.populateCollection(c); - return c; - } - - protected Collection buildEmptyCollection() { - return new ArrayList(); - } - - private void populateCollection(Collection c) { - c.add("one"); - c.add("two"); - c.add("three"); - c.add("four"); - c.add("five"); - c.add("six"); - c.add("seven"); - c.add("eight"); - } - - // ********** custom collection ********** - static class SlowCollection extends ArrayList { - private static final long serialVersionUID = 1L; - private boolean hasStartedClone = false; - - public SlowCollection() { - super(); - } - - @Override - public Object[] toArray() { - this.setHasStartedClone(true); - // take a little snooze before returning the array - try { - Thread.sleep(100); - } catch (InterruptedException ex) { - throw new RuntimeException(ex); - } - return super.toArray(); - } - - synchronized void setHasStartedClone(boolean hasStartedClone) { - this.hasStartedClone = hasStartedClone; - } - - synchronized boolean hasStartedClone() { - return this.hasStartedClone; - } - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java deleted file mode 100644 index c6045a9f12..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java +++ /dev/null @@ -1,408 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.CloneListIterator; -import org.eclipse.jpt.utility.tests.internal.TestTools; - -public class CloneListIteratorTests extends TestCase { - List originalList; - - private boolean concurrentProblem; - private List concurrentList; - - public CloneListIteratorTests(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.originalList = this.buildList(); - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - public void testHasNext() { - int originalSize = this.originalList.size(); - int i = 0; - for (ListIterator stream = this.buildCloneListIterator(); stream.hasNext();) { - stream.next(); - // should allow concurrent modification - this.originalList.add("foo"); - i++; - } - assertTrue(originalSize != this.originalList.size()); - assertEquals(originalSize, i); - } - - public void testNext() { - ListIterator nestedListIterator = this.buildNestedListIterator(); - for (ListIterator stream = this.buildCloneListIterator(); stream.hasNext();) { - assertEquals("bogus element", nestedListIterator.next(), stream.next()); - } - } - - public void testIndex() { - ListIterator cloneListIterator = this.buildCloneListIterator(); - ListIterator nestedListIterator = this.buildNestedListIterator(); - for (int i = 0; i < 7; i++) { - nestedListIterator.next(); - cloneListIterator.next(); - assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex()); - assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex()); - } - - for (int i = 0; i < 3; i++) { - nestedListIterator.previous(); - cloneListIterator.previous(); - assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex()); - assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex()); - } - - while (nestedListIterator.hasNext()) { - nestedListIterator.next(); - cloneListIterator.next(); - assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex()); - assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex()); - } - } - - public void testHasPrevious() { - int originalSize = this.originalList.size(); - int i = 0; - ListIterator stream = this.buildCloneListIterator(); - while (stream.hasNext()) { - stream.next(); - this.originalList.add("foo"); - i++; - } - assertTrue(originalSize != this.originalList.size()); - originalSize = this.originalList.size(); - while (stream.hasPrevious()) { - stream.previous(); - // should allow concurrent modification - this.originalList.add("bar"); - i--; - } - assertTrue(originalSize != this.originalList.size()); - assertEquals(0, i); - } - - public void testPrevious() { - ListIterator nestedListIterator = this.buildNestedListIterator(); - ListIterator stream = this.buildCloneListIterator(); - while (stream.hasNext()) { - nestedListIterator.next(); - stream.next(); - } - while (stream.hasPrevious()) { - assertEquals("bogus element", nestedListIterator.previous(), stream.previous()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - ListIterator stream = this.buildCloneListIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - - exCaught = false; - while (stream.hasPrevious()) { - string = stream.previous(); - } - try { - string = stream.previous(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testModifyDefault() { - boolean exCaught = false; - for (ListIterator stream = this.buildCloneListIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - - exCaught = false; - for (ListIterator stream = this.buildCloneListIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.add("three and a half"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - - exCaught = false; - for (ListIterator stream = this.buildCloneListIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.set("another three"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testModifyMutatorNext() { - this.verifyModifyNext(new CloneListIterator(this.originalList, this.buildMutator())); - } - - public void testModifyMutatorPrevious() { - this.verifyModifyPrevious(new CloneListIterator(this.originalList, this.buildMutator())); - } - - private CloneListIterator.Mutator buildMutator() { - return new CloneListIterator.Mutator() { - public void add(int index, String o) { - CloneListIteratorTests.this.originalList.add(index, o); - } - - public void remove(int index) { - CloneListIteratorTests.this.originalList.remove(index); - } - - public void set(int index, String o) { - CloneListIteratorTests.this.originalList.set(index, o); - } - }; - } - - public void testModifySubclassNext() { - this.verifyModifyNext(this.buildSubclass()); - } - - public void testModifySubclassPrevious() { - this.verifyModifyPrevious(this.buildSubclass()); - } - - private ListIterator buildSubclass() { - return new CloneListIterator(this.originalList) { - @Override - protected void add(int currentIndex, String o) { - CloneListIteratorTests.this.originalList.add(currentIndex, o); - } - - @Override - protected void remove(int currentIndex) { - CloneListIteratorTests.this.originalList.remove(currentIndex); - } - - @Override - protected void set(int currentIndex, String o) { - CloneListIteratorTests.this.originalList.set(currentIndex, o); - } - }; - } - - private void verifyModifyNext(ListIterator iterator) { - String removed = "three"; - String addedAfter = "five"; - String added = "five and a half"; - String replaced = "seven"; - String replacement = "another seven"; - assertTrue(this.originalList.contains(removed)); - assertTrue(this.originalList.contains(addedAfter)); - assertTrue(this.originalList.contains(replaced)); - // try to remove before calling #next() - boolean exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - while (iterator.hasNext()) { - String next = iterator.next(); - if (next.equals(addedAfter)) { - iterator.add(added); - } - if (next.equals(removed)) { - iterator.remove(); - // try to remove twice - exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - if (next.equals(replaced)) { - iterator.set(replacement); - } - } - assertTrue(this.originalList.contains(added)); - assertFalse(this.originalList.contains(removed)); - assertFalse(this.originalList.contains(replaced)); - assertTrue(this.originalList.contains(replacement)); - } - - private void verifyModifyPrevious(ListIterator iterator) { - String removed = "three"; - String addedBefore = "five"; - String added = "four and a half"; - String replaced = "seven"; - String replacement = "another seven"; - assertTrue(this.originalList.contains(removed)); - assertTrue(this.originalList.contains(addedBefore)); - assertTrue(this.originalList.contains(replaced)); - while (iterator.hasNext()) { - iterator.next(); - } - while (iterator.hasPrevious()) { - Object previous = iterator.previous(); - if (previous.equals(addedBefore)) { - iterator.add(added); - } - if (previous.equals(removed)) { - iterator.remove(); - // try to remove twice - boolean exCaught = false; - try { - iterator.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - if (previous.equals(replaced)) { - iterator.set(replacement); - } - } - assertTrue(this.originalList.contains(added)); - assertFalse(this.originalList.contains(removed)); - assertFalse(this.originalList.contains(replaced)); - assertTrue(this.originalList.contains(replacement)); - } - - private ListIterator buildCloneListIterator() { - return this.buildCloneListIterator(this.originalList); - } - - private ListIterator buildCloneListIterator(List list) { - return new CloneListIterator(list); - } - - private ListIterator buildNestedListIterator() { - return this.originalList.listIterator(); - } - - private List buildList() { - List list = this.buildEmptyList(); - this.populateList(list); - return list; - } - - private void populateList(List list) { - list.add("zero"); - list.add("one"); - list.add("two"); - list.add("three"); - list.add("four"); - list.add("five"); - list.add("six"); - list.add("seven"); - list.add("eight"); - list.add("nine"); - } - - protected List buildEmptyList() { - return new ArrayList(); - } - - /** - * Test concurrent access: First build a clone iterator in a separate thread - * that hangs momentarily during its construction; then modify the shared - * collection in this thread. This would cause a - * ConcurrentModificationException in the other thread if the clone iterator - * were not synchronized on the original collection. - */ - public void testConcurrentAccess() throws Exception { - CloneIteratorTests.SlowCollection slow = new CloneIteratorTests.SlowCollection(); - this.populateList(slow); - // using the unsynchronized list will cause the test to fail - // this.originalList = slow; - this.originalList = Collections.synchronizedList(slow); - - this.concurrentProblem = false; - this.concurrentList = new ArrayList(); - Thread thread = new Thread(this.buildRunnable()); - thread.start(); - while (!slow.hasStartedClone()) { - // wait for the other thread to start the clone... - Thread.yield(); - } - // ...then sneak in an extra element - this.originalList.add("seventeen"); - while (thread.isAlive()) { - // wait for the other thread to finish - Thread.yield(); - } - assertFalse(this.concurrentProblem); - List expected = new ArrayList(); - this.populateList(expected); - assertEquals(expected, this.concurrentList); - } - - private Runnable buildRunnable() { - return new Runnable() { - public void run() { - CloneListIteratorTests.this.loopWithCloneListIterator(); - } - }; - } - - /** - * use a clone iterator to loop over the "slow" collection and copy its - * contents to the concurrent collection - */ - void loopWithCloneListIterator() { - try { - for (ListIterator stream = this.buildCloneListIterator(); stream.hasNext();) { - this.concurrentList.add(stream.next()); - } - } catch (Throwable t) { - this.concurrentProblem = true; - } - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java deleted file mode 100644 index d7173cefa8..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java +++ /dev/null @@ -1,334 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.CompositeIterator; - -public class CompositeIteratorTests extends TestCase { - - public CompositeIteratorTests(String name) { - super(name); - } - - public void testHasAnother() { - this.verifyHasAnother(this.buildCompositeIterator()); - } - - public void testHasAnother2() { - this.verifyHasAnother(this.buildCompositeIterator2()); - } - - public void testHasAnother3() { - this.verifyHasAnother(this.buildCompositeIterator3()); - } - - void verifyHasAnother(Iterator stream) { - this.verifyHasAnother(8, stream); - } - - void verifyHasAnother(int expected, Iterator stream) { - int i = 0; - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(expected, i); - } - - public void testAnother() { - this.verifyAnother(this.buildCompositeIterator()); - } - - public void testAnother2() { - this.verifyAnother(this.buildCompositeIterator2()); - } - - public void testAnother3() { - this.verifyAnother(this.buildCompositeIterator3()); - } - - void verifyAnother(Iterator stream) { - this.verifyAnother(1, stream); - } - - void verifyAnother(int start, Iterator stream) { - int index = start; - while (stream.hasNext()) { - assertEquals("bogus element", String.valueOf(index++), stream.next().substring(0, 1)); - } - } - - public void testRemove() { - List list1 = this.buildList1(); - Object lastElement1 = list1.get(list1.size() - 1); - List list2 = this.buildList2(); - List list3 = this.buildList3(); - - List> list = new ArrayList>(); - list.add(list1.listIterator()); - list.add(list2.listIterator()); - list.add(list3.listIterator()); - - Iterator stream = this.buildCompositeIterator(list.listIterator()); - while (stream.hasNext()) { - Object next = stream.next(); - if (next.equals("333")) { - stream.remove(); - } - // test special case - where we are between iterators - if (next.equals(lastElement1)) { - // this will trigger the next iterator to be loaded - stream.hasNext(); - // now try to remove from the previous iterator - stream.remove(); - } - } - stream.remove(); - - assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size()); - assertFalse("element still in collection 1", list1.contains("333")); - assertFalse("last element still in collection 1", list1.contains(lastElement1)); - assertTrue("wrong element removed from collection 1", list1.contains("22")); - - assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size()); - assertFalse("element still in collection 3", list3.contains("88888888")); - assertTrue("wrong element removed from collection 3", list3.contains("666666")); - } - - public void testSingleElement() { - String item = "0"; - this.verifyHasAnother(9, this.buildCompositeIterator(item, this.buildCompositeIterator())); - this.verifyAnother(0, this.buildCompositeIterator(item, this.buildCompositeIterator())); - } - - public void testNoSuchElementException() { - this.verifyNoSuchElementException(this.buildCompositeIterator()); - } - - void verifyNoSuchElementException(Iterator stream) { - boolean exCaught = false; - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testUnsupportedOperationException() { - this.verifyUnsupportedOperationException(this.buildUnmodifiableCompositeIterator()); - } - - void verifyUnsupportedOperationException(Iterator stream) { - boolean exCaught = false; - while (stream.hasNext()) { - Object string = stream.next(); - if (string.equals("333")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testIllegalStateException() { - this.verifyIllegalStateException(this.buildCompositeIterator()); - } - - void verifyIllegalStateException(Iterator stream) { - boolean exCaught = false; - try { - stream.remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - - public void testEmptyHasAnother1() { - this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator1()); - } - - void verifyEmptyHasAnother(Iterator stream) { - int i = 0; - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(0, i); - } - - public void testEmptyNoSuchElementException1() { - this.verifyNoSuchElementException(this.buildEmptyCompositeIterator1()); - } - - public void testEmptyIllegalStateException1() { - this.verifyIllegalStateException(this.buildEmptyCompositeIterator1()); - } - - public void testEmptyHasAnother2() { - this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator2()); - } - - public void testEmptyNoSuchElementException2() { - this.verifyNoSuchElementException(this.buildEmptyCompositeIterator2()); - } - - public void testEmptyIllegalStateException2() { - this.verifyIllegalStateException(this.buildEmptyCompositeIterator2()); - } - - Iterator buildCompositeIterator() { - return this.buildCompositeIterator(this.buildIterators()); - } - - Iterator buildEmptyCompositeIterator1() { - return this.buildCompositeIterator(this.buildEmptyIterators1()); - } - - Iterator buildEmptyCompositeIterator2() { - return this.buildCompositeIterator(this.buildEmptyIterators2()); - } - - Iterator buildUnmodifiableCompositeIterator() { - return this.buildCompositeIterator(this.buildUnmodifiableIterators()); - } - - // leave unchecked so we can override in subclass - @SuppressWarnings("unchecked") - Iterator buildCompositeIterator(Iterator iterators) { - return new CompositeIterator(iterators); - } - - // use vararg constructor - @SuppressWarnings("unchecked") - Iterator buildCompositeIterator2() { - return new CompositeIterator(this.buildIterator1(), this.buildIterator2(), this.buildIterator3()); - } - - // use vararg constructor - @SuppressWarnings("unchecked") - Iterator buildCompositeIterator3() { - return new CompositeIterator(new Iterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() }); - } - - Iterator buildCompositeIterator(String string, Iterator iterator) { - return new CompositeIterator(string, iterator); - } - - ListIterator> buildIterators() { - List> list = new ArrayList>(); - list.add(this.buildIterator1()); - list.add(this.buildIterator2()); - list.add(this.buildIterator3()); - return list.listIterator(); - } - - ListIterator> buildEmptyIterators1() { - return this.buildEmptyIteratorIterator(); - } - - ListIterator> buildEmptyIterators2() { - List> list = new ArrayList>(); - list.add(this.buildEmptyStringIterator()); - list.add(this.buildEmptyStringIterator()); - list.add(this.buildEmptyStringIterator()); - return list.listIterator(); - } - - ListIterator> buildUnmodifiableIterators() { - List> list = new ArrayList>(); - list.add(this.buildUnmodifiableIterator1()); - list.add(this.buildUnmodifiableIterator2()); - list.add(this.buildUnmodifiableIterator3()); - return list.listIterator(); - } - - ListIterator buildIterator1() { - return this.buildList1().listIterator(); - } - - ListIterator buildIterator2() { - return this.buildList2().listIterator(); - } - - ListIterator buildIterator3() { - return this.buildList3().listIterator(); - } - - ListIterator buildUnmodifiableIterator1() { - return this.buildUnmodifiableList1().listIterator(); - } - - ListIterator buildUnmodifiableIterator2() { - return this.buildUnmodifiableList2().listIterator(); - } - - ListIterator buildUnmodifiableIterator3() { - return this.buildUnmodifiableList3().listIterator(); - } - - ListIterator> buildEmptyIteratorIterator() { - return (new ArrayList>()).listIterator(); - } - - ListIterator buildEmptyStringIterator() { - return (new ArrayList()).listIterator(); - } - - List buildList1() { - List list = new ArrayList(); - list.add("1"); - list.add("22"); - list.add("333"); - list.add("4444"); - return list; - } - - List buildList2() { - return new ArrayList(); - } - - List buildList3() { - List list = new ArrayList(); - list.add("55555"); - list.add("666666"); - list.add("7777777"); - list.add("88888888"); - return list; - } - - List buildUnmodifiableList1() { - return Collections.unmodifiableList(this.buildList1()); - } - - List buildUnmodifiableList2() { - return Collections.unmodifiableList(this.buildList2()); - } - - List buildUnmodifiableList3() { - return Collections.unmodifiableList(this.buildList3()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java deleted file mode 100644 index f2de1d1426..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java +++ /dev/null @@ -1,404 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator; - -public class CompositeListIteratorTests extends CompositeIteratorTests { - - public CompositeListIteratorTests(String name) { - super(name); - } - - @Override - void verifyHasAnother(Iterator stream) { - super.verifyHasAnother(stream); - ListIterator stream2 = (ListIterator) stream; - int i = 0; - while (stream2.hasPrevious()) { - stream2.previous(); - i++; - } - assertEquals(8, i); - } - - @Override - void verifyAnother(Iterator stream) { - super.verifyAnother(stream); - int i = 8; - ListIterator stream2 = (ListIterator) stream; - while (stream2.hasPrevious()) { - assertEquals("bogus element", String.valueOf(i--), stream2.previous().substring(0, 1)); - } - } - - @Override - public void testRemove() { - super.testRemove(); - List list1 = this.buildList1(); - List list2 = this.buildList2(); - List list3 = this.buildList3(); - Object firstElement3 = list3.get(0); - - List> list = new ArrayList>(); - list.add(list1.listIterator()); - list.add(list2.listIterator()); - list.add(list3.listIterator()); - - ListIterator stream = (ListIterator) this.buildCompositeIterator(list.listIterator()); - // position to end of stream - while (stream.hasNext()) { - stream.next(); - } - while (stream.hasPrevious()) { - Object previous = stream.previous(); - if (previous.equals("333")) { - stream.remove(); - } - // test special case - where we are between iterators - if (previous.equals(firstElement3)) { - // this will trigger the next iterator to be loaded - stream.hasPrevious(); - // now try to remove from the previous iterator - stream.remove(); - } - } - stream.remove(); - - assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size()); - assertFalse("element still in collection 1", list1.contains("1")); - assertFalse("element still in collection 1", list1.contains("333")); - - assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size()); - assertFalse("first element still in collection 3", list3.contains(firstElement3)); - assertTrue("wrong element removed from collection 3", list3.contains("666666")); - } - - public void testAdd() { - List list1 = this.buildList1(); - Object lastElement1 = list1.get(list1.size() - 1); - List list2 = this.buildList2(); - List list3 = this.buildList3(); - Object firstElement3 = list3.get(0); - - List> list = new ArrayList>(); - list.add(list1.listIterator()); - list.add(list2.listIterator()); - list.add(list3.listIterator()); - - ListIterator stream = (ListIterator) this.buildCompositeIterator(list.listIterator()); - while (stream.hasNext()) { - Object next = stream.next(); - if (next.equals("333")) { - stream.add("3.5"); - } - // test special case - where we are between iterators - if (next.equals(lastElement1)) { - // this will trigger the next iterator to be loaded - stream.hasNext(); - // now try to add to the iterator - stream.add("something in 3"); - } - } - stream.add("finale"); - boolean checkForFinale = true; - while (stream.hasPrevious()) { - Object previous = stream.previous(); - if (checkForFinale) { - checkForFinale = false; - assertEquals("added element dropped", "finale", previous); - } - if (previous.equals("333")) { - stream.add("2.5"); - } - // test special case - where we are between iterators - if (previous.equals(firstElement3)) { - // this will trigger the next iterator to be loaded - stream.hasPrevious(); - // now try to remove from the previous iterator - stream.add("old start of 3"); - } - } - stream.add("prelude"); - assertEquals("added element dropped", "prelude", stream.previous()); - - assertEquals("elements not added to collection 1", this.buildList1().size() + 3, list1.size()); - assertEquals("element not added to collection 1", "prelude", list1.get(0)); - assertEquals("element not added to collection 1", "2.5", list1.get(3)); - assertEquals("element not added to collection 1", "3.5", list1.get(5)); - - assertEquals("elements not added to collection 3", this.buildList3().size() + 3, list3.size()); - assertEquals("element not added to collection 3", "something in 3", list3.get(0)); - assertEquals("element not added to collection 3", "old start of 3", list3.get(1)); - assertEquals("element not added to collection 3", "finale", list3.get(list3.size() - 1)); - - // add to the front - stream = (ListIterator) this.buildCompositeIterator(); - stream.add("blah"); - assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah")); - - stream = (ListIterator) this.buildCompositeIterator(); - stream.add("blah"); - assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah")); - - stream = (ListIterator) this.buildCompositeIterator(); - while (stream.hasNext()) { - stream.next(); - } - while (stream.hasPrevious()) { - stream.previous(); - } - stream.add("blah"); - assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah")); - - stream = (ListIterator) this.buildCompositeIterator(); - while (stream.hasNext()) { - stream.next(); - } - while (stream.hasPrevious()) { - stream.previous(); - } - stream.add("blah"); - assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah")); - - // add to the middle - stream = (ListIterator) this.buildCompositeIterator(); - stream.next(); - stream.add("blah"); - assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah")); - - stream = (ListIterator) this.buildCompositeIterator(); - stream.next(); - stream.add("blah"); - assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah")); - - stream = (ListIterator) this.buildCompositeIterator(); - while (stream.hasNext()) { - stream.next(); - } - stream.previous(); - stream.add("blah"); - assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah")); - - stream = (ListIterator) this.buildCompositeIterator(); - while (stream.hasNext()) { - stream.next(); - } - stream.previous(); - stream.add("blah"); - assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah")); - - // add to the end - stream = (ListIterator) this.buildCompositeIterator(); - while (stream.hasNext()) { - stream.next(); - } - stream.add("blah"); - assertFalse("added element should be placed BEFORE the \"cursor\"", stream.hasNext()); - - stream = (ListIterator) this.buildCompositeIterator(); - while (stream.hasNext()) { - stream.next(); - } - stream.add("blah"); - assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah")); - } - - public void testSet() { - List list1 = this.buildList1(); - Object lastElement1 = list1.get(list1.size() - 1); - List list2 = this.buildList2(); - List list3 = this.buildList3(); - Object firstElement3 = list3.get(0); - - List> list = new ArrayList>(); - list.add(list1.listIterator()); - list.add(list2.listIterator()); - list.add(list3.listIterator()); - - ListIterator stream = (ListIterator) this.buildCompositeIterator(list.listIterator()); - // position to end of stream - while (stream.hasNext()) { - Object next = stream.next(); - if (next.equals("333")) { - stream.set("333a"); - } - // test special case - where we are between iterators - if (next.equals(lastElement1)) { - // this will trigger the next iterator to be loaded - stream.hasNext(); - // now try to remove from the previous iterator - stream.set("end of 1"); - } - } - while (stream.hasPrevious()) { - Object previous = stream.previous(); - if (previous.equals("22")) { - stream.set("22a"); - } - // test special case - where we are between iterators - if (previous.equals(firstElement3)) { - // this will trigger the next iterator to be loaded - stream.hasPrevious(); - // now try to remove from the previous iterator - stream.set("start of 3"); - } - } - - assertEquals("element(s) added to collection 1", this.buildList1().size(), list1.size()); - assertEquals("element not set in collection 1", "22a", list1.get(1)); - assertFalse("element not set in collection 1", list1.contains("22")); - assertEquals("element not set in collection 1", "333a", list1.get(2)); - assertFalse("element not set in collection 1", list1.contains("333")); - assertEquals("element not set in collection 1", "end of 1", list1.get(list1.size() - 1)); - assertFalse("element not set in collection 1", list1.contains(lastElement1)); - - assertEquals("element(s) added to collection 3", this.buildList3().size(), list3.size()); - assertEquals("element not set in collection 3", "start of 3", list3.get(0)); - assertFalse("element not set in collection 3", list3.contains(firstElement3)); - } - - public void testNextIndexPreviousIndex() { - int i = 0; - ListIterator stream = (ListIterator) this.buildCompositeIterator(); - assertEquals(i, stream.nextIndex()); - assertEquals(i - 1, stream.previousIndex()); - while (stream.hasNext()) { - Object next = stream.next(); - i++; - if (next.equals("333")) { - stream.remove(); - i--; - } - if (next.equals("7777777")) { - stream.add("7.5"); - i++; - } - assertEquals(i, stream.nextIndex()); - assertEquals(i - 1, stream.previousIndex()); - } - assertEquals("index is corrupt", 8, i); - - assertEquals(i, stream.nextIndex()); - assertEquals(i - 1, stream.previousIndex()); - while (stream.hasPrevious()) { - Object previous = stream.previous(); - i--; - if (previous.equals("666666")) { - stream.remove(); - // removing a previous element, does not change the cursor - } - if (previous.equals("22")) { - stream.add("1.5"); - i++; - } - assertEquals(i, stream.nextIndex()); - assertEquals(i - 1, stream.previousIndex()); - } - assertEquals("index is corrupt", 0, i); - } - - public void testPreviousIndex() { - // TODO - } - - @Override - void verifyNoSuchElementException(Iterator stream) { - super.verifyNoSuchElementException(stream); - ListIterator stream2 = (ListIterator) stream; - boolean exCaught = false; - String string = null; - while (stream2.hasPrevious()) { - string = stream2.previous(); - } - try { - string = stream2.previous(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - @Override - void verifyUnsupportedOperationException(Iterator stream) { - super.verifyUnsupportedOperationException(stream); - boolean exCaught = false; - ListIterator stream2 = (ListIterator) stream; - while (stream2.hasPrevious()) { - Object string = stream2.previous(); - if (string.equals("333")) { - try { - stream2.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - @Override - void verifyIllegalStateException(Iterator stream) { - super.verifyIllegalStateException(stream); - ListIterator stream2 = (ListIterator) stream; - boolean exCaught = false; - try { - stream2.set("junk"); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - - @Override - void verifyEmptyHasAnother(Iterator stream) { - super.verifyEmptyHasAnother(stream); - ListIterator stream2 = (ListIterator) stream; - int i = 0; - while (stream2.hasPrevious()) { - stream2.previous(); - i++; - } - assertEquals(0, i); - } - - // unchecked so we can override the unchecked method in superclass - @Override - @SuppressWarnings("unchecked") - Iterator buildCompositeIterator(Iterator iterators) { - return new CompositeListIterator((ListIterator>) iterators); - } - - @Override - @SuppressWarnings("unchecked") - Iterator buildCompositeIterator2() { - return new CompositeListIterator(this.buildIterator1(), this.buildIterator2(), this.buildIterator3()); - } - - @Override - @SuppressWarnings("unchecked") - Iterator buildCompositeIterator3() { - return new CompositeListIterator(new ListIterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() }); - } - - Iterator buildCompositeIterator(String string, ListIterator iterator) { - return this.buildCompositeListIterator(string, iterator); - } - - ListIterator buildCompositeListIterator(String string, ListIterator iterator) { - return new CompositeListIterator(string, iterator); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java deleted file mode 100644 index 98697897b7..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Enumeration; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration; - -public class EmptyEnumerationTests extends TestCase { - - public EmptyEnumerationTests(String name) { - super(name); - } - - public void testHasMoreElements() { - int i = 0; - for (Enumeration stream = EmptyEnumeration.instance(); stream.hasMoreElements();) { - stream.nextElement(); - i++; - } - assertEquals(0, i); - } - - public void testNextElement() { - for (Enumeration stream = EmptyEnumeration.instance(); stream.hasMoreElements();) { - fail("bogus element: " + stream.nextElement()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Enumeration stream = EmptyEnumeration.instance(); - Object element = null; - while (stream.hasMoreElements()) { - element = stream.nextElement(); - } - try { - element = stream.nextElement(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + element, exCaught); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java deleted file mode 100644 index 6985ad4ffa..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; - -public class EmptyIteratorTests extends TestCase { - - public EmptyIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = EmptyIterator.instance(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(0, i); - } - - public void testNext() { - for (Iterator stream = EmptyIterator.instance(); stream.hasNext();) { - fail("bogus element: " + stream.next()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = EmptyIterator.instance(); - Object element = null; - while (stream.hasNext()) { - element = stream.next(); - } - try { - element = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + element, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - try { - EmptyIterator.instance().remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java deleted file mode 100644 index 35c8efc011..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ListIterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator; - -public class EmptyListIteratorTests extends TestCase { - - public EmptyListIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (ListIterator stream = EmptyListIterator.instance(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(0, i); - } - - public void testNext() { - for (ListIterator stream = EmptyListIterator.instance(); stream.hasNext();) { - fail("bogus element: " + stream.next()); - } - } - - public void testNextIndex() { - ListIterator stream = EmptyListIterator.instance(); - assertEquals(0, stream.nextIndex()); - } - - public void testHasPrevious() { - ListIterator stream = EmptyListIterator.instance(); - int i = 0; - while (stream.hasPrevious()) { - stream.previous(); - i++; - } - assertEquals(0, i); - - while (stream.hasNext()) { - stream.next(); - } - i = 0; - while (stream.hasPrevious()) { - stream.previous(); - i++; - } - assertEquals(0, i); - } - - public void testPrevious() { - ListIterator stream = EmptyListIterator.instance(); - while (stream.hasPrevious()) { - fail("bogus element: " + stream.previous()); - } - while (stream.hasNext()) { - stream.next(); - } - while (stream.hasPrevious()) { - fail("bogus element: " + stream.previous()); - } - } - - public void testPreviousIndex() { - ListIterator stream = EmptyListIterator.instance(); - assertEquals(-1, stream.previousIndex()); - } - - public void testNoSuchElementException() { - boolean exCaught = false; - ListIterator stream = EmptyListIterator.instance(); - Object element = null; - while (stream.hasNext()) { - element = stream.next(); - } - try { - element = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown (next): " + element, exCaught); - while (stream.hasPrevious()) { - element = stream.previous(); - } - try { - element = stream.previous(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown (previous): " + element, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - try { - EmptyListIterator.instance().remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - assertTrue("UnsupportedOperationException not thrown (remove)", exCaught); - try { - EmptyListIterator.instance().set(new Object()); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - assertTrue("UnsupportedOperationException not thrown (set)", exCaught); - try { - EmptyListIterator.instance().add(new Object()); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - assertTrue("UnsupportedOperationException not thrown (add)", exCaught); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java deleted file mode 100644 index 528f101110..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Enumeration; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Vector; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.EnumerationIterator; - -public class EnumerationIteratorTests extends TestCase { - - public EnumerationIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(this.buildVector().size(), i); - } - - public void testHasNextUpcast() { - int i = 0; - for (Iterator stream = this.buildIteratorUpcast(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(this.buildVector().size(), i); - } - - public void testNext() { - Enumeration enumeration = this.buildEnumeration(); - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - assertEquals("bogus element", enumeration.nextElement(), stream.next()); - } - } - - public void testNextUpcast() { - Enumeration enumeration = this.buildEnumeration(); - for (Iterator stream = this.buildIteratorUpcast(); stream.hasNext();) { - assertEquals("bogus element", enumeration.nextElement(), stream.next()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - private Iterator buildIterator() { - return this.buildIterator(this.buildEnumeration()); - } - - private Iterator buildIterator(Enumeration enumeration) { - return new EnumerationIterator(enumeration); - } - - private Enumeration buildEnumeration() { - return this.buildVector().elements(); - } - - private Vector buildVector() { - Vector v = new Vector(); - v.addElement("one"); - v.addElement("two"); - v.addElement("three"); - v.addElement("four"); - v.addElement("five"); - v.addElement("six"); - v.addElement("seven"); - v.addElement("eight"); - return v; - } - - private Iterator buildIteratorUpcast() { - return this.buildIteratorUpcast(this.buildEnumeration()); - } - - private Iterator buildIteratorUpcast(Enumeration enumeration) { - return new EnumerationIterator(enumeration); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java deleted file mode 100644 index c268245304..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java +++ /dev/null @@ -1,285 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.Filter; -import org.eclipse.jpt.utility.internal.SimpleFilter; -import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; - -public class FilteringIteratorTests extends TestCase { - - private static final String PREFIX = "prefix"; - - public FilteringIteratorTests(String name) { - super(name); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator stream = this.buildAcceptIterator(); stream.hasNext();) { - String string = stream.next(); - if (string.equals(PREFIX + "3")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildAcceptIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testAcceptHasNext() { - int i = 0; - for (Iterator stream = this.buildAcceptIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(6, i); - } - - public void testAcceptNext() { - for (Iterator stream = this.buildAcceptIterator(); stream.hasNext();) { - assertTrue("bogus accept", stream.next().startsWith(PREFIX)); - } - } - - public void testInnerHasNext() { - int i = 0; - for (Iterator stream = this.buildInnerIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(6, i); - } - - public void testInnerNext() { - for (Iterator stream = this.buildInnerIterator(); stream.hasNext();) { - assertTrue("bogus accept", stream.next().startsWith(PREFIX)); - } - } - - public void testRejectHasNext() { - int i = 0; - for (Iterator stream = this.buildRejectIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(2, i); - } - - public void testRejectNext() { - for (Iterator stream = this.buildRejectIterator(); stream.hasNext();) { - assertFalse("bogus reject", stream.next().startsWith(PREFIX)); - } - } - - public void testBothHasNext() { - // if both accept() and reject() are overridden, accept() is used - int i = 0; - for (Iterator stream = this.buildBothIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(6, i); - } - - public void testLoadNext() { - // loadNext() used to cause a NPE when executing during the - // constructor because the "outer" class is not bound until completion - // of the constructor - for (Iterator stream = this.buildInnerIterator2(); stream.hasNext();) { - assertTrue("bogus accept", stream.next().startsWith(PREFIX)); - } - } - - // test a filtered iterator with a nested iterator of a sub-type (Number vs. Integer) - public void testGenerics1() { - List integers = new ArrayList(); - integers.add(new Integer(0)); - integers.add(new Integer(1)); - integers.add(new Integer(2)); - integers.add(new Integer(3)); - Iterator stream = new FilteringIterator(integers.iterator()) { - @Override - protected boolean accept(Object o) { - return ((Number) o).intValue() > 1; - } - }; - assertEquals(2, CollectionTools.size(stream)); - } - - // test a filtered iterator with a nested iterator of a super-type (Integer vs. Number) - // i.e. trust that Filter will only return the appropriate sub-type objects - public void testGenerics2() { - List integers = new ArrayList(); - integers.add(new Integer(0)); - integers.add(new Long(1)); - integers.add(new Integer(2)); - integers.add(new Float(3)); - Iterator stream = new FilteringIterator(integers.iterator()) { - @Override - protected boolean accept(Object o) { - return o instanceof Integer; - } - }; - assertEquals(2, CollectionTools.size(stream)); - } - - public void testFilterHasNext() { - int i = 0; - for (Iterator stream = this.buildFilterIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(6, i); - } - - public void testFilterNext() { - for (Iterator stream = this.buildFilterIterator(); stream.hasNext();) { - assertTrue("bogus accept", stream.next().startsWith(PREFIX)); - } - } - - private Iterator buildFilteredIterator(Iterator nestedIterator, Filter filter) { - return new FilteringIterator(nestedIterator, filter); - } - - private Iterator buildInnerFilteredIterator(Iterator nestedIterator) { - return new FilteringIterator(nestedIterator) { - @Override - protected boolean accept(Object o) { - return ((String) o).startsWith(PREFIX); - } - }; - } - - String getPrefix() { - return PREFIX; - } - - // this inner iterator will call the "outer" object - private Iterator buildInnerFilteredIterator2(Iterator nestedIterator) { - return new FilteringIterator(nestedIterator) { - @Override - protected boolean accept(Object o) { - return ((String) o).startsWith(FilteringIteratorTests.this.getPrefix()); - } - }; - } - - private Iterator buildNestedIterator() { - Collection c = new ArrayList(); - c.add(PREFIX + "1"); - c.add(PREFIX + "2"); - c.add(PREFIX + "3"); - c.add("4"); - c.add(PREFIX + "5"); - c.add(PREFIX + "6"); - c.add(PREFIX + "7"); - c.add("8"); - return c.iterator(); - } - - private Iterator buildAcceptIterator() { - return this.buildFilteredIterator(this.buildNestedIterator(), this.buildAcceptFilter(PREFIX)); - } - - private Iterator buildInnerIterator() { - return this.buildInnerFilteredIterator(this.buildNestedIterator()); - } - - // this inner iterator will call the "outer" object - private Iterator buildInnerIterator2() { - return this.buildInnerFilteredIterator2(this.buildNestedIterator()); - } - - private Iterator buildFilterIterator() { - return this.buildFilteredIterator(this.buildNestedIterator(), this.buildFilterFilter(PREFIX)); - } - - private Filter buildAcceptFilter(String prefix) { - return new SimpleFilter(prefix) { - private static final long serialVersionUID = 1L; - - @Override - public boolean accept(String s) { - return s.startsWith(this.criterion); - } - }; - } - - private Iterator buildRejectIterator() { - return this.buildFilteredIterator(this.buildNestedIterator(), this.buildRejectFilter(PREFIX)); - } - - private Filter buildRejectFilter(String prefix) { - return new SimpleFilter(prefix) { - private static final long serialVersionUID = 1L; - - @Override - public boolean reject(String s) { - return s.startsWith(this.criterion); - } - }; - } - - // use anonymous inner Filter - private Filter buildFilterFilter(final String prefix) { - return new Filter() { - public boolean accept(String s) { - return s.startsWith(prefix); - } - }; - } - - private Iterator buildBothIterator() { - return this.buildFilteredIterator(this.buildNestedIterator(), this.buildBothFilter(PREFIX)); - } - - private Filter buildBothFilter(String prefix) { - return new SimpleFilter(prefix) { - private static final long serialVersionUID = 1L; - - @Override - public boolean reject(String s) { - return s.startsWith(this.criterion); - } - - @Override - public boolean accept(String s) { - return s.startsWith(this.criterion); - } - }; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java deleted file mode 100644 index d7f884c04e..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java +++ /dev/null @@ -1,183 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterators.GraphIterator; -import org.eclipse.jpt.utility.tests.internal.TestTools; - -public class GraphIteratorTests extends TestCase { - /** this will be populated with all the nodes created for the test */ - Collection nodes = new ArrayList(); - - public GraphIteratorTests(String name) { - super(name); - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - public void testHasNext1() { - this.verifyHasNext(this.buildGraphIterator1()); - } - - public void testHasNext2() { - this.verifyHasNext(this.buildGraphIterator2()); - } - - private void verifyHasNext(Iterator iterator) { - int i = 0; - while (iterator.hasNext()) { - iterator.next(); - i++; - } - assertEquals(this.nodes.size(), i); - } - - public void testNext1() { - this.verifyNext(this.buildGraphIterator1()); - } - - public void testNext2() { - this.verifyNext(this.buildGraphIterator2()); - } - - private void verifyNext(Iterator iterator) { - while (iterator.hasNext()) { - assertTrue("bogus element", this.nodes.contains(iterator.next())); - } - } - - public void testNoSuchElementException1() { - this.verifyNoSuchElementException(this.buildGraphIterator1()); - } - - public void testNoSuchElementException2() { - this.verifyNoSuchElementException(this.buildGraphIterator2()); - } - - private void verifyNoSuchElementException(Iterator iterator) { - boolean exCaught = false; - while (iterator.hasNext()) { - iterator.next(); - } - try { - iterator.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown", exCaught); - } - - public void testSize1() { - this.verifySize(this.buildGraphIterator1()); - } - - public void testSize2() { - this.verifySize(this.buildGraphIterator2()); - } - - private void verifySize(Iterator iterator) { - int iteratorSize = CollectionTools.size(iterator); - int actualSize = this.nodes.size(); - assertTrue("Too few items in iterator.", iteratorSize >= actualSize); - assertTrue("Too many items in iterator.", iteratorSize <= actualSize); - } - - /** - * build a graph iterator with an explicit misterRogers - */ - private Iterator buildGraphIterator1() { - return new GraphIterator(this.buildGraphRoot(), this.buildMisterRogers()); - } - - private GraphIterator.MisterRogers buildMisterRogers() { - return new GraphIterator.MisterRogers() { - public Iterator neighbors(GraphNode next) { - return next.neighbors(); - } - }; - } - - /** - * build a graph iterator with an override - */ - private Iterator buildGraphIterator2() { - return new GraphIterator(this.buildGraphRoot()) { - @Override - public Iterator neighbors(GraphNode next) { - return next.neighbors(); - } - }; - } - - private GraphNode buildGraphRoot() { - GraphNode ncNode = new GraphNode("North Carolina"); - GraphNode vaNode = new GraphNode("Virginia"); - GraphNode scNode = new GraphNode("South Carolina"); - GraphNode gaNode = new GraphNode("Georgia"); - GraphNode flNode = new GraphNode("Florida"); - GraphNode alNode = new GraphNode("Alabama"); - GraphNode msNode = new GraphNode("Mississippi"); - GraphNode tnNode = new GraphNode("Tennessee"); - - ncNode.setNeighbors(new GraphNode[] { vaNode, scNode, gaNode, tnNode }); - vaNode.setNeighbors(new GraphNode[] { ncNode, tnNode }); - scNode.setNeighbors(new GraphNode[] { ncNode, gaNode }); - gaNode.setNeighbors(new GraphNode[] { ncNode, scNode, flNode, alNode, tnNode }); - flNode.setNeighbors(new GraphNode[] { gaNode }); - alNode.setNeighbors(new GraphNode[] { gaNode, msNode, tnNode }); - msNode.setNeighbors(new GraphNode[] { alNode, tnNode }); - tnNode.setNeighbors(new GraphNode[] { vaNode, ncNode, gaNode, alNode, msNode }); - - return ncNode; - } - - private class GraphNode { - private String name; - - private Collection neighbors = new ArrayList(); - - public GraphNode(String name) { - super(); - GraphIteratorTests.this.nodes.add(this); // log node - this.name = name; - } - - public String getName() { - return this.name; - } - - void setNeighbors(GraphNode[] neighbors) { - this.neighbors = CollectionTools.list(neighbors); - } - - public Iterator neighbors() { - return this.neighbors.iterator(); - } - - public int neighborsSize() { - return this.neighbors.size(); - } - - @Override - public String toString() { - return "GraphNode(" + this.name + ")"; - } - } -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java deleted file mode 100644 index 42d8eb459e..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Enumeration; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Vector; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.IteratorEnumeration; - -public class IteratorEnumerationTests extends TestCase { - - public IteratorEnumerationTests(String name) { - super(name); - } - - public void testHasMoreElements() { - int i = 0; - for (Enumeration stream = this.buildEnumeration(); stream.hasMoreElements();) { - stream.nextElement(); - i++; - } - assertEquals(this.buildVector().size(), i); - } - - public void testHasMoreElementsUpcast() { - int i = 0; - for (Enumeration stream = this.buildEnumerationUpcast(); stream.hasMoreElements();) { - stream.nextElement(); - i++; - } - assertEquals(this.buildVector().size(), i); - } - - public void testNextElement() { - Iterator iterator = this.buildIterator(); - for (Enumeration stream = this.buildEnumeration(); stream.hasMoreElements();) { - assertEquals("bogus element", iterator.next(), stream.nextElement()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Enumeration stream = this.buildEnumeration(); - String string = null; - while (stream.hasMoreElements()) { - string = stream.nextElement(); - } - try { - string = stream.nextElement(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - private Enumeration buildEnumeration() { - return this.buildEnumeration(this.buildIterator()); - } - - private Enumeration buildEnumerationUpcast() { - return this.buildEnumerationUpcast(this.buildIterator()); - } - - private Enumeration buildEnumeration(Iterator iterator) { - return new IteratorEnumeration(iterator); - } - - private Enumeration buildEnumerationUpcast(Iterator iterator) { - return new IteratorEnumeration(iterator); - } - - private Iterator buildIterator() { - return this.buildVector().iterator(); - } - - private Vector buildVector() { - Vector v = new Vector(); - v.addElement("one"); - v.addElement("two"); - v.addElement("three"); - v.addElement("four"); - v.addElement("five"); - v.addElement("six"); - v.addElement("seven"); - v.addElement("eight"); - return v; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java deleted file mode 100644 index 76e6717b34..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * decentralize test creation code - */ -public class JptUtilityIteratorsTests { - - public static Test suite() { - TestSuite suite = new TestSuite(JptUtilityIteratorsTests.class.getPackage().getName()); - - suite.addTestSuite(ArrayIteratorTests.class); - suite.addTestSuite(ArrayListIteratorTests.class); - suite.addTestSuite(ChainIteratorTests.class); - suite.addTestSuite(CloneIteratorTests.class); - suite.addTestSuite(CloneListIteratorTests.class); - suite.addTestSuite(CompositeIteratorTests.class); - suite.addTestSuite(CompositeListIteratorTests.class); - suite.addTestSuite(EmptyEnumerationTests.class); - suite.addTestSuite(EmptyIteratorTests.class); - suite.addTestSuite(EmptyListIteratorTests.class); - suite.addTestSuite(EnumerationIteratorTests.class); - suite.addTestSuite(FilteringIteratorTests.class); - suite.addTestSuite(GraphIteratorTests.class); - suite.addTestSuite(IteratorEnumerationTests.class); - suite.addTestSuite(PeekableIteratorTests.class); - suite.addTestSuite(ReadOnlyIteratorTests.class); - suite.addTestSuite(ReadOnlyListIteratorTests.class); - suite.addTestSuite(SingleElementIteratorTests.class); - suite.addTestSuite(SingleElementListIteratorTests.class); - suite.addTestSuite(TransformationIteratorTests.class); - suite.addTestSuite(TransformationListIteratorTests.class); - suite.addTestSuite(TreeIteratorTests.class); - - return suite; - } - - private JptUtilityIteratorsTests() { - super(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java deleted file mode 100644 index 1a3b47b78f..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.PeekableIterator; - -public class PeekableIteratorTests extends TestCase { - - public PeekableIteratorTests(String name) { - super(name); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator stream = this.buildPeekableIterator(); stream.hasNext();) { - String string = stream.next(); - if (string.equals("three")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildPeekableIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = this.buildPeekableIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(6, i); - } - - public void testHasNextUpcast() { - int i = 0; - for (Iterator stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(6, i); - } - - public void testNext() { - Iterator stream = this.buildPeekableIterator(); - assertEquals("zero", stream.next()); - assertEquals("one", stream.next()); - assertEquals("two", stream.next()); - assertEquals("three", stream.next()); - assertEquals("four", stream.next()); - assertEquals("five", stream.next()); - } - - public void testNextUpcast() { - Iterator stream = this.buildPeekableIteratorUpcast(); - assertEquals("zero", stream.next()); - assertEquals("one", stream.next()); - assertEquals("two", stream.next()); - assertEquals("three", stream.next()); - assertEquals("four", stream.next()); - assertEquals("five", stream.next()); - } - - public void testPeek() { - Object next = null; - for (PeekableIterator stream = this.buildPeekableIterator(); stream.hasNext();) { - Object peek = stream.peek(); - assertTrue("peek and next are prematurely identical", peek != next); - next = stream.next(); - assertTrue("peek and next are not identical", peek == next); - } - } - - public void testPeekUpcast() { - Object next = null; - for (PeekableIterator stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) { - Object peek = stream.peek(); - assertTrue("peek and next are prematurely identical", peek != next); - next = stream.next(); - assertTrue("peek and next are not identical", peek == next); - } - } - - private PeekableIterator buildPeekableIterator() { - return this.buildPeekableIterator(this.buildNestedIterator()); - } - - private PeekableIterator buildPeekableIteratorUpcast() { - return this.buildPeekableIteratorUpcast(this.buildNestedIterator()); - } - - private PeekableIterator buildPeekableIterator(Iterator nestedIterator) { - return new PeekableIterator(nestedIterator); - } - - private PeekableIterator buildPeekableIteratorUpcast(Iterator nestedIterator) { - return new PeekableIterator(nestedIterator); - } - - private Iterator buildNestedIterator() { - Collection c = new ArrayList(); - c.add("zero"); - c.add("one"); - c.add("two"); - c.add("three"); - c.add("four"); - c.add("five"); - return c.iterator(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java deleted file mode 100644 index 4defa2e414..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Vector; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator; - -public class ReadOnlyIteratorTests extends TestCase { - - public ReadOnlyIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = this.buildReadOnlyIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(this.buildVector().size(), i); - } - - public void testHasNextUpcast() { - int i = 0; - for (Iterator stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(this.buildVector().size(), i); - } - - public void testNext() { - Iterator nestedIterator = this.buildNestedIterator(); - for (Iterator stream = this.buildReadOnlyIterator(); stream.hasNext();) { - assertEquals("bogus element", nestedIterator.next(), stream.next()); - } - } - - public void testNextUpcast() { - Iterator nestedIterator = this.buildNestedIterator(); - for (Iterator stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) { - assertEquals("bogus element", nestedIterator.next(), stream.next()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildReadOnlyIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testRemove() { - boolean exCaught = false; - for (Iterator stream = this.buildReadOnlyIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - private Iterator buildReadOnlyIterator() { - return this.buildReadOnlyIterator(this.buildNestedIterator()); - } - - private Iterator buildReadOnlyIteratorUpcast() { - return this.buildReadOnlyIteratorUpcast(this.buildNestedIterator()); - } - - private Iterator buildReadOnlyIterator(Iterator nestedIterator) { - return new ReadOnlyIterator(nestedIterator); - } - - private Iterator buildReadOnlyIteratorUpcast(Iterator nestedIterator) { - return new ReadOnlyIterator(nestedIterator); - } - - private Iterator buildNestedIterator() { - return this.buildVector().iterator(); - } - - private Vector buildVector() { - Vector v = new Vector(); - v.addElement("one"); - v.addElement("two"); - v.addElement("three"); - v.addElement("four"); - v.addElement("five"); - v.addElement("six"); - v.addElement("seven"); - v.addElement("eight"); - return v; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java deleted file mode 100644 index 4db72f6754..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java +++ /dev/null @@ -1,203 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator; - -public class ReadOnlyListIteratorTests extends TestCase { - - public ReadOnlyListIteratorTests(String name) { - super(name); - } - - public void testHasNextAndHasPrevious() { - int i = 0; - ListIterator stream = this.buildReadOnlyListIterator(); - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(this.buildList().size(), i); - - while (stream.hasPrevious()) { - stream.previous(); - i--; - } - assertEquals(0, i); - } - - public void testHasNextAndHasPreviousUpcast() { - int i = 0; - ListIterator stream = this.buildReadOnlyListIteratorUpcast(); - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(this.buildList().size(), i); - - while (stream.hasPrevious()) { - stream.previous(); - i--; - } - assertEquals(0, i); - } - - public void testNextAndPrevious() { - ListIterator nestedListIterator = this.buildNestedListIterator(); - ListIterator stream = this.buildReadOnlyListIterator(); - while (stream.hasNext()) { - assertEquals("bogus element", nestedListIterator.next(), stream.next()); - } - while (stream.hasPrevious()) { - assertEquals("bogus element", nestedListIterator.previous(), stream.previous()); - } - } - - public void testNextAndPreviousUpcast() { - ListIterator nestedListIterator = this.buildNestedListIterator(); - ListIterator stream = this.buildReadOnlyListIteratorUpcast(); - while (stream.hasNext()) { - assertEquals("bogus element", nestedListIterator.next(), stream.next()); - } - while (stream.hasPrevious()) { - assertEquals("bogus element", nestedListIterator.previous(), stream.previous()); - } - } - - public void testNextIndexAndPreviousIndex() { - ListIterator nestedListIterator = this.buildNestedListIterator(); - ListIterator stream = this.buildReadOnlyListIterator(); - while (stream.hasNext()) { - assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex()); - nestedListIterator.next(); - stream.next(); - } - assertEquals("bogus index", this.buildList().size(), stream.nextIndex()); - while (stream.hasPrevious()) { - assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex()); - nestedListIterator.previous(); - stream.previous(); - } - assertEquals("bogus index", -1, stream.previousIndex()); - } - - public void testNextIndexAndPreviousIndexUpcast() { - ListIterator nestedListIterator = this.buildNestedListIterator(); - ListIterator stream = this.buildReadOnlyListIteratorUpcast(); - while (stream.hasNext()) { - assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex()); - nestedListIterator.next(); - stream.next(); - } - assertEquals("bogus index", this.buildList().size(), stream.nextIndex()); - while (stream.hasPrevious()) { - assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex()); - nestedListIterator.previous(); - stream.previous(); - } - assertEquals("bogus index", -1, stream.previousIndex()); - } - - public void testNoSuchElementException() { - boolean exCaught = false; - ListIterator stream = this.buildReadOnlyListIterator(); - String string = null; - while (stream.hasNext()) { - string = stream.next(); - } - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testRemove() { - boolean exCaught = false; - for (ListIterator stream = this.buildReadOnlyListIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testSet() { - boolean exCaught = false; - for (ListIterator stream = this.buildReadOnlyListIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.set("bogus"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testAdd() { - boolean exCaught = false; - for (ListIterator stream = this.buildReadOnlyListIterator(); stream.hasNext();) { - if (stream.next().equals("three")) { - try { - stream.add("bogus"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - private ListIterator buildReadOnlyListIterator() { - return this.buildReadOnlyListIterator(this.buildNestedListIterator()); - } - - private ListIterator buildReadOnlyListIteratorUpcast() { - return this.buildReadOnlyListIteratorUpcast(this.buildNestedListIterator()); - } - - private ListIterator buildReadOnlyListIterator(ListIterator nestedListIterator) { - return new ReadOnlyListIterator(nestedListIterator); - } - - private ListIterator buildReadOnlyListIteratorUpcast(ListIterator nestedListIterator) { - return new ReadOnlyListIterator(nestedListIterator); - } - - private ListIterator buildNestedListIterator() { - return this.buildList().listIterator(); - } - - private List buildList() { - List l = new ArrayList(); - l.add("one"); - l.add("two"); - l.add("three"); - l.add("four"); - l.add("five"); - l.add("six"); - l.add("seven"); - l.add("eight"); - return l; - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java deleted file mode 100644 index e84657c93d..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; - -public class SingleElementIteratorTests extends TestCase { - - public SingleElementIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = this.buildSingleElementIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(1, i); - } - - public void testNext() { - for (Iterator stream = this.buildSingleElementIterator(); stream.hasNext();) { - assertEquals("bogus element", this.singleElement(), stream.next()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildSingleElementIterator(); - String string = stream.next(); - try { - string = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + string, exCaught); - } - - public void testRemove() { - boolean exCaught = false; - for (Iterator stream = this.buildSingleElementIterator(); stream.hasNext();) { - if (stream.next().equals(this.singleElement())) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - protected Iterator buildSingleElementIterator() { - return new SingleElementIterator(this.singleElement()); - } - - protected String singleElement() { - return "single element"; - } -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java deleted file mode 100644 index e3e4197c7d..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Iterator; -import java.util.ListIterator; -import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator; - -public class SingleElementListIteratorTests extends SingleElementIteratorTests { - - public SingleElementListIteratorTests(String name) { - super(name); - } - - public void testNextIndex() { - ListIterator stream = this.buildSingleElementListIterator(); - while (stream.hasNext()) { - assertEquals("bogus index", 0, stream.nextIndex()); - stream.next(); - } - assertEquals("bogus index", 1, stream.nextIndex()); - } - - public void testHasPrevious() { - int i = 0; - ListIterator stream = this.buildSingleElementListIterator(); - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(1, i); - - while (stream.hasPrevious()) { - stream.previous(); - i++; - } - assertEquals(2, i); - } - - public void testPrevious() { - ListIterator stream = this.buildSingleElementListIterator(); - - while (stream.hasNext()) { - assertEquals("bogus element", this.singleElement(), stream.next()); - } - - while (stream.hasPrevious()) { - assertEquals("bogus element", this.singleElement(), stream.previous()); - } - } - - public void testPreviousIndex() { - ListIterator stream = this.buildSingleElementListIterator(); - - while (stream.hasNext()) { - assertEquals("bogus index", 0, stream.nextIndex()); - stream.next(); - } - - while (stream.hasPrevious()) { - assertEquals("bogus index", 0, stream.previousIndex()); - stream.previous(); - } - - assertEquals("bogus index", -1, stream.previousIndex()); - } - - public void testAdd() { - boolean exCaught = false; - ListIterator stream = this.buildSingleElementListIterator(); - - try { - stream.add("foo"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testSet() { - boolean exCaught = false; - for (ListIterator stream = this.buildSingleElementListIterator(); stream.hasNext();) { - if (stream.next().equals(this.singleElement())) { - try { - stream.set("foo"); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - @Override - protected Iterator buildSingleElementIterator() { - return new SingleElementListIterator(this.singleElement()); - } - - protected ListIterator buildSingleElementListIterator() { - return (ListIterator) this.buildSingleElementIterator(); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java deleted file mode 100644 index 6ec0d082b1..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.Transformer; -import org.eclipse.jpt.utility.internal.iterators.TransformationIterator; - -public class TransformationIteratorTests extends TestCase { - - public TransformationIteratorTests(String name) { - super(name); - } - - public void testHasNext() { - int i = 0; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(8, i); - } - - public void testHasNextUpcast() { - int i = 0; - for (Iterator stream = this.buildIteratorUpcast(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(8, i); - } - - public void testInnerHasNext() { - int i = 0; - for (Iterator stream = this.buildInnerIterator(); stream.hasNext();) { - stream.next(); - i++; - } - assertEquals(8, i); - } - - public void testNext() { - int i = 0; - for (Iterator stream = this.buildIterator(); stream.hasNext();) { - assertEquals("bogus transformation", ++i, stream.next().intValue()); - } - } - - public void testNextUpcast() { - int i = 0; - for (Iterator stream = this.buildIteratorUpcast(); stream.hasNext();) { - assertEquals("bogus transformation", ++i, ((Integer) stream.next()).intValue()); - } - } - - public void testInnerNext() { - int i = 0; - for (Iterator stream = this.buildInnerIterator(); stream.hasNext();) { - assertEquals("bogus transformation", ++i, stream.next().intValue()); - } - } - - public void testRemove() { - Collection c = this.buildCollection(); - for (Iterator stream = this.buildInnerTransformationIterator(c.iterator()); stream.hasNext();) { - if (stream.next().intValue() == 3) { - stream.remove(); - } - } - assertEquals("nothing removed", this.buildCollection().size() - 1, c.size()); - assertFalse("element still in collection", c.contains("333")); - assertTrue("wrong element removed", c.contains("22")); - } - - public void testInnerRemove() { - Collection c = this.buildCollection(); - for (Iterator stream = this.buildTransformationIterator(c.iterator(), this.buildTransformer()); stream.hasNext();) { - if (stream.next().intValue() == 3) { - stream.remove(); - } - } - assertEquals("nothing removed", this.buildCollection().size() - 1, c.size()); - assertFalse("element still in collection", c.contains("333")); - assertTrue("wrong element removed", c.contains("22")); - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Iterator stream = this.buildIterator(); - Integer integer = null; - while (stream.hasNext()) { - integer = stream.next(); - } - try { - integer = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + integer, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator stream = this.buildUnmodifiableIterator(); stream.hasNext();) { - int i = stream.next().intValue(); - if (i == 3) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testIllegalStateException() { - boolean exCaught = false; - try { - this.buildIterator().remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - - private Iterator buildIterator() { - return this.buildTransformationIterator(this.buildNestedIterator(), this.buildTransformer()); - } - - private Iterator buildIteratorUpcast() { - return this.buildTransformationIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast()); - } - - private Iterator buildInnerIterator() { - return this.buildInnerTransformationIterator(this.buildNestedIterator()); - } - - private Iterator buildUnmodifiableIterator() { - return this.buildTransformationIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer()); - } - - private Iterator buildTransformationIterator(Iterator nestedIterator, Transformer transformer) { - return new TransformationIterator(nestedIterator, transformer); - } - - private Iterator buildTransformationIteratorUpcast(Iterator nestedIterator, Transformer transformer) { - return new TransformationIterator(nestedIterator, transformer); - } - - private Transformer buildTransformer() { - // transform each string into an integer with a value of the string's length - return new Transformer() { - public Integer transform(String next) { - return new Integer(next.length()); - } - }; - } - - private Transformer buildTransformerUpcast() { - // transform each string into an integer with a value of the string's length - return new Transformer() { - public Integer transform(Object next) { - return new Integer(((String) next).length()); - } - }; - } - - private Iterator buildInnerTransformationIterator(Iterator nestedIterator) { - // transform each string into an integer with a value of the string's length - return new TransformationIterator(nestedIterator) { - @Override - protected Integer transform(String next) { - return new Integer(next.length()); - } - }; - } - - private Iterator buildNestedIterator() { - return this.buildCollection().iterator(); - } - - private Iterator buildUnmodifiableNestedIterator() { - return this.buildUnmodifiableCollection().iterator(); - } - - private Collection buildCollection() { - Collection c = new ArrayList(); - c.add("1"); - c.add("22"); - c.add("333"); - c.add("4444"); - c.add("55555"); - c.add("666666"); - c.add("7777777"); - c.add("88888888"); - return c; - } - - private Collection buildUnmodifiableCollection() { - return Collections.unmodifiableCollection(this.buildCollection()); - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java deleted file mode 100644 index fb507d5af4..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java +++ /dev/null @@ -1,306 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.Transformer; -import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator; - -public class TransformationListIteratorTests extends TestCase { - public TransformationListIteratorTests(String name) { - super(name); - } - - public void testHasNextAndHasPrevious() { - int i = 0; - ListIterator stream = this.buildIterator(); - - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(8, i); - - while (stream.hasPrevious()) { - stream.previous(); - i--; - } - assertEquals(0, i); - } - - public void testHasNextAndHasPreviousUpcast() { - int i = 0; - ListIterator stream = this.buildIteratorUpcast(); - - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(8, i); - - while (stream.hasPrevious()) { - stream.previous(); - i--; - } - assertEquals(0, i); - } - - public void testInnerHasNextAndHasPrevious() { - int i = 0; - ListIterator stream = this.buildInnerIterator(); - - while (stream.hasNext()) { - stream.next(); - i++; - } - assertEquals(8, i); - - while (stream.hasPrevious()) { - stream.previous(); - i--; - } - assertEquals(0, i); - } - - public void testNextAndPrevious() { - int i = 0; - ListIterator stream = this.buildIterator(); - - while (stream.hasNext()) { - assertEquals(++i, stream.next().intValue()); - } - - ++i; - - while (stream.hasPrevious()) { - assertEquals(--i, stream.previous().intValue()); - } - } - - public void testInnerNextAndPrevious() { - int i = 0; - ListIterator stream = this.buildInnerIterator(); - - while (stream.hasNext()) { - assertEquals(++i, stream.next().intValue()); - } - - ++i; - - while (stream.hasPrevious()) { - assertEquals(--i, stream.previous().intValue()); - } - } - - public void testNextIndexAndPreviousIndex() { - int i = -1; - ListIterator stream = this.buildIterator(); - - while (stream.hasNext()) { - assertEquals(++i, stream.nextIndex()); - stream.next(); - } - - ++i; - - while (stream.hasPrevious()) { - assertEquals(--i, stream.previousIndex()); - stream.previous(); - } - } - - public void testInnerNextIndexAndPreviousIndex() { - int i = -1; - ListIterator stream = this.buildInnerIterator(); - - while (stream.hasNext()) { - assertEquals(++i, stream.nextIndex()); - stream.next(); - } - - ++i; - - while (stream.hasPrevious()) { - assertEquals(--i, stream.previousIndex()); - stream.previous(); - } - } - - public void testRemove() { - List l = this.buildList(); - for (ListIterator stream = this.buildInnerTransformationListIterator(l.listIterator()); stream.hasNext();) { - if (stream.next().intValue() == 3) { - stream.remove(); - } - } - assertEquals("nothing removed", this.buildList().size() - 1, l.size()); - assertFalse("element still in list", l.contains("333")); - assertTrue("wrong element removed", l.contains("22")); - } - - public void testInnerRemove() { - List l = this.buildList(); - for (ListIterator stream = this.buildTransformationListIterator(l.listIterator(), this.buildTransformer()); stream.hasNext();) { - if (stream.next().intValue() == 3) { - stream.remove(); - } - } - assertEquals("nothing removed", this.buildList().size() - 1, l.size()); - assertFalse("element still in list", l.contains("333")); - assertTrue("wrong element removed", l.contains("22")); - } - - public void testUnsupportedOperationExceptionOnAdd() { - ListIterator stream = this.buildIterator(); - boolean exCaught = false; - try { - stream.add(new Integer(0)); - fail("exception not thrown"); - } catch (UnsupportedOperationException e) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testUnsupportedOperationExceptionOnSet() { - ListIterator stream = this.buildIterator(); - boolean exCaught = false; - try { - stream.set(new Integer(0)); - fail("exception not thrown"); - } catch (UnsupportedOperationException e) { - exCaught = true; - } - assertTrue(exCaught); - } - - public void testNoSuchElementException() { - boolean exCaught = false; - ListIterator stream = this.buildIterator(); - Integer integer = null; - while (stream.hasNext()) { - integer = stream.next(); - } - try { - integer = stream.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + integer, exCaught); - } - - public void testUnsupportedOperationException() { - boolean exCaught = false; - for (Iterator stream = this.buildUnmodifiableIterator(); stream.hasNext();) { - int i = stream.next().intValue(); - if (i == 3) { - try { - stream.remove(); - } catch (UnsupportedOperationException ex) { - exCaught = true; - } - } - } - assertTrue("UnsupportedOperationException not thrown", exCaught); - } - - public void testIllegalStateException() { - boolean exCaught = false; - try { - this.buildIterator().remove(); - } catch (IllegalStateException ex) { - exCaught = true; - } - assertTrue("IllegalStateException not thrown", exCaught); - } - - private ListIterator buildIterator() { - return this.buildTransformationListIterator(this.buildNestedIterator(), this.buildTransformer()); - } - - private ListIterator buildIteratorUpcast() { - return this.buildTransformationListIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast()); - } - - private ListIterator buildInnerIterator() { - return this.buildInnerTransformationListIterator(this.buildNestedIterator()); - } - - private ListIterator buildUnmodifiableIterator() { - return this.buildTransformationListIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer()); - } - - private ListIterator buildTransformationListIterator(ListIterator nestedIterator, Transformer transformer) { - return new TransformationListIterator(nestedIterator, transformer); - } - - private ListIterator buildTransformationListIteratorUpcast(ListIterator nestedIterator, Transformer transformer) { - return new TransformationListIterator(nestedIterator, transformer); - } - - private Transformer buildTransformer() { - // transform each string into an integer with a value of the string's length - return new Transformer() { - public Integer transform(String next) { - return new Integer(next.length()); - } - }; - } - - private Transformer buildTransformerUpcast() { - // transform each string into an integer with a value of the string's length - return new Transformer() { - public Integer transform(Object next) { - return new Integer(((String) next).length()); - } - }; - } - - private ListIterator buildInnerTransformationListIterator(ListIterator nestedIterator) { - // transform each string into an integer with a value of the string's length - return new TransformationListIterator(nestedIterator) { - @Override - protected Integer transform(String next) { - return new Integer(next.length()); - } - }; - } - - private ListIterator buildNestedIterator() { - return this.buildList().listIterator(); - } - - private ListIterator buildUnmodifiableNestedIterator() { - return this.buildUnmodifiableList().listIterator(); - } - - private List buildList() { - List l = new ArrayList(); - l.add("1"); - l.add("22"); - l.add("333"); - l.add("4444"); - l.add("55555"); - l.add("666666"); - l.add("7777777"); - l.add("88888888"); - return l; - } - - private List buildUnmodifiableList() { - return Collections.unmodifiableList(this.buildList()); - } -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java deleted file mode 100644 index 655d0835c0..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java +++ /dev/null @@ -1,197 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.TreeIterator; -import org.eclipse.jpt.utility.tests.internal.TestTools; - -public class TreeIteratorTests extends TestCase { - /** this will be populated with all the nodes created for the test */ - Collection nodes = new ArrayList(); - - public TreeIteratorTests(String name) { - super(name); - } - - @Override - protected void tearDown() throws Exception { - TestTools.clear(this); - super.tearDown(); - } - - public void testHasNext1() { - this.verifyHasNext(this.buildTreeIterator1()); - } - - public void testHasNext2() { - this.verifyHasNext(this.buildTreeIterator2()); - } - - private void verifyHasNext(Iterator iterator) { - int i = 0; - while (iterator.hasNext()) { - iterator.next(); - i++; - } - assertEquals(this.nodes.size(), i); - } - - public void testNext1() { - this.verifyNext(this.buildTreeIterator1()); - } - - public void testNext2() { - this.verifyNext(this.buildTreeIterator2()); - } - - private void verifyNext(Iterator iterator) { - while (iterator.hasNext()) { - assertTrue("bogus element", this.nodes.contains(iterator.next())); - } - } - - public void testNoSuchElementException1() { - this.verifyNoSuchElementException(this.buildTreeIterator1()); - } - - public void testNoSuchElementException2() { - this.verifyNoSuchElementException(this.buildTreeIterator2()); - } - - private void verifyNoSuchElementException(Iterator iterator) { - boolean exCaught = false; - while (iterator.hasNext()) { - iterator.next(); - } - try { - iterator.next(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown", exCaught); - } - - public void testRemove1() { - this.verifyRemove(this.buildTreeIterator1()); - } - - public void testRemove2() { - this.verifyRemove(this.buildTreeIterator2()); - } - - private void verifyRemove(Iterator iterator) { - String parentName = "child 2"; - String childName = "grandchild 2A"; - int startSize = this.childrenSize(parentName); - while (iterator.hasNext()) { - TreeNode node = iterator.next(); - if (node.getName().equals(childName)) { - iterator.remove(); - } - } - int endSize = this.childrenSize(parentName); - assertEquals(startSize - 1, endSize); - } - - private int childrenSize(String nodeName) { - for (Iterator stream = this.nodes.iterator(); stream.hasNext();) { - TreeNode node = stream.next(); - if (node.getName().equals(nodeName)) { - return node.childrenSize(); - } - } - throw new IllegalArgumentException(nodeName); - } - - /** - * build a tree iterator with an explicit midwife - */ - private Iterator buildTreeIterator1() { - return new TreeIterator(this.buildTree(), this.buildMidwife()); - } - - private TreeIterator.Midwife buildMidwife() { - return new TreeIterator.Midwife() { - public Iterator children(TreeNode next) { - return next.children(); - } - }; - } - - /** - * build a tree iterator with an override - */ - private Iterator buildTreeIterator2() { - return new TreeIterator(this.buildTree()) { - @Override - public Iterator children(TreeNode next) { - return next.children(); - } - }; - } - - private TreeNode buildTree() { - TreeNode root = new TreeNode("root"); - TreeNode child1 = new TreeNode(root, "child 1"); - new TreeNode(child1, "grandchild 1A"); - TreeNode child2 = new TreeNode(root, "child 2"); - new TreeNode(child2, "grandchild 2A"); - TreeNode grandchild2B = new TreeNode(child2, "grandchild 2B"); - new TreeNode(grandchild2B, "great-grandchild 2B1"); - new TreeNode(grandchild2B, "great-grandchild 2B2"); - TreeNode grandchild2C = new TreeNode(child2, "grandchild 2C"); - new TreeNode(grandchild2C, "great-grandchild 2C1"); - new TreeNode(root, "child 3"); - return root; - } - - private class TreeNode { - private String name; - private Collection children = new ArrayList(); - - public TreeNode(String name) { - super(); - TreeIteratorTests.this.nodes.add(this); // log node - this.name = name; - } - - public TreeNode(TreeNode parent, String name) { - this(name); - parent.addChild(this); - } - - public String getName() { - return this.name; - } - - private void addChild(TreeNode child) { - this.children.add(child); - } - - public Iterator children() { - return this.children.iterator(); - } - - public int childrenSize() { - return this.children.size(); - } - - @Override - public String toString() { - return "TreeNode(" + this.name + ")"; - } - } - -} diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml b/jpa/tests/org.eclipse.jpt.utility.tests/test.xml deleted file mode 100644 index 8598dc69f7..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3