From 5a50ff3aeafeb18e74f2ae005e86953fb4e38ceb Mon Sep 17 00:00:00 2001
From: pfullbright
Date: Wed, 25 Apr 2007 20:09:37 +0000
Subject: renamed
---
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.jdt.core.prefs | 12 +
.../org.eclipse.jpt.core/META-INF/MANIFEST.MF | 54 +
jpa/plugins/org.eclipse.jpt.core/build.properties | 22 +
jpa/plugins/org.eclipse.jpt.core/component.xml | 1 +
.../model/DaliEmfFormatter.xml | 258 +
jpa/plugins/org.eclipse.jpt.core/model/core.ecore | 529 ++
.../org.eclipse.jpt.core/model/coreModels.genmodel | 656 ++
jpa/plugins/org.eclipse.jpt.core/model/java.ecore | 90 +
.../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 | 270 +
.../org.eclipse.jpt.core/model/persistence.ecore | 70 +
jpa/plugins/org.eclipse.jpt.core/plugin.properties | 36 +
jpa/plugins/org.eclipse.jpt.core/plugin.xml | 187 +
.../property_files/jpa_core.properties | 18 +
.../property_files/jpa_validation.properties | 55 +
.../org.eclipse.jpt.core/schema/jpaPlatform.exsd | 122 +
.../org/eclipse/jpt/core/internal/AccessType.java | 237 +
.../jpt/core/internal/IAttributeMapping.java | 56 +
.../eclipse/jpt/core/internal/IJpaContentNode.java | 36 +
.../jpt/core/internal/IJpaCoreConstants.java | 28 +
.../eclipse/jpt/core/internal/IJpaDataSource.java | 35 +
.../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 | 125 +
.../org/eclipse/jpt/core/internal/IJpaProject.java | 113 +
.../jpt/core/internal/IJpaRootContentNode.java | 64 +
.../jpt/core/internal/IJpaSourceObject.java | 31 +
.../eclipse/jpt/core/internal/IMappingKeys.java | 30 +
.../jpt/core/internal/IPersistentAttribute.java | 92 +
.../eclipse/jpt/core/internal/IPersistentType.java | 105 +
.../org/eclipse/jpt/core/internal/ITextRange.java | 41 +
.../eclipse/jpt/core/internal/ITypeMapping.java | 128 +
.../org/eclipse/jpt/core/internal/IXmlEObject.java | 24 +
.../eclipse/jpt/core/internal/JpaCoreFactory.java | 209 +
.../eclipse/jpt/core/internal/JpaCoreMessages.java | 41 +
.../eclipse/jpt/core/internal/JpaCorePackage.java | 1783 ++++
.../eclipse/jpt/core/internal/JpaCorePlugin.java | 132 +
.../eclipse/jpt/core/internal/JpaDataSource.java | 185 +
.../org/eclipse/jpt/core/internal/JpaEObject.java | 128 +
.../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 | 543 ++
.../jpt/core/internal/JpaPlatformRegistry.java | 190 +
.../org/eclipse/jpt/core/internal/JpaProject.java | 645 ++
.../core/internal/JpaProjectAdapterFactory.java | 42 +
.../eclipse/jpt/core/internal/NullTypeMapping.java | 252 +
.../org/eclipse/jpt/core/internal/XmlEObject.java | 217 +
.../content/java/IJavaAttributeMapping.java | 47 +
.../java/IJavaAttributeMappingProvider.java | 30 +
.../internal/content/java/IJavaContentNodes.java | 24 +
.../internal/content/java/IJavaTypeMapping.java | 40 +
.../content/java/IJavaTypeMappingProvider.java | 27 +
.../core/internal/content/java/JavaEObject.java | 95 +
.../content/java/JavaJpaFileContentProvider.java | 37 +
.../content/java/JavaPersistentAttribute.java | 652 ++
.../internal/content/java/JavaPersistentType.java | 917 ++
.../internal/content/java/JpaCompilationUnit.java | 432 +
.../core/internal/content/java/JpaJavaFactory.java | 139 +
.../core/internal/content/java/JpaJavaPackage.java | 787 ++
.../content/java/mappings/AbstractJavaColumn.java | 672 ++
.../content/java/mappings/AbstractJavaTable.java | 761 ++
.../java/mappings/IntAnnotationElementAdapter.java | 100 +
.../core/internal/content/java/mappings/JPA.java | 294 +
.../content/java/mappings/JavaAbstractQuery.java | 626 ++
.../java/mappings/JavaAssociationOverride.java | 434 +
.../java/mappings/JavaAttributeMapping.java | 138 +
.../java/mappings/JavaAttributeOverride.java | 238 +
.../internal/content/java/mappings/JavaBasic.java | 913 ++
.../content/java/mappings/JavaBasicProvider.java | 228 +
.../internal/content/java/mappings/JavaColumn.java | 448 +
.../java/mappings/JavaDiscriminatorColumn.java | 726 ++
.../content/java/mappings/JavaEmbeddable.java | 99 +
.../java/mappings/JavaEmbeddableProvider.java | 54 +
.../content/java/mappings/JavaEmbedded.java | 543 ++
.../content/java/mappings/JavaEmbeddedId.java | 59 +
.../java/mappings/JavaEmbeddedIdProvider.java | 59 +
.../java/mappings/JavaEmbeddedProvider.java | 73 +
.../internal/content/java/mappings/JavaEntity.java | 2761 ++++++
.../content/java/mappings/JavaEntityProvider.java | 54 +
.../content/java/mappings/JavaGeneratedValue.java | 343 +
.../content/java/mappings/JavaGenerator.java | 574 ++
.../internal/content/java/mappings/JavaId.java | 736 ++
.../content/java/mappings/JavaIdProvider.java | 59 +
.../content/java/mappings/JavaJoinColumn.java | 477 +
.../content/java/mappings/JavaJoinTable.java | 788 ++
.../content/java/mappings/JavaManyToMany.java | 86 +
.../java/mappings/JavaManyToManyProvider.java | 59 +
.../content/java/mappings/JavaManyToOne.java | 85 +
.../java/mappings/JavaManyToOneProvider.java | 59 +
.../java/mappings/JavaMappedSuperclass.java | 125 +
.../mappings/JavaMappedSuperclassProvider.java | 54 +
.../mappings/JavaMultiRelationshipMapping.java | 509 ++
.../content/java/mappings/JavaNamedColumn.java | 461 +
.../java/mappings/JavaNamedNativeQuery.java | 353 +
.../content/java/mappings/JavaNamedQuery.java | 75 +
.../java/mappings/JavaNullAttributeMapping.java | 57 +
.../mappings/JavaNullAttributeMappingProvider.java | 60 +
.../content/java/mappings/JavaNullTypeMapping.java | 97 +
.../java/mappings/JavaNullTypeMappingProvider.java | 55 +
.../content/java/mappings/JavaOneToMany.java | 86 +
.../java/mappings/JavaOneToManyProvider.java | 59 +
.../content/java/mappings/JavaOneToOne.java | 289 +
.../java/mappings/JavaOneToOneProvider.java | 59 +
.../content/java/mappings/JavaOrderBy.java | 437 +
.../content/java/mappings/JavaOverride.java | 293 +
.../java/mappings/JavaPrimaryKeyJoinColumn.java | 695 ++
.../content/java/mappings/JavaQueryHint.java | 384 +
.../java/mappings/JavaRelationshipMapping.java | 559 ++
.../content/java/mappings/JavaSecondaryTable.java | 104 +
.../java/mappings/JavaSequenceGenerator.java | 340 +
.../mappings/JavaSingleRelationshipMapping.java | 606 ++
.../internal/content/java/mappings/JavaTable.java | 83 +
.../content/java/mappings/JavaTableGenerator.java | 1118 +++
.../content/java/mappings/JavaTransient.java | 59 +
.../java/mappings/JavaTransientProvider.java | 59 +
.../content/java/mappings/JavaTypeMapping.java | 262 +
.../content/java/mappings/JavaVersion.java | 377 +
.../content/java/mappings/JavaVersionProvider.java | 59 +
.../java/mappings/JpaJavaMappingsFactory.java | 505 ++
.../java/mappings/JpaJavaMappingsPackage.java | 4838 ++++++++++
.../util/JpaJavaMappingsAdapterFactory.java | 1904 ++++
.../java/mappings/util/JpaJavaMappingsSwitch.java | 2486 ++++++
.../content/java/util/JpaJavaAdapterFactory.java | 404 +
.../internal/content/java/util/JpaJavaSwitch.java | 444 +
.../internal/content/orm/AbstractXmlColumn.java | 929 ++
.../content/orm/AbstractXmlNamedColumn.java | 451 +
.../internal/content/orm/AbstractXmlQuery.java | 353 +
.../internal/content/orm/AbstractXmlTable.java | 913 ++
.../core/internal/content/orm/EntityMappings.java | 76 +
.../internal/content/orm/EntityMappingsForXml.java | 84 +
.../content/orm/EntityMappingsInternal.java | 1690 ++++
.../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 | 655 ++
.../jpt/core/internal/content/orm/OrmInit.java | 56 +
.../jpt/core/internal/content/orm/OrmPackage.java | 9394 ++++++++++++++++++++
.../content/orm/OrmXmlJpaFileContentProvider.java | 95 +
.../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 | 361 +
.../internal/content/orm/XmlAttributeOverride.java | 323 +
.../jpt/core/internal/content/orm/XmlBasic.java | 699 ++
.../internal/content/orm/XmlBasicProvider.java | 40 +
.../jpt/core/internal/content/orm/XmlColumn.java | 672 ++
.../content/orm/XmlDiscriminatorColumn.java | 922 ++
.../core/internal/content/orm/XmlEmbeddable.java | 88 +
.../content/orm/XmlEmbeddableProvider.java | 25 +
.../jpt/core/internal/content/orm/XmlEmbedded.java | 354 +
.../core/internal/content/orm/XmlEmbeddedId.java | 60 +
.../content/orm/XmlEmbeddedIdProvider.java | 40 +
.../internal/content/orm/XmlEmbeddedProvider.java | 40 +
.../jpt/core/internal/content/orm/XmlEntity.java | 82 +
.../core/internal/content/orm/XmlEntityForXml.java | 84 +
.../internal/content/orm/XmlEntityInternal.java | 1857 ++++
.../internal/content/orm/XmlEntityProvider.java | 24 +
.../internal/content/orm/XmlGeneratedValue.java | 285 +
.../core/internal/content/orm/XmlGenerator.java | 490 +
.../jpt/core/internal/content/orm/XmlId.java | 672 ++
.../core/internal/content/orm/XmlIdProvider.java | 40 +
.../core/internal/content/orm/XmlJoinColumn.java | 456 +
.../core/internal/content/orm/XmlJoinTable.java | 507 ++
.../core/internal/content/orm/XmlManyToMany.java | 61 +
.../content/orm/XmlManyToManyProvider.java | 40 +
.../core/internal/content/orm/XmlManyToOne.java | 60 +
.../internal/content/orm/XmlManyToOneProvider.java | 41 +
.../internal/content/orm/XmlMappedSuperclass.java | 104 +
.../content/orm/XmlMappedSuperclassProvider.java | 24 +
.../content/orm/XmlMultiRelationshipMapping.java | 24 +
.../orm/XmlMultiRelationshipMappingForXml.java | 83 +
.../orm/XmlMultiRelationshipMappingInternal.java | 553 ++
.../internal/content/orm/XmlNamedNativeQuery.java | 281 +
.../core/internal/content/orm/XmlNamedQuery.java | 45 +
.../content/orm/XmlNullAttributeMapping.java | 56 +
.../core/internal/content/orm/XmlOneToMany.java | 59 +
.../internal/content/orm/XmlOneToManyProvider.java | 40 +
.../jpt/core/internal/content/orm/XmlOneToOne.java | 240 +
.../internal/content/orm/XmlOneToOneProvider.java | 40 +
.../jpt/core/internal/content/orm/XmlOrderBy.java | 327 +
.../jpt/core/internal/content/orm/XmlOverride.java | 232 +
.../content/orm/XmlPersistentAttribute.java | 398 +
.../internal/content/orm/XmlPersistentType.java | 940 ++
.../content/orm/XmlPrimaryKeyJoinColumn.java | 411 +
.../core/internal/content/orm/XmlQueryHint.java | 281 +
.../content/orm/XmlRelationshipMapping.java | 451 +
.../internal/content/orm/XmlRootContentNode.java | 351 +
.../internal/content/orm/XmlSecondaryTable.java | 61 +
.../internal/content/orm/XmlSequenceGenerator.java | 281 +
.../content/orm/XmlSingleRelationshipMapping.java | 410 +
.../jpt/core/internal/content/orm/XmlTable.java | 70 +
.../internal/content/orm/XmlTableGenerator.java | 983 ++
.../core/internal/content/orm/XmlTransient.java | 60 +
.../internal/content/orm/XmlTransientProvider.java | 40 +
.../core/internal/content/orm/XmlTypeMapping.java | 653 ++
.../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 +
.../orm/resource/AttributeMappingTranslator.java | 50 +
.../orm/resource/AttributeMappingsTranslator.java | 119 +
.../orm/resource/AttributeNameTranslator.java | 27 +
.../orm/resource/AttributeOverrideTranslator.java | 70 +
.../content/orm/resource/BasicTranslator.java | 79 +
.../orm/resource/BooleanEnumeratorTranslator.java | 23 +
.../content/orm/resource/ColumnTranslator.java | 68 +
.../content/orm/resource/DebugTranslator.java | 431 +
.../resource/DiscriminatorColumnTranslator.java | 84 +
.../content/orm/resource/EmbeddableTranslator.java | 45 +
.../content/orm/resource/EmbeddedIdTranslator.java | 41 +
.../content/orm/resource/EmbeddedTranslator.java | 52 +
.../orm/resource/EmptyTagBooleanTranslator.java | 52 +
.../orm/resource/EntityMappingsTranslator.java | 116 +
.../content/orm/resource/EntityTranslator.java | 179 +
.../resource/EnumeratedTypeElementTranslator.java | 58 +
.../content/orm/resource/EnumeratorTranslator.java | 42 +
.../orm/resource/GeneratedValueTranslator.java | 60 +
.../content/orm/resource/GeneratorTranslator.java | 52 +
.../content/orm/resource/IdTranslator.java | 65 +
.../content/orm/resource/JoinColumnTranslator.java | 54 +
.../content/orm/resource/JoinTableTranslator.java | 87 +
.../content/orm/resource/ManyToManyTranslator.java | 49 +
.../content/orm/resource/ManyToOneTranslator.java | 38 +
.../orm/resource/MappedSuperclassTranslator.java | 56 +
.../resource/MultiObjectDependencyTranslator.java | 63 +
.../orm/resource/MultiRelationshipTranslator.java | 59 +
.../orm/resource/NamedNativeQueryTranslator.java | 77 +
.../content/orm/resource/NamedQueryTranslator.java | 67 +
.../content/orm/resource/OneToManyTranslator.java | 51 +
.../content/orm/resource/OneToOneTranslator.java | 45 +
.../content/orm/resource/OrderByRefTranslator.java | 79 +
.../content/orm/resource/OrmXmlMapper.java | 168 +
.../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 | 31 +
.../orm/resource/SecondaryTableTranslator.java | 57 +
.../orm/resource/SequenceGeneratorTranslator.java | 42 +
.../orm/resource/SingleRelationshipTranslator.java | 55 +
.../orm/resource/TableGeneratorTranslator.java | 67 +
.../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 | 93 +
.../content/orm/resource/VersionTranslator.java | 36 +
.../content/orm/util/OrmAdapterFactory.java | 2284 +++++
.../core/internal/content/orm/util/OrmSwitch.java | 3090 +++++++
.../internal/content/persistence/JavaClassRef.java | 168 +
.../content/persistence/MappingFileRef.java | 231 +
.../internal/content/persistence/Persistence.java | 348 +
.../content/persistence/PersistenceFactory.java | 278 +
.../content/persistence/PersistenceInit.java | 55 +
.../content/persistence/PersistencePackage.java | 1379 +++
.../content/persistence/PersistenceUnit.java | 877 ++
.../PersistenceUnitTransactionType.java | 212 +
.../PersistenceXmlJpaFileContentProvider.java | 96 +
.../persistence/PersistenceXmlRootContentNode.java | 357 +
.../internal/content/persistence/Properties.java | 157 +
.../internal/content/persistence/Property.java | 237 +
.../persistence/resource/BooleanTranslator.java | 32 +
.../resource/IPersistenceXmlContentNodes.java | 17 +
.../resource/JavaClassRefTranslator.java | 33 +
.../resource/MappingFileTranslator.java | 33 +
.../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 | 14 +
.../facet/IJpaFacetDataModelProperties.java | 35 +
.../internal/facet/JpaFacetDataModelProvider.java | 100 +
.../internal/facet/JpaFacetInstallDelegate.java | 57 +
.../facet/JpaFacetPostInstallDelegate.java | 140 +
.../internal/facet/JpaFacetUninstallDelegate.java | 48 +
.../jpt/core/internal/facet/JpaFacetUtils.java | 111 +
.../core/internal/jdtutility/ASTNodeTextRange.java | 39 +
.../jdtutility/AbstractAnnotationAdapter.java | 169 +
.../AbstractDeclarationAnnotationAdapter.java | 148 +
.../jdtutility/AbstractExpressionConverter.java | 50 +
...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 | 218 +
.../jdtutility/BooleanAnnotationAdapter.java | 77 +
.../BooleanStringExpressionConverter.java | 54 +
.../CharacterStringExpressionConverter.java | 56 +
...inationIndexedDeclarationAnnotationAdapter.java | 490 +
...versionDeclarationAnnotationElementAdapter.java | 112 +
.../jdtutility/DeclarationAnnotationAdapter.java | 64 +
.../DeclarationAnnotationElementAdapter.java | 48 +
.../EnumDeclarationAnnotationElementAdapter.java | 104 +
.../internal/jdtutility/ExpressionConverter.java | 35 +
...ressionDeclarationAnnotationElementAdapter.java | 354 +
.../core/internal/jdtutility/FieldAttribute.java | 91 +
.../jdtutility/IndexedAnnotationAdapter.java | 28 +
.../IndexedDeclarationAnnotationAdapter.java | 28 +
.../jpt/core/internal/jdtutility/JDTTools.java | 201 +
.../jpt/core/internal/jdtutility/Member.java | 394 +
.../jdtutility/MemberAnnotationAdapter.java | 24 +
.../jdtutility/MemberAnnotationElementAdapter.java | 103 +
.../jdtutility/MemberIndexedAnnotationAdapter.java | 70 +
.../core/internal/jdtutility/MethodAttribute.java | 97 +
.../internal/jdtutility/ModifiedDeclaration.java | 442 +
.../jdtutility/NameStringExpressionConverter.java | 57 +
.../NestedDeclarationAnnotationAdapter.java | 93 +
.../NestedIndexedDeclarationAnnotationAdapter.java | 331 +
.../NullDeclarationAnnotationAdapter.java | 80 +
.../NullDeclarationAnnotationElementAdapter.java | 53 +
.../jdtutility/NullExpressionConverter.java | 52 +
.../NumberStringExpressionConverter.java | 54 +
.../PrimitiveTypeStringExpressionConverter.java | 61 +
.../ShortCircuitAnnotationElementAdapter.java | 102 +
.../jdtutility/SimpleBooleanAnnotationAdapter.java | 85 +
.../SimpleDeclarationAnnotationAdapter.java | 64 +
.../SimpleTypeStringExpressionConverter.java | 63 +
.../jdtutility/StringExpressionConverter.java | 55 +
.../eclipse/jpt/core/internal/jdtutility/Type.java | 78 +
.../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 | 238 +
.../internal/mappings/IAbstractJoinColumn.java | 115 +
.../internal/mappings/IAssociationOverride.java | 152 +
.../core/internal/mappings/IAttributeOverride.java | 44 +
.../eclipse/jpt/core/internal/mappings/IBasic.java | 193 +
.../jpt/core/internal/mappings/IColumn.java | 119 +
.../jpt/core/internal/mappings/IColumnMapping.java | 37 +
.../internal/mappings/IDiscriminatorColumn.java | 235 +
.../jpt/core/internal/mappings/IEmbeddable.java | 25 +
.../jpt/core/internal/mappings/IEmbedded.java | 144 +
.../jpt/core/internal/mappings/IEmbeddedId.java | 25 +
.../jpt/core/internal/mappings/IEntity.java | 636 ++
.../core/internal/mappings/IGeneratedValue.java | 87 +
.../jpt/core/internal/mappings/IGenerator.java | 177 +
.../eclipse/jpt/core/internal/mappings/IId.java | 163 +
.../jpt/core/internal/mappings/IJoinColumn.java | 64 +
.../jpt/core/internal/mappings/IJoinTable.java | 281 +
.../jpt/core/internal/mappings/IManyToMany.java | 23 +
.../jpt/core/internal/mappings/IManyToOne.java | 23 +
.../core/internal/mappings/IMappedSuperclass.java | 25 +
.../mappings/IMultiRelationshipMapping.java | 90 +
.../jpt/core/internal/mappings/INamedColumn.java | 136 +
.../core/internal/mappings/INamedNativeQuery.java | 84 +
.../jpt/core/internal/mappings/INamedQuery.java | 25 +
.../core/internal/mappings/INonOwningMapping.java | 59 +
.../jpt/core/internal/mappings/IOneToMany.java | 23 +
.../jpt/core/internal/mappings/IOneToOne.java | 24 +
.../jpt/core/internal/mappings/IOrderBy.java | 90 +
.../jpt/core/internal/mappings/IOverride.java | 81 +
.../internal/mappings/IPrimaryKeyJoinColumn.java | 23 +
.../eclipse/jpt/core/internal/mappings/IQuery.java | 104 +
.../jpt/core/internal/mappings/IQueryHint.java | 84 +
.../internal/mappings/IRelationshipMapping.java | 134 +
.../core/internal/mappings/ISecondaryTable.java | 23 +
.../core/internal/mappings/ISequenceGenerator.java | 87 +
.../mappings/ISingleRelationshipMapping.java | 180 +
.../eclipse/jpt/core/internal/mappings/ITable.java | 245 +
.../core/internal/mappings/ITableGenerator.java | 386 +
.../jpt/core/internal/mappings/ITransient.java | 25 +
.../jpt/core/internal/mappings/IVersion.java | 76 +
.../core/internal/mappings/InheritanceType.java | 303 +
.../internal/mappings/JpaCoreMappingsFactory.java | 373 +
.../internal/mappings/JpaCoreMappingsPackage.java | 8177 +++++++++++++++++
.../jpt/core/internal/mappings/OrderingType.java | 240 +
.../mappings/RelationshipMappingTools.java | 42 +
.../jpt/core/internal/mappings/TemporalType.java | 296 +
.../util/JpaCoreMappingsAdapterFactory.java | 984 ++
.../mappings/util/JpaCoreMappingsSwitch.java | 1354 +++
.../platform/AbstractJoinColumnContext.java | 56 +
.../platform/AssociationOverrideContext.java | 130 +
.../platform/AttributeOverrideContext.java | 130 +
.../jpt/core/internal/platform/BaseContext.java | 59 +
.../core/internal/platform/BaseJpaPlatform.java | 175 +
.../internal/platform/BaseJpaProjectContext.java | 323 +
.../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 | 105 +
.../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 | 288 +
.../jpt/core/internal/platform/JavaIdContext.java | 117 +
.../internal/platform/JavaManyToManyContext.java | 18 +
.../internal/platform/JavaManyToOneContext.java | 24 +
.../platform/JavaMappedSuperclassContext.java | 25 +
.../JavaMultiRelationshipMappingContext.java | 157 +
.../platform/JavaNullAttributeMappingContext.java | 25 +
.../platform/JavaNullTypeMappingContext.java | 24 +
.../internal/platform/JavaOneToManyContext.java | 29 +
.../internal/platform/JavaOneToOneContext.java | 24 +
.../platform/JavaPersistentAttributeContext.java | 115 +
.../platform/JavaRelationshipMappingContext.java | 51 +
.../JavaSingleRelationshipMappingContext.java | 124 +
.../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 | 158 +
.../internal/platform/NullGeneratorRepository.java | 41 +
.../internal/platform/PersistenceUnitContext.java | 484 +
.../platform/PrimaryKeyJoinColumnContext.java | 37 +
.../jpt/core/internal/platform/TableContext.java | 81 +
.../jpt/core/internal/platform/TypeContext.java | 20 +
.../internal/platform/XmlAttributeContext.java | 141 +
.../core/internal/platform/XmlBasicContext.java | 124 +
.../internal/platform/XmlEmbeddableContext.java | 18 +
.../core/internal/platform/XmlEmbeddedContext.java | 106 +
.../internal/platform/XmlEmbeddedIdContext.java | 21 +
.../core/internal/platform/XmlEntityContext.java | 364 +
.../jpt/core/internal/platform/XmlIdContext.java | 177 +
.../internal/platform/XmlManyToManyContext.java | 22 +
.../internal/platform/XmlManyToOneContext.java | 19 +
.../platform/XmlMappedSuperclassContext.java | 19 +
.../XmlMultiRelationshipMappingContext.java | 72 +
.../platform/XmlNullAttributeMappingContext.java | 19 +
.../internal/platform/XmlOneToManyContext.java | 29 +
.../core/internal/platform/XmlOneToOneContext.java | 20 +
.../platform/XmlRelationshipMappingContext.java | 76 +
.../XmlSingleRelationshipMappingContext.java | 145 +
.../internal/platform/XmlTransientContext.java | 22 +
.../jpt/core/internal/platform/XmlTypeContext.java | 368 +
.../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 | 194 +
.../core/internal/util/JpaCoreAdapterFactory.java | 524 ++
.../jpt/core/internal/util/JpaCoreSwitch.java | 675 ++
.../validation/IJpaValidationMessages.java | 104 +
.../jpt/core/internal/validation/JpaHelper.java | 38 +
.../internal/validation/JpaValidationMessages.java | 64 +
.../jpt/core/internal/validation/JpaValidator.java | 54 +
465 files changed, 123567 insertions(+)
create mode 100644 jpa/plugins/org.eclipse.jpt.core/.classpath
create mode 100644 jpa/plugins/org.eclipse.jpt.core/.cvsignore
create mode 100644 jpa/plugins/org.eclipse.jpt.core/.project
create mode 100644 jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs
create mode 100644 jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF
create mode 100644 jpa/plugins/org.eclipse.jpt.core/build.properties
create mode 100644 jpa/plugins/org.eclipse.jpt.core/component.xml
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/core.ecore
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/java.ecore
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/javaModel.ecore
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/javaModel.genmodel
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
create mode 100644 jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore
create mode 100644 jpa/plugins/org.eclipse.jpt.core/plugin.properties
create mode 100644 jpa/plugins/org.eclipse.jpt.core/plugin.xml
create mode 100644 jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties
create mode 100644 jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
create mode 100644 jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AccessType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaContentNode.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaCoreConstants.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaEObject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFile.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFileContentProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaModel.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaRootContentNode.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaSourceObject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IMappingKeys.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITextRange.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITypeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IXmlEObject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCoreFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCoreMessages.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePlugin.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaEObject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFile.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFileContentRegistry.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModel.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/NullTypeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlEObject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMappingProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaContentNodes.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaTypeMappingProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaEObject.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaJpaFileContentProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/IntAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JPA.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAbstractQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAssociationOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAttributeOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasicProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaDiscriminatorColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddableProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedIdProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntityProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGeneratedValue.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaIdProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToManyProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOneProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclassProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedNativeQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullAttributeMappingProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNullTypeMappingProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToManyProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOneProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOrderBy.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaPrimaryKeyJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaQueryHint.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSequenceGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSingleRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransient.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTransientProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTypeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersion.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaVersionProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/util/JpaJavaSwitch.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappings.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsForXml.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/EntityMappingsInternal.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlAttributeMappingProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlColumnMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlContentNodes.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/IXmlTypeMappingProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmInit.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlResource.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaults.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsForXml.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitDefaultsInternal.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadata.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataForXml.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/PersistenceUnitMetadataInternal.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAssociationOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlAttributeOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasicProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddableProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedIdProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntity.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityForXml.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGeneratedValue.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToMany.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToManyProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOneProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclassProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedNativeQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNamedQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlNullAttributeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToMany.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToManyProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOneProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOrderBy.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlQueryHint.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRootContentNode.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSequenceGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSingleRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransient.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTransientProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTypeMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersion.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlVersionProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractColumnTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AccessTypeElementTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AssociationOverrideTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeMappingsTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeNameTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AttributeOverrideTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BasicTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/BooleanEnumeratorTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ColumnTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DebugTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddableTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedIdTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmbeddedTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EmptyTagBooleanTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityMappingsTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EntityTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratedTypeElementTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/EnumeratorTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratedValueTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/GeneratorTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/IdTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinColumnTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/JoinTableTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToOneTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiObjectDependencyTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedNativeQueryTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/NamedQueryTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToOneTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByRefTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlResourceImpl.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitDefaultsTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PersistenceUnitMetadataTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/PrimaryKeyJoinColumnTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/QueryHintTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SecondaryTableTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SequenceGeneratorTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/SingleRelationshipTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableGeneratorTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TableTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TemporalTypeElementTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TransientTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeJavaClassTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/TypeMappingsTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/VersionTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/MappingFileRef.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Persistence.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceInit.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistencePackage.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnit.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceUnitTransactionType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlRootContentNode.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Properties.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/Property.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/BooleanTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/IPersistenceXmlContentNodes.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/JavaClassRefTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/MappingFileTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceResource.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXMLMapper.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/PersistenceXmlResourceFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/resource/TransactionTypeTranslator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/util/PersistenceSwitch.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/IJpaFacetDataModelProperties.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AttributeAnnotationTools.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanStringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberStringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultEagerFetchType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultFalseBoolean.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultLazyFetchType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DefaultTrueBoolean.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/DiscriminatorType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/EnumType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/GenerationType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAssociationOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAttributeOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IBasic.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumnMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IDiscriminatorColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbedded.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEmbeddedId.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IEntity.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGeneratedValue.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IId.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToMany.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IManyToOne.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMappedSuperclass.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedNativeQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INamedQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToMany.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOneToOne.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOrderBy.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOverride.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IPrimaryKeyJoinColumn.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQuery.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IQueryHint.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISequenceGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISingleRelationshipMapping.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITransient.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IVersion.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/InheritanceType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/OrderingType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/RelationshipMappingTools.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/TemporalType.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AbstractJoinColumnContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AssociationOverrideContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/AttributeOverrideContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaPlatform.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/BaseJpaProjectContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/ColumnContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/DefaultsContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GeneratorRepository.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/IGeneratorRepository.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaAttributeContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaBasicContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddableContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEmbeddedIdContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaIdContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToManyContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaManyToOneContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMappedSuperclassContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullAttributeMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaNullTypeMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToManyContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaOneToOneContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaPersistentAttributeContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaRelationshipMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaSingleRelationshipMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTransientContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaTypeContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaVersionContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinColumnContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JoinTableContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/MappingFileContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/NullGeneratorRepository.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PersistenceUnitContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/PrimaryKeyJoinColumnContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TableContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/TypeContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlAttributeContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlBasicContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddableContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEmbeddedIdContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlIdContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToManyContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlManyToOneContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMappedSuperclassContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlNullAttributeMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToManyContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlOneToOneContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlRelationshipMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlSingleRelationshipMappingContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTransientContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlVersionContext.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/generic/GenericPlatform.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreAdapterFactory.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/util/JpaCoreSwitch.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/IJpaValidationMessages.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
create mode 100644 jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java
diff --git a/jpa/plugins/org.eclipse.jpt.core/.classpath b/jpa/plugins/org.eclipse.jpt.core/.classpath
new file mode 100644
index 0000000000..8f257414e6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/.classpath
@@ -0,0 +1,8 @@
+
+
+ * 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+ * 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) benull
.
+ */
+ IJpaContentNode getContentNode(int offset);
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..846217ebc7
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFileContentProvider.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+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
new file mode 100644
index 0000000000..343ded1f2c
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaModel.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+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.
+ */
+ Iteratornull
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+ * The following features are supported: + *
""
.
+ * 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) benull
.
+ */
+ IJpaContentNode getContentNode(int offset);
+
+ /**
+ * Handle java change as befits this file content
+ */
+ void handleJavaElementChangedEvent(ElementChangedEvent event);
+
+ /**
+ * Dispose before removed from model
+ */
+ void dispose();
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..4cb58e7ee8
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaSourceObject.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Oracle. All rights reserved. This program and
+ * the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, 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 source location for this object.
+ */
+ ITextRange getTextRange();
+}
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
new file mode 100644
index 0000000000..f219fb0a6e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IMappingKeys.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * 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 MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY = "manyToMany";
+ String MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY = "manyToOne";
+ String ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY = "oneToOne";
+ String ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY = "oneToMany";
+ String EMBEDDED_ATTRIBUTE_MAPPING_KEY = "embedded";
+ String EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY = "embeddedId";
+ String TRANSIENT_ATTRIBUTE_MAPPING_KEY = "transient";
+ String VERSION_ATTRIBUTE_MAPPING_KEY = "version";
+
+}
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
new file mode 100644
index 0000000000..39bfb346f1
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * 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: + *
+ * 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 org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute_MappingKey() + * @model required="true" changeable="false" + * @generated + */ + String getMappingKey(); + + void setMappingKey(String value, boolean default_); + + /** + * Returns an iterator on all mapping keys that are available for this attribute. + */ + Iterator candidateMappingKeys(); + + /** + * + * + * @model kind="operation" required="true" + * @generated + */ + IAttributeMapping getMapping(); + + /** + * + * + * @model required="true" + * @generated + */ + ITypeMapping typeMapping(); + + /** + * + * + * @model kind="operation" + * @generated + */ + String getName(); + + /** + * Return the java Attribute that this IPersistentAttribute is associated with + * @return + */ + Attribute getAttribute(); + + String defaultKey(); + + /** + * If the attribute is mapped to a primary key column, return the + * column's name, otherwise return null. + */ + String primaryKeyColumnName(); +} \ No newline at end of file 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 new file mode 100644 index 0000000000..324f0c79b6 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentType.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2006, 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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: + *
+ * 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+ * 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 + * @return + */ + Iterator+ * This interface is not intended to be implemented by clients. + *
+ */ +public interface ITextRange +{ + + /** + * Returns the length of the text. + * + * @return the length of the text + */ + int getLength(); + + /** + * Returns the offset of the text. + * + * @return the offset of the text + */ + int getOffset(); + + /** + * Retruns the line number in the text + * + * @return line number + */ + int getLineNumber(); + +} 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 new file mode 100644 index 0000000000..8329aac842 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ITypeMapping.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package org.eclipse.jpt.core.internal; + +import java.util.Iterator; +import org.eclipse.jpt.core.internal.mappings.ITable; +import org.eclipse.jpt.db.internal.Table; + +/** + * + * A representation of the model object 'I Type Mapping'. + * + * + *+ * The following features are supported: + *
+ * 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. + */ + IteratorNote: 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(); + JavaRefPackage.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.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.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 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(2); + } + + /** + * 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.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 attribute '{@link org.eclipse.jpt.core.internal.IPersistentAttribute#getMappingKey Mapping Key}'. + * + * + * @return the meta object for the attribute 'Mapping Key'. + * @see org.eclipse.jpt.core.internal.IPersistentAttribute#getMappingKey() + * @see #getIPersistentAttribute() + * @generated + */ + public EAttribute getIPersistentAttribute_MappingKey() { + return (EAttribute) 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); + 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); + createEAttribute(iPersistentAttributeEClass, IPERSISTENT_ATTRIBUTE__MAPPING_KEY); + 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); + 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); + 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); + initEAttribute(getIPersistentAttribute_MappingKey(), ecorePackage.getEString(), "mappingKey", null, 1, 1, IPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + addEOperation(iPersistentAttributeEClass, this.getIAttributeMapping(), "getMapping", 1, 1); + addEOperation(iPersistentAttributeEClass, this.getITypeMapping(), "typeMapping", 1, 1); + addEOperation(iPersistentAttributeEClass, theEcorePackage.getEString(), "getName", 0, 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 + *
"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$
+
+ /**
+ * 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 JpaCorePlugin 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 JpaCorePlugin() {
+ 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/JpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java
new file mode 100644
index 0000000000..70a2254409
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaDataSource.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0, which accompanies this distribution 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.ConnectionProfileRepository;
+
+/**
+ *
+ * A representation of the model object 'Jpa Data Source'.
+ *
+ *
+ * + * The following features are supported: + *
+ * 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 setConnectionProfileName(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 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(); + } +} // JpaDataSource 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 new file mode 100644 index 0000000000..3ac5a1f76d --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaEObject.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2006, 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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; + +/** + * + * + * + * + * @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+ * The following features are supported: + *
+ * 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; + } +} \ No newline at end of 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 new file mode 100644 index 0000000000..054f61261d --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaFileContentRegistry.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0, which accompanies this distribution 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) { + JpaCorePlugin.log(e); + } + catch (CoreException e) { + JpaCorePlugin.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 new file mode 100644 index 0000000000..2bf6b6e688 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModel.java @@ -0,0 +1,264 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +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: + *
+ * 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 EListnull
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, JpaCorePlugin.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+ * The following features are supported: + *
+ * 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 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) { + JpaDataSource ds = JpaCoreFactory.eINSTANCE.createJpaDataSource(); + ds.setConnectionProfileName(connectionProfileName); + setDataSource(ds); + } + + @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+ * 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 getTextRange() { + throw new UnsupportedOperationException("getTextRange()"); + } + + /** + * + * + * @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 boolean tableNameIsInvalid(String tableName) { + return false; + } + + public Iterator+ * The following features are supported: + *
+ * 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 org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIPersistentAttribute_MappingKey() + * @model required="true" changeable="false" + * @generated + */ + public String getMappingKey() { + return mappingKey; + } + + /** + * 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 setDefaultMapping(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)); + } + + /** + * 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. + * + * + * @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)); + } + + /** + * 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 setSpecifiedMapping(IJavaAttributeMapping newMapping) { + if (this.specifiedMapping != null) { + this.attribute.removeAnnotation(this.annotationAdapterForAttributeMappingKey(this.specifiedMapping.getKey())); + } + if (newMapping != null) { + this.attribute.newMarkerAnnotation(this.annotationAdapterForAttributeMappingKey(newMapping.getKey())); + } + this.setSpecifiedMappingGen(newMapping); + } + + protected void setMappingKeyInternal(String newMappingKey) { + String oldMappingKey = mappingKey; + mappingKey = newMappingKey; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__MAPPING_KEY, oldMappingKey, mappingKey)); + } + + /** + * 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 setMappingKey(String newMappingKey, boolean default_) { + if (default_) { + setSpecifiedMapping(null); + setMappingKeyInternal(newMappingKey); + return; + } + this.setSpecifiedMapping(this.buildMapping(newMappingKey)); + if (this.specifiedMapping != null) { + this.specifiedMapping.initialize(); + } + this.setMappingKeyInternal(newMappingKey); + //TODO need to support mapping morphing, 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 IJavaAttributeMapping getMapping() { + return getSpecifiedMapping() != null ? getSpecifiedMapping() : getDefaultMapping(); + } + + public String getName() { + return getAttribute().attributeName(); + } + + /** + * + * + * @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_KEY : + return getMappingKey(); + 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_KEY : + return MAPPING_KEY_EDEFAULT == null ? mappingKey != null : !MAPPING_KEY_EDEFAULT.equals(mappingKey); + 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_KEY : + return JpaCorePackage.IPERSISTENT_ATTRIBUTE__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 == IPersistentAttribute.class) { + switch (baseFeatureID) { + case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING_KEY : + return JpaJavaPackage.JAVA_PERSISTENT_ATTRIBUTE__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(')'); + return result.toString(); + } + + public IPersistentType getPersistentType() { + return (IPersistentType) this.eContainer(); + } + + public ITypeMapping typeMapping() { + return this.getPersistentType().getMapping(); + } + + private IJavaAttributeMappingProvider attributeMappingProviderFor(String attributeMappingKey) { + for (IJavaAttributeMappingProvider provider : this.attributeMappingProviders) { + if (provider.key() == attributeMappingKey) { + return provider; + } + } + throw new IllegalArgumentException("Unsupported attribute mapping key: " + attributeMappingKey); + } + + private DeclarationAnnotationAdapter annotationAdapterForAttributeMappingKey(String attributeMappingKey) { + return this.attributeMappingProviderFor(attributeMappingKey).declarationAnnotationAdapter(); + } + + public Iterator+ * The following features are supported: + *
+ * 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""
.
+ * 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 extends JavaPersistentAttribute>) 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) { + this.type = new Type(iType); + this.setAccess(this.javaAccessType(this.getType().astRoot())); + this.createAndSetPersistentTypeMappingFromJava(this.javaTypeMappingKey()); + } + + 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().jdtType(); + } + + /** + * 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.getType().astRoot(); + this.setAccess(this.javaAccessType(astRoot)); + String jpaKey = this.getMapping().getKey(); + String javaKey = this.javaTypeMappingKey(); + if (jpaKey != javaKey) { + this.createAndSetPersistentTypeMappingFromJava(javaKey); + } + this.getMapping().updateFromJava(astRoot); + this.updatePersistentAttributes(astRoot); + } + + private void updatePersistentAttributes(CompilationUnit astRoot) { + List+ * The following features are supported: + *
""
.
+ * 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 EListNote: 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(); + JavaRefPackage.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.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 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.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 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 + *
+ * 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(); + } + + public ITextRange getTableTextRange() { + return this.elementTextRange(this.tableDeclarationAdapter); + } + + @Override + public void updateFromJava(CompilationUnit astRoot) { + super.updateFromJava(astRoot); + this.setSpecifiedTable((String) 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))); + } + + public Column dbColumn() { + Table table = this.dbTable(); + return (table == null) ? null : table.columnNamed(this.getName()); + } + + public Table dbTable() { + return this.getOwner().dbTable(getTable()); + } + + public boolean isConnected() { + ConnectionProfile connectionProfile = this.getJpaProject().connectionProfile(); + return connectionProfile != null && connectionProfile.isConnected(); + } + + public boolean isResolved() { + return this.dbColumn() != null; + } +} 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 new file mode 100644 index 0000000000..c7f4d8734b --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java @@ -0,0 +1,761 @@ +/******************************************************************************* + * Copyright (c) 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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.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.INamedColumn; +import org.eclipse.jpt.core.internal.mappings.ITable; +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.ConnectionProfile; +import org.eclipse.jpt.db.internal.Schema; +import org.eclipse.jpt.db.internal.Table; + +/** + * + * 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; + + 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(INamedColumn.class)) { + case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME : + this.nameAdapter.setValue(notification.getNewValue()); + break; + case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA : + this.schemaAdapter.setValue(notification.getNewValue()); + break; + case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG : + this.catalogAdapter.setValue(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; + } + + /** + * + * + * @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(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @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; + } + 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; + } + 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); + } + 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; + 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; + 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 getNameTextRange() { + return this.elementTextRange(this.nameDeclarationAdapter); + } + + public ITextRange getSchemaTextRange() { + return this.elementTextRange(this.schemaDeclarationAdapter); + } + + public ITextRange getCatalogTextRange() { + return this.elementTextRange(this.catalogDeclarationAdapter); + } + + //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; + } + + //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((String) this.nameAdapter.getValue(astRoot)); + this.setSpecifiedSchema((String) this.schemaAdapter.getValue(astRoot)); + this.setSpecifiedCatalog((String) this.catalogAdapter.getValue(astRoot)); + } + + public ITextRange getTextRange() { + ITextRange textRange = this.member.annotationTextRange(this.daa); + return (textRange != null) ? textRange : this.getOwner().getTextRange(); + } + + public Table dbTable() { + Schema schema = this.dbSchema(); + return (schema == null) ? null : schema.tableNamed(this.getName()); + } + + public Schema dbSchema() { + return this.getJpaProject().connectionProfile().getDatabase().schemaNamed(this.getSchema()); + } + + public boolean isConnected() { + ConnectionProfile connectionProfile = this.getJpaProject().connectionProfile(); + return connectionProfile != null && connectionProfile.isConnected(); + } + + 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)); + } +} 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 new file mode 100644 index 0000000000..13abf2fcbb --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/IntAnnotationElementAdapter.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +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 Object convertIntToValue(int intValue) { + return this.convertStringToValue(this.convertIntToString(intValue)); + } + + /** + * assume the wrapped adapter expects a string + */ + protected Object 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 new file mode 100644 index 0000000000..8675c6da6f --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JPA.java @@ -0,0 +1,294 @@ +/******************************************************************************* + * Copyright (c) 2006, 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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 new file mode 100644 index 0000000000..62fa42bc10 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaAbstractQuery.java @@ -0,0 +1,626 @@ +/******************************************************************************* + * Copyright (c) 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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+ * 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+ * 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+ * 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+ * 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); + } + + public void updateFromJava(CompilationUnit astRoot) { + super.updateFromJava(astRoot); + ((JavaColumn) getColumn()).updateFromJava(astRoot); + } + + // ********** 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); + } +} // JavaAttributeOverride 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 new file mode 100644 index 0000000000..4603d0bace --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java @@ -0,0 +1,913 @@ +/******************************************************************************* + * Copyright (c) 2006, 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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.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.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; + +/** + * + * 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))); + ((JavaColumn) this.column).updateFromJava(astRoot); + this.setLob(this.lobAdapter.getValue(astRoot)); + this.updateTemporalFromJava(astRoot); + this.updateEnumeratedFromJava(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) { + 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); + } + } + + // ********** 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); + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..24cefa0a12 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasicProvider.java @@ -0,0 +1,228 @@ +/******************************************************************************* + * Copyright (c) 2006, 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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().jdtType()); + } + + 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/JavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java new file mode 100644 index 0000000000..9833789b7c --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java @@ -0,0 +1,448 @@ +/******************************************************************************* + * Copyright (c) 2006, 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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 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 new file mode 100644 index 0000000000..e59295ef9d --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaDiscriminatorColumn.java @@ -0,0 +1,726 @@ +/******************************************************************************* + * Copyright (c) 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0, which accompanies this distribution 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.ShortCircuitAnnotationElementAdapter; +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.IEntity; +import org.eclipse.jpt.core.internal.mappings.INamedColumn; +import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; +import org.eclipse.jpt.db.internal.Table; + +/** + * + * 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 JavaEObject + implements IDiscriminatorColumn +{ + private Type type; + + private AnnotationElementAdapter discriminatorTypeAdapter; + + private AnnotationElementAdapter nameAdapter; + + private IntAnnotationElementAdapter lengthAdapter; + + private AnnotationElementAdapter columnDefinitionAdapter; + + private static final DeclarationAnnotationAdapter ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.DISCRIMINATOR_COLUMN); + + private static final DeclarationAnnotationElementAdapter DISCRIMINATOR_TYPE_ADAPTER = buildDiscriminatorTypeAdapter(); + + private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = buildAnnotationElementAdapter(JPA.DISCRIMINATOR_COLUMN__NAME); + + private static final DeclarationAnnotationElementAdapter LENGTH_ADAPTER = buildAnnotationElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH); + + private static final DeclarationAnnotationElementAdapter COLUMN_DEFINITION_ADAPTER = buildAnnotationElementAdapter(JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION); + + /** + * 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 #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 #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * 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 #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 #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; + + /** + * + * + * @generated NOT + */ + protected JavaDiscriminatorColumn() { + throw new UnsupportedOperationException(); + } + + protected JavaDiscriminatorColumn(Type type) { + super(); + this.type = type; + this.discriminatorTypeAdapter = new ShortCircuitAnnotationElementAdapter(this.type, DISCRIMINATOR_TYPE_ADAPTER); + this.nameAdapter = new ShortCircuitAnnotationElementAdapter(this.type, NAME_ADAPTER); + this.lengthAdapter = new IntAnnotationElementAdapter(new ShortCircuitAnnotationElementAdapter(this.type, LENGTH_ADAPTER)); + this.columnDefinitionAdapter = new ShortCircuitAnnotationElementAdapter(this.type, COLUMN_DEFINITION_ADAPTER); + } + + @Override + protected void notifyChanged(Notification notification) { + super.notifyChanged(notification); + switch (notification.getFeatureID(INamedColumn.class)) { + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME : + this.nameAdapter.setValue(notification.getNewValue()); + break; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + this.discriminatorTypeAdapter.setValue(((DiscriminatorType) notification.getNewValue()).convertToJavaAnnotationValue()); + break; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + this.columnDefinitionAdapter.setValue(notification.getNewValue()); + 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 '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 #setDefaultName(String) + * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIDiscriminatorColumn_DefaultName() + * @model + * @generated + */ + public String getDefaultName() { + return defaultName; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn#getDefaultName Default Name}' attribute. + * + * + * @param value the new value of the 'Default Name' attribute. + * @see #getDefaultName() + * @generated + */ + public void setDefaultName(String newDefaultName) { + String oldDefaultName = defaultName; + defaultName = newDefaultName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_NAME, oldDefaultName, 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.java.mappings.JpaJavaMappingsPackage#getIDiscriminatorColumn_SpecifiedName() + * @model + * @generated + */ + public String getSpecifiedName() { + return specifiedName; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn#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_DISCRIMINATOR_COLUMN__SPECIFIED_NAME, oldSpecifiedName, specifiedName)); + } + + /** + * 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#getIDiscriminatorColumn_Name() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated NOT + */ + public String getName() { + return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName(); + } + + /** + * 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 '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#getIDiscriminatorColumn_ColumnDefinition() + * @model + * @generated + */ + public String getColumnDefinition() { + return columnDefinition; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn#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_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION, oldColumnDefinition, columnDefinition)); + } + + /** + * 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__DEFAULT_NAME : + return getDefaultName(); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME : + return getSpecifiedName(); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__NAME : + return getName(); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + return getDiscriminatorType(); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + return getColumnDefinition(); + 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__DEFAULT_NAME : + setDefaultName((String) newValue); + return; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME : + setSpecifiedName((String) newValue); + return; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + setDiscriminatorType((DiscriminatorType) newValue); + return; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + setColumnDefinition((String) 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__DEFAULT_NAME : + setDefaultName(DEFAULT_NAME_EDEFAULT); + return; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME : + setSpecifiedName(SPECIFIED_NAME_EDEFAULT); + return; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT); + return; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + setColumnDefinition(COLUMN_DEFINITION_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__DEFAULT_NAME : + return DEFAULT_NAME_EDEFAULT == null ? defaultName != null : !DEFAULT_NAME_EDEFAULT.equals(defaultName); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME : + return SPECIFIED_NAME_EDEFAULT == null ? specifiedName != null : !SPECIFIED_NAME_EDEFAULT.equals(specifiedName); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__NAME : + return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName()); + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + return COLUMN_DEFINITION_EDEFAULT == null ? columnDefinition != null : !COLUMN_DEFINITION_EDEFAULT.equals(columnDefinition); + 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__DEFAULT_NAME : + return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DEFAULT_NAME; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME : + return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__SPECIFIED_NAME; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__NAME : + return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__NAME; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; + case JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + return JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__COLUMN_DEFINITION; + 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__DEFAULT_NAME : + return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DEFAULT_NAME; + case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__SPECIFIED_NAME : + return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__SPECIFIED_NAME; + case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__NAME : + return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__NAME; + case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE : + return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; + case JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__COLUMN_DEFINITION : + return JpaJavaMappingsPackage.JAVA_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; + 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(" (defaultName: "); + result.append(defaultName); + result.append(", specifiedName: "); + result.append(specifiedName); + result.append(", discriminatorType: "); + result.append(discriminatorType); + result.append(", columnDefinition: "); + result.append(columnDefinition); + result.append(", defaultLength: "); + result.append(defaultLength); + result.append(", specifiedLength: "); + result.append(specifiedLength); + result.append(')'); + return result.toString(); + } + + public ITextRange getTextRange() { + return this.type.textRange(); + } + + public Table dbTable() { + return entity().primaryDbTable(); + } + + private IEntity entity() { + return (IEntity) eContainer(); + } + + // ********** java annotations -> persistence model ********** + public void updateFromJava(CompilationUnit astRoot) { + setDiscriminatorType(DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot))); + setSpecifiedName((String) this.nameAdapter.getValue(astRoot)); + setSpecifiedLength(this.lengthAdapter.getValue(astRoot)); + setColumnDefinition((String) this.columnDefinitionAdapter.getValue(astRoot)); + } + + // ********** static methods ********** + private static DeclarationAnnotationElementAdapter buildDiscriminatorTypeAdapter() { + return new EnumDeclarationAnnotationElementAdapter(ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); + } + + private static DeclarationAnnotationElementAdapter buildAnnotationElementAdapter(String elementName) { + return new ConversionDeclarationAnnotationElementAdapter(ANNOTATION_ADAPTER, elementName); + } +} // 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 new file mode 100644 index 0000000000..12d9fa6d8c --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddable.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright (c) 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * 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.Collections; +import java.util.Iterator; +import java.util.List; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.jdt.core.dom.CompilationUnit; +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; +import org.eclipse.jpt.core.internal.mappings.ITable; +import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; + +/** + * + * 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 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 ANNOTATION_ADAPTER; + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JpaJavaMappingsPackage.Literals.JAVA_EMBEDDABLE; + } + + public String getKey() { + return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY; + } + + public boolean tableNameIsInvalid(String tableName) { + return false; + } + + public Iterator+ * 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+ * 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+ * The following features are supported: + *
+ * 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; + } + + private String specifiedNameFromJava() { + return (String) this.getType().annotationElementValue(NAME_ADAPTER); + } + + private String defaultNameFromJava() { + return super.getName(); + } + + /** + * 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 '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.java.mappings.JpaJavaMappingsPackage#getJavaEntity_SecondaryTables() + * @model type="org.eclipse.jpt.core.internal.mappings.ISecondaryTable" containment="true" + * @generated + */ + public EList+ * 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+ * 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+ * 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+ * 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+ * 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+ * 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+ * 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+ * 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+ * 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