Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AbstractJavaResourceNode.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/BasicAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ColumnAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EntityAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EnumeratedAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/GeneratedValueAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdClassAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/InheritanceAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnsAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinTableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/LobAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToManyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToOneAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MapKeyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueriesAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueryAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAnnotation.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseColumnAnnotation.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseTableAnnotation.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullColumnAnnotation.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorValueAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullEnumeratedAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullInheritanceAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinColumnAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinTableAnnotation.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullNamedColumnAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTableAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTemporalAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToManyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToOneAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OrderByAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableGeneratorAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TemporalAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TransientAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/VersionAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotatedElement.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotation.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBasicAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryClassFile.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryColumnAnnotation.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryContainerAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEntityAnnotation.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdClassAnnotation.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryLobAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNode.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOrderByAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOverrideAnnotation.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragment.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentAttribute.java657
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentMember.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentType.java700
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentTypeCache.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryAnnotation.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableAnnotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java293
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTemporalAnnotation.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTransientAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryVersionAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/RootBinaryNode.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/AnnotationContainerTools.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotatedElement.java474
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotation.java271
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java245
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseColumnAnnotation.java334
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTableAnnotation.java426
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBasicAnnotation.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceColumnAnnotation.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompilationUnit.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddableAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEntityAnnotation.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEnumeratedAnnotation.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratorAnnotation.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdClassAnnotation.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceInheritanceAnnotation.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnAnnotation.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinTableAnnotation.java409
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceLobAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToManyAnnotation.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToOneAnnotation.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMapKeyAnnotation.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedColumnAnnotation.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueryAnnotation.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNode.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToManyAnnotation.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToOneAnnotation.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOrderByAnnotation.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOverrideAnnotation.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackage.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentAttribute.java408
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentMember.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentType.java930
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryAnnotation.java364
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryHintAnnotation.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java357
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java283
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java470
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTemporalAnnotation.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTransientAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTypeCompilationUnit.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceVersionAnnotation.java45
192 files changed, 0 insertions, 23066 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AbstractJavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AbstractJavaResourceNode.java
deleted file mode 100644
index 8cb4a5f3d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AbstractJavaResourceNode.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.AspectChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * Java resource containment hierarchy
- */
-public abstract class AbstractJavaResourceNode
- extends AbstractModel
- implements JavaResourceNode
-{
- protected final JavaResourceNode parent;
-
-
- // ********** constructor **********
-
- protected AbstractJavaResourceNode(JavaResourceNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
-
- // ********** parent **********
-
- public JavaResourceNode getParent() {
- return this.parent;
- }
-
- protected void checkParent(JavaResourceNode p) {
- if (p == null) {
- if (this.requiresParent()) {
- throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
- }
- } else {
- if (this.forbidsParent()) {
- throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
- }
- }
- }
-
- protected boolean requiresParent() {
- return true;
- }
-
- protected boolean forbidsParent() {
- return ! this.requiresParent(); // assume 'parent' is not optional
- }
-
-
- // ********** change support callback hook **********
-
- @Override
- protected final ChangeSupport buildChangeSupport() {
- return new AspectChangeSupport(this, this.buildChangeSupportListener());
- }
-
- private AspectChangeSupport.Listener buildChangeSupportListener() {
- return new AspectChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJavaResourceNode.this.aspectChanged(aspectName);
- }
- };
- }
-
- /**
- * ignore the aspect name, we notify listeners of *every* change
- */
- protected void aspectChanged(@SuppressWarnings("unused") String aspectName) {
- this.getRoot().resourceModelChanged();
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceCompilationUnit#getRoot()
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryPackageFragmentRoot#getRoot()
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryPersistentTypeCache#getRoot()
- */
- public Root getRoot() {
- return this.parent.getRoot();
- }
-
- public IFile getFile() {
- return this.getRoot().getFile();
- }
-
-
- // ********** misc **********
-
- protected JpaAnnotationProvider getAnnotationProvider() {
- return this.getRoot().getAnnotationProvider();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java
deleted file mode 100644
index d92334b88b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.binary.BinaryAssociationOverride1_0Annotation;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.source.SourceAssociationOverride1_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public final class AssociationOverrideAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AssociationOverrideAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AssociationOverrideAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceAssociationOverride1_0Annotation.buildAssociationOverride((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryAssociationOverride1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java
deleted file mode 100644
index 42561b2853..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.binary.BinaryAssociationOverrides1_0Annotation;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.source.SourceAssociationOverrides1_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public final class AssociationOverridesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AssociationOverridesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AssociationOverridesAnnotationDefinition() {
- super();
- }
-
- public AssociationOverridesAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceAssociationOverrides1_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public AssociationOverridesAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryAssociationOverrides1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverridesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java
deleted file mode 100644
index e0c82a25cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryAttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.AttributeOverride
- */
-public final class AttributeOverrideAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AttributeOverrideAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AttributeOverrideAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceAttributeOverrideAnnotation.buildAttributeOverride((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryAttributeOverrideAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java
deleted file mode 100644
index 8e0629aca6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryAttributeOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAttributeOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.AttributeOverrides
- */
-public final class AttributeOverridesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AttributeOverridesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AttributeOverridesAnnotationDefinition() {
- super();
- }
-
- public AttributeOverridesAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceAttributeOverridesAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public AttributeOverridesAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryAttributeOverridesAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AttributeOverridesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/BasicAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/BasicAnnotationDefinition.java
deleted file mode 100644
index a5f249a48d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/BasicAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryBasicAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceBasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Basic
- */
-public final class BasicAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new BasicAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BasicAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceBasicAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryBasicAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return BasicAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ColumnAnnotationDefinition.java
deleted file mode 100644
index 56fec881a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ColumnAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryColumnAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.Column
- */
-public final class ColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ColumnAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceColumnAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement, SourceColumnAnnotation.MAPPING_DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullColumnAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryColumnAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java
deleted file mode 100644
index a9d8797d59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorColumn
- */
-public final class DiscriminatorColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new DiscriminatorColumnAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DiscriminatorColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return DiscriminatorColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java
deleted file mode 100644
index 1150a7d7a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryDiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceDiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class DiscriminatorValueAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new DiscriminatorValueAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DiscriminatorValueAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullDiscriminatorValueAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return DiscriminatorValueAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddableAnnotationDefinition.java
deleted file mode 100644
index 995417e071..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddableAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryEmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Embeddable
- */
-public final class EmbeddableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EmbeddableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEmbeddableAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEmbeddableAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedAnnotationDefinition.java
deleted file mode 100644
index 50818c215e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryEmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Embedded
- */
-public final class EmbeddedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EmbeddedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EmbeddedAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java
deleted file mode 100644
index 572fde6d2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryEmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.EmbeddedId
- */
-public final class EmbeddedIdAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EmbeddedIdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddedIdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EmbeddedIdAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EntityAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EntityAnnotationDefinition.java
deleted file mode 100644
index f13e842fbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EntityAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryEntityAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Entity
- */
-public final class EntityAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EntityAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EntityAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEntityAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEntityAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EnumeratedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EnumeratedAnnotationDefinition.java
deleted file mode 100644
index 79ce931c82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/EnumeratedAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryEnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class EnumeratedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EnumeratedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EnumeratedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEnumeratedAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EnumeratedAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/GeneratedValueAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/GeneratedValueAnnotationDefinition.java
deleted file mode 100644
index 0cc96173bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/GeneratedValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryGeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceGeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.GeneratedValue
- */
-public final class GeneratedValueAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new GeneratedValueAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GeneratedValueAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return GeneratedValueAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdAnnotationDefinition.java
deleted file mode 100644
index 8628cfede1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryIdAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Id
- */
-public final class IdAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new IdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private IdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryIdAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return IdAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdClassAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdClassAnnotationDefinition.java
deleted file mode 100644
index e5cbb6c281..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/IdClassAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryIdClassAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.IdClass
- */
-public final class IdClassAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new IdClassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private IdClassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceIdClassAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryIdClassAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return IdClassAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/InheritanceAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/InheritanceAnnotationDefinition.java
deleted file mode 100644
index d0d4734830..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/InheritanceAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryInheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceInheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class InheritanceAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new InheritanceAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private InheritanceAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceInheritanceAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullInheritanceAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryInheritanceAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return InheritanceAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnAnnotationDefinition.java
deleted file mode 100644
index 8430099980..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-/**
- * javax.persistence.JoinColumn
- */
-public final class JoinColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new JoinColumnAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceJoinColumnAnnotation.createJoinColumn((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryJoinColumnAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnsAnnotationDefinition.java
deleted file mode 100644
index e0e07b6efd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinColumnsAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryJoinColumnsAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceJoinColumnsAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnsAnnotation;
-
-/**
- * javax.persistence.JoinColumns
- */
-public final class JoinColumnsAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new JoinColumnsAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinColumnsAnnotationDefinition() {
- super();
- }
-
- public JoinColumnsAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceJoinColumnsAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public JoinColumnsAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryJoinColumnsAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinColumnsAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinTableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinTableAnnotationDefinition.java
deleted file mode 100644
index ad35ea19e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/JoinTableAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryJoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceJoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-/**
- * javax.persistence.JoinTable
- */
-public final class JoinTableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new JoinTableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinTableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceJoinTableAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullJoinTableAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryJoinTableAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/LobAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/LobAnnotationDefinition.java
deleted file mode 100644
index 593295e108..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/LobAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryLobAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceLobAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-
-/**
- * javax.persistence.Lob
- */
-public final class LobAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new LobAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private LobAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceLobAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryLobAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return LobAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToManyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToManyAnnotationDefinition.java
deleted file mode 100644
index 173ae215c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToManyAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-
-/**
- * javax.persistence.ManyToMany
- */
-public final class ManyToManyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ManyToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ManyToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceManyToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryManyToManyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ManyToManyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToOneAnnotationDefinition.java
deleted file mode 100644
index 7d8571e116..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/ManyToOneAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-
-/**
- * javax.persistence.ManyToOne
- */
-public final class ManyToOneAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ManyToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ManyToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceManyToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryManyToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ManyToOneAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MapKeyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MapKeyAnnotationDefinition.java
deleted file mode 100644
index db92373fe0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MapKeyAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryMapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceMapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-
-/**
- * javax.persistence.MapKey
- */
-public final class MapKeyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceMapKeyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java
deleted file mode 100644
index 2d03a17fe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryMappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceMappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-/**
- * javax.persistence.MappedSuperclass
- */
-public final class MappedSuperclassAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MappedSuperclassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MappedSuperclassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceMappedSuperclassAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryMappedSuperclassAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java
deleted file mode 100644
index 64d1419a8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryNamedNativeQueriesAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceNamedNativeQueriesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueriesAnnotation;
-
-/**
- * javax.persistence.NamedNativeQueries
- */
-public final class NamedNativeQueriesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedNativeQueriesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedNativeQueriesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedNativeQueriesAnnotation(parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedNativeQueriesAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedNativeQueriesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java
deleted file mode 100644
index 07aa297403..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryNamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceNamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-
-/**
- * javax.persistence.NamedNativeQuery
- */
-public final class NamedNativeQueryAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedNativeQueryAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedNativeQueryAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceNamedNativeQueryAnnotation.createNamedNativeQuery(parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedNativeQueryAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedNativeQueryAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueriesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueriesAnnotationDefinition.java
deleted file mode 100644
index 4636029019..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueriesAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.binary.BinaryNamedQueries1_0Annotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceNamedQueries1_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueriesAnnotation;
-
-/**
- * javax.persistence.NamedQueries
- */
-public final class NamedQueriesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedQueriesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedQueriesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedQueries1_0Annotation(parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedQueries1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedQueriesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueryAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueryAnnotationDefinition.java
deleted file mode 100644
index 3b49b07818..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NamedQueryAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.binary.BinaryNamedQuery1_0Annotation;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.source.SourceNamedQuery1_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-
-/**
- * javax.persistence.NamedQuery
- */
-public final class NamedQueryAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedQueryAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedQueryAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedQuery1_0Annotation(parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedQuery1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAnnotation.java
deleted file mode 100644
index ab7a3377a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAnnotation.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * Simplify null annotation classes.
- */
-public abstract class NullAnnotation<A extends Annotation>
- extends AbstractJavaResourceNode
- implements Annotation
-{
- protected NullAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- throw new UnsupportedOperationException();
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isUnset() {
- throw new UnsupportedOperationException();
- }
-
- public void storeOn(Map<String, Object> map) {
- // NOP
- }
-
- public void restoreFrom(Map<String, Object> map) {
- // NOP
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Convenience method: Cast the annotation's parent to a
- * persistent member.
- */
- protected JavaResourcePersistentMember getMember() {
- return (JavaResourcePersistentMember) this.parent;
- }
-
- /**
- * Convenience method: Add the type or attribute's annotation
- * and return it.
- * <p>
- * Pre-condition: The annotation's parent must be a persistent member
- * (type or attribute).
- */
- @SuppressWarnings("unchecked")
- protected A addAnnotation() {
- return (A) this.addAnnotation_();
- }
-
- protected Annotation addAnnotation_() {
- return this.getMember().addAnnotation(this.getAnnotationName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java
deleted file mode 100644
index 8271825126..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-
-/**
- * <code>javax.persistence.Column</code>
- */
-public final class NullAttributeOverrideColumnAnnotation
- extends NullColumnAnnotation
-{
- public NullAttributeOverrideColumnAnnotation(AttributeOverrideAnnotation parent) {
- super(parent);
- }
-
- private AttributeOverrideAnnotation getAttributeOverrideAnnotation() {
- return (AttributeOverrideAnnotation) this.parent;
- }
-
- @Override
- protected ColumnAnnotation addAnnotation() {
- return this.getAttributeOverrideAnnotation().addColumn();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseColumnAnnotation.java
deleted file mode 100644
index 44696dab1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseColumnAnnotation.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * <ul>
- * <li><code>javax.persistence.Column</code>
- * <li><code>javax.persistence.JoinColumn</code>
- * <li><code>javax.persistence.MapKeyColumn</code>
- * </ul>
- */
-public abstract class NullBaseColumnAnnotation<A extends BaseColumnAnnotation>
- extends NullNamedColumnAnnotation<A>
- implements BaseColumnAnnotation
-{
- protected NullBaseColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- // ***** table
- public String getTable() {
- return null;
- }
-
- public void setTable(String table) {
- if (table != null) {
- this.addAnnotation().setTable(table);
- }
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** unique
- public Boolean getUnique() {
- return null;
- }
-
- public void setUnique(Boolean unique) {
- if (unique != null) {
- this.addAnnotation().setUnique(unique);
- }
- }
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return null;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (updatable != null) {
- this.addAnnotation().setUpdatable(updatable);
- }
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return null;
- }
-
- public void setInsertable(Boolean insertable) {
- if (insertable != null) {
- this.addAnnotation().setInsertable(insertable);
- }
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** nullable
- public Boolean getNullable() {
- return null;
- }
-
- public void setNullable(Boolean nullable) {
- if (nullable != null) {
- this.addAnnotation().setNullable(nullable);
- }
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseTableAnnotation.java
deleted file mode 100644
index 931b3cd56a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullBaseTableAnnotation.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- * <ul>
- * <li><code>javax.persistence.Table</code>
- * <li><code>javax.persistence.JoinTable</code>
- * <li><code>javax.persistence.CollectionTable</code>
- * <ul>
- */
-public abstract class NullBaseTableAnnotation<A extends BaseTableAnnotation>
- extends NullAnnotation<A>
- implements BaseTableAnnotation
-{
- protected NullBaseTableAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public boolean isSpecified() {
- return false;
- }
-
- // ***** name
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- this.addAnnotation().setName(name);
- }
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** schema
- public String getSchema() {
- return null;
- }
-
- public void setSchema(String schema) {
- if (schema != null) {
- this.addAnnotation().setSchema(schema);
- }
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** catalog
- public String getCatalog() {
- return null;
- }
-
- public void setCatalog(String catalog) {
- if (catalog != null) {
- this.addAnnotation().setCatalog(catalog);
- }
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return EmptyListIterator.instance();
- }
-
- public int uniqueConstraintsSize() {
- return 0;
- }
-
- public UniqueConstraintAnnotation uniqueConstraintAt(int index) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- throw new UnsupportedOperationException();
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- return this.addAnnotation().addUniqueConstraint(index);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullColumnAnnotation.java
deleted file mode 100644
index 92e9045040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullColumnAnnotation.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * <code>javax.persistence.Column</code>
- */
-public class NullColumnAnnotation
- extends NullBaseColumnAnnotation<ColumnAnnotation>
- implements ColumnAnnotation
-{
- public NullColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- this.addAnnotation().setLength(length);
- }
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** scale
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- this.addAnnotation().setScale(scale);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** precision
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- this.addAnnotation().setPrecision(precision);
- }
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java
deleted file mode 100644
index 54add2a0a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * <code>javax.persistence.DiscriminatorColumn</code>
- */
-public final class NullDiscriminatorColumnAnnotation
- extends NullNamedColumnAnnotation<DiscriminatorColumnAnnotation>
- implements DiscriminatorColumnAnnotation
-{
- public NullDiscriminatorColumnAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** discriminator type
- public DiscriminatorType getDiscriminatorType() {
- return null;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- if (discriminatorType != null) {
- this.addAnnotation().setDiscriminatorType(discriminatorType);
- }
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- this.addAnnotation().setLength(length);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorValueAnnotation.java
deleted file mode 100644
index 0169a216f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * <code>javax.persistence.DiscriminatorValue</code>
- */
-public final class NullDiscriminatorValueAnnotation
- extends NullAnnotation<DiscriminatorValueAnnotation>
- implements DiscriminatorValueAnnotation
-{
- protected NullDiscriminatorValueAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullEnumeratedAnnotation.java
deleted file mode 100644
index 288cdd0964..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullEnumeratedAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * <code>javax.persistence.Enumerated</code>
- */
-public final class NullEnumeratedAnnotation
- extends NullAnnotation<EnumeratedAnnotation>
- implements EnumeratedAnnotation
-{
- protected NullEnumeratedAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** value
- public EnumType getValue() {
- return null;
- }
-
- public void setValue(EnumType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullInheritanceAnnotation.java
deleted file mode 100644
index 3e1db48102..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullInheritanceAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceType;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * <code>javax.persistence.Inheritance</code>
- */
-public final class NullInheritanceAnnotation
- extends NullAnnotation<InheritanceAnnotation>
- implements InheritanceAnnotation
-{
- protected NullInheritanceAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** strategy
- public InheritanceType getStrategy() {
- return null;
- }
-
- public void setStrategy(InheritanceType strategy) {
- if (strategy != null) {
- this.addAnnotation().setStrategy(strategy);
- }
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinColumnAnnotation.java
deleted file mode 100644
index b5cbdec77b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinColumnAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.JoinColumn</code>
- */
-public final class NullJoinColumnAnnotation
- extends NullBaseColumnAnnotation<JoinColumnAnnotation>
- implements JoinColumnAnnotation
-{
- public NullJoinColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return null;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinTableAnnotation.java
deleted file mode 100644
index 7fce754e00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullJoinTableAnnotation.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-/**
- * <code>javax.persistence.JoinTable</code>
- */
-public class NullJoinTableAnnotation
- extends NullBaseTableAnnotation<JoinTableAnnotation>
- implements JoinTableAnnotation
-{
- public NullJoinTableAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- // the JoinTable annotation is missing, add both it and a join column at the same time
- return this.addAnnotation().addJoinColumn(index);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- // ***** inverse join columns
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int inverseJoinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return null;
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- // the JoinTable annotation is missing, add both it and a join column at the same time
- return this.addAnnotation().addInverseJoinColumn(index);
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullNamedColumnAnnotation.java
deleted file mode 100644
index 61f04b9e6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullNamedColumnAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedColumnAnnotation;
-
-/**
- * <ul>
- * <li><code>javax.persistence.Column</code>
- * <li><code>javax.persistence.JoinColumn</code>
- * <li><code>javax.persistence.MapKeyColumn</code>
- * <li><code>javax.persistence.DiscriminatorColumn</code>
- * <li><code>javax.persistence.OrderColumn</code>
- * <li><code>javax.persistence.PrimaryKeyJoinColumn</code>
- * </ul>
- */
-public abstract class NullNamedColumnAnnotation<A extends NamedColumnAnnotation>
- extends NullAnnotation<A>
- implements NamedColumnAnnotation
-{
- protected NullNamedColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public boolean isSpecified() {
- return false;
- }
-
- // ***** name
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- this.addAnnotation().setName(name);
- }
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** column definition
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- if (columnDefinition != null) {
- this.addAnnotation().setColumnDefinition(columnDefinition);
- }
- }
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index 730c7398df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.PrimaryKeyJoinColumn</code>
- */
-public final class NullPrimaryKeyJoinColumnAnnotation
- extends NullNamedColumnAnnotation<PrimaryKeyJoinColumnAnnotation>
- implements PrimaryKeyJoinColumnAnnotation
-{
- public NullPrimaryKeyJoinColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return null;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTableAnnotation.java
deleted file mode 100644
index 3ffc637bd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTableAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-
-/**
- * <code>javax.persistence.Table</code>
- */
-public final class NullTableAnnotation
- extends NullBaseTableAnnotation<TableAnnotation>
- implements TableAnnotation
-{
- protected NullTableAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTemporalAnnotation.java
deleted file mode 100644
index ce77b832e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/NullTemporalAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-/**
- * <code>javax.persistence.Temporal</code>
- */
-public final class NullTemporalAnnotation
- extends NullAnnotation<TemporalAnnotation>
- implements TemporalAnnotation
-{
- protected NullTemporalAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** value
- public TemporalType getValue() {
- return null;
- }
-
- public void setValue(TemporalType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToManyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToManyAnnotationDefinition.java
deleted file mode 100644
index 9f0ccaf7c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToManyAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryOneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceOneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class OneToManyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OneToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OneToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceOneToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryOneToManyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OneToManyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToOneAnnotationDefinition.java
deleted file mode 100644
index d909ad2552..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OneToOneAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryOneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceOneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-
-/**
- * javax.persistence.OneToOne
- */
-public final class OneToOneAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OneToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OneToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceOneToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryOneToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OneToOneAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OrderByAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OrderByAnnotationDefinition.java
deleted file mode 100644
index 21a6687fe3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/OrderByAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryOrderByAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceOrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-
-/**
- * javax.persistence.OrderBy
- */
-public final class OrderByAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OrderByAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrderByAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceOrderByAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryOrderByAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OrderByAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java
deleted file mode 100644
index 2a46e8d96a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryPrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourcePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumn
- */
-public final class PrimaryKeyJoinColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new PrimaryKeyJoinColumnAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrimaryKeyJoinColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourcePrimaryKeyJoinColumnAnnotation.createPrimaryKeyJoinColumn((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryPrimaryKeyJoinColumnAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java
deleted file mode 100644
index 6c93d75044..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryPrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourcePrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumns
- */
-public final class PrimaryKeyJoinColumnsAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new PrimaryKeyJoinColumnsAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrimaryKeyJoinColumnsAnnotationDefinition() {
- super();
- }
-
- public PrimaryKeyJoinColumnsAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourcePrimaryKeyJoinColumnsAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public PrimaryKeyJoinColumnsAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryPrimaryKeyJoinColumnsAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTableAnnotationDefinition.java
deleted file mode 100644
index 2ab5857808..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTableAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinarySecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceSecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-
-/**
- * javax.persistence.SecondaryTable
- */
-public final class SecondaryTableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SecondaryTableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SecondaryTableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceSecondaryTableAnnotation.createSecondaryTable((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinarySecondaryTableAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java
deleted file mode 100644
index d30934de34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinarySecondaryTablesAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceSecondaryTablesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTablesAnnotation;
-
-/**
- * javax.persistence.SecondaryTables
- */
-public final class SecondaryTablesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SecondaryTablesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SecondaryTablesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceSecondaryTablesAnnotation((JavaResourcePersistentType) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinarySecondaryTablesAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SecondaryTablesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java
deleted file mode 100644
index 3e03fa5a0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.binary.BinarySequenceGenerator1_0Annotation;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.source.SourceSequenceGenerator1_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public final class SequenceGeneratorAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SequenceGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- protected SequenceGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceSequenceGenerator1_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinarySequenceGenerator1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SequenceGeneratorAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableAnnotationDefinition.java
deleted file mode 100644
index d5ea08d3ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-
-/**
- * javax.persistence.Table
- */
-public final class TableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceTableAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullTableAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryTableAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableGeneratorAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableGeneratorAnnotationDefinition.java
deleted file mode 100644
index 3c043df606..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TableGeneratorAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryTableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceTableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-
-/**
- * javax.persistence.TableGenerator
- */
-public final class TableGeneratorAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TableGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TableGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceTableGeneratorAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryTableGeneratorAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TableGeneratorAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TemporalAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TemporalAnnotationDefinition.java
deleted file mode 100644
index 47cc40ebdb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TemporalAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryTemporalAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceTemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-
-/**
- * javax.persistence.Temporal
- */
-public final class TemporalAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TemporalAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TemporalAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceTemporalAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullTemporalAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryTemporalAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TemporalAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TransientAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TransientAnnotationDefinition.java
deleted file mode 100644
index ab9f9f0220..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/TransientAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryTransientAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceTransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-
-/**
- * javax.persistence.Transient
- */
-public final class TransientAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TransientAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TransientAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceTransientAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryTransientAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TransientAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/VersionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/VersionAnnotationDefinition.java
deleted file mode 100644
index c1719af680..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/VersionAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryVersionAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceVersionAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-
-/**
- * javax.persistence.Version
- */
-public final class VersionAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new VersionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private VersionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceVersionAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryVersionAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return VersionAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotatedElement.java
deleted file mode 100644
index 3ab6aca048..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotatedElement.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * binary annotated element
- */
-abstract class BinaryAnnotatedElement
- extends BinaryNode
- implements JavaResourceAnnotatedElement
-{
- /** JDT annotated element adapter */
- final Adapter adapter;
-
- /** annotations */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- /**
- * these are built as needed
- */
- private final HashMap<String, Annotation> nullAnnotationsCache = new HashMap<String, Annotation>();
-
-
- // ********** construction/initialization **********
-
- public BinaryAnnotatedElement(JavaResourceNode parent, Adapter adapter) {
- super(parent);
- this.adapter = adapter;
- this.initializeAnnotations();
- }
-
- private void initializeAnnotations() {
- for (IAnnotation annotation : this.getJdtAnnotations()) {
- this.addAnnotation(annotation);
- }
- }
-
- private void addAnnotation(IAnnotation jdtAnnotation) {
- if (this.annotationIsValid(jdtAnnotation)) {
- this.annotations.add(this.buildAnnotation(jdtAnnotation));
- }
- }
-
-
- // ********** updating **********
-
- @Override
- public void update() {
- super.update();
- this.updateAnnotations();
- }
-
- // TODO
- private void updateAnnotations() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** annotations **********
-
- public Iterator<Annotation> annotations() {
- return this.getAnnotations().iterator();
- }
-
- private Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int annotationsSize() {
- return this.annotations.size();
- }
-
- public Annotation getAnnotation(String annotationName) {
- return this.selectAnnotationNamed(this.getAnnotations(), annotationName);
- }
-
- public Annotation getNonNullAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- return (annotation != null) ? annotation : this.getNullAnnotation(annotationName);
- }
-
- private synchronized Annotation getNullAnnotation(String annotationName) {
- Annotation annotation = this.nullAnnotationsCache.get(annotationName);
- if (annotation == null) {
- annotation = this.buildNullAnnotation(annotationName);
- this.nullAnnotationsCache.put(annotationName, annotation);
- }
- return annotation;
- }
-
- public Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- return containerAnnotation.getNestedAnnotations().iterator();
- }
- NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName);
- return (nestableAnnotation == null) ?
- EmptyListIterator.<NestableAnnotation>instance() :
- new SingleElementIterator<NestableAnnotation>(nestableAnnotation);
- }
-
- private NestableAnnotation getNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.getAnnotation(annotationName);
- }
-
- @SuppressWarnings("unchecked")
- private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName);
- }
-
- private boolean annotationIsValid(IAnnotation jdtAnnotation) {
- return CollectionTools.contains(this.validAnnotationNames(), jdtAnnotation.getElementName());
- }
-
- abstract Iterator<String> validAnnotationNames();
-
- abstract Annotation buildAnnotation(IAnnotation jdtAnnotation);
-
- abstract Annotation buildNullAnnotation(String annotationName);
-
-
- // ********** simple state **********
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty();
- }
-
-
- // ********** misc **********
-
- IJavaElement getAnnotatedElement() {
- return this.adapter.getElement();
- }
-
- private Annotation selectAnnotationNamed(Iterable<Annotation> annotationList, String annotationName) {
- for (Annotation annotation : annotationList) {
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- private IAnnotation[] getJdtAnnotations() {
- try {
- return this.adapter.getAnnotations();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return EMPTY_JDT_ANNOTATION_ARRAY;
- }
- }
- private static final IAnnotation[] EMPTY_JDT_ANNOTATION_ARRAY = new IAnnotation[0];
-
-
- // ********** IJavaElement adapter **********
-
- interface Adapter {
- /**
- * Return the adapter's JDT element (IPackageFragment, IType, IField, IMethod).
- */
- IJavaElement getElement();
-
- /**
- * Return the adapter's element's JDT annotations.
- */
- IAnnotation[] getAnnotations() throws JavaModelException;
- }
-
-
- // ********** unsupported JavaResourcePersistentMember implementation **********
-
- public Annotation addAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void addStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotation.java
deleted file mode 100644
index 8f59feac5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAnnotation.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Map;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * JAR annotation
- */
-public abstract class BinaryAnnotation
- extends BinaryNode
- implements Annotation
-{
- final IAnnotation jdtAnnotation;
-
- protected BinaryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent);
- this.jdtAnnotation = jdtAnnotation;
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return the values of the JDT annotation's member with the specified name.
- */
- protected Object[] getJdtMemberValues(String memberName) {
- Object[] values = (Object[]) this.getJdtMemberValue(memberName);
- return (values != null) ? values : EMPTY_OBJECT_ARRAY;
- }
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- /**
- * Return the value of the JDT annotation's member with the specified name.
- */
- protected Object getJdtMemberValue(String memberName) {
- IMemberValuePair pair = this.getJdtMemberValuePair(memberName);
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * Return the JDT annotation's member-value pair with the specified name.
- */
- private IMemberValuePair getJdtMemberValuePair(String memberName) {
- for (IMemberValuePair pair : this.getJdtMemberValuePairs()) {
- if (pair.getMemberName().equals(memberName)) {
- return pair;
- }
- }
- return null;
- }
-
- private IMemberValuePair[] getJdtMemberValuePairs() {
- try {
- return this.jdtAnnotation.getMemberValuePairs();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return EMPTY_MEMBER_VALUE_PAIR_ARRAY;
- }
- }
- private static final IMemberValuePair[] EMPTY_MEMBER_VALUE_PAIR_ARRAY = new IMemberValuePair[0];
-
-
- // ********** Annotation implementation **********
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
- public boolean isUnset() {
- throw new UnsupportedOperationException();
- }
-
- // ********** NestableAnnotation implementation **********
- public void moveAnnotation(@SuppressWarnings("unused") int index) {
- throw new UnsupportedOperationException();
- }
- public void convertToNested(@SuppressWarnings("unused") ContainerAnnotation<? extends NestableAnnotation> containerAnnotation, @SuppressWarnings("unused") DeclarationAnnotationAdapter containerAnnotationAdapter, @SuppressWarnings("unused") int index) {
- throw new UnsupportedOperationException();
- }
- public void convertToStandAlone() {
- throw new UnsupportedOperationException();
- }
-
- // ********** misc **********
- public void storeOn(Map<String, Object> map) {
- throw new UnsupportedOperationException();
- }
- public void restoreFrom(Map<String, Object> map) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java
deleted file mode 100644
index f7573033bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAssociationOverrideAnnotation;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public abstract class BinaryAssociationOverrideAnnotation
- extends BinaryOverrideAnnotation
- implements NestableAssociationOverrideAnnotation
-{
- private final Vector<JoinColumnAnnotation> joinColumns;
-
-
- protected BinaryAssociationOverrideAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- }
-
-
- // ********** BinaryOverrideAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.ASSOCIATION_OVERRIDE__NAME;
- }
-
-
- // ********** AssociationOverrideAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java
deleted file mode 100644
index 7ecda6b2f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAssociationOverrideAnnotation;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public abstract class BinaryAssociationOverridesAnnotation
- extends BinaryContainerAnnotation<NestableAssociationOverrideAnnotation>
- implements AssociationOverridesAnnotation
-{
- private final Vector<NestableAssociationOverrideAnnotation> associationOverrides;
-
-
- protected BinaryAssociationOverridesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.associationOverrides = this.buildAssociationOverrides();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableAssociationOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAssociationOverrideAnnotation>(this.associationOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.associationOverrides.size();
- }
-
- private Vector<NestableAssociationOverrideAnnotation> buildAssociationOverrides() {
- Object[] jdtAssociationOverrides = this.getJdtMemberValues(JPA.ASSOCIATION_OVERRIDES__VALUE);
- Vector<NestableAssociationOverrideAnnotation> result = new Vector<NestableAssociationOverrideAnnotation>(jdtAssociationOverrides.length);
- for (Object jdtAssociationOverride : jdtAssociationOverrides) {
- result.add(buildAssociationOverride(jdtAssociationOverride));
- }
- return result;
- }
-
- protected abstract NestableAssociationOverrideAnnotation buildAssociationOverride(Object jdtAssociationOverride);
-
- @Override
- public void update() {
- super.update();
- this.updateAssociationOverrides();
- }
-
- // TODO
- private void updateAssociationOverrides() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java
deleted file mode 100644
index e7a6c90119..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.NullAttributeOverrideColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAttributeOverrideAnnotation;
-
-/**
- * javax.persistence.AttributeOverride
- */
-public final class BinaryAttributeOverrideAnnotation
- extends BinaryOverrideAnnotation
- implements NestableAttributeOverrideAnnotation
-{
- private ColumnAnnotation column;
- private final ColumnAnnotation nullColumn;
-
-
- public BinaryAttributeOverrideAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.column = this.buildColumn();
- this.nullColumn = this.buildNullColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateColumn();
- }
-
-
- //************ BinaryOverrideAnnotation implementation ****************
-
- @Override
- protected String getNameElementName() {
- return JPA.ATTRIBUTE_OVERRIDE__NAME;
- }
-
-
- //************ AttributeOverride implementation ****************
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : this.nullColumn;
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
- private ColumnAnnotation buildColumn() {
- IAnnotation jdtColumn = this.getJdtColumn();
- return (jdtColumn == null) ? null : this.buildColumn(jdtColumn);
- }
-
- private ColumnAnnotation buildNullColumn() {
- return new NullAttributeOverrideColumnAnnotation(this);
- }
-
- private ColumnAnnotation buildColumn(IAnnotation jdtColumn) {
- return new BinaryColumnAnnotation(this, jdtColumn);
- }
-
- private IAnnotation getJdtColumn() {
- return (IAnnotation) this.getJdtMemberValue(JPA.ATTRIBUTE_OVERRIDE__COLUMN);
- }
-
- private void setColumn(ColumnAnnotation column) {
- ColumnAnnotation old = this.column;
- this.column = column;
- this.firePropertyChanged(COLUMN_PROPERTY, old, column);
- }
-
- // TODO
- private void updateColumn() {
- throw new UnsupportedOperationException();
-// IAnnotation jdtColumn = this.getJdtColumn();
-// if (jdtColumn == null) {
-// this.setColumn(null);
-// } else {
-// if (this.column == null) {
-// this.setColumn(this.buildColumn(jdtColumn));
-// } else {
-// this.column.update(jdtColumn);
-// }
-// }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java
deleted file mode 100644
index d4a73ac475..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAttributeOverrideAnnotation;
-
-/**
- * javax.persistence.AttributeOverrides
- */
-public final class BinaryAttributeOverridesAnnotation
- extends BinaryContainerAnnotation<NestableAttributeOverrideAnnotation>
- implements AttributeOverridesAnnotation
-{
- private final Vector<NestableAttributeOverrideAnnotation> attributeOverrides;
-
-
- public BinaryAttributeOverridesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.attributeOverrides = this.buildAttributeOverrides();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableAttributeOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAttributeOverrideAnnotation>(this.attributeOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.attributeOverrides.size();
- }
-
- private Vector<NestableAttributeOverrideAnnotation> buildAttributeOverrides() {
- Object[] jdtAttributeOverrides = this.getJdtMemberValues(JPA.ATTRIBUTE_OVERRIDES__VALUE);
- Vector<NestableAttributeOverrideAnnotation> result = new Vector<NestableAttributeOverrideAnnotation>(jdtAttributeOverrides.length);
- for (Object jdtAttributeOverride : jdtAttributeOverrides) {
- result.add(new BinaryAttributeOverrideAnnotation(this, (IAnnotation) jdtAttributeOverride));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateAttributeOverrides();
- }
-
- // TODO
- private void updateAttributeOverrides() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java
deleted file mode 100644
index 31f4a617f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- */
-public abstract class BinaryBaseColumnAnnotation
- extends BinaryNamedColumnAnnotation
- implements BaseColumnAnnotation
-{
- private String table;
- private Boolean unique;
- private Boolean nullable;
- private Boolean insertable;
- private Boolean updatable;
-
-
- protected BinaryBaseColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.table = this.buildTable();
- this.unique = this.buildUnique();
- this.nullable = this.buildNullable();
- this.insertable = this.buildInsertable();
- this.updatable = this.buildUpdatable();
- }
-
- @Override
- public void update() {
- super.update();
- this.setTable_(this.buildTable());
- this.setUnique_(this.buildUnique());
- this.setNullable_(this.buildNullable());
- this.setInsertable_(this.buildInsertable());
- this.setUpdatable_(this.buildUpdatable());
- }
-
-
- //************* BaseColumnAnnotation implementation *************
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- throw new UnsupportedOperationException();
- }
-
- private void setTable_(String table) {
- String old = this.table;
- this.table = table;
- this.firePropertyChanged(TABLE_PROPERTY, old, table);
- }
-
- private String buildTable() {
- return (String) this.getJdtMemberValue(this.getTableElementName());
- }
-
- protected abstract String getTableElementName();
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** unique
- public Boolean getUnique() {
- return this.unique;
- }
-
- public void setUnique(Boolean unique) {
- throw new UnsupportedOperationException();
- }
-
- private void setUnique_(Boolean unique) {
- Boolean old = this.unique;
- this.unique = unique;
- this.firePropertyChanged(UNIQUE_PROPERTY, old, unique);
- }
-
- private Boolean buildUnique() {
- return (Boolean) this.getJdtMemberValue(this.getUniqueElementName());
- }
-
- protected abstract String getUniqueElementName();
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** nullable
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean nullable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNullable_(Boolean nullable) {
- Boolean old = this.nullable;
- this.nullable = nullable;
- this.firePropertyChanged(NULLABLE_PROPERTY, old, nullable);
- }
-
- private Boolean buildNullable() {
- return (Boolean) this.getJdtMemberValue(this.getNullableElementName());
- }
-
- protected abstract String getNullableElementName();
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean insertable) {
- throw new UnsupportedOperationException();
- }
-
- private void setInsertable_(Boolean insertable) {
- Boolean old = this.insertable;
- this.insertable = insertable;
- this.firePropertyChanged(INSERTABLE_PROPERTY, old, insertable);
- }
-
- private Boolean buildInsertable() {
- return (Boolean) this.getJdtMemberValue(this.getInsertableElementName());
- }
-
- protected abstract String getInsertableElementName();
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean updatable) {
- throw new UnsupportedOperationException();
- }
-
- private void setUpdatable_(Boolean updatable) {
- Boolean old = this.updatable;
- this.updatable = updatable;
- this.firePropertyChanged(UPDATABLE_PROPERTY, old, updatable);
- }
-
- private Boolean buildUpdatable() {
- return (Boolean) this.getJdtMemberValue(this.getUpdatableElementName());
- }
-
- protected abstract String getUpdatableElementName();
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java
deleted file mode 100644
index 07acd58ce7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.Enumerated
- */
-public abstract class BinaryBaseEnumeratedAnnotation
- extends BinaryAnnotation
- implements EnumeratedAnnotation
-{
- private EnumType value;
-
-
- protected BinaryBaseEnumeratedAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** EnumeratedAnnotation implementation **********
-
- // ***** value
- public EnumType getValue() {
- return this.value;
- }
-
- public void setValue(EnumType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(EnumType value) {
- EnumType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private EnumType buildValue() {
- return EnumType.fromJavaAnnotationValue(this.getJdtMemberValue(this.getValueElementName()));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getValueElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java
deleted file mode 100644
index f8c35068ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.BaseJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.JoinColumn
- * javax.persistence.MapKeyJoinColumn
- */
-public abstract class BinaryBaseJoinColumnAnnotation
- extends BinaryBaseColumnAnnotation
- implements BaseJoinColumnAnnotation
-{
- private String referencedColumnName;
-
-
- public BinaryBaseJoinColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.referencedColumnName = this.buildReferencedColumnName();
- }
-
- @Override
- public void update() {
- super.update();
- this.setReferencedColumnName_(this.buildReferencedColumnName());
- }
-
- protected abstract String getReferencedColumnNameElementName();
-
-
- //************ BaseJoinColumnAnnotation implementation ***************
-
- // referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setReferencedColumnName_(String referencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = referencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, referencedColumnName);
- }
-
- private String buildReferencedColumnName() {
- return (String) this.getJdtMemberValue(JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java
deleted file mode 100644
index 7e410a1a7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- * javax.persistence.Table
- * javax.persistence.JoinTable
- * javax.persistence.SecondaryTable
- */
-public abstract class BinaryBaseTableAnnotation
- extends BinaryAnnotation
- implements BaseTableAnnotation
-{
- String name;
- String schema;
- String catalog;
- final Vector<UniqueConstraintAnnotation> uniqueConstraints;
-
-
- protected BinaryBaseTableAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.schema = this.buildSchema();
- this.catalog = this.buildCatalog();
- this.uniqueConstraints = this.buildUniqueConstraints();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setSchema_(this.buildSchema());
- this.setCatalog_(this.buildCatalog());
- this.updateUniqueConstraints();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BaseTableAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- protected abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- throw new UnsupportedOperationException();
- }
-
- private void setSchema_(String schema) {
- String old = this.schema;
- this.schema = schema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, schema);
- }
-
- private String buildSchema() {
- return (String) this.getJdtMemberValue(this.getSchemaElementName());
- }
-
- protected abstract String getSchemaElementName();
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- throw new UnsupportedOperationException();
- }
-
- private void setCatalog_(String catalog) {
- String old = this.catalog;
- this.catalog = catalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, catalog);
- }
-
- private String buildCatalog() {
- return (String) this.getJdtMemberValue(this.getCatalogElementName());
- }
-
- protected abstract String getCatalogElementName();
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public UniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<UniqueConstraintAnnotation> buildUniqueConstraints() {
- Object[] jdtUniqueConstraints = this.getJdtMemberValues(this.getUniqueConstraintElementName());
- Vector<UniqueConstraintAnnotation> result = new Vector<UniqueConstraintAnnotation>(jdtUniqueConstraints.length);
- for (Object jdtUniqueConstraint : jdtUniqueConstraints) {
- result.add(new BinaryUniqueConstraintAnnotation(this, (IAnnotation) jdtUniqueConstraint));
- }
- return result;
- }
-
- protected abstract String getUniqueConstraintElementName();
-
- // TODO
- private void updateUniqueConstraints() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java
deleted file mode 100644
index 5c98ccf8b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-/**
- * javax.persistence.Temporal
- * javax.persistence.MapKeyTemporal
- */
-public abstract class BinaryBaseTemporalAnnotation
- extends BinaryAnnotation
- implements TemporalAnnotation
-{
- private TemporalType value;
-
-
- protected BinaryBaseTemporalAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** TemporalAnnotation implementation **********
-
- // ***** value
- public TemporalType getValue() {
- return this.value;
- }
-
- public void setValue(TemporalType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(TemporalType value) {
- TemporalType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private TemporalType buildValue() {
- return TemporalType.fromJavaAnnotationValue(this.getJdtMemberValue(getValueElementName()));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getValueElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBasicAnnotation.java
deleted file mode 100644
index 17ba837fae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBasicAnnotation.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Basic
- */
-public final class BinaryBasicAnnotation
- extends BinaryAnnotation
- implements BasicAnnotation
-{
- private Boolean optional;
- private FetchType fetch;
-
-
- public BinaryBasicAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = this.buildOptional();
- this.fetch = this.buildFetch();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setOptional_(this.buildOptional());
- this.setFetch_(this.buildFetch());
- }
-
-
- //*************** Basic implementation ****************
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(JPA.BASIC__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- throw new UnsupportedOperationException();
- }
-
- private void setFetch_(FetchType fetch) {
- FetchType old = this.fetch;
- this.fetch = fetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, fetch);
- }
-
- private FetchType buildFetch() {
- return FetchType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.BASIC__FETCH));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryClassFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryClassFile.java
deleted file mode 100644
index 28721d9178..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryClassFile.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceClassFile;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * binary class file
- */
-final class BinaryClassFile
- extends BinaryNode
- implements JavaResourceClassFile
-{
- /** JDT class file */
- private final IClassFile classFile;
-
- /** class file's persistent type */
- private final JavaResourcePersistentType persistentType;
-
-
- // ********** construction/initialization **********
-
- /**
- * The JDT type gets passed in because the package fragment inspects it
- * beforehand to determine whether it is "persistable". (We only build
- * class files for "persistable" types.)
- */
- BinaryClassFile(JavaResourcePackageFragment parent, IClassFile classFile, IType jdtType) {
- super(parent);
- this.classFile = classFile;
- this.persistentType = this.buildPersistentType(jdtType);
- }
-
- private JavaResourcePersistentType buildPersistentType(IType jdtType) {
- return new BinaryPersistentType(this, jdtType);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classFile.getElementName());
- }
-
-
- // ********** JavaResourceClassFile implementation **********
-
- public JavaResourcePersistentType getPersistentType() {
- return this.persistentType;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
-// this.persistentType.update(this.classFile.getType());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryColumnAnnotation.java
deleted file mode 100644
index 840041256d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryColumnAnnotation.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.Column
- */
-public final class BinaryColumnAnnotation
- extends BinaryCompleteColumnAnnotation
- implements ColumnAnnotation
-{
-
- public BinaryColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** BinaryBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.COLUMN__UPDATABLE;
- }
-
-
- // ********** BinaryCompleteColumnAnnotation implementation **********
-
- @Override
- protected String getLengthElementName() {
- return JPA.COLUMN__LENGTH;
- }
-
- @Override
- protected String getPrecisionElementName() {
- return JPA.COLUMN__PRECISION;
- }
-
- @Override
- protected String getScaleElementName() {
- return JPA.COLUMN__SCALE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java
deleted file mode 100644
index b1bc0bd745..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.CompleteColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * Abstract implementation of ColumnAnnotation to be used for JPA annotations:
- * javax.persistence.Column
- * javax.persistence.MapKeyColumn
- */
-public abstract class BinaryCompleteColumnAnnotation
- extends BinaryBaseColumnAnnotation
- implements CompleteColumnAnnotation
-{
- protected Integer length;
- protected Integer precision;
- protected Integer scale;
-
-
- protected BinaryCompleteColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.length = this.buildLength();
- this.precision = this.buildPrecision();
- this.scale = this.buildScale();
- }
-
- @Override
- public void update() {
- super.update();
- this.setLength_(this.buildLength());
- this.setPrecision_(this.buildPrecision());
- this.setScale_(this.buildScale());
- }
-
-
- // ********** ColumnAnnotation implementation **********
-
- // ***** length
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer length) {
- throw new UnsupportedOperationException();
- }
-
- private void setLength_(Integer length) {
- Integer old = this.length;
- this.length = length;
- this.firePropertyChanged(LENGTH_PROPERTY, old, length);
- }
-
- private Integer buildLength() {
- return (Integer) this.getJdtMemberValue(this.getLengthElementName());
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getLengthElementName();
-
- // ***** precision
- public Integer getPrecision() {
- return this.precision;
- }
-
- public void setPrecision(Integer precision) {
- throw new UnsupportedOperationException();
- }
-
- private void setPrecision_(Integer precision) {
- Integer old = this.precision;
- this.precision = precision;
- this.firePropertyChanged(PRECISION_PROPERTY, old, precision);
- }
-
- private Integer buildPrecision() {
- return (Integer) this.getJdtMemberValue(this.getPrecisionElementName());
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getPrecisionElementName();
-
- // ***** scale
- public Integer getScale() {
- return this.scale;
- }
-
- public void setScale(Integer scale) {
- throw new UnsupportedOperationException();
- }
-
- private void setScale_(Integer scale) {
- Integer old = this.scale;
- this.scale = scale;
- this.firePropertyChanged(SCALE_PROPERTY, old, scale);
- }
-
- private Integer buildScale() {
- return (Integer) this.getJdtMemberValue(this.getScaleElementName());
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getScaleElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryContainerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryContainerAnnotation.java
deleted file mode 100644
index fdd3f152a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryContainerAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * JAR annotations do not support most of the container annotation protocol.
- */
-public abstract class BinaryContainerAnnotation<T extends NestableAnnotation>
- extends BinaryAnnotation
- implements ContainerAnnotation<T>
-{
-
- protected BinaryContainerAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getElementName() {
- throw new UnsupportedOperationException();
- }
-
- public String getNestedAnnotationName() {
- throw new UnsupportedOperationException();
- }
-
- public T addNestedAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- throw new UnsupportedOperationException();
- }
-
- public T moveNestedAnnotation(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public T removeNestedAnnotation(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- throw new UnsupportedOperationException();
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- throw new UnsupportedOperationException();
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- throw new UnsupportedOperationException();
- }
-
- public void removeLastNestedAnnotation() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java
deleted file mode 100644
index 3346100136..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorColumn
- */
-public final class BinaryDiscriminatorColumnAnnotation
- extends BinaryNamedColumnAnnotation
- implements DiscriminatorColumnAnnotation
-{
- private DiscriminatorType discriminatorType;
- private Integer length;
-
-
- public BinaryDiscriminatorColumnAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.discriminatorType = this.buildDiscriminatorType();
- this.length = this.buildLength();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setDiscriminatorType_(this.buildDiscriminatorType());
- this.setLength_(this.buildLength());
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** DiscriminatorColumnAnnotation implementation **********
-
- // ***** discriminator type
- public DiscriminatorType getDiscriminatorType() {
- return null;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- throw new UnsupportedOperationException();
- }
-
- private void setDiscriminatorType_(DiscriminatorType discriminatorType) {
- DiscriminatorType old = this.discriminatorType;
- this.discriminatorType = discriminatorType;
- this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, discriminatorType);
- }
-
- private DiscriminatorType buildDiscriminatorType() {
- return DiscriminatorType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE));
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- throw new UnsupportedOperationException();
- }
-
- private void setLength_(Integer length) {
- Integer old = this.length;
- this.length = length;
- this.firePropertyChanged(LENGTH_PROPERTY, old, length);
- }
-
- private Integer buildLength() {
- return (Integer) this.getJdtMemberValue(JPA.DISCRIMINATOR_COLUMN__LENGTH);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java
deleted file mode 100644
index 9b86088033..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class BinaryDiscriminatorValueAnnotation
- extends BinaryAnnotation
- implements DiscriminatorValueAnnotation
-{
- private String value;
-
-
- public BinaryDiscriminatorValueAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** DiscriminatorValueAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA.DISCRIMINATOR_VALUE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java
deleted file mode 100644
index 7457e74476..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Embeddable
- */
-public final class BinaryEmbeddableAnnotation
- extends BinaryAnnotation
- implements EmbeddableAnnotation
-{
-
- public BinaryEmbeddableAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java
deleted file mode 100644
index 6f2bd59e8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Embedded
- */
-public final class BinaryEmbeddedAnnotation
- extends BinaryAnnotation
- implements EmbeddedAnnotation
-{
-
- public BinaryEmbeddedAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java
deleted file mode 100644
index 5636c3f215..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.EmbeddedId
- */
-public final class BinaryEmbeddedIdAnnotation
- extends BinaryAnnotation
- implements EmbeddedIdAnnotation
-{
-
- public BinaryEmbeddedIdAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEntityAnnotation.java
deleted file mode 100644
index acb9b3de4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEntityAnnotation.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Entity
- */
-public final class BinaryEntityAnnotation
- extends BinaryAnnotation
- implements EntityAnnotation
-{
- private String name;
-
-
- public BinaryEntityAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** EntityAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JPA.ENTITY__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java
deleted file mode 100644
index 73abbe72e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class BinaryEnumeratedAnnotation
- extends BinaryBaseEnumeratedAnnotation
- implements EnumeratedAnnotation
-{
-
- public BinaryEnumeratedAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.ENUMERATED__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java
deleted file mode 100644
index f232dfaf42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GenerationType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.GeneratedValue
- */
-public final class BinaryGeneratedValueAnnotation
- extends BinaryAnnotation
- implements GeneratedValueAnnotation
-{
- private GenerationType strategy;
- private String generator;
-
-
- public BinaryGeneratedValueAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.strategy = this.buildStrategy();
- this.generator = this.buildGenerator();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setStrategy_(this.buildStrategy());
- this.setGenerator_(this.buildGenerator());
- }
-
-
- // ********** GeneratedValueAnnotation implementation **********
-
- // ***** strategy
- public GenerationType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(GenerationType strategy) {
- throw new UnsupportedOperationException();
- }
-
- private void setStrategy_(GenerationType strategy) {
- GenerationType old = this.strategy;
- this.strategy = strategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, strategy);
- }
-
- private GenerationType buildStrategy() {
- return GenerationType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.GENERATED_VALUE__STRATEGY));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** generator
- public String getGenerator() {
- return this.generator;
- }
-
- public void setGenerator(String generator) {
- throw new UnsupportedOperationException();
- }
-
- private void setGenerator_(String generator) {
- String old = this.generator;
- this.generator = generator;
- this.firePropertyChanged(GENERATOR_PROPERTY, old, generator);
- }
-
- private String buildGenerator() {
- return (String) this.getJdtMemberValue(JPA.GENERATED_VALUE__GENERATOR);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean generatorTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java
deleted file mode 100644
index df5549d573..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.SequenceGenerator
- * javax.persistence.TableGenerator
- */
-abstract class BinaryGeneratorAnnotation
- extends BinaryAnnotation
- implements GeneratorAnnotation
-{
- String name;
- Integer initialValue;
- Integer allocationSize;
-
-
- BinaryGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.initialValue = this.buildInitialValue();
- this.allocationSize = this.buildAllocationSize();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setInitialValue_(this.buildInitialValue());
- this.setAllocationSize_(this.buildAllocationSize());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** GeneratorAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** initial value
- public Integer getInitialValue() {
- return this.initialValue;
- }
-
- public void setInitialValue(Integer initialValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setInitialValue_(Integer initialValue) {
- Integer old = this.initialValue;
- this.initialValue = initialValue;
- this.firePropertyChanged(INITIAL_VALUE_PROPERTY, old, initialValue);
- }
-
- private Integer buildInitialValue() {
- return (Integer) this.getJdtMemberValue(this.getInitialValueElementName());
- }
-
- abstract String getInitialValueElementName();
-
- public TextRange getInitialValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** name
- public Integer getAllocationSize() {
- return this.allocationSize;
- }
-
- public void setAllocationSize(Integer allocationSize) {
- throw new UnsupportedOperationException();
- }
-
- private void setAllocationSize_(Integer allocationSize) {
- Integer old = this.allocationSize;
- this.allocationSize = allocationSize;
- this.firePropertyChanged(NAME_PROPERTY, old, allocationSize);
- }
-
- private Integer buildAllocationSize() {
- return (Integer) this.getJdtMemberValue(this.getAllocationSizeElementName());
- }
-
- abstract String getAllocationSizeElementName();
-
- public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdAnnotation.java
deleted file mode 100644
index 5c3323827c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Id
- */
-public final class BinaryIdAnnotation
- extends BinaryAnnotation
- implements IdAnnotation
-{
-
- public BinaryIdAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdClassAnnotation.java
deleted file mode 100644
index 5eef8693d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryIdClassAnnotation.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.IdClass
- */
-public final class BinaryIdClassAnnotation
- extends BinaryAnnotation
- implements IdClassAnnotation
-{
- private String value;
-
-
- public BinaryIdClassAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** IdClassAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA.ID_CLASS__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified class name
- /**
- * binary is already fully-qualified
- */
- public String getFullyQualifiedClassName() {
- return this.value;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java
deleted file mode 100644
index 41a01e25e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class BinaryInheritanceAnnotation
- extends BinaryAnnotation
- implements InheritanceAnnotation
-{
- private InheritanceType strategy;
-
-
- public BinaryInheritanceAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.strategy = this.buildStrategy();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setStrategy_(this.buildStrategy());
- }
-
-
- // ********** InheritanceAnnotation implementation **********
-
- // ***** strategy
- public InheritanceType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(InheritanceType strategy) {
- throw new UnsupportedOperationException();
- }
-
- private void setStrategy_(InheritanceType strategy) {
- InheritanceType old = this.strategy;
- this.strategy = strategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, strategy);
- }
-
- private InheritanceType buildStrategy() {
- return InheritanceType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.INHERITANCE__STRATEGY));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java
deleted file mode 100644
index 6ec2b225cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * javax.persistence.JoinColumn
- */
-public final class BinaryJoinColumnAnnotation
- extends BinaryBaseJoinColumnAnnotation
- implements NestableJoinColumnAnnotation
-{
-
- public BinaryJoinColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** BinaryBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.JOIN_COLUMN__UPDATABLE;
- }
-
-
- // ********** BinaryBaseJoinColumnAnnotation implementation **********
-
- @Override
- protected String getReferencedColumnNameElementName() {
- return JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java
deleted file mode 100644
index 6a55a85ffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * javax.persistence.JoinColumns
- */
-public final class BinaryJoinColumnsAnnotation
- extends BinaryContainerAnnotation<NestableJoinColumnAnnotation>
- implements JoinColumnsAnnotation
-{
- private final Vector<NestableJoinColumnAnnotation> joinColumns;
-
-
- public BinaryJoinColumnsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.joinColumns.size();
- }
-
- private Vector<NestableJoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.JOIN_COLUMNS__VALUE);
- Vector<NestableJoinColumnAnnotation> result = new Vector<NestableJoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java
deleted file mode 100644
index 5113f1a2cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-/**
- * javax.persistence.JoinTable
- */
-public final class BinaryJoinTableAnnotation
- extends BinaryBaseTableAnnotation
- implements JoinTableAnnotation
-{
- private final Vector<JoinColumnAnnotation> joinColumns;
- private final Vector<JoinColumnAnnotation> inverseJoinColumns;
-
-
- public BinaryJoinTableAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- this.inverseJoinColumns = this.buildInverseJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- this.updateInverseJoinColumns();
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA.JOIN_TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA.JOIN_TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ********** JoinTableAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.JOIN_TABLE__JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** inverse join columns
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.get(index);
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildInverseJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateInverseJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryLobAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryLobAnnotation.java
deleted file mode 100644
index 660ea9f218..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryLobAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-
-/**
- * javax.persistence.Lob
- */
-public final class BinaryLobAnnotation
- extends BinaryAnnotation
- implements LobAnnotation
-{
- public BinaryLobAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java
deleted file mode 100644
index 13e474a8b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.ManyToMany
- */
-public final class BinaryManyToManyAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements ManyToMany2_0Annotation
-{
- private String mappedBy;
-
-
- public BinaryManyToManyAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mappedBy = this.buildMappedBy();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setMappedBy_(this.buildMappedBy());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.MANY_TO_MANY__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.MANY_TO_MANY__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.MANY_TO_MANY__CASCADE;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- throw new UnsupportedOperationException();
- }
-
- private void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- private String buildMappedBy() {
- return (String) this.getJdtMemberValue(JPA.MANY_TO_MANY__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java
deleted file mode 100644
index f3f9ae511e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.ManyToOne
- */
-public final class BinaryManyToOneAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements ManyToOne2_0Annotation
-{
- private Boolean optional;
-
-
- public BinaryManyToOneAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = this.buildOptional();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setOptional_(this.buildOptional());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.MANY_TO_ONE__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.MANY_TO_ONE__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.MANY_TO_ONE__CASCADE;
- }
-
-
- // ********** ManyToOneMappingAnnotation implementation **********
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(JPA.MANY_TO_ONE__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java
deleted file mode 100644
index 06cced26d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-
-/**
- * javax.persistence.MapKey
- */
-public final class BinaryMapKeyAnnotation
- extends BinaryAnnotation
- implements MapKeyAnnotation
-{
- private String name;
-
-
- public BinaryMapKeyAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** MapKeyAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JPA.MAP_KEY__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java
deleted file mode 100644
index 94053e7423..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-public final class BinaryMappedSuperclassAnnotation
- extends BinaryAnnotation
- implements MappedSuperclassAnnotation
-{
- public BinaryMappedSuperclassAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java
deleted file mode 100644
index a10b169070..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedColumnAnnotation;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- * javax.persistence.DiscriminatorColumn
- * javax.persistence.PrimaryKeyJoinColumn.
- */
-public abstract class BinaryNamedColumnAnnotation
- extends BinaryAnnotation
- implements NamedColumnAnnotation
-{
- private String name;
- private String columnDefinition;
-
-
- protected BinaryNamedColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.columnDefinition = this.buildColumnDefinition();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setColumnDefinition_(this.buildColumnDefinition());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedColumn implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- protected abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** column definition
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- throw new UnsupportedOperationException();
- }
-
- private void setColumnDefinition_(String columnDefinition) {
- String old = this.columnDefinition;
- this.columnDefinition = columnDefinition;
- this.firePropertyChanged(COLUMN_DEFINITION_PROPERTY, old, columnDefinition);
- }
-
- private String buildColumnDefinition() {
- return (String) this.getJdtMemberValue(this.getColumnDefinitionElementName());
- }
-
- protected abstract String getColumnDefinitionElementName();
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java
deleted file mode 100644
index 2163b1fd50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedNativeQueryAnnotation;
-
-/**
- * javax.persistence.NamedNativeQueries
- */
-public final class BinaryNamedNativeQueriesAnnotation
- extends BinaryContainerAnnotation<NestableNamedNativeQueryAnnotation>
- implements NamedNativeQueriesAnnotation
-{
- private final Vector<NestableNamedNativeQueryAnnotation> namedNativeQueries;
-
-
- public BinaryNamedNativeQueriesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.namedNativeQueries = this.buildNamedNativeQueries();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedNativeQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedNativeQueryAnnotation>(this.namedNativeQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedNativeQueries.size();
- }
-
- private Vector<NestableNamedNativeQueryAnnotation> buildNamedNativeQueries() {
- Object[] jdtQueries = this.getJdtMemberValues(JPA.NAMED_NATIVE_QUERIES__VALUE);
- Vector<NestableNamedNativeQueryAnnotation> result = new Vector<NestableNamedNativeQueryAnnotation>(jdtQueries.length);
- for (Object jdtQuery : jdtQueries) {
- result.add(new BinaryNamedNativeQueryAnnotation(this, (IAnnotation) jdtQuery));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNamedNativeQueries();
- }
-
- // TODO
- private void updateNamedNativeQueries() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java
deleted file mode 100644
index dfd105b1b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedNativeQueryAnnotation;
-
-/**
- * javax.persistence.NamedNativeQuery
- */
-public final class BinaryNamedNativeQueryAnnotation
- extends BinaryQueryAnnotation
- implements NestableNamedNativeQueryAnnotation
-{
- private String resultClass;
- private String resultSetMapping;
-
-
- public BinaryNamedNativeQueryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.resultClass = this.buildResultClass();
- this.resultSetMapping = this.buildResultSetMapping();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setResultClass_(this.buildResultClass());
- this.setResultSetMapping_(this.buildResultSetMapping());
- }
-
-
- // ********** BinaryBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_NATIVE_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_NATIVE_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_NATIVE_QUERY__HINTS;
- }
-
-
- // ********** NamedNativeQueryAnnotation implementation **********
-
- // ***** result class
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String resultClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setResultClass_(String resultClass) {
- String old = this.resultClass;
- this.resultClass = resultClass;
- this.firePropertyChanged(RESULT_CLASS_PROPERTY, old, resultClass);
- }
-
- private String buildResultClass() {
- return (String) this.getJdtMemberValue(JPA.NAMED_NATIVE_QUERY__RESULT_CLASS);
- }
-
- public TextRange getResultClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified result class name
- public String getFullyQualifiedResultClassName() {
- return this.resultClass;
- }
-
- // ***** result set mapping
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String resultSetMapping) {
- throw new UnsupportedOperationException();
- }
-
- private void setResultSetMapping_(String resultSetMapping) {
- String old = this.resultSetMapping;
- this.resultSetMapping = resultSetMapping;
- this.firePropertyChanged(RESULT_SET_MAPPING_PROPERTY, old, resultSetMapping);
- }
-
- private String buildResultSetMapping() {
- return (String) this.getJdtMemberValue(JPA.NAMED_NATIVE_QUERY__RESULT_CLASS);
- }
-
- public TextRange getResultSetMappingTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java
deleted file mode 100644
index 9c6a2e4965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedQueryAnnotation;
-
-/**
- * javax.persistence.NamedQueries
- */
-public abstract class BinaryNamedQueriesAnnotation
- extends BinaryContainerAnnotation<NestableNamedQueryAnnotation>
- implements NamedQueriesAnnotation
-{
- private final Vector<NestableNamedQueryAnnotation> namedQueries;
-
-
- public BinaryNamedQueriesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.namedQueries = this.buildNamedQueries();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedQueryAnnotation>(this.namedQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedQueries.size();
- }
-
- private Vector<NestableNamedQueryAnnotation> buildNamedQueries() {
- Object[] jdtQueries = this.getJdtMemberValues(JPA.NAMED_QUERIES__VALUE);
- Vector<NestableNamedQueryAnnotation> result = new Vector<NestableNamedQueryAnnotation>(jdtQueries.length);
- for (Object jdtQuery : jdtQueries) {
- result.add(this.buildNamedQuery(jdtQuery));
- }
- return result;
- }
-
- protected abstract NestableNamedQueryAnnotation buildNamedQuery(Object jdtQuery);
-
- @Override
- public void update() {
- super.update();
- this.updateNamedQueries();
- }
-
- // TODO
- private void updateNamedQueries() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java
deleted file mode 100644
index 938575cbb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedQueryAnnotation;
-
-/**
- * javax.persistence.NamedQuery
- */
-public abstract class BinaryNamedQueryAnnotation
- extends BinaryQueryAnnotation
- implements NestableNamedQueryAnnotation
-{
- public BinaryNamedQueryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_QUERY__HINTS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNode.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNode.java
deleted file mode 100644
index 5cc726ad3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryNode.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * Binary convenience methods
- */
-// TODO hopefully this class can go away with some sort of refactoring of the
-// source and binary hierarchies...
-public abstract class BinaryNode
- extends AbstractJavaResourceNode
-{
- // ********** construction **********
-
- protected BinaryNode(JavaResourceNode parent) {
- super(parent);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- @Override
- public IFile getFile() {
- return null; // only BinaryPackageFragmentRoot has a file...
- }
-
- public void update() {
- // nothing by default
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void initialize(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java
deleted file mode 100644
index 67775fa2aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class BinaryOneToManyAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements OneToMany2_0Annotation
-{
- private String mappedBy;
-
- private Boolean orphanRemoval; //added in JPA 2.0
-
- public BinaryOneToManyAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mappedBy = this.buildMappedBy();
- this.orphanRemoval = this.buildOrphanRemoval();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setMappedBy_(this.buildMappedBy());
- this.setOrphanRemoval_(this.buildOrphanRemoval());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.ONE_TO_MANY__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.ONE_TO_MANY__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.ONE_TO_MANY__CASCADE;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- throw new UnsupportedOperationException();
- }
-
- private void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- private String buildMappedBy() {
- return (String) this.getJdtMemberValue(JPA.ONE_TO_MANY__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** OneToMany2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private Boolean buildOrphanRemoval() {
- return (Boolean) this.getJdtMemberValue(JPA2_0.ONE_TO_MANY__ORPHAN_REMOVAL);
- }
-
- private void setOrphanRemoval_(Boolean orphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = orphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, orphanRemoval);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java
deleted file mode 100644
index ac9bce72a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.OneToOne
- */
-public class BinaryOneToOneAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements OneToOne2_0Annotation
-{
- private Boolean optional;
- private String mappedBy;
- private Boolean orphanRemoval; //added in JPA 2.0
-
- public BinaryOneToOneAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = this.buildOptional();
- this.mappedBy = this.buildMappedBy();
- this.orphanRemoval = this.buildOrphanRemoval();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setOptional_(this.buildOptional());
- this.setMappedBy_(this.buildMappedBy());
- this.setOrphanRemoval_(this.buildOrphanRemoval());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.ONE_TO_ONE__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.ONE_TO_ONE__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.ONE_TO_ONE__CASCADE;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- throw new UnsupportedOperationException();
- }
-
- private void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- private String buildMappedBy() {
- return (String) this.getJdtMemberValue(JPA.ONE_TO_ONE__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- //**************** OneToOneAnnotation implementation **************
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(JPA.ONE_TO_ONE__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** OneToOne2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private Boolean buildOrphanRemoval() {
- return (Boolean) this.getJdtMemberValue(JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
- private void setOrphanRemoval_(Boolean orphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = orphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, orphanRemoval);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOrderByAnnotation.java
deleted file mode 100644
index 1f9df3c60c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOrderByAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-
-/**
- * javax.persistence.OrderBy
- */
-public final class BinaryOrderByAnnotation
- extends BinaryAnnotation
- implements OrderByAnnotation
-{
- private String value;
-
-
- public BinaryOrderByAnnotation(JavaResourcePersistentAttribute parent, IAnnotation annotation) {
- super(parent, annotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** OrderByAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA.ORDER_BY__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOverrideAnnotation.java
deleted file mode 100644
index 642e936e55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryOverrideAnnotation.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.OverrideAnnotation;
-
-/**
- * Common behavior for
- * javax.persistence.AttributeOverride
- * javax.persistence.AssociationOverride
- */
-public abstract class BinaryOverrideAnnotation
- extends BinaryAnnotation
- implements OverrideAnnotation
-{
- private String name;
-
-
- public BinaryOverrideAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** OverrideAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(OverrideAnnotation.NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- protected abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragment.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragment.java
deleted file mode 100644
index cc8623e16f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragment.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceClassFile;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * binary package fragment
- */
-final class BinaryPackageFragment
- extends BinaryNode
- implements JavaResourcePackageFragment
-{
- /** JDT package fragment */
- private final IPackageFragment packageFragment;
-
- /**
- * class files in the package fragment;
- * we only hold class files/types that are actually annotated;
- * if the unannotated types are needed (e.g. for orm.xml or an
- * inheritance tree) they can be discovered on the classpath as needed
- */
- private final Vector<JavaResourceClassFile> classFiles = new Vector<JavaResourceClassFile>();
-
-
- // ********** construction/initialization **********
-
- BinaryPackageFragment(JavaResourcePackageFragmentRoot parent, IPackageFragment packageFragment) {
- super(parent);
- this.packageFragment = packageFragment;
- this.classFiles.addAll(this.buildClassFiles());
- }
-
- private Collection<JavaResourceClassFile> buildClassFiles() {
- IJavaElement[] children = this.getJDTChildren();
- ArrayList<JavaResourceClassFile> result = new ArrayList<JavaResourceClassFile>(children.length);
- for (IJavaElement child : children) {
- IClassFile jdtClassFile = (IClassFile) child;
- IType jdtType = jdtClassFile.getType();
- if (BinaryPersistentType.typeIsPersistable(jdtType)) {
- JavaResourceClassFile classFile = new BinaryClassFile(this, jdtClassFile, jdtType);
- if (classFile.getPersistentType().isAnnotated()) { // we only hold annotated types
- result.add(classFile);
- }
- }
- }
- return result;
- }
-
-
- // ********** JarResourceNode implementation **********
-
- @Override
- public void update() {
- super.update();
- this.updateClassFiles();
- }
-
- // TODO
- private void updateClassFiles() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** JavaResourcePackageFragment implementation **********
-
- public ListIterator<JavaResourceClassFile> classFiles() {
- return new CloneListIterator<JavaResourceClassFile>(this.classFiles);
- }
-
- public int classFilesSize() {
- return this.classFiles.size();
- }
-
- public Iterator<JavaResourcePersistentType> persistedTypes() {
- return new TransformationIterator<JavaResourceClassFile, JavaResourcePersistentType>(this.classFiles()) {
- @Override
- protected JavaResourcePersistentType transform(JavaResourceClassFile classFile) {
- return classFile.getPersistentType(); // we only hold annotated types
- }
- };
- }
-
-
- // ********** misc **********
-
- private IJavaElement[] getJDTChildren() {
- try {
- return this.packageFragment.getChildren();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return EMPTY_JAVA_ELEMENT_ARRAY;
- }
- }
- protected static final IJavaElement[] EMPTY_JAVA_ELEMENT_ARRAY = new IJavaElement[0];
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.packageFragment.getElementName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java
deleted file mode 100644
index dd6367e6ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * binary package fragment root
- */
-public final class BinaryPackageFragmentRoot
- extends RootBinaryNode
- implements JavaResourcePackageFragmentRoot
-{
- /** JDT package fragment root */
- private final IPackageFragmentRoot packageFragmentRoot;
-
- /** package fragments in the JAR */
- private final Vector<JavaResourcePackageFragment> packageFragments = new Vector<JavaResourcePackageFragment>();
-
-
- // ********** construction/initialization **********
-
- public BinaryPackageFragmentRoot(IPackageFragmentRoot packageFragmentRoot, JpaAnnotationProvider annotationProvider) {
- super(null, annotationProvider); // the package fragment root is the root of its sub-tree
- this.packageFragmentRoot = packageFragmentRoot;
- this.packageFragments.addAll(this.buildPackageFragments());
- }
-
- private Collection<JavaResourcePackageFragment> buildPackageFragments() {
- IJavaElement[] jdtChildren = this.getJDTChildren();
- ArrayList<JavaResourcePackageFragment> result = new ArrayList<JavaResourcePackageFragment>(jdtChildren.length);
- for (IJavaElement child : jdtChildren) {
- result.add(new BinaryPackageFragment(this, (IPackageFragment) child));
- }
- return result;
- }
-
-
- // ********** overrides **********
-
- @Override
- public IFile getFile() {
- return (IFile) this.packageFragmentRoot.getResource();
- }
-
- @Override
- public void update() {
- super.update();
- this.updatePackageFragments();
- }
-
- // TODO
- private void updatePackageFragments() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- /**
- * NB: we hold only annotated types
- */
- public Iterator<JavaResourcePersistentType> persistentTypes() {
- return new CompositeIterator<JavaResourcePersistentType>(this.persistedTypesLists());
- }
-
- private Iterator<Iterator<JavaResourcePersistentType>> persistedTypesLists() {
- return new TransformationIterator<JavaResourcePackageFragment, Iterator<JavaResourcePersistentType>>(this.packageFragments()) {
- @Override
- protected Iterator<JavaResourcePersistentType> transform(JavaResourcePackageFragment fragment) {
- return fragment.persistedTypes();
- }
- };
- }
-
-
- // ********** JavaResourcePackageFragmentRoot implementation **********
-
- public Iterator<JavaResourcePackageFragment> packageFragments() {
- return new CloneIterator<JavaResourcePackageFragment>(this.packageFragments);
- }
-
- public int packageFragmentsSize() {
- return this.packageFragments.size();
- }
-
-
- // ********** misc **********
-
- private IJavaElement[] getJDTChildren() {
- return JDTTools.getChildren(this.packageFragmentRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentAttribute.java
deleted file mode 100644
index 5dd4678578..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentAttribute.java
+++ /dev/null
@@ -1,657 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JPTTools;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.NameTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AccessType;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * binary persistent attribute (field or property)
- */
-final class BinaryPersistentAttribute
- extends BinaryPersistentMember
- implements JavaResourcePersistentAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- BinaryPersistentAttribute(JavaResourcePersistentType parent, IField field) {
- this(parent, new FieldAdapter(field));
- }
-
- BinaryPersistentAttribute(JavaResourcePersistentType parent, IMethod method) {
- this(parent, new MethodAdapter(method));
- }
-
- private BinaryPersistentAttribute(JavaResourcePersistentType parent, Adapter adapter) {
- super(parent, adapter);
- this.modifiers = this.buildModifiers();
- this.typeName = this.buildTypeName();
-
- IType type = this.getType(); // shouldn't be an array...
- this.typeIsInterface = this.buildTypeIsInterface(type);
- this.typeIsEnum = this.buildTypeIsEnum(type);
- this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(type));
- this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(type));
-
- this.typeTypeArgumentNames.addAll(this.buildTypeTypeArgumentNames());
- }
-
-
- // ******** overrides ********
-
- @Override
- public void update() {
- super.update();
- this.setModifiers(this.buildModifiers());
- this.setTypeName(this.buildTypeName());
-
- IType type = this.getType(); // shouldn't be an array...
- this.setTypeIsInterface(this.buildTypeIsInterface(type));
- this.setTypeIsEnum(this.buildTypeIsEnum(type));
- this.setTypeSuperclassNames(this.buildTypeSuperclassNames(type));
- this.setTypeInterfaceNames(this.buildTypeInterfaceNames(type));
-
- this.setTypeTypeArgumentNames(this.buildTypeTypeArgumentNames());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** BinaryPersistentMember implementation **********
-
- private Adapter getAdapter() {
- return (Adapter) this.adapter;
- }
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().attributeAnnotationNames();
- }
-
- @Override
- Annotation buildAnnotation(IAnnotation jdtAnnotation) {
- return this.getAnnotationProvider().buildAttributeAnnotation(this, jdtAnnotation);
- }
-
- Annotation buildNullAnnotation_(String annotationName) {
- return this.getAnnotationProvider().buildNullAttributeAnnotation(this, annotationName);
- }
-
-
- // ********** JavaResourcePersistentAttribute implementation **********
-
- @Override
- public JavaResourcePersistentType getParent() {
- return (JavaResourcePersistentType) super.getParent();
- }
-
- public JavaResourcePersistentType getResourcePersistentType() {
- return this.getParent();
- }
-
- public String getName() {
- return this.getAdapter().getAttributeName();
- }
-
- @Override
- public Annotation buildNullAnnotation(String annotationName) {
- return (annotationName == null) ? null : this.buildNullAnnotation_(annotationName);
- }
-
- public boolean isField() {
- return this.getAdapter().isField();
- }
-
- public boolean isProperty() {
- return ! this.isField();
- }
-
- public boolean isFor(MethodSignature methodSignature, int occurrence) {
- throw new UnsupportedOperationException();
- }
-
- public AccessType getSpecifiedAccess() {
- Access2_0Annotation accessAnnotation = (Access2_0Annotation) this.getAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- return accessAnnotation == null ? null : accessAnnotation.getValue();
- }
-
- public boolean typeIsSubTypeOf(String tn) {
- return ((this.typeName != null) && this.typeName.equals(tn))
- || this.typeInterfaceNames.contains(tn)
- || this.typeSuperclassNames.contains(tn);
- }
-
- public boolean typeIsVariablePrimitive() {
- return (this.typeName != null) && ClassName.isVariablePrimitive(this.typeName);
- }
-
- // ***** modifiers
- public int getModifiers() {
- return this.modifiers;
- }
-
- private void setModifiers(int modifiers) {
- int old = this.modifiers;
- this.modifiers = modifiers;
- this.firePropertyChanged(MODIFIERS_PROPERTY, old, modifiers);
- }
-
- /**
- * zero seems like a reasonable default...
- */
- private int buildModifiers() {
- try {
- return this.getMember().getFlags();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return 0;
- }
- }
-
- // ***** type name
- public String getTypeName() {
- return this.typeName;
- }
-
- private void setTypeName(String typeName) {
- String old = this.typeName;
- this.typeName = typeName;
- this.firePropertyChanged(TYPE_NAME_PROPERTY, old, typeName);
- }
-
- /**
- * JARs don't have array types;
- * also, no generic type parameters
- */
- private String buildTypeName() {
- return convertTypeSignatureToTypeName(this.getTypeSignature());
- }
-
- // ***** type is interface
- public boolean typeIsInterface() {
- return this.typeIsInterface;
- }
-
- private void setTypeIsInterface(boolean typeIsInterface) {
- boolean old = this.typeIsInterface;
- this.typeIsInterface = typeIsInterface;
- this.firePropertyChanged(TYPE_IS_INTERFACE_PROPERTY, old, typeIsInterface);
- }
-
- private boolean buildTypeIsInterface(IType type) {
- try {
- return (type != null) && type.isInterface();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** type is enum
- public boolean typeIsEnum() {
- return this.typeIsEnum;
- }
-
- private void setTypeIsEnum(boolean typeIsEnum) {
- boolean old = this.typeIsEnum;
- this.typeIsEnum = typeIsEnum;
- this.firePropertyChanged(TYPE_IS_ENUM_PROPERTY, old, typeIsEnum);
- }
-
- private boolean buildTypeIsEnum(IType type) {
- try {
- return (type != null) && type.isEnum();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** type superclass hierarchy
- public ListIterator<String> typeSuperclassNames() {
- return new CloneListIterator<String>(this.typeSuperclassNames);
- }
-
- public boolean typeSuperclassNamesContains(String superclassName) {
- return this.typeSuperclassNames.contains(superclassName);
- }
-
- private void setTypeSuperclassNames(List<String> typeSuperclassNames) {
- this.synchronizeList(typeSuperclassNames, this.typeSuperclassNames, TYPE_SUPERCLASS_NAMES_LIST);
- }
-
- private List<String> buildTypeSuperclassNames(IType type) {
- if (type == null) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>();
- type = this.findSuperclass(type);
- while (type != null) {
- names.add(type.getFullyQualifiedName('.')); // no parameters are included here
- type = this.findSuperclass(type);
- }
- return names;
- }
-
- // ***** type interface hierarchy
- public Iterator<String> typeInterfaceNames() {
- return new CloneIterator<String>(this.typeInterfaceNames);
- }
-
- public boolean typeInterfaceNamesContains(String interfaceName) {
- return this.typeInterfaceNames.contains(interfaceName);
- }
-
- private void setTypeInterfaceNames(Collection<String> typeInterfaceNames) {
- this.synchronizeCollection(typeInterfaceNames, this.typeInterfaceNames, TYPE_INTERFACE_NAMES_COLLECTION);
- }
-
- private Collection<String> buildTypeInterfaceNames(IType type) {
- if (type == null) {
- return Collections.emptySet();
- }
-
- HashSet<String> names = new HashSet<String>();
- while (type != null) {
- this.addInterfaceNamesTo(type, names);
- type = this.findSuperclass(type);
- }
- return names;
- }
-
- private void addInterfaceNamesTo(IType type, HashSet<String> names) {
- for (String interfaceSignature : this.getSuperInterfaceTypeSignatures(type)) {
- String interfaceName = convertTypeSignatureToTypeName(interfaceSignature);
- names.add(interfaceName);
- IType interfaceType = this.findType(interfaceName);
- if (interfaceType != null) {
- this.addInterfaceNamesTo(interfaceType, names); // recurse
- }
- }
- }
-
- // ***** type type argument names
- public ListIterator<String> typeTypeArgumentNames() {
- return new CloneListIterator<String>(this.typeTypeArgumentNames);
- }
-
- public int typeTypeArgumentNamesSize() {
- return this.typeTypeArgumentNames.size();
- }
-
- public String getTypeTypeArgumentName(int index) {
- return this.typeTypeArgumentNames.get(index);
- }
-
- private void setTypeTypeArgumentNames(List<String> typeTypeArgumentNames) {
- this.synchronizeList(typeTypeArgumentNames, this.typeTypeArgumentNames, TYPE_TYPE_ARGUMENT_NAMES_LIST);
- }
-
- /**
- * these types can be arrays (e.g. "java.lang.String[]");
- * but they won't have any further nested generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>")
- */
- private List<String> buildTypeTypeArgumentNames() {
- String typeSignature = this.getTypeSignature();
- if (typeSignature == null) {
- return Collections.emptyList();
- }
-
- String[] typeArgumentSignatures = Signature.getTypeArguments(typeSignature);
- if (typeArgumentSignatures.length == 0) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>(typeArgumentSignatures.length);
- for (String typeArgumentSignature : typeArgumentSignatures) {
- names.add(convertTypeSignatureToTypeName(typeArgumentSignature));
- }
- return names;
- }
-
-
- // ********** convenience methods **********
-
- private String getTypeSignature() {
- try {
- return this.getAdapter().getTypeSignature();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return null;
- }
- }
-
- private IType findSuperclass(IType type) {
- return this.findTypeBySignature(this.getSuperclassSignature(type));
- }
-
- private String getSuperclassSignature(IType type) {
- try {
- return type.getSuperclassTypeSignature();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return null;
- }
- }
-
- private String[] getSuperInterfaceTypeSignatures(IType type) {
- try {
- return type.getSuperInterfaceTypeSignatures();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return StringTools.EMPTY_STRING_ARRAY;
- }
- }
-
- private IType findTypeBySignature(String typeSignature) {
- return (typeSignature == null) ? null : this.findType(convertTypeSignatureToTypeName_(typeSignature));
- }
-
- private IType getType() {
- return (this.typeName == null) ? null : this.findType(this.typeName);
- }
-
- private IType findType(String fullyQualifiedName) {
- try {
- return this.getJavaProject().findType(fullyQualifiedName);
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return null;
- }
- }
-
- private IJavaProject getJavaProject() {
- return this.getMember().getJavaProject();
- }
-
-
-
- // ********** adapters **********
-
- /**
- * Adapt an IField or IMethod.
- */
- interface Adapter
- extends BinaryPersistentMember.Adapter
- {
- /**
- * Return the field or getter method's "attribute" name
- * (e.g. field "foo" -> "foo"; method "getFoo" -> "foo").
- */
- String getAttributeName();
-
- /**
- * Return whether the attribute is a Java field (as opposed to a method).
- */
- boolean isField();
-
- /**
- * Return the attribute's type signature.
- */
- String getTypeSignature() throws JavaModelException;
- }
-
- /**
- * IField adapter
- */
- static class FieldAdapter
- implements Adapter
- {
- final IField field;
-
- FieldAdapter(IField field) {
- super();
- this.field = field;
- }
-
- public IField getElement() {
- return this.field;
- }
-
- public boolean isPersistable() {
- return this.field.exists() && JPTTools.fieldIsPersistable(new JPTToolsAdapter());
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.field.getAnnotations();
- }
-
- public String getAttributeName() {
- return this.field.getElementName();
- }
-
- public boolean isField() {
- return true;
- }
-
- public String getTypeSignature() throws JavaModelException {
- return this.field.getTypeSignature();
- }
-
- /**
- * JPTTools needs an adapter so it can work with either an IField
- * or an IVariableBinding etc.
- */
- class JPTToolsAdapter implements JPTTools.FieldAdapter {
- public int getModifiers() {
- try {
- return FieldAdapter.this.field.getFlags();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return 0;
- }
- }
-
- }
-
- }
-
- /**
- * IMethod adapter
- */
- static class MethodAdapter
- implements Adapter
- {
- final IMethod method;
- static final IMethod[] EMPTY_METHOD_ARRAY = new IMethod[0];
-
- MethodAdapter(IMethod method) {
- super();
- this.method = method;
- }
-
- public IMethod getElement() {
- return this.method;
- }
-
- public boolean isPersistable() {
- return JPTTools.methodIsPersistablePropertyGetter(new JPTToolsAdapter());
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.method.getAnnotations();
- }
-
- public String getAttributeName() {
- return NameTools.convertGetterSetterMethodNameToPropertyName(this.method.getElementName());
- }
-
- public boolean isField() {
- return false;
- }
-
- public String getTypeSignature() throws JavaModelException {
- return this.method.getReturnType();
- }
-
- /**
- * JPTTools needs an adapter so it can work with either an IMethod
- * or an IMethodBinding etc.
- */
- abstract static class AbstractJPTToolsAdapter
- implements JPTTools.SimpleMethodAdapter
- {
- AbstractJPTToolsAdapter() {
- super();
- }
-
- abstract IMethod getMethod();
-
- public int getModifiers() {
- try {
- return this.getMethod().getFlags();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return 0;
- }
- }
-
- public String getReturnTypeErasureName() {
- return convertTypeSignatureToTypeName(this.getReturnTypeSignature());
- }
-
- private String getReturnTypeSignature() {
- try {
- return this.getMethod().getReturnType();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return null;
- }
- }
-
- public boolean isConstructor() {
- try {
- return this.getMethod().isConstructor();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- }
-
- static class SimpleJPTToolsAdapter
- extends AbstractJPTToolsAdapter
- {
- private final IMethod method;
-
- SimpleJPTToolsAdapter(IMethod method) {
- super();
- this.method = method;
- }
-
- @Override
- IMethod getMethod() {
- return this.method;
- }
-
- }
-
- class JPTToolsAdapter
- extends AbstractJPTToolsAdapter
- implements JPTTools.MethodAdapter
- {
- JPTToolsAdapter() {
- super();
- }
-
- @Override
- IMethod getMethod() {
- return MethodAdapter.this.method;
- }
-
- public String getName() {
- return this.getMethod().getElementName();
- }
-
- public int getParametersLength() {
- return this.getMethod().getParameterTypes().length;
- }
-
- public JPTTools.SimpleMethodAdapter getSibling(String name) {
- for (IMethod sibling : this.getSiblings()) {
- if ((sibling.getParameterTypes().length == 0)
- && sibling.getElementName().equals(name)) {
- return new SimpleJPTToolsAdapter(sibling);
- }
- }
- return null;
- }
-
- public JPTTools.SimpleMethodAdapter getSibling(String name, String parameterTypeErasureName) {
- for (IMethod sibling : this.getSiblings()) {
- String[] parmTypes = sibling.getParameterTypes();
- if ((parmTypes.length == 1)
- && sibling.getElementName().equals(name)
- && convertTypeSignatureToTypeName(parmTypes[0]).equals(parameterTypeErasureName)) {
- return new SimpleJPTToolsAdapter(sibling);
- }
- }
- return null;
- }
-
- private IMethod[] getSiblings() {
- try {
- return this.getMethod().getDeclaringType().getMethods();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return EMPTY_METHOD_ARRAY;
- }
- }
-
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentMember.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentMember.java
deleted file mode 100644
index 90fc759dca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentMember.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * binary persistent member
- */
-abstract class BinaryPersistentMember
- extends BinaryAnnotatedElement
- implements JavaResourcePersistentMember
-{
-
- boolean persistable;
-
- private boolean final_; // 'final' is a reserved word
-
-
- // ********** construction/initialization **********
-
- public BinaryPersistentMember(JavaResourceNode parent, Adapter adapter) {
- super(parent, adapter);
- this.persistable = this.buildPersistable();
- this.final_ = this.buildFinal();
- }
-
-
- private Adapter getAdapter() {
- return (Adapter) this.adapter;
- }
-
- // ********** updating **********
-
- @Override
- public void update() {
- super.update();
- this.setPersistable(this.buildPersistable());
- this.setFinal(this.buildFinal());
- }
-
-
- // ********** simple state **********
-
- public boolean isPersistable() {
- return this.persistable;
- }
-
- private void setPersistable(boolean persistable) {
- boolean old = this.persistable;
- this.persistable = persistable;
- this.firePropertyChanged(PERSISTABLE_PROPERTY, old, persistable);
- }
-
- private boolean buildPersistable() {
- return this.getAdapter().isPersistable();
- }
-
- // ***** final
- public boolean isFinal() {
- return this.final_;
- }
-
- private void setFinal(boolean final_) {
- boolean old = this.final_;
- this.final_ = final_;
- this.firePropertyChanged(FINAL_PROPERTY, old, final_);
- }
-
- private boolean buildFinal() {
- try {
- return Flags.isFinal(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
-
- // ********** miscellaneous **********
-
- IMember getMember() {
- return (IMember) this.adapter.getElement();
- }
-
- /**
- * convenience method
- */
- <T extends JavaResourcePersistentMember> Iterator<T> persistableMembers(Iterator<T> members) {
- @SuppressWarnings("unchecked")
- Filter<T> filter = (Filter<T>) PERSISTABLE_MEMBER_FILTER;
- return new FilteringIterator<T>(members, filter);
- }
-
- /**
- * Strip off the type signature's parameters if present.
- * Convert to a readable string.
- */
- static String convertTypeSignatureToTypeName(String typeSignature) {
- return (typeSignature == null) ? null : convertTypeSignatureToTypeName_(typeSignature);
- }
-
- /**
- * no null check
- */
- static String convertTypeSignatureToTypeName_(String typeSignature) {
- return Signature.toString(Signature.getTypeErasure(typeSignature));
- }
-
-
- // ********** IMember adapter **********
-
- interface Adapter extends BinaryAnnotatedElement.Adapter {
- /**
- * Return the adapter's JDT member (IType, IField, IMethod).
- */
- IMember getElement();
-
- /**
- * Return whether the adapter's member is "persistable"
- * (i.e. according to the JPA spec the member can be mapped)
- */
- boolean isPersistable();
- }
-
-
- // ********** unsupported JavaResourceAnnotatedElement implementation **********
-
- @Override
- public Annotation addAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void removeAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isFor(String memberName, int occurrence) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentType.java
deleted file mode 100644
index 876a38c278..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentType.java
+++ /dev/null
@@ -1,700 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JPTTools;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.jpa.core.resource.java.AccessType;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * binary persistent type
- */
-final class BinaryPersistentType
- extends BinaryPersistentMember
- implements JavaResourcePersistentType2_0
-{
- private String name;
-
- private String qualifiedName;
-
- private String packageName;
-
- private String superclassQualifiedName;
-
- private String declaringTypeName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private boolean static_; // 'static' is a reserved word
-
- private boolean memberType;
-
- private boolean hasPrivateNoArgConstructor;
-
- private boolean hasNoArgConstructor;
-
- private final Vector<JavaResourcePersistentAttribute> fields;
-
- private final Vector<JavaResourcePersistentAttribute> methods;
-
-
- // ********** construction/initialization **********
-
- BinaryPersistentType(JavaResourceNode parent, IType type) {
- super(parent, new TypeAdapter(type));
- this.name = this.buildName();
- this.qualifiedName = this.buildQualifiedName();
- this.packageName = this.buildPackageName();
- this.superclassQualifiedName = this.buildSuperclassQualifiedName();
- this.declaringTypeName = this.buildDeclaringTypeName();
- this.abstract_ = this.buildAbstract();
- this.static_ = this.buildStatic();
- this.memberType = this.buildMemberType();
- this.hasNoArgConstructor = this.buildHasNoArgConstructor();
- this.hasPrivateNoArgConstructor = this.buildHasPrivateNoArgConstructor();
- this.fields = this.buildFields();
- this.methods = this.buildMethods();
- }
-
-
- // ********** overrides **********
-
- @Override
- public void update() {
- super.update();
- this.setName(this.buildName());
- this.setQualifiedName(this.buildQualifiedName());
- this.setPackageName(this.buildPackageName());
- this.setSuperclassQualifiedName(this.buildSuperclassQualifiedName());
- this.setDeclaringTypeName(this.buildDeclaringTypeName());
- this.setAbstract(this.buildAbstract());
- this.setStatic(this.buildStatic());
- this.setMemberType(this.buildMemberType());
- this.setHasNoArgConstructor(this.buildHasNoArgConstructor());
- this.setHasPrivateNoArgConstructor(this.buildHasPrivateNoArgConstructor());
- this.updateFields();
- this.updateMethods();
- }
-
- // TODO
- private void updateFields() {
- throw new UnsupportedOperationException();
- }
-
- // TODO
- private void updateMethods() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BinaryPersistentMember implementation **********
-
- @Override
- Annotation buildAnnotation(IAnnotation jdtAnnotation) {
- return this.getAnnotationProvider().buildTypeAnnotation(this, jdtAnnotation);
- }
-
- @Override
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullTypeAnnotation(this, annotationName);
- }
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().typeAnnotationNames();
- }
-
-
- // ********** JavaResourcePersistentType implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return this.getMember().getElementName();
- }
-
- // ***** qualified name
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- private void setQualifiedName(String qualifiedName) {
- String old = this.qualifiedName;
- this.qualifiedName = qualifiedName;
- this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, qualifiedName);
- }
-
- private String buildQualifiedName() {
- return this.getMember().getFullyQualifiedName('.'); // no parameters are included here
- }
-
- // ***** package
- public String getPackageName() {
- return this.packageName;
- }
-
- private void setPackageName(String packageName) {
- String old = this.packageName;
- this.packageName = packageName;
- this.firePropertyChanged(PACKAGE_NAME_PROPERTY, old, packageName);
- }
-
- private String buildPackageName() {
- return this.getMember().getPackageFragment().getElementName();
- }
-
- public boolean isIn(IPackageFragment packageFragment) {
- return StringTools.stringsAreEqual(packageFragment.getElementName(), this.packageName);
- }
-
- // ***** superclass qualified name
- public String getSuperclassQualifiedName() {
- return this.superclassQualifiedName;
- }
-
- private void setSuperclassQualifiedName(String superclassQualifiedName) {
- String old = this.superclassQualifiedName;
- this.superclassQualifiedName = superclassQualifiedName;
- this.firePropertyChanged(SUPERCLASS_QUALIFIED_NAME_PROPERTY, old, superclassQualifiedName);
- }
-
- private String buildSuperclassQualifiedName() {
- return convertTypeSignatureToTypeName(this.getSuperclassTypeSignature());
- }
-
- private String getSuperclassTypeSignature() {
- try {
- return this.getMember().getSuperclassTypeSignature();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return null;
- }
- }
-
- // ***** declaring type name
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- private void setDeclaringTypeName(String declaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = declaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, declaringTypeName);
- }
-
- private String buildDeclaringTypeName() {
- IType declaringType = this.getMember().getDeclaringType();
- return (declaringType == null) ? null : declaringType.getFullyQualifiedName('.'); // no parameters are included here
- }
-
- // ***** abstract
- public boolean isAbstract() {
- return this.abstract_;
- }
-
- private void setAbstract(boolean abstract_) {
- boolean old = this.abstract_;
- this.abstract_ = abstract_;
- this.firePropertyChanged(ABSTRACT_PROPERTY, old, abstract_);
- }
-
- private boolean buildAbstract() {
- try {
- return Flags.isAbstract(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** static
- public boolean isStatic() {
- return this.static_;
- }
-
- private void setStatic(boolean static_) {
- boolean old = this.static_;
- this.static_ = static_;
- this.firePropertyChanged(STATIC_PROPERTY, old, static_);
- }
-
- private boolean buildStatic() {
- try {
- return Flags.isStatic(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** member
- public boolean isMemberType() {
- return this.memberType;
- }
-
- private void setMemberType(boolean memberType) {
- boolean old = this.memberType;
- this.memberType = memberType;
- this.firePropertyChanged(MEMBER_TYPE_PROPERTY, old, memberType);
- }
-
- private boolean buildMemberType() {
- try {
- return this.getMember().isMember();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** no-arg constructor
- public boolean hasNoArgConstructor() {
- return this.hasNoArgConstructor;
- }
-
- private void setHasNoArgConstructor(boolean hasNoArgConstructor) {
- boolean old = this.hasNoArgConstructor;
- this.hasNoArgConstructor = hasNoArgConstructor;
- this.firePropertyChanged(NO_ARG_CONSTRUCTOR_PROPERTY, old, hasNoArgConstructor);
- }
-
- private boolean buildHasNoArgConstructor() {
- return this.findNoArgConstructor() != null;
- }
-
- private IMethod findNoArgConstructor() {
- try {
- for (IMethod method : this.getMember().getMethods()) {
- if (method.isConstructor()) {
- return method;
- }
- }
- }
- catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- }
- return null;
- }
-
- // ***** private no-arg constructor
- public boolean hasPrivateNoArgConstructor() {
- return this.hasPrivateNoArgConstructor;
- }
-
- private void setHasPrivateNoArgConstructor(boolean hasPrivateNoArgConstructor) {
- boolean old = this.hasPrivateNoArgConstructor;
- this.hasPrivateNoArgConstructor = hasPrivateNoArgConstructor;
- this.firePropertyChanged(PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY, old, hasPrivateNoArgConstructor);
- }
-
- private boolean buildHasPrivateNoArgConstructor() {
- IMethod method = this.findNoArgConstructor();
- try {
- return method != null && Flags.isPrivate(method.getFlags());
- }
- catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
-
- // ********** misc **********
-
- public boolean isMapped() {
- for (Annotation annotation : CollectionTools.iterable(annotations())) {
- if (this.annotationIsMappingAnnotation(annotation)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean annotationIsMappingAnnotation(Annotation annotation) {
- return CollectionTools.contains(this.mappingAnnotationNames(), annotation.getAnnotationName());
- }
-
- private Iterator<String> mappingAnnotationNames() {
- return this.getAnnotationProvider().typeMappingAnnotationNames();
- }
-
- /**
- * check only persistable attributes
- */
- public boolean hasAnyAnnotatedAttributes() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableAttributes(); stream.hasNext(); ) {
- if (stream.next().isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public IType getMember() {
- return (IType) super.getMember();
- }
-
-
- // ********** fields **********
-
- public Iterator<JavaResourcePersistentAttribute> fields() {
- return this.getFields().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getFields() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.fields);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFields() {
- return this.persistableMembers(this.fields());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- FIELD_ACCESS_TYPE_FILTER
- );
- }
-
- private void addField(JavaResourcePersistentAttribute field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourcePersistentAttribute getField(String fieldName, int occurrence) {
- for (JavaResourcePersistentAttribute field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private Vector<JavaResourcePersistentAttribute> buildFields() {
- IField[] jdtFields = this.getFields(this.getMember());
- Vector<JavaResourcePersistentAttribute> result = new Vector<JavaResourcePersistentAttribute>(jdtFields.length);
- for (IField jdtField : jdtFields) {
- result.add(this.buildField(jdtField));
- }
- return result;
- }
-
- private IField[] getFields(IType type) {
- try {
- return type.getFields();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return EMPTY_FIELD_ARRAY;
- }
- }
- private static final IField[] EMPTY_FIELD_ARRAY = new IField[0];
-
- private JavaResourcePersistentAttribute buildField(IField jdtField) {
- return new BinaryPersistentAttribute(this, jdtField);
- }
-
-
- // ********** methods **********
-
- public Iterator<JavaResourcePersistentAttribute> methods() {
- return this.getMethods().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getMethods() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.methods);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableProperties() {
- return persistableMembers(this.methods());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(
- this.persistableProperties(),
- PROPERTY_ACCESS_TYPE_FILTER
- );
- }
-
- private JavaResourcePersistentAttribute getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourcePersistentAttribute method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourcePersistentAttribute method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private Vector<JavaResourcePersistentAttribute> buildMethods() {
- IMethod[] jdtMethods = this.getMethods(this.getMember());
- Vector<JavaResourcePersistentAttribute> result = new Vector<JavaResourcePersistentAttribute>(jdtMethods.length);
- for (IMethod jdtMethod : jdtMethods) {
- result.add(this.buildMethod(jdtMethod));
- }
- return result;
- }
-
- private IMethod[] getMethods(IType type) {
- try {
- return type.getMethods();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return EMPTY_METHOD_ARRAY;
- }
- }
- private static final IMethod[] EMPTY_METHOD_ARRAY = new IMethod[0];
-
- private JavaResourcePersistentAttribute buildMethod(IMethod jdtMethod) {
- return new BinaryPersistentAttribute(this, jdtMethod);
- }
-
-
- // ********** attributes **********
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistableProperties()
- );
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes(AccessType specifiedAccess) {
- switch (specifiedAccess) {
- case FIELD :
- return this.persistableAttributesForFieldAccessType();
- case PROPERTY :
- return this.persistableAttributesForPropertyAccessType();
- default :
- throw new IllegalArgumentException("unknown access: " + specifiedAccess); //$NON-NLS-1$
- }
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForFieldAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistablePropertiesWithSpecifiedPropertyAccess()
- );
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForPropertyAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableProperties(),
- this.persistableFieldsWithSpecifiedFieldAccess()
- );
- }
-
-
- // ********** IType adapter **********
-
- static class TypeAdapter implements Adapter {
- private final IType type;
-
- TypeAdapter(IType type) {
- super();
- this.type = type;
- }
-
- public IType getElement() {
- return this.type;
- }
-
- public boolean isPersistable() {
- return true; // we only build a JAR type if it is "persistable"
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.type.getAnnotations();
- }
-
- }
-
-
- // ********** "persistable" check **********
-
- static boolean typeIsPersistable(IType type) {
- return (type != null)
- && type.exists()
- && JPTTools.typeIsPersistable(new JPTToolsAdapter(type));
- }
-
-
- // ********** JPT tools adapter **********
-
- /**
- * JPTTools needs an adapter so it can work with either an IType
- * or an ITypeBinding etc.
- */
- static class JPTToolsAdapter implements JPTTools.TypeAdapter {
- private final IType type;
-
- protected JPTToolsAdapter(IType type) {
- super();
- if (type == null) {
- throw new NullPointerException();
- }
- this.type = type;
- }
-
- public int getModifiers() {
- try {
- return this.type.getFlags();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return 0;
- }
- }
-
- public boolean isAnnotation() {
- try {
- return this.type.isAnnotation();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isAnonymous() {
- try {
- return this.type.isAnonymous();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isArray() {
- return false; // ???
- }
-
- public boolean isEnum() {
- try {
- return this.type.isEnum();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isInterface() {
- try {
- return this.type.isInterface();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isLocal() {
- try {
- return this.type.isLocal();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isMember() {
- try {
- return this.type.isMember();
- } catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isPrimitive() {
- return false; // ???
- }
-
- }
-
-
- // ********** unsupported JavaResourcePersistentType implementation **********
-
- public Iterator<JavaResourcePersistentType> types() {
- throw new UnsupportedOperationException();
- }
-
- public Iterator<JavaResourcePersistentType> allTypes() {
- throw new UnsupportedOperationException();
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isGeneratedMetamodelTopLevelType(IPackageFragmentRoot sourceFolder) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isGeneratedMetamodelTopLevelType() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isMetamodel() {
- throw new UnsupportedOperationException();
- }
-
- public GeneratedAnnotation getGeneratedAnnotation() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentTypeCache.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentTypeCache.java
deleted file mode 100644
index 6452d7a519..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPersistentTypeCache.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentTypeCache;
-
-/**
- * cache used to hold binary "external" Java resource persistent types
- * (typically derived from JARs on the project's build path)
- */
-public final class BinaryPersistentTypeCache
- extends RootBinaryNode
- implements JavaResourcePersistentTypeCache
-{
- /** populated on-demand */
- private final Vector<Entry> entries = new Vector<Entry>();
-
-
- // ********** construction **********
-
- public BinaryPersistentTypeCache(JpaAnnotationProvider annotationProvider) {
- super(null, annotationProvider);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public Iterator<JavaResourcePersistentType> persistentTypes() {
- return this.getPersistentTypes().iterator();
- }
-
- private Iterable<JavaResourcePersistentType> getPersistentTypes() {
- return new TransformationIterable<Entry, JavaResourcePersistentType>(this.getEntries()) {
- @Override
- protected JavaResourcePersistentType transform(Entry entry) {
- return entry.persistentType;
- }
- };
- }
-
- private Iterable<Entry> getEntries() {
- return new LiveCloneIterable<Entry>(this.entries);
- }
-
-
- // ********** JavaResourcePersistentTypeCache implementation **********
-
- public int persistentTypesSize() {
- return this.entries.size();
- }
-
- public JavaResourcePersistentType addPersistentType(IType jdtType) {
- Entry entry = this.buildEntry(jdtType);
- this.entries.add(entry);
- this.fireItemAdded(PERSISTENT_TYPES_COLLECTION, entry.persistentType);
- return entry.persistentType;
- }
-
- private Entry buildEntry(IType jdtType) {
- return new Entry(this.buildPersistentType(jdtType), jdtType.getResource());
- }
-
- private JavaResourcePersistentType buildPersistentType(IType jdtType) {
- return new BinaryPersistentType(this, jdtType);
- }
-
- public boolean removePersistentTypes(IFile jarFile) {
- boolean modified = false;
- for (Entry entry : this.getEntries()) {
- IResource resource = entry.resource;
- if ((resource != null) && resource.equals(jarFile)) {
- this.removeEntry(entry);
- modified = true;
- }
- }
- return modified;
- }
-
- private void removeEntry(Entry entry) {
- this.entries.remove(entry);
- this.fireItemRemoved(PERSISTENT_TYPES_COLLECTION, entry.persistentType);
- }
-
-
- // ********** overrides **********
-
- /**
- * Ignore changes to this collection. Adds can be ignored since they are triggered
- * by requests that will, themselves, trigger updates (typically during the
- * update of an object that calls a setter with the newly-created resource
- * type). Deletes will be accompanied by manual updates.
- */
- @Override
- protected void aspectChanged(String aspectName) {
- if ((aspectName != null) && ! aspectName.equals(PERSISTENT_TYPES_COLLECTION)) {
- super.aspectChanged(aspectName);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.entries);
- }
-
-
- // ********** cache entry **********
-
- /**
- * Associate a persistent type with its resource.
- * This will be a JAR in the case of a type loaded from a JAR that is in
- * the Eclipse workspace. The resource will be null for a type loaded
- * from a JAR or class directory outside of the workspace.
- */
- static class Entry {
- final JavaResourcePersistentType persistentType;
- final IResource resource;
-
- Entry(JavaResourcePersistentType persistentType, IResource resource) {
- super();
- this.persistentType = persistentType;
- this.resource = resource;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.persistentType);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index 9165a8395b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumn
- */
-public final class BinaryPrimaryKeyJoinColumnAnnotation
- extends BinaryNamedColumnAnnotation
- implements NestablePrimaryKeyJoinColumnAnnotation
-{
- private String referencedColumnName;
-
-
- public BinaryPrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.referencedColumnName = this.buildReferencedColumnName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setReferencedColumnName_(this.buildReferencedColumnName());
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** PrimaryKeyJoinColumnAnnotation implementation **********
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setReferencedColumnName_(String referencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = referencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, referencedColumnName);
- }
-
- private String buildReferencedColumnName() {
- return (String) this.getJdtMemberValue(JPA.PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java
deleted file mode 100644
index e24dedd4c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumns
- */
-public final class BinaryPrimaryKeyJoinColumnsAnnotation
- extends BinaryContainerAnnotation<NestablePrimaryKeyJoinColumnAnnotation>
- implements PrimaryKeyJoinColumnsAnnotation
-{
- private final Vector<NestablePrimaryKeyJoinColumnAnnotation> pkJoinColumns;
-
-
- public BinaryPrimaryKeyJoinColumnsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.pkJoinColumns = this.buildPkJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestablePrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.pkJoinColumns.size();
- }
-
- private Vector<NestablePrimaryKeyJoinColumnAnnotation> buildPkJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.PRIMARY_KEY_JOIN_COLUMNS__VALUE);
- Vector<NestablePrimaryKeyJoinColumnAnnotation> result = new Vector<NestablePrimaryKeyJoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryPrimaryKeyJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updatePkJoinColumns();
- }
-
- // TODO
- private void updatePkJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryAnnotation.java
deleted file mode 100644
index bc528de494..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryAnnotation.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.QueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-/**
- * javax.persistence.NamedQuery
- * javax.persistence.NamedNativeQuery
- */
-abstract class BinaryQueryAnnotation
- extends BinaryAnnotation
- implements QueryAnnotation
-{
- String name;
- String query;
- final Vector<QueryHintAnnotation> hints;
-
-
- BinaryQueryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.query = this.buildQuery();
- this.hints = this.buildHints();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setQuery_(this.buildQuery());
- this.updateHints();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BaseNamedQueryAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** query
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String query) {
- throw new UnsupportedOperationException();
- }
-
- private void setQuery_(String query) {
- String old = this.query;
- this.query = query;
- this.firePropertyChanged(QUERY_PROPERTY, old, query);
- }
-
- private String buildQuery() {
- return (String) this.getJdtMemberValue(this.getQueryElementName());
- }
-
- abstract String getQueryElementName();
-
- public TextRange getQueryTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** hints
- public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public QueryHintAnnotation hintAt(int index) {
- return this.hints.get(index);
- }
-
- public int indexOfHint(QueryHintAnnotation queryHint) {
- return this.hints.indexOf(queryHint);
- }
-
- public QueryHintAnnotation addHint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeHint(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<QueryHintAnnotation> buildHints() {
- Object[] jdtHints = this.getJdtMemberValues(this.getHintsElementName());
- Vector<QueryHintAnnotation> result = new Vector<QueryHintAnnotation>(jdtHints.length);
- for (Object jdtHint : jdtHints) {
- result.add(new BinaryQueryHintAnnotation(this, (IAnnotation) jdtHint));
- }
- return result;
- }
-
- abstract String getHintsElementName();
-
- // TODO
- private void updateHints() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java
deleted file mode 100644
index f1d4ac8f92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-/**
- * javax.persistence.QueryHint
- */
-class BinaryQueryHintAnnotation
- extends BinaryAnnotation
- implements QueryHintAnnotation
-{
- private String name;
- private String value;
-
-
- BinaryQueryHintAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** QueryHintAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JPA.QUERY_HINT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA.QUERY_HINT__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java
deleted file mode 100644
index 365d2e5263..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.ManyToMany
- * javax.persistence.ManyToOne
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- */
-abstract class BinaryRelationshipMappingAnnotation
- extends BinaryAnnotation
- implements RelationshipMapping2_0Annotation
-{
- String targetEntity;
- FetchType fetch;
- boolean cascadeAll;
- boolean cascadeMerge;
- boolean cascadePersist;
- boolean cascadeRefresh;
- boolean cascadeRemove;
- boolean cascadeDetach; //added in JPA 2.0
-
-
- BinaryRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.targetEntity = this.buildTargetEntity();
- this.fetch = this.buildFetch();
- this.initializeCascadeTypes(this.buildCascadeTypes());
- }
-
- protected void initializeCascadeTypes(CascadeType[] cascadeTypes) {
- this.cascadeAll = ArrayTools.contains(cascadeTypes, CascadeType.ALL);
- this.cascadeMerge = ArrayTools.contains(cascadeTypes, CascadeType.MERGE);
- this.cascadePersist = ArrayTools.contains(cascadeTypes, CascadeType.PERSIST);
- this.cascadeRefresh = ArrayTools.contains(cascadeTypes, CascadeType.REFRESH);
- this.cascadeRemove = ArrayTools.contains(cascadeTypes, CascadeType.REMOVE);
- this.cascadeDetach = ArrayTools.contains(cascadeTypes, CascadeType.DETACH);
- }
-
- @Override
- public void update() {
- super.update();
- this.setTargetEntity_(this.buildTargetEntity());
- this.setFetch_(this.buildFetch());
- this.updateCascadeTypes(this.buildCascadeTypes());
- }
-
- protected void updateCascadeTypes(CascadeType[] cascadeTypes) {
- this.setCascadeAll_(ArrayTools.contains(cascadeTypes, CascadeType.ALL));
- this.setCascadeMerge_(ArrayTools.contains(cascadeTypes, CascadeType.MERGE));
- this.setCascadePersist_(ArrayTools.contains(cascadeTypes, CascadeType.PERSIST));
- this.setCascadeRefresh_(ArrayTools.contains(cascadeTypes, CascadeType.REFRESH));
- this.setCascadeRemove_(ArrayTools.contains(cascadeTypes, CascadeType.REMOVE));
- this.setCascadeDetach_(ArrayTools.contains(cascadeTypes, CascadeType.DETACH));
- }
-
- // ********** RelationshipMappingAnnotation implementation **********
-
- // ***** target entity
- public String getTargetEntity() {
- return this.targetEntity;
- }
-
- public void setTargetEntity(String targetEntity) {
- throw new UnsupportedOperationException();
- }
-
- private void setTargetEntity_(String targetEntity) {
- String old = this.targetEntity;
- this.targetEntity = targetEntity;
- this.firePropertyChanged(TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- private String buildTargetEntity() {
- return (String) this.getJdtMemberValue(this.getTargetEntityElementName());
- }
-
- abstract String getTargetEntityElementName();
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified target entity class name
- public String getFullyQualifiedTargetEntityClassName() {
- return this.targetEntity;
- }
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- throw new UnsupportedOperationException();
- }
-
- private void setFetch_(FetchType fetch) {
- FetchType old = this.fetch;
- this.fetch = fetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, fetch);
- }
-
- private FetchType buildFetch() {
- return FetchType.fromJavaAnnotationValue(this.getJdtMemberValue(this.getFetchElementName()));
- }
-
- abstract String getFetchElementName();
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** cascade
- private CascadeType[] buildCascadeTypes() {
- return CascadeType.fromJavaAnnotationValues(this.getJdtMemberValues(this.getCascadeElementName()));
- }
-
- abstract String getCascadeElementName();
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** cascade all
- public boolean isCascadeAll() {
- return this.cascadeAll;
- }
-
- public void setCascadeAll(boolean cascadeAll) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeAll_(boolean cascadeAll) {
- boolean old = this.cascadeAll;
- this.cascadeAll = cascadeAll;
- this.firePropertyChanged(CASCADE_ALL_PROPERTY, old, cascadeAll);
- }
-
- // ***** cascade merge
- public boolean isCascadeMerge() {
- return this.cascadeMerge;
- }
-
- public void setCascadeMerge(boolean cascadeMerge) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeMerge_(boolean cascadeMerge) {
- boolean old = this.cascadeMerge;
- this.cascadeMerge = cascadeMerge;
- this.firePropertyChanged(CASCADE_MERGE_PROPERTY, old, cascadeMerge);
- }
-
- // ***** cascade persist
- public boolean isCascadePersist() {
- return this.cascadePersist;
- }
-
- public void setCascadePersist(boolean cascadePersist) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadePersist_(boolean cascadePersist) {
- boolean old = this.cascadePersist;
- this.cascadePersist = cascadePersist;
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, cascadePersist);
- }
-
- // ***** cascade refresh
- public boolean isCascadeRefresh() {
- return this.cascadeRefresh;
- }
-
- public void setCascadeRefresh(boolean cascadeRefresh) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeRefresh_(boolean cascadeRefresh) {
- boolean old = this.cascadeRefresh;
- this.cascadeRefresh = cascadeRefresh;
- this.firePropertyChanged(CASCADE_REFRESH_PROPERTY, old, cascadeRefresh);
- }
-
- // ***** cascade remove
- public boolean isCascadeRemove() {
- return this.cascadeRemove;
- }
-
- public void setCascadeRemove(boolean cascadeRemove) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeRemove_(boolean cascadeRemove) {
- boolean old = this.cascadeRemove;
- this.cascadeRemove = cascadeRemove;
- this.firePropertyChanged(CASCADE_REMOVE_PROPERTY, old, cascadeRemove);
- }
-
- // ***** cascade detach - JPA 2.0
- public boolean isCascadeDetach() {
- return this.cascadeDetach;
- }
-
- public void setCascadeDetach(boolean cascadeDetach) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeDetach_(boolean cascadeDetach) {
- boolean old = this.cascadeDetach;
- this.cascadeDetach = cascadeDetach;
- this.firePropertyChanged(CASCADE_DETACH_PROPERTY, old, cascadeDetach);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java
deleted file mode 100644
index f5c1983fea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-/**
- * javax.persistence.SecondaryTable
- */
-public final class BinarySecondaryTableAnnotation
- extends BinaryBaseTableAnnotation
- implements NestableSecondaryTableAnnotation
-{
- private final Vector<PrimaryKeyJoinColumnAnnotation> pkJoinColumns;
-
- public BinarySecondaryTableAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.pkJoinColumns = this.buildPkJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updatePkJoinColumns();
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.SECONDARY_TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA.SECONDARY_TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA.SECONDARY_TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ************* SecondaryTableAnnotation implementation *******************
-
- // ***** pk join columns
- public ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns() {
- return new CloneListIterator<PrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int pkJoinColumnsSize() {
- return this.pkJoinColumns.size();
- }
-
- public PrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation pkJoinColumn) {
- return this.pkJoinColumns.indexOf(pkJoinColumn);
- }
-
- public PrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void movePkJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removePkJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<PrimaryKeyJoinColumnAnnotation> buildPkJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS);
- Vector<PrimaryKeyJoinColumnAnnotation> result = new Vector<PrimaryKeyJoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryPrimaryKeyJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updatePkJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java
deleted file mode 100644
index 08d36f54c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTablesAnnotation;
-
-/**
- * javax.persistence.SecondaryTables
- */
-public final class BinarySecondaryTablesAnnotation
- extends BinaryContainerAnnotation<NestableSecondaryTableAnnotation>
- implements SecondaryTablesAnnotation
-{
- private final Vector<NestableSecondaryTableAnnotation> secondaryTables;
-
-
- public BinarySecondaryTablesAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.secondaryTables = this.buildSecondaryTables();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableSecondaryTableAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableSecondaryTableAnnotation>(this.secondaryTables);
- }
-
- public int getNestedAnnotationsSize() {
- return this.secondaryTables.size();
- }
-
- private Vector<NestableSecondaryTableAnnotation> buildSecondaryTables() {
- Object[] jdtSecondaryTables = this.getJdtMemberValues(JPA.SECONDARY_TABLES__VALUE);
- Vector<NestableSecondaryTableAnnotation> result = new Vector<NestableSecondaryTableAnnotation>(jdtSecondaryTables.length);
- for (Object jdtSecondaryTable : jdtSecondaryTables) {
- result.add(new BinarySecondaryTableAnnotation(this, (IAnnotation) jdtSecondaryTable));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateSecondaryTables();
- }
-
- // TODO
- private void updateSecondaryTables() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java
deleted file mode 100644
index e4d09f7098..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public abstract class BinarySequenceGeneratorAnnotation
- extends BinaryGeneratorAnnotation
- implements SequenceGeneratorAnnotation
-{
- private String sequenceName;
-
-
- protected BinarySequenceGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.sequenceName = this.buildSequenceName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setSequenceName_(this.buildSequenceName());
- }
-
-
- // ********** BinaryGeneratorAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.SEQUENCE_GENERATOR__NAME;
- }
-
- @Override
- String getInitialValueElementName() {
- return JPA.SEQUENCE_GENERATOR__INITIAL_VALUE;
- }
-
- @Override
- String getAllocationSizeElementName() {
- return JPA.SEQUENCE_GENERATOR__ALLOCATION_SIZE;
- }
-
-
- // ********** SequenceGeneratorAnnotation implementation **********
-
- // ***** sequence name
- public String getSequenceName() {
- return this.sequenceName;
- }
-
- public void setSequenceName(String sequenceName) {
- throw new UnsupportedOperationException();
- }
-
- private void setSequenceName_(String sequenceName) {
- String old = this.sequenceName;
- this.sequenceName = sequenceName;
- this.firePropertyChanged(SEQUENCE_NAME_PROPERTY, old, sequenceName);
- }
-
- private String buildSequenceName() {
- return (String) this.getJdtMemberValue(JPA.SEQUENCE_GENERATOR__SEQUENCE_NAME);
- }
-
- public TextRange getSequenceNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean sequenceNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableAnnotation.java
deleted file mode 100644
index 939515dea4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableAnnotation.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-
-/**
- * javax.persistence.Table
- */
-public final class BinaryTableAnnotation
- extends BinaryBaseTableAnnotation
- implements TableAnnotation
-{
- public BinaryTableAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA.TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA.TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA.TABLE__UNIQUE_CONSTRAINTS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java
deleted file mode 100644
index 4c3540ae1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- * javax.persistence.TableGenerator
- */
-public final class BinaryTableGeneratorAnnotation
- extends BinaryGeneratorAnnotation
- implements TableGeneratorAnnotation
-{
- private String table;
- private String schema;
- private String catalog;
- private String pkColumnName;
- private String valueColumnName;
- private String pkColumnValue;
- private final Vector<UniqueConstraintAnnotation> uniqueConstraints;
-
-
- public BinaryTableGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.table = this.buildTable();
- this.schema = this.buildSchema();
- this.catalog = this.buildCatalog();
- this.pkColumnName = this.buildPkColumnName();
- this.valueColumnName = this.buildValueColumnName();
- this.pkColumnValue = this.buildPkColumnValue();
- this.uniqueConstraints = this.buildUniqueConstraints();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setTable_(this.buildTable());
- this.setSchema_(this.buildSchema());
- this.setCatalog_(this.buildCatalog());
- this.setPkColumnName_(this.buildPkColumnName());
- this.setValueColumnName_(this.buildValueColumnName());
- this.setPkColumnValue_(this.buildPkColumnValue());
- this.updateUniqueConstraints();
- }
-
-
- // ********** AbstractGeneratorAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.TABLE_GENERATOR__NAME;
- }
-
- @Override
- String getInitialValueElementName() {
- return JPA.TABLE_GENERATOR__INITIAL_VALUE;
- }
-
- @Override
- String getAllocationSizeElementName() {
- return JPA.TABLE_GENERATOR__ALLOCATION_SIZE;
- }
-
-
- // ********** TableGeneratorAnnotation implementation **********
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- throw new UnsupportedOperationException();
- }
-
- private void setTable_(String table) {
- String old = this.table;
- this.table = table;
- this.firePropertyChanged(TABLE_PROPERTY, old, table);
- }
-
- private String buildTable() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__TABLE);
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- throw new UnsupportedOperationException();
- }
-
- private void setSchema_(String schema) {
- String old = this.schema;
- this.schema = schema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, schema);
- }
-
- private String buildSchema() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__SCHEMA);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- throw new UnsupportedOperationException();
- }
-
- private void setCatalog_(String catalog) {
- String old = this.catalog;
- this.catalog = catalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, catalog);
- }
-
- private String buildCatalog() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__CATALOG);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** pk column name
- public String getPkColumnName() {
- return this.pkColumnName;
- }
-
- public void setPkColumnName(String pkColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setPkColumnName_(String pkColumnName) {
- String old = this.pkColumnName;
- this.pkColumnName = pkColumnName;
- this.firePropertyChanged(PK_COLUMN_NAME_PROPERTY, old, pkColumnName);
- }
-
- private String buildPkColumnName() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__PK_COLUMN_NAME);
- }
-
- public TextRange getPkColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean pkColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** value column name
- public String getValueColumnName() {
- return this.valueColumnName;
- }
-
- public void setValueColumnName(String valueColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setValueColumnName_(String valueColumnName) {
- String old = this.valueColumnName;
- this.valueColumnName = valueColumnName;
- this.firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, old, valueColumnName);
- }
-
- private String buildValueColumnName() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME);
- }
-
- public TextRange getValueColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** pk column value
- public String getPkColumnValue() {
- return this.pkColumnValue;
- }
-
- public void setPkColumnValue(String pkColumnValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setPkColumnValue_(String pkColumnValue) {
- String old = this.pkColumnValue;
- this.pkColumnValue = pkColumnValue;
- this.firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, old, pkColumnValue);
- }
-
- private String buildPkColumnValue() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE);
- }
-
- public TextRange getPkColumnValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean pkColumnValueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public UniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<UniqueConstraintAnnotation> buildUniqueConstraints() {
- Object[] jdtUniqueConstraints = this.getJdtMemberValues(JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
- Vector<UniqueConstraintAnnotation> result = new Vector<UniqueConstraintAnnotation>(jdtUniqueConstraints.length);
- for (Object jdtUniqueConstraint : jdtUniqueConstraints) {
- result.add(new BinaryUniqueConstraintAnnotation(this, (IAnnotation) jdtUniqueConstraint));
- }
- return result;
- }
-
- // TODO
- private void updateUniqueConstraints() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTemporalAnnotation.java
deleted file mode 100644
index c8faac2678..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTemporalAnnotation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-
-/**
- * javax.persistence.Temporal
- */
-public final class BinaryTemporalAnnotation
- extends BinaryBaseTemporalAnnotation
- implements TemporalAnnotation
-{
-
- public BinaryTemporalAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.TEMPORAL__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTransientAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTransientAnnotation.java
deleted file mode 100644
index dd7ad500ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryTransientAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-
-/**
- * javax.persistence.Transient
- */
-public final class BinaryTransientAnnotation
- extends BinaryAnnotation
- implements TransientAnnotation
-{
-
- public BinaryTransientAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java
deleted file mode 100644
index c88b2370bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- * javax.persistence.UniqueConstraint
- */
-final class BinaryUniqueConstraintAnnotation
- extends BinaryAnnotation
- implements UniqueConstraintAnnotation
-{
- private final Vector<String> columnNames;
-
-
- BinaryUniqueConstraintAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.columnNames = this.buildColumnNames();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateColumnNames();
- }
-
- // TODO
- private void updateColumnNames() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** UniqueConstraintAnnotation implementation **********
-
- // ***** column names
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- private Vector<String> buildColumnNames() {
- Object[] jdtColumnNames = this.getJdtMemberValues(JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES);
- Vector<String> result = new Vector<String>(jdtColumnNames.length);
- for (Object jdtColumnName : jdtColumnNames) {
- result.add((String) jdtColumnName);
- }
- return result;
- }
-
- public void addColumnName(String columnName) {
- throw new UnsupportedOperationException();
- }
-
- public void addColumnName(int index, String columnName) {
- throw new UnsupportedOperationException();
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumnName(String columnName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumnName(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryVersionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryVersionAnnotation.java
deleted file mode 100644
index d0a856b11b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryVersionAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-
-/**
- * javax.persistence.Version
- */
-public final class BinaryVersionAnnotation
- extends BinaryAnnotation
- implements VersionAnnotation
-{
-
- public BinaryVersionAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/RootBinaryNode.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/RootBinaryNode.java
deleted file mode 100644
index baf9b674e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/RootBinaryNode.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.binary;
-
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * JAR and external types
- */
-abstract class RootBinaryNode
- extends BinaryNode
- implements JavaResourceNode.Root
-{
- /** pluggable annotation provider */
- private final JpaAnnotationProvider annotationProvider;
-
- /** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
-
-
- // ********** construction **********
-
- RootBinaryNode(JavaResourceNode parent, JpaAnnotationProvider annotationProvider) {
- super(parent);
- this.annotationProvider = annotationProvider;
- }
-
-
- // ********** overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public Root getRoot() {
- return this;
- }
-
- @Override
- public JpaAnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/AnnotationContainerTools.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/AnnotationContainerTools.java
deleted file mode 100644
index 3a050867fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/AnnotationContainerTools.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * Utility methods for manipulating annotation containers.
- */
-public final class AnnotationContainerTools {
-
- /**
- * Add a nested annotation to the specified annotation container
- * at the specified index.
- * This method modifies both the resource model annotation container and the
- * AST; with <em>no</em> change notification.
- */
- public static <T extends NestableAnnotation> NestableAnnotation addNestedAnnotation(int index, AnnotationContainer<T> annotationContainer) {
- // add a new annotation to the end of the list...
- int sourceIndex = annotationContainer.getNestedAnnotationsSize();
- T nestedAnnotation = annotationContainer.addNestedAnnotation();
- nestedAnnotation.newAnnotation();
- // ...then move it to the specified index
- moveNestedAnnotation(index, sourceIndex, annotationContainer);
- return nestedAnnotation;
- }
-
- /**
- * Move the nested annotation at the specified source index in the
- * specified annotation container to the specified target index.
- * This method modifies both the resource model annotation container and the
- * AST; with <em>no</em> change notification.
- */
- public static <T extends NestableAnnotation> void moveNestedAnnotation(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer) {
- if (targetIndex != sourceIndex) {
- moveNestedAnnotation_(targetIndex, sourceIndex, annotationContainer);
- }
- }
-
- private static <T extends NestableAnnotation> void moveNestedAnnotation_(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer) {
- NestableAnnotation nestedAnnotation = annotationContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- syncAstAnnotationsAfterMove(targetIndex, sourceIndex, annotationContainer, nestedAnnotation);
- }
-
- /**
- * An annotation was moved within the specified annotation container from
- * the specified source index to the specified target index.
- * Synchronize the AST annotations with the resource model annotation container,
- * starting with the lower index to prevent overlap.
- */
- private static <T extends NestableAnnotation> void syncAstAnnotationsAfterMove(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer, NestableAnnotation nestedAnnotation) {
- // move the Java annotation to the end of the list...
- nestedAnnotation.moveAnnotation(annotationContainer.getNestedAnnotationsSize());
- // ...then shift the other AST annotations over one slot...
- List<T> nestableAnnotations = CollectionTools.list(annotationContainer.getNestedAnnotations());
- if (sourceIndex < targetIndex) {
- for (int i = sourceIndex; i < targetIndex; i++) {
- nestableAnnotations.get(i).moveAnnotation(i);
- }
- } else {
- for (int i = sourceIndex; i > targetIndex; i-- ) {
- nestableAnnotations.get(i).moveAnnotation(i);
- }
- }
- // ...then move the AST annotation to the now empty slot at the target index
- nestedAnnotation.moveAnnotation(targetIndex);
- }
-
- /**
- * Remove the nested annotation at the specified index in the
- * specified annotation container.
- * This method modifies both the resource model annotation container and the
- * AST; with <em>no</em> change notification.
- */
- public static <T extends NestableAnnotation> void removeNestedAnnotation(int index, AnnotationContainer<T> annotationContainer) {
- T nestedAnnotation = annotationContainer.removeNestedAnnotation(index);
- nestedAnnotation.removeAnnotation();
- syncAstAnnotationsAfterRemove(index, annotationContainer);
- }
-
- /**
- * An annotation was removed from the specified annotation container at the
- * specified index.
- * Synchronize the AST annotations with the resource model annotation container,
- * starting at the specified index to prevent overlap.
- */
- private static <T extends NestableAnnotation> void syncAstAnnotationsAfterRemove(int index, AnnotationContainer<T> annotationContainer) {
- List<T> nestableAnnotations = CollectionTools.list(annotationContainer.getNestedAnnotations());
- for (int i = index; i < nestableAnnotations.size(); i++) {
- // the indices are the same because the model annotations are
- // already in the proper locations - it's the AST annotations that
- // need to be moved to the matching location
- nestableAnnotations.get(i).moveAnnotation(i);
- }
- }
-
- /**
- * Initialize the specified resource model annotation container to be in
- * sync with the specified AST. No change notification will occur.
- */
- public static <T extends NestableAnnotation> void initialize(AnnotationContainer<T> annotationContainer, CompilationUnit astRoot) {
- // ignore the nested AST annotations themselves
- // (maybe someday we can use them during initialization...)
- int size = getNestedAstAnnotations(astRoot, annotationContainer).size();
- for (int i = 0; i < size; i++) {
- T nestedAnnotation = annotationContainer.addNestedAnnotation();
- nestedAnnotation.initialize(astRoot);
- }
- }
-
- /**
- * Return a list of the nested AST annotations.
- */
- private static <T extends NestableAnnotation> List<Annotation> getNestedAstAnnotations(CompilationUnit astRoot, AnnotationContainer<T> annotationContainer) {
- Annotation astContainerAnnotation = annotationContainer.getAstAnnotation(astRoot);
- if (astContainerAnnotation == null) {
- // seems unlikely the AST container annotation would be null,
- // since the resource container annotation is only created and
- // initialized (or synchronized) when the AST container annotation
- // is discovered
- return Collections.emptyList();
- }
-
- if (astContainerAnnotation.isMarkerAnnotation()) {
- return Collections.emptyList(); // no nested annotations
- }
-
- if (astContainerAnnotation.isSingleMemberAnnotation()) {
- return getNestedAstAnnotations((SingleMemberAnnotation) astContainerAnnotation, annotationContainer);
- }
-
- if (astContainerAnnotation.isNormalAnnotation()) {
- return getNestedAstAnnotations((NormalAnnotation) astContainerAnnotation, annotationContainer);
- }
-
- throw new IllegalStateException("unknown annotation type: " + astContainerAnnotation); //$NON-NLS-1$
- }
-
- private static <T extends NestableAnnotation> List<Annotation> getNestedAstAnnotations(SingleMemberAnnotation astContainerAnnotation, AnnotationContainer<T> annotationContainer) {
- return annotationContainer.getElementName().equals("value") ? //$NON-NLS-1$
- getAstAnnotations(astContainerAnnotation.getValue(), annotationContainer) :
- Collections.<Annotation>emptyList();
- }
-
- private static <T extends NestableAnnotation> List<Annotation> getNestedAstAnnotations(NormalAnnotation astContainerAnnotation, AnnotationContainer<T> annotationContainer) {
- MemberValuePair pair = getMemberValuePair(astContainerAnnotation, annotationContainer.getElementName());
- return (pair != null) ?
- getAstAnnotations(pair.getValue(), annotationContainer) :
- Collections.<Annotation>emptyList();
- }
-
- private static <T extends NestableAnnotation> List<Annotation> getAstAnnotations(Expression expression, AnnotationContainer<T> annotationContainer) {
- return (expression != null) ?
- getAstAnnotations_(expression, annotationContainer.getNestedAnnotationName()) :
- Collections.<Annotation>emptyList();
- }
-
- /**
- * pre-condition: expression is not null
- */
- private static <T extends NestableAnnotation> List<Annotation> getAstAnnotations_(Expression expression, String annotationName) {
- ArrayList<Annotation> result = new ArrayList<Annotation>();
- addAstAnnotationsTo(expression, annotationName, result);
- return result;
- }
-
- /**
- * pre-condition: expression is not null
- * <p>
- * Add whatever annotations are represented by the specified expression to
- * the specified list. Skip any non-annotation expressions.
- */
- private static void addAstAnnotationsTo(Expression expression, String annotationName, ArrayList<Annotation> astAnnotations) {
- if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- addAstAnnotationsTo((ArrayInitializer) expression, annotationName, astAnnotations);
- } else {
- addAstAnnotationTo(expression, annotationName, astAnnotations);
- }
- }
-
- private static void addAstAnnotationsTo(ArrayInitializer arrayInitializer, String annotationName, ArrayList<Annotation> astAnnotations) {
- @SuppressWarnings("unchecked")
- List<Expression> expressions = arrayInitializer.expressions();
- for (Expression expression : expressions) {
- if (expression != null) {
- addAstAnnotationTo(expression, annotationName, astAnnotations);
- }
- }
- }
-
- private static void addAstAnnotationTo(Expression expression, String annotationName, ArrayList<Annotation> astAnnotations) {
- switch (expression.getNodeType()) {
- case ASTNode.NORMAL_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.MARKER_ANNOTATION:
- Annotation astAnnotation = (Annotation) expression;
- if (getQualifiedName(astAnnotation).equals(annotationName)) {
- astAnnotations.add(astAnnotation);
- }
- break;
- default:
- break;
- }
- }
-
- private static String getQualifiedName(Annotation astAnnotation) {
- ITypeBinding typeBinding = astAnnotation.resolveTypeBinding();
- if (typeBinding != null) {
- String resolvedName = typeBinding.getQualifiedName();
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- return astAnnotation.getTypeName().getFullyQualifiedName();
- }
-
- private static MemberValuePair getMemberValuePair(NormalAnnotation annotation, String elementName) {
- @SuppressWarnings("unchecked")
- List<MemberValuePair> pairs = annotation.values();
- for (MemberValuePair pair : pairs) {
- if (pair.getName().getFullyQualifiedName().equals(elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- /**
- * Synchronize the resource model annotations in the specified annotation
- * container with those in the specified AST. Trigger the appropriate change
- * notification.
- */
- public static <T extends NestableAnnotation> void synchronize(AnnotationContainer<T> annotationContainer, CompilationUnit astRoot) {
- List<Annotation> astAnnotations = getNestedAstAnnotations(astRoot, annotationContainer);
- Iterator<Annotation> astAnnotationStream = astAnnotations.iterator();
-
- for (T nestedAnnotation : annotationContainer.getNestedAnnotations()) {
- if (astAnnotationStream.hasNext()) {
- // matching AST annotation is present - synchronize the nested annotation
- astAnnotationStream.next(); // maybe someday we can pass this to the update
- nestedAnnotation.synchronizeWith(astRoot);
- } else {
- // no more AST annotations - remove the remaining nested annotations and exit
- annotationContainer.syncRemoveNestedAnnotations(astAnnotations.size());
- return;
- }
- }
-
- // add nested annotations for any remaining AST annotations
- while (astAnnotationStream.hasNext()) {
- annotationContainer.syncAddNestedAnnotation(astAnnotationStream.next());
- }
- }
-
- private AnnotationContainerTools() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotatedElement.java
deleted file mode 100644
index 9c36e4f331..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotatedElement.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * Java source annotated element (annotations)
- */
-abstract class SourceAnnotatedElement<A extends AnnotatedElement>
- extends SourceNode
- implements JavaResourceAnnotatedElement
-{
- final A annotatedElement;
-
- /**
- * annotations; no duplicates (java compiler has an error for duplicates)
- */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- /**
- * these are built as needed
- */
- private final HashMap<String, Annotation> nullAnnotationCache = new HashMap<String, Annotation>();
-
-
- // ********** construction/initialization **********
-
- SourceAnnotatedElement(JavaResourceNode parent, A annotatedElement) {
- super(parent);
- this.annotatedElement = annotatedElement;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.annotatedElement.getBodyDeclaration(astRoot).accept(this.buildInitialAnnotationVisitor(astRoot));
- }
-
- private ASTVisitor buildInitialAnnotationVisitor(CompilationUnit astRoot) {
- return new InitialAnnotationVisitor(astRoot, this.annotatedElement.getBodyDeclaration(astRoot));
- }
-
- /**
- * called from {@link InitialAnnotationVisitor#visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation)}
- */
- /* CU private */ void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot) {
- String astAnnotationName = ASTTools.resolveAnnotation(node);
- if (astAnnotationName != null) {
- this.addInitialAnnotation(astAnnotationName, astRoot);
- }
- }
-
- /**
- * pre-condition: <code>astAnnotationName</code> is not <code>null</code>
- */
- void addInitialAnnotation(String astAnnotationName, CompilationUnit astRoot) {
- if (this.annotationIsValid(astAnnotationName)) {
- if (this.selectAnnotationNamed(this.annotations, astAnnotationName) == null) { // ignore duplicates
- Annotation annotation = this.buildAnnotation(astAnnotationName);
- annotation.initialize(astRoot);
- this.annotations.add(annotation);
- }
- }
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncAnnotations(astRoot);
- }
-
-
- // ********** annotations **********
-
- public Iterator<Annotation> annotations() {
- return this.getAnnotations().iterator();
- }
-
- Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int annotationsSize() {
- return this.annotations.size();
- }
-
- public Annotation getAnnotation(String annotationName) {
- return this.selectAnnotationNamed(this.getAnnotations(), annotationName);
- }
-
- public Annotation getNonNullAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- return (annotation != null) ? annotation : this.getNullAnnotation(annotationName);
- }
-
- private synchronized Annotation getNullAnnotation(String annotationName) {
- Annotation annotation = this.nullAnnotationCache.get(annotationName);
- if (annotation == null) {
- annotation = this.buildNullAnnotation(annotationName);
- this.nullAnnotationCache.put(annotationName, annotation);
- }
- return annotation;
- }
-
- public Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- return containerAnnotation.getNestedAnnotations().iterator();
- }
- NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName);
- if (nestableAnnotation != null) {
- return new SingleElementIterator<NestableAnnotation>(nestableAnnotation);
- }
- return EmptyIterator.instance();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName);
- }
-
- private NestableAnnotation getNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.getAnnotation(annotationName);
- }
-
- public Annotation addAnnotation(String annotationName) {
- Annotation annotation = this.buildAnnotation(annotationName);
- this.annotations.add(annotation);
- annotation.newAnnotation();
- return annotation;
- }
-
- /**
- * <ol>
- * <li>Check for a container annotation;
- * if it is present, add a nested annotation to it.
- * <li>Check for a stand-alone nested annotation;
- * if it is missing, add a stand-alone nested annotation.
- * <li>If there is an existing stand-alone nested annotation,
- * add a container annotation and move the stand-alone nested annotation to it
- * and add a new nested annotation to it also
- * <ol>
- */
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- // ignore any stand-alone nestable annotations and just add to the container annotation
- return AnnotationContainerTools.addNestedAnnotation(index, containerAnnotation);
- }
- NestableAnnotation standAloneAnnotation = this.getNestableAnnotation(nestableAnnotationName);
- if (standAloneAnnotation == null) {
- // add a stand-alone nestable annotation since neither the nestable nor the container exist
- return (NestableAnnotation) this.addAnnotation(nestableAnnotationName);
- }
- // move the stand-alone nestable annotation to a container and add another nestable
- return this.addSecondNestedAnnotation(index, containerAnnotationName, standAloneAnnotation);
- }
-
- /**
- * <ol>
- * <li>Build a new container annotation
- * <li>If the new annotation is to be added at index 0<ol>
- * <li>Add a new nestable annotation to the new container annotation
- * at index 0
- * <li>Move the existing stand-alone nestable annotation to the new
- * container annotation at index 1
- * </ol>
- * <li>If the new annotation is to be added at index 1<ol>
- * <li>Move the existing stand-alone nestable annotation to the new
- * container annotation at index 0
- * <li>Add a new nestable annotation to the new container annotation
- * at index 1
- * </ol>
- * </ol>
- */
- private NestableAnnotation addSecondNestedAnnotation(int index, String containerAnnotationName, NestableAnnotation standAloneAnnotation) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.buildContainerAnnotation(containerAnnotationName);
- this.annotations.add(containerAnnotation);
- containerAnnotation.newAnnotation();
-
- NestableAnnotation nestedAnnotation = null;
- switch (index) {
- case 0 :
- // adding new annotation at 0, so move the stand-alone to slot 1
- nestedAnnotation = containerAnnotation.addNestedAnnotation();
- nestedAnnotation.newAnnotation();
- this.annotations.remove(standAloneAnnotation);
- containerAnnotation.nestStandAloneAnnotation(standAloneAnnotation);
- break;
- case 1 :
- // adding new annotation at 1, so move the stand-alone to slot 0
- this.annotations.remove(standAloneAnnotation);
- containerAnnotation.nestStandAloneAnnotation(standAloneAnnotation);
- nestedAnnotation = containerAnnotation.addNestedAnnotation();
- nestedAnnotation.newAnnotation();
- break;
- default :
- throw new IllegalArgumentException("invalid index: " + index); //$NON-NLS-1$
- }
-
- return nestedAnnotation;
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
- this.moveAnnotation(targetIndex, sourceIndex, this.getContainerAnnotation(containerAnnotationName));
- }
-
- private void moveAnnotation(int targetIndex, int sourceIndex, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, containerAnnotation);
- }
-
- public void removeAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- if (annotation != null) {
- this.removeAnnotation(annotation);
- }
- }
-
- private void removeAnnotation(Annotation annotation) {
- this.annotations.remove(annotation);
- annotation.removeAnnotation();
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation == null) {
- if (index != 0) {
- throw new IllegalArgumentException("invalid index: " + index); //$NON-NLS-1$
- }
- this.removeAnnotation(this.getAnnotation(nestableAnnotationName));
- } else {
- this.removeAnnotation(index, containerAnnotation);
- }
- }
-
- /**
- * After we remove the nested annotation, check to see whether we need to
- * either remove the container (if it is empty) or convert the last nested
- * annotation to a stand-alone annotation.
- */
- private void removeAnnotation(int index, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- AnnotationContainerTools.removeNestedAnnotation(index, containerAnnotation);
- switch (containerAnnotation.getNestedAnnotationsSize()) {
- case 0:
- this.removeAnnotation(containerAnnotation);
- break;
- case 1:
- this.convertLastNestedAnnotation(containerAnnotation);
- break;
- default:
- break;
- }
- }
-
- /**
- * Convert the last nested annotation in the container to a stand-alone
- * annotation and remove the container annotation.
- */
- private void convertLastNestedAnnotation(ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- containerAnnotation.convertLastNestedAnnotationToStandAlone();
- this.annotations.remove(containerAnnotation);
- containerAnnotation.removeAnnotation();
- }
-
- public void addStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.annotations.add(standAloneAnnotation);
- }
-
- private boolean annotationIsValid(String annotationName) {
- return CollectionTools.contains(this.validAnnotationNames(), annotationName);
- }
-
- abstract Iterator<String> validAnnotationNames();
-
- abstract Annotation buildAnnotation(String annotationName);
-
- abstract Annotation buildNullAnnotation(String annotationName);
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private ContainerAnnotation<NestableAnnotation> buildContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.buildAnnotation(annotationName);
- }
-
- private void syncAnnotations(CompilationUnit astRoot) {
- HashSet<Annotation> annotationsToRemove = new HashSet<Annotation>(this.annotations);
-
- this.annotatedElement.getBodyDeclaration(astRoot).accept(this.buildSynchronizeAnnotationVisitor(astRoot, annotationsToRemove));
-
- this.removeItemsFromCollection(annotationsToRemove, this.annotations, ANNOTATIONS_COLLECTION);
- }
-
- private ASTVisitor buildSynchronizeAnnotationVisitor(CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- return new SynchronizeAnnotationVisitor(astRoot, this.annotatedElement.getBodyDeclaration(astRoot), annotationsToRemove);
- }
-
- /**
- * called from {@link SynchronizeAnnotationVisitor#visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation)}
- */
- /* CU private */ void addOrSyncAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- String astAnnotationName = ASTTools.resolveAnnotation(astAnnotation);
- if (astAnnotationName != null) {
- this.addOrSyncAnnotation(astAnnotationName, astRoot, annotationsToRemove);
- }
- }
-
- /**
- * pre-condition: <code>astAnnotationName</code> is not <code>null</code>
- */
- void addOrSyncAnnotation(String astAnnotationName, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- if (this.annotationIsValid(astAnnotationName)) {
- this.addOrSyncAnnotation_(astAnnotationName, astRoot, annotationsToRemove);
- }
- }
-
- /**
- * pre-condition: <code>astAnnotationName</code> is valid
- */
- private void addOrSyncAnnotation_(String astAnnotationName, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- Annotation annotation = this.selectAnnotationNamed(annotationsToRemove, astAnnotationName);
- if (annotation != null) {
- annotation.synchronizeWith(astRoot);
- annotationsToRemove.remove(annotation);
- } else {
- annotation = this.buildAnnotation(astAnnotationName);
- annotation.initialize(astRoot);
- this.addItemToCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
- }
-
-
- // ********** misc **********
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.buildTextRange(this.annotatedElement.getBodyDeclaration(astRoot));
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.annotatedElement.getNameTextRange(astRoot);
- }
-
- private Annotation selectAnnotationNamed(Iterable<Annotation> list, String annotationName) {
- for (Annotation annotation : list) {
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- private TextRange buildTextRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
-
- // ********** AST visitors **********
-
- /**
- * annotation visitor
- */
- static abstract class AnnotationVisitor
- extends ASTVisitor
- {
- final CompilationUnit astRoot;
- final ASTNode node;
-
-
- protected AnnotationVisitor(CompilationUnit astRoot, ASTNode node) {
- super();
- this.astRoot = astRoot;
- this.node = node;
- }
-
- @Override
- public boolean visit(SingleMemberAnnotation annotation) {
- return this.visit_(annotation);
- }
-
- @Override
- public boolean visit(NormalAnnotation annotation) {
- return this.visit_(annotation);
- }
-
- @Override
- public boolean visit(MarkerAnnotation annotation) {
- return this.visit_(annotation);
- }
-
- protected boolean visit_(org.eclipse.jdt.core.dom.Annotation annotation) {
- // ignore annotations for child members, only this member
- if (annotation.getParent() == this.node) {
- this.visitChildAnnotation(annotation);
- }
- return false;
- }
-
- protected abstract void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation annotation);
- }
-
-
- /**
- * initial annotation visitor
- */
- class InitialAnnotationVisitor
- extends AnnotationVisitor
- {
- protected InitialAnnotationVisitor(CompilationUnit astRoot, ASTNode node) {
- super(astRoot, node);
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation annotation) {
- SourceAnnotatedElement.this.addInitialAnnotation(annotation, this.astRoot);
- }
- }
-
-
- /**
- * synchronize annotation visitor
- */
- class SynchronizeAnnotationVisitor
- extends AnnotationVisitor
- {
- protected final Set<Annotation> annotationsToRemove;
-
- protected SynchronizeAnnotationVisitor(CompilationUnit astRoot, ASTNode node, Set<Annotation> annotationsToRemove) {
- super(astRoot, node);
- this.annotationsToRemove = annotationsToRemove;
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation annotation) {
- SourceAnnotatedElement.this.addOrSyncAnnotation(annotation, this.astRoot, this.annotationsToRemove);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotation.java
deleted file mode 100644
index c4e5d87a1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAnnotation.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * some common state and behavior for Java source annotations;
- * and lots of convenience methods
- */
-public abstract class SourceAnnotation<A extends AnnotatedElement>
- extends SourceNode
- implements Annotation
-{
- protected final A annotatedElement;
-
- // TODO - make 'final' if we start using combination annotation adapters(?)
- protected DeclarationAnnotationAdapter daa;
-
- // TODO - make 'final' if we start using combination annotation adapters(?)
- protected AnnotationAdapter annotationAdapter;
-
-
- /**
- * constructor for straight member annotation
- */
- protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa) {
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- /**
- * constructor for nested annotation (typically)
- */
- protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent);
- this.annotatedElement = annotatedElement;
- this.daa = daa;
- this.annotationAdapter = annotationAdapter;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return this.getAnnotationTextRange(astRoot);
- }
-
-
- // ********** Annotation implementation **********
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return this.annotationAdapter.getAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- this.annotationAdapter.newMarkerAnnotation();
- }
-
- public void removeAnnotation() {
- this.annotationAdapter.removeAnnotation();
- }
-
- public boolean isUnset() {
- return true;
- }
-
-
- // ********** convenience methods **********
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(this.daa, elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildIntegerElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forNumbers(this.daa, elementName);
- }
-
- protected AnnotationElementAdapter<String> buildStringElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildIntegerElementAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Integer>(this.annotatedElement, daea);
- }
-
- /**
- * Return the text range corresponding to the annotation.
- * If the annotation is missing, return <code>null</code>.
- */
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.getTextRange(this.getAstAnnotation(astRoot));
- }
-
- /**
- * Convenience method.
- * Return the text range corresponding to the specified element.
- * If the specified element is missing, return the annotation's text range instead.
- */
- protected TextRange getElementTextRange(DeclarationAnnotationElementAdapter<?> elementAdapter, CompilationUnit astRoot) {
- return this.getElementTextRange(this.getAnnotationElementTextRange(elementAdapter, astRoot), astRoot);
- }
-
- /**
- * Convenience method. If the specified element text range is null
- * return the member's text range instead.
- */
- protected TextRange getElementTextRange(TextRange elementTextRange, CompilationUnit astRoot) {
- return (elementTextRange != null) ? elementTextRange : this.getAnnotationTextRange(astRoot);
- }
-
- /**
- * Convenience method. Return whether the specified position exists and
- * touches the specified element.
- */
- protected boolean elementTouches(DeclarationAnnotationElementAdapter<?> elementAdapter, int pos, CompilationUnit astRoot) {
- return this.textRangeTouches(this.getAnnotationElementTextRange(elementAdapter, astRoot), pos);
- }
-
- /**
- * Convenience method. Return whether the specified text range is not
- * null (meaning the corresponding AST node exists) and the specified position touches it.
- */
- protected boolean textRangeTouches(TextRange textRange, int pos) {
- return (textRange != null) && textRange.touches(pos);
- }
-
- /**
- * Return the text range corresponding to the specified element.
- * If the element is missing, return <code>null</code>.
- */
- protected TextRange getAnnotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.getTextRange(this.getAnnotationElementExpression(adapter, astRoot));
- }
-
- /**
- * Return the specified AST DOM element.
- */
- protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- /**
- * Return the text range corresponding to the specified AST node.
- * If the AST node is null, return null.
- */
- protected TextRange getTextRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
- /**
- * Convenience implementation of
- * {@link org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation#convertToNested(ContainerAnnotation, DeclarationAnnotationAdapter, int)}
- * used by subclasses.
- */
- public void convertToNested(ContainerAnnotation<? extends NestableAnnotation> containerAnnotation, DeclarationAnnotationAdapter containerAnnotationAdapter, int index) {
- Map<String, Object> map = this.buildState();
- this.removeAnnotation(); // this annotation has already been removed from the model
- IndexedDeclarationAnnotationAdapter idaa = this.buildNestedDeclarationAnnotationAdapter(containerAnnotationAdapter, index);
- this.daa = idaa;
- this.annotationAdapter = new ElementIndexedAnnotationAdapter(this.annotatedElement, idaa);
- this.rebuildAdapters();
- containerAnnotation.addNestedAnnotation(index, (NestableAnnotation) this);
- this.newAnnotation();
- this.restoreFrom(map);
- }
-
- /**
- * Convenience implementation of
- * {@link org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation#convertToStandAlone()}
- * used by subclasses.
- */
- public void convertToStandAlone() {
- Map<String, Object> map = this.buildState();
- this.removeAnnotation(); // this annotation has already been removed from the model
- this.daa = new SimpleDeclarationAnnotationAdapter(this.getAnnotationName());
- this.annotationAdapter = new ElementAnnotationAdapter(this.annotatedElement, this.daa);
- this.rebuildAdapters();
- this.getParent().addStandAloneAnnotation((NestableAnnotation) this);
- this.newAnnotation();
- this.restoreFrom(map);
- }
-
- private Map<String, Object> buildState() {
- Map<String, Object> map = new HashMap<String, Object>();
- this.storeOn(map);
- return map;
- }
-
- protected void rebuildAdapters() {
- // this is only needed by nestable annotations
- }
-
- public void storeOn(Map<String, Object> map) {
- // this is only needed by nestable annotations
- }
-
- public void restoreFrom(Map<String, Object> map) {
- // this is only needed by nestable annotations
- }
-
- protected List<Map<String, Object>> buildStateList(int initialCapacity) {
- return (initialCapacity == 0) ?
- Collections.<Map<String, Object>>emptyList() :
- new ArrayList<Map<String, Object>>(initialCapacity);
- }
-
- protected IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter containerAnnotationAdapter, int index) {
- return buildNestedDeclarationAnnotationAdapter(index, containerAnnotationAdapter, this.getAnnotationName());
- }
-
- protected static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter containerAnnotationAdapter, String annotationName) {
- return new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, index, annotationName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java
deleted file mode 100644
index 94a233d5d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.AssociationOverride</code>
- */
-public abstract class SourceAssociationOverrideAnnotation
- extends SourceOverrideAnnotation
- implements NestableAssociationOverrideAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final JoinColumnsAnnotationContainer joinColumnsContainer = new JoinColumnsAnnotationContainer();
-
-
- protected SourceAssociationOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.joinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.joinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceOverrideAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.ASSOCIATION_OVERRIDE__NAME;
- }
-
-
- // ********** AssociationOverrideAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- private NestableJoinColumnAnnotation addJoinColumn() {
- return this.addJoinColumn(this.joinColumns.size());
- }
-
- public NestableJoinColumnAnnotation addJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addJoinColumn_() {
- return this.addJoinColumn_(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- void syncAddJoinColumn(Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- return SourceJoinColumnAnnotation.createAssociationOverrideJoinColumn(this.daa, this, this.annotatedElement, index);
- }
-
- void joinColumnAdded(int index, NestableJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeJoinColumn_(int index) {
- return this.joinColumns.remove(index);
- }
-
- void syncRemoveJoinColumns(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
-
- // ********** join column container **********
-
- /**
- * adapt the AnnotationContainer interface to the override's join columns
- */
- class JoinColumnsAnnotationContainer
- implements AnnotationContainer<NestableJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceAssociationOverrideAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS;
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceAssociationOverrideAnnotation.this.getNestableJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceAssociationOverrideAnnotation.this.joinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceAssociationOverrideAnnotation.this.addJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceAssociationOverrideAnnotation.this.syncAddJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceAssociationOverrideAnnotation.this.moveJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceAssociationOverrideAnnotation.this.removeJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceAssociationOverrideAnnotation.this.syncRemoveJoinColumns(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.joinColumns.isEmpty();
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
-
- List<Map<String, Object>> joinColumnsState = this.buildStateList(this.joinColumns.size());
- for (NestableJoinColumnAnnotation joinColumn : this.getNestableJoinColumns()) {
- Map<String, Object> joinColumnState = new HashMap<String, Object>();
- joinColumn.storeOn(joinColumnState);
- joinColumnsState.add(joinColumnState);
- }
- map.put(JOIN_COLUMNS_LIST, joinColumnsState);
- this.joinColumns.clear();
- }
-
- @Override
- public void restoreFrom(Map<String,Object> map) {
- super.restoreFrom(map);
-
- @SuppressWarnings("unchecked")
- List<Map<String, Object>> joinColumnsState = (List<Map<String, Object>>) map.get(JOIN_COLUMNS_LIST);
- for (Map<String, Object> joinColumnState : joinColumnsState) {
- this.addJoinColumn().restoreFrom(joinColumnState);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java
deleted file mode 100644
index 4591355155..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAssociationOverrideAnnotation;
-
-/**
- * <code>javax.persistence.AssociationOverrides</code>
- */
-public abstract class SourceAssociationOverridesAnnotation
- extends SourceAnnotation<Member>
- implements AssociationOverridesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableAssociationOverrideAnnotation> associationOverrides = new Vector<NestableAssociationOverrideAnnotation>();
-
-
- protected SourceAssociationOverridesAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.associationOverrides.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.associationOverrides);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.ASSOCIATION_OVERRIDES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableAssociationOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAssociationOverrideAnnotation>(this.associationOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.associationOverrides.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.associationOverrides.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.associationOverrides.add(index, (NestableAssociationOverrideAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.associationOverrides.remove(0).convertToStandAlone();
- }
-
- public NestableAssociationOverrideAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.associationOverrides.size());
- }
-
- private NestableAssociationOverrideAnnotation addNestedAnnotation(int index) {
- NestableAssociationOverrideAnnotation associationOverride = this.buildAssociationOverride(index);
- this.associationOverrides.add(index, associationOverride);
- return associationOverride;
- }
-
- protected abstract NestableAssociationOverrideAnnotation buildAssociationOverride(int index);
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.associationOverrides.size();
- NestableAssociationOverrideAnnotation associationOverride = this.addNestedAnnotation(index);
- associationOverride.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
- }
-
- public NestableAssociationOverrideAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.associationOverrides, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableAssociationOverrideAnnotation removeNestedAnnotation(int index) {
- return this.associationOverrides.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java
deleted file mode 100644
index d1151a8487..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.NullAttributeOverrideColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAttributeOverrideAnnotation;
-
-/**
- * <code>javax.persistence.AttributeOverride</code>
- */
-public final class SourceAttributeOverrideAnnotation
- extends SourceOverrideAnnotation
- implements NestableAttributeOverrideAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private ElementAnnotationAdapter columnAdapter;
- private ColumnAnnotation column;
- private final ColumnAnnotation nullColumn;
-
-
- public SourceAttributeOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.columnAdapter = this.buildColumnAdapter();
- this.nullColumn = this.buildNullColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.annotatedElement, this.daa);
- this.column.initialize(astRoot);
- }
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncColumn(astRoot);
- }
-
-
- // ********** SourceOverrideAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.ATTRIBUTE_OVERRIDE__NAME;
- }
-
-
- //************ AttributeOverride implementation ****************
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : this.nullColumn;
- }
-
- public ColumnAnnotation addColumn() {
- if (this.column != null) {
- throw new IllegalStateException("'column' element already exists: " + this.column); //$NON-NLS-1$
- }
- this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.annotatedElement, this.daa);
- this.column.newAnnotation();
- return this.column;
- }
-
- public void removeColumn() {
- if (this.column == null) {
- throw new IllegalStateException("'column' element does not exist"); //$NON-NLS-1$
- }
- ColumnAnnotation old = this.column;
- this.column = null;
- old.removeAnnotation();
- }
-
- private void syncColumn(CompilationUnit astRoot) {
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.syncColumn_(null);
- } else {
- if (this.column == null) {
- ColumnAnnotation col = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.annotatedElement, this.daa);
- col.initialize(astRoot);
- this.syncColumn_(col);
- } else {
- this.column.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncColumn_(ColumnAnnotation astColumn) {
- ColumnAnnotation old = this.column;
- this.column = astColumn;
- this.firePropertyChanged(COLUMN_PROPERTY, old, astColumn);
- }
-
- private ElementAnnotationAdapter buildColumnAdapter() {
- return new ElementAnnotationAdapter(this.annotatedElement, SourceColumnAnnotation.buildAttributeOverrideAnnotationAdapter(this.daa));
- }
-
- private ColumnAnnotation buildNullColumn() {
- return new NullAttributeOverrideColumnAnnotation(this);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.column == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.columnAdapter = this.buildColumnAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- if (this.column != null) {
- Map<String, Object> columnState = new HashMap<String, Object>();
- this.column.storeOn(columnState);
- map.put(COLUMN_PROPERTY, columnState);
- this.column = null;
- }
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- @SuppressWarnings("unchecked")
- Map<String, Object> columnState = (Map<String, Object>) map.get(COLUMN_PROPERTY);
- if (columnState != null) {
- this.addColumn().restoreFrom(columnState);
- }
- }
-
-
- // ********** static methods **********
-
- public static SourceAttributeOverrideAnnotation buildAttributeOverride(JavaResourceNode parent, Member member) {
- return new SourceAttributeOverrideAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceAttributeOverrideAnnotation buildNestedAttributeOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter, ANNOTATION_NAME);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
- return new SourceAttributeOverrideAnnotation(parent, member, idaa, annotationAdapter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java
deleted file mode 100644
index d1d75c6f31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAttributeOverrideAnnotation;
-
-/**
- * <code>javax.persistence.AttributeOverrides</code>
- */
-public final class SourceAttributeOverridesAnnotation
- extends SourceAnnotation<Member>
- implements AttributeOverridesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableAttributeOverrideAnnotation> attributeOverrides = new Vector<NestableAttributeOverrideAnnotation>();
-
-
- public SourceAttributeOverridesAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.attributeOverrides.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.attributeOverrides);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.ATTRIBUTE_OVERRIDES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableAttributeOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAttributeOverrideAnnotation>(this.attributeOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.attributeOverrides.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.attributeOverrides.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.attributeOverrides.add(index, (NestableAttributeOverrideAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.attributeOverrides.remove(0).convertToStandAlone();
- }
-
- public NestableAttributeOverrideAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.attributeOverrides.size());
- }
-
- private NestableAttributeOverrideAnnotation addNestedAnnotation(int index) {
- NestableAttributeOverrideAnnotation attributeOverride = this.buildAttributeOverride(index);
- this.attributeOverrides.add(index, attributeOverride);
- return attributeOverride;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.attributeOverrides.size();
- NestableAttributeOverrideAnnotation attributeOverride = this.addNestedAnnotation(index);
- attributeOverride.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- }
-
- private NestableAttributeOverrideAnnotation buildAttributeOverride(int index) {
- // pass the Java resource persistent member as the nested annotation's parent
- // since the nested annotation can be converted to stand-alone
- return SourceAttributeOverrideAnnotation.buildNestedAttributeOverride(this.parent, this.annotatedElement, index, this.daa);
- }
-
- public NestableAttributeOverrideAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.attributeOverrides, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableAttributeOverrideAnnotation removeNestedAnnotation(int index) {
- return this.attributeOverrides.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.attributeOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseColumnAnnotation.java
deleted file mode 100644
index 37730073e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseColumnAnnotation.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * <ul>
- * <li><code>javax.persistence.Column</code>
- * <li><code>javax.persistence.JoinColumn</code>
- * <li><code>javax.persistence.MapKeyColumn</code>
- * <li><code>javax.persistence.MapKeyJoinColumn</code>
- * </ul>
- */
-public abstract class SourceBaseColumnAnnotation
- extends SourceNamedColumnAnnotation
- implements BaseColumnAnnotation
-{
- protected DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter;
- protected AnnotationElementAdapter<String> tableAdapter;
- protected String table;
-
- protected DeclarationAnnotationElementAdapter<Boolean> uniqueDeclarationAdapter;
- protected AnnotationElementAdapter<Boolean> uniqueAdapter;
- protected Boolean unique;
-
- protected DeclarationAnnotationElementAdapter<Boolean> nullableDeclarationAdapter;
- protected AnnotationElementAdapter<Boolean> nullableAdapter;
- protected Boolean nullable;
-
- protected DeclarationAnnotationElementAdapter<Boolean> insertableDeclarationAdapter;
- protected AnnotationElementAdapter<Boolean> insertableAdapter;
- protected Boolean insertable;
-
- protected DeclarationAnnotationElementAdapter<Boolean> updatableDeclarationAdapter;
- protected AnnotationElementAdapter<Boolean> updatableAdapter;
- protected Boolean updatable;
-
-
- protected SourceBaseColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new ElementAnnotationAdapter(member, daa));
- }
-
- protected SourceBaseColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.tableDeclarationAdapter = this.buildTableDeclarationAdapter();
- this.tableAdapter = this.buildTableAdapter();
- this.uniqueDeclarationAdapter = this.buildUniqueDeclarationAdapter();
- this.uniqueAdapter = this.buildUniqueAdapter();
- this.nullableDeclarationAdapter = this.buildNullableDeclarationAdapter();
- this.nullableAdapter = this.buildNullableAdapter();
- this.insertableDeclarationAdapter = this.buildInsertableDeclarationAdapter();
- this.insertableAdapter = this.buildInsertableAdapter();
- this.updatableDeclarationAdapter = this.buildUpdatableDeclarationAdapter();
- this.updatableAdapter = this.buildUpdatableAdapter();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.buildTable(astRoot);
- this.unique = this.buildUnique(astRoot);
- this.nullable = this.buildNullable(astRoot);
- this.insertable = this.buildInsertable(astRoot);
- this.updatable = this.buildUpdatable(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncTable(this.buildTable(astRoot));
- this.syncUnique(this.buildUnique(astRoot));
- this.syncNullable(this.buildNullable(astRoot));
- this.syncInsertable(this.buildInsertable(astRoot));
- this.syncUpdatable(this.buildUpdatable(astRoot));
- }
-
-
- //************* BaseColumnAnnotation implementation *************
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- if (this.attributeValueHasChanged(this.table, table)) {
- this.table = table;
- this.tableAdapter.setValue(table);
- }
- }
-
- private void syncTable(String astTable) {
- String old = this.table;
- this.table = astTable;
- this.firePropertyChanged(TABLE_PROPERTY, old, astTable);
- }
-
- private String buildTable(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.tableDeclarationAdapter, astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.tableDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTableDeclarationAdapter() {
- return this.buildStringElementAdapter(this.getTableElementName());
- }
-
- private AnnotationElementAdapter<String> buildTableAdapter() {
- return this.buildStringElementAdapter(this.tableDeclarationAdapter);
- }
-
- protected abstract String getTableElementName();
-
- // ***** unique
- public Boolean getUnique() {
- return this.unique;
- }
-
- public void setUnique(Boolean unique) {
- if (this.attributeValueHasChanged(this.unique, unique)) {
- this.unique = unique;
- this.uniqueAdapter.setValue(unique);
- }
- }
-
- private void syncUnique(Boolean astUnique) {
- Boolean old = this.unique;
- this.unique = astUnique;
- this.firePropertyChanged(UNIQUE_PROPERTY, old, astUnique);
- }
-
- private Boolean buildUnique(CompilationUnit astRoot) {
- return this.uniqueAdapter.getValue(astRoot);
- }
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.uniqueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildUniqueDeclarationAdapter() {
- return this.buildBooleanElementAdapter(this.getUniqueElementName());
- }
-
- private AnnotationElementAdapter<Boolean> buildUniqueAdapter() {
- return this.buildBooleanElementAdapter(this.uniqueDeclarationAdapter);
- }
-
- protected abstract String getUniqueElementName();
-
- // ***** nullable
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean nullable) {
- if (this.attributeValueHasChanged(this.nullable, nullable)) {
- this.nullable = nullable;
- this.nullableAdapter.setValue(nullable);
- }
- }
-
- private void syncNullable(Boolean astNullable) {
- Boolean old = this.nullable;
- this.nullable = astNullable;
- this.firePropertyChanged(NULLABLE_PROPERTY, old, astNullable);
- }
-
- private Boolean buildNullable(CompilationUnit astRoot) {
- return this.nullableAdapter.getValue(astRoot);
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nullableDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNullableDeclarationAdapter() {
- return this.buildBooleanElementAdapter(this.getNullableElementName());
- }
-
- private AnnotationElementAdapter<Boolean> buildNullableAdapter() {
- return this.buildBooleanElementAdapter(this.nullableDeclarationAdapter);
- }
-
- protected abstract String getNullableElementName();
-
- // ***** insertable
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean insertable) {
- if (this.attributeValueHasChanged(this.insertable, insertable)) {
- this.insertable = insertable;
- this.insertableAdapter.setValue(insertable);
- }
- }
-
- private void syncInsertable(Boolean astInsertable) {
- Boolean old = this.insertable;
- this.insertable = astInsertable;
- this.firePropertyChanged(INSERTABLE_PROPERTY, old, astInsertable);
- }
-
- private Boolean buildInsertable(CompilationUnit astRoot) {
- return this.insertableAdapter.getValue(astRoot);
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.insertableDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildInsertableDeclarationAdapter() {
- return this.buildBooleanElementAdapter(this.getInsertableElementName());
- }
-
- private AnnotationElementAdapter<Boolean> buildInsertableAdapter() {
- return this.buildBooleanElementAdapter(this.insertableDeclarationAdapter);
- }
-
- protected abstract String getInsertableElementName();
-
- // ***** updatable
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (this.attributeValueHasChanged(this.updatable, updatable)) {
- this.updatable = updatable;
- this.updatableAdapter.setValue(updatable);
- }
- }
-
- private void syncUpdatable(Boolean astUpdatable) {
- Boolean old = this.updatable;
- this.updatable = astUpdatable;
- this.firePropertyChanged(UPDATABLE_PROPERTY, old, astUpdatable);
- }
-
- private Boolean buildUpdatable(CompilationUnit astRoot) {
- return this.updatableAdapter.getValue(astRoot);
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.updatableDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildUpdatableDeclarationAdapter() {
- return this.buildBooleanElementAdapter(this.getUpdatableElementName());
- }
-
- private AnnotationElementAdapter<Boolean> buildUpdatableAdapter() {
- return this.buildBooleanElementAdapter(this.updatableDeclarationAdapter);
- }
-
- protected abstract String getUpdatableElementName();
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.table == null) &&
- (this.unique == null) &&
- (this.nullable == null) &&
- (this.insertable == null) &&
- (this.updatable == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.tableDeclarationAdapter = this.buildTableDeclarationAdapter();
- this.tableAdapter = this.buildTableAdapter();
- this.uniqueDeclarationAdapter = this.buildUniqueDeclarationAdapter();
- this.uniqueAdapter = this.buildUniqueAdapter();
- this.nullableDeclarationAdapter = this.buildNullableDeclarationAdapter();
- this.nullableAdapter = this.buildNullableAdapter();
- this.insertableDeclarationAdapter = this.buildInsertableDeclarationAdapter();
- this.insertableAdapter = this.buildInsertableAdapter();
- this.updatableDeclarationAdapter = this.buildUpdatableDeclarationAdapter();
- this.updatableAdapter = this.buildUpdatableAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(TABLE_PROPERTY, this.table);
- this.table = null;
- map.put(UNIQUE_PROPERTY, this.unique);
- this.unique = null;
- map.put(NULLABLE_PROPERTY, this.nullable);
- this.nullable = null;
- map.put(INSERTABLE_PROPERTY, this.insertable);
- this.insertable = null;
- map.put(UPDATABLE_PROPERTY, this.updatable);
- this.updatable = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setTable((String) map.get(TABLE_PROPERTY));
- this.setUnique((Boolean) map.get(UNIQUE_PROPERTY));
- this.setNullable((Boolean) map.get(NULLABLE_PROPERTY));
- this.setInsertable((Boolean) map.get(INSERTABLE_PROPERTY));
- this.setUpdatable((Boolean) map.get(UPDATABLE_PROPERTY));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java
deleted file mode 100644
index 20d6cce5d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.Enumerated
- * javax.persistence.MapKeyEnumerated
- */
-public abstract class SourceBaseEnumeratedAnnotation
- extends SourceAnnotation<Attribute>
- implements EnumeratedAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private EnumType value;
-
-
- protected SourceBaseEnumeratedAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.valueDeclarationAdapter = new EnumDeclarationAnnotationElementAdapter(daa, getValueElementName());
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** EnumeratedAnnotation implementation **********
-
- // ***** value
- public EnumType getValue() {
- return this.value;
- }
-
- public void setValue(EnumType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(EnumType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(EnumType astValue) {
- EnumType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private EnumType buildValue(CompilationUnit astRoot) {
- return EnumType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- protected abstract String getValueElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java
deleted file mode 100644
index c32e64df6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.BaseJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * <ul>
- * <li><code>javax.persistence.JoinColumn</code>
- * <li><code>javax.persistence.MapKeyJoinColumn</code>
- * </ul>
- */
-public abstract class SourceBaseJoinColumnAnnotation
- extends SourceBaseColumnAnnotation
- implements BaseJoinColumnAnnotation
-{
- private DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
- private AnnotationElementAdapter<String> referencedColumnNameAdapter;
- private String referencedColumnName;
-
-
- protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildReferencedColumnNameDeclarationAdapter();
- this.referencedColumnNameAdapter = this.buildReferencedColumnNameAdapter();
- }
-
- protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new ElementAnnotationAdapter(member, daa));
- }
-
- protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.referencedColumnName = this.buildReferencedColumnName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncReferencedColumnName(this.buildReferencedColumnName(astRoot));
- }
-
-
- //************ BaseJoinColumnAnnotation implementation ***************
-
- // referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- if (this.attributeValueHasChanged(this.referencedColumnName, referencedColumnName)) {
- this.referencedColumnName = referencedColumnName;
- this.referencedColumnNameAdapter.setValue(referencedColumnName);
- }
- }
-
- private void syncReferencedColumnName(String astReferencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = astReferencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, astReferencedColumnName);
- }
-
- private String buildReferencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildReferencedColumnNameDeclarationAdapter() {
- return this.buildStringElementAdapter(this.getReferencedColumnNameElementName());
- }
-
- private AnnotationElementAdapter<String> buildReferencedColumnNameAdapter() {
- return this.buildStringElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
- protected abstract String getReferencedColumnNameElementName();
-
-
- // ********** NestableAnnotation implementation **********
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.referencedColumnName == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.referencedColumnNameDeclarationAdapter = this.buildReferencedColumnNameDeclarationAdapter();
- this.referencedColumnNameAdapter = this.buildReferencedColumnNameAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(REFERENCED_COLUMN_NAME_PROPERTY, this.referencedColumnName);
- this.referencedColumnName = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setReferencedColumnName((String) map.get(REFERENCED_COLUMN_NAME_PROPERTY));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTableAnnotation.java
deleted file mode 100644
index 770574872f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTableAnnotation.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableUniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- * <ul>
- * <li><code>javax.persistence.Table</code>
- * <li><code>javax.persistence.JoinTable</code>
- * <li><code>javax.persistence.SecondaryTable</code>
- * <li><code>javax.persistence.CollectionTable</code>
- * </ul>
- */
-public abstract class SourceBaseTableAnnotation
- extends SourceAnnotation<Member>
- implements BaseTableAnnotation
-{
- DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- AnnotationElementAdapter<String> nameAdapter;
- String name;
-
- DeclarationAnnotationElementAdapter<String> schemaDeclarationAdapter;
- AnnotationElementAdapter<String> schemaAdapter;
- String schema;
-
- DeclarationAnnotationElementAdapter<String> catalogDeclarationAdapter;
- AnnotationElementAdapter<String> catalogAdapter;
- String catalog;
-
- final Vector<NestableUniqueConstraintAnnotation> uniqueConstraints = new Vector<NestableUniqueConstraintAnnotation>();
- final UniqueConstraintsAnnotationContainer uniqueConstraintsContainer = new UniqueConstraintsAnnotationContainer();
-
-
- protected SourceBaseTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new ElementAnnotationAdapter(member, daa));
- }
-
- protected SourceBaseTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.schemaDeclarationAdapter = this.buildSchemaDeclarationAdapter();
- this.schemaAdapter = this.buildSchemaAdapter();
- this.catalogDeclarationAdapter = this.buildCatalogDeclarationAdapter();
- this.catalogAdapter = this.buildCatalogAdapter();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.schema = this.buildSchema(astRoot);
- this.catalog = this.buildCatalog(astRoot);
- AnnotationContainerTools.initialize(this.uniqueConstraintsContainer, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncSchema(this.buildSchema(astRoot));
- this.syncCatalog(this.buildCatalog(astRoot));
- AnnotationContainerTools.synchronize(this.uniqueConstraintsContainer, astRoot);
- }
-
- /**
- * Return the uniqueConstraints element name
- */
- protected abstract String getUniqueConstraintsElementName();
-
-
- // ********** BaseTableAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- /**
- * Build a declaration element adapter for the table's 'name' element.
- */
- protected abstract DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter();
-
- private AnnotationElementAdapter<String> buildNameAdapter() {
- return this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- if (this.attributeValueHasChanged(this.schema, schema)) {
- this.schema = schema;
- this.schemaAdapter.setValue(schema);
- }
- }
-
- private void syncSchema(String astSchema) {
- String old = this.schema;
- this.schema = astSchema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, astSchema);
- }
-
- private String buildSchema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.schemaDeclarationAdapter, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.schemaDeclarationAdapter, pos, astRoot);
- }
-
- /**
- * Build a declaration element adapter for the table's 'schema' element.
- */
- protected abstract DeclarationAnnotationElementAdapter<String> buildSchemaDeclarationAdapter();
-
- private AnnotationElementAdapter<String> buildSchemaAdapter() {
- return this.buildAnnotationElementAdapter(this.schemaDeclarationAdapter);
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- if (this.attributeValueHasChanged(this.catalog, catalog)) {
- this.catalog = catalog;
- this.catalogAdapter.setValue(catalog);
- }
- }
-
- private void syncCatalog(String astCatalog) {
- String old = this.catalog;
- this.catalog = astCatalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, astCatalog);
- }
-
- private String buildCatalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.catalogDeclarationAdapter, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.catalogDeclarationAdapter, pos, astRoot);
- }
-
- /**
- * Build a declaration element adapter for the table's 'catalog' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> buildCatalogDeclarationAdapter();
-
- private AnnotationElementAdapter<String> buildCatalogAdapter() {
- return this.buildAnnotationElementAdapter(this.catalogDeclarationAdapter);
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- Iterable<NestableUniqueConstraintAnnotation> getNestableUniqueConstraints() {
- return new LiveCloneIterable<NestableUniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- private NestableUniqueConstraintAnnotation addUniqueConstraint() {
- return this.addUniqueConstraint(this.uniqueConstraints.size());
- }
-
- public NestableUniqueConstraintAnnotation addUniqueConstraint(int index) {
- return (NestableUniqueConstraintAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation addUniqueConstraint_() {
- return this.addUniqueConstraint_(this.uniqueConstraints.size());
- }
-
- private NestableUniqueConstraintAnnotation addUniqueConstraint_(int index) {
- NestableUniqueConstraintAnnotation uniqueConstraint = this.buildUniqueConstraint(index);
- this.uniqueConstraints.add(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- void syncAddUniqueConstraint(Annotation astAnnotation) {
- int index = this.uniqueConstraints.size();
- NestableUniqueConstraintAnnotation uniqueConstraint = this.addUniqueConstraint_(index);
- uniqueConstraint.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- }
-
- NestableUniqueConstraintAnnotation buildUniqueConstraint(int index) {
- return new SourceUniqueConstraintAnnotation(this, this.annotatedElement, buildUniqueConstraintAnnotationAdapter(index));
- }
-
- IndexedDeclarationAnnotationAdapter buildUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, getUniqueConstraintsElementName(), index, JPA.UNIQUE_CONSTRAINT);
- }
-
- void uniqueConstraintAdded(int index, NestableUniqueConstraintAnnotation constraint) {
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, constraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation moveUniqueConstraint_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeUniqueConstraint(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation removeUniqueConstraint_(int index) {
- return this.uniqueConstraints.remove(index);
- }
-
- void syncRemoveUniqueConstraints(int index) {
- this.removeItemsFromList(index, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
-
- // ********** unique constraint container **********
-
- /**
- * adapt the AnnotationContainer interface to the table's unique constraints
- */
- class UniqueConstraintsAnnotationContainer
- implements AnnotationContainer<NestableUniqueConstraintAnnotation>
- {
- public Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceBaseTableAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return SourceBaseTableAnnotation.this.getUniqueConstraintsElementName();
- }
-
- public String getNestedAnnotationName() {
- return UniqueConstraintAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableUniqueConstraintAnnotation> getNestedAnnotations() {
- return SourceBaseTableAnnotation.this.getNestableUniqueConstraints();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceBaseTableAnnotation.this.uniqueConstraintsSize();
- }
-
- public NestableUniqueConstraintAnnotation addNestedAnnotation() {
- return SourceBaseTableAnnotation.this.addUniqueConstraint_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceBaseTableAnnotation.this.syncAddUniqueConstraint(astAnnotation);
- }
-
- public NestableUniqueConstraintAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceBaseTableAnnotation.this.moveUniqueConstraint_(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraintAnnotation removeNestedAnnotation(int index) {
- return SourceBaseTableAnnotation.this.removeUniqueConstraint_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceBaseTableAnnotation.this.syncRemoveUniqueConstraints(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null) &&
- (this.schema == null) &&
- (this.catalog == null) &&
- this.uniqueConstraints.isEmpty();
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.schemaDeclarationAdapter = this.buildSchemaDeclarationAdapter();
- this.schemaAdapter = this.buildSchemaAdapter();
- this.catalogDeclarationAdapter = this.buildCatalogDeclarationAdapter();
- this.catalogAdapter = this.buildCatalogAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
-
- map.put(NAME_PROPERTY, this.name);
- this.name = null;
- map.put(SCHEMA_PROPERTY, this.schema);
- this.schema = null;
- map.put(CATALOG_PROPERTY, this.catalog);
- this.catalog = null;
-
- List<Map<String, Object>> constraintsState = this.buildStateList(this.uniqueConstraints.size());
- for (NestableUniqueConstraintAnnotation constraint : this.getNestableUniqueConstraints()) {
- Map<String, Object> constraintState = new HashMap<String, Object>();
- constraint.storeOn(constraintState);
- constraintsState.add(constraintState);
- }
- map.put(UNIQUE_CONSTRAINTS_LIST, constraintsState);
- this.uniqueConstraints.clear();
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
-
- this.setName((String) map.get(NAME_PROPERTY));
- this.setSchema((String) map.get(SCHEMA_PROPERTY));
- this.setCatalog((String) map.get(CATALOG_PROPERTY));
-
- @SuppressWarnings("unchecked")
- List<Map<String, Object>> constraintsState = (List<Map<String, Object>>) map.get(UNIQUE_CONSTRAINTS_LIST);
- for (Map<String, Object> constraintState : constraintsState) {
- this.addUniqueConstraint().restoreFrom(constraintState);
- }
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java
deleted file mode 100644
index abc301e316..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-/**
- * Abstract implementation for JPA annotations
- * javax.persistence.Temporal
- * javax.persistence.MapKeyTemporal
- */
-public abstract class SourceBaseTemporalAnnotation
- extends SourceAnnotation<Attribute>
- implements TemporalAnnotation
-{
- protected final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private TemporalType value;
-
-
- protected SourceBaseTemporalAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.valueDeclarationAdapter = new EnumDeclarationAnnotationElementAdapter(daa, getValueElementName());
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** TemporalAnnotation implementation **********
-
- // ***** value
- public TemporalType getValue() {
- return this.value;
- }
-
- public void setValue(TemporalType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(TemporalType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(TemporalType astValue) {
- TemporalType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private TemporalType buildValue(CompilationUnit astRoot) {
- return TemporalType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- protected abstract String getValueElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBasicAnnotation.java
deleted file mode 100644
index ee9c9d9138..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBasicAnnotation.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Basic
- */
-public final class SourceBasicAnnotation
- extends SourceAnnotation<Attribute>
- implements BasicAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
- private final AnnotationElementAdapter<String> fetchAdapter;
- private FetchType fetch;
-
-
- public SourceBasicAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER);
- this.fetchAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = this.buildOptional(astRoot);
- this.fetch = this.buildFetch(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncOptional(this.buildOptional(astRoot));
- this.syncFetch(this.buildFetch(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.optional == null) &&
- (this.fetch == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.fetch);
- }
-
-
- //*************** Basic implementation ****************
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (this.attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, astOptional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- if (this.attributeValueHasChanged(this.fetch, fetch)) {
- this.fetch = fetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(fetch));
- }
- }
-
- private void syncFetch(FetchType astFetch) {
- FetchType old = this.fetch;
- this.fetch = astFetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, astFetch);
- }
-
- private FetchType buildFetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FETCH_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__OPTIONAL, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__FETCH);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceColumnAnnotation.java
deleted file mode 100644
index b0b90584bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceColumnAnnotation.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * <code>javax.persistence.Column</code>
- */
-public final class SourceColumnAnnotation
- extends SourceCompleteColumnAnnotation
- implements ColumnAnnotation
-{
- // this adapter is only used by a Column annotation associated with a mapping annotation (e.g. Basic)
- public static final DeclarationAnnotationAdapter MAPPING_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** SourceBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.COLUMN__UPDATABLE;
- }
-
- // ********** SourceCompleteColumnAnnotation implementation **********
-
- @Override
- protected String getLengthElementName() {
- return JPA.COLUMN__LENGTH;
- }
-
- @Override
- protected String getPrecisionElementName() {
- return JPA.COLUMN__PRECISION;
- }
-
- @Override
- protected String getScaleElementName() {
- return JPA.COLUMN__SCALE;
- }
-
-
- // ********** static methods **********
-
- static ColumnAnnotation createAttributeOverrideColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new SourceColumnAnnotation(parent, member, buildAttributeOverrideAnnotationAdapter(attributeOverrideAnnotationAdapter));
- }
-
- static DeclarationAnnotationAdapter buildAttributeOverrideAnnotationAdapter(DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(attributeOverrideAnnotationAdapter, JPA.ATTRIBUTE_OVERRIDE__COLUMN, JPA.COLUMN);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompilationUnit.java
deleted file mode 100644
index 49e760889b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompilationUnit.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-
-/**
- * Java compilation unit (source file)
- */
-public abstract class SourceCompilationUnit
- extends SourceNode
- implements JavaResourceCompilationUnit
-{
- /** JDT compilation unit */
- final ICompilationUnit compilationUnit;
-
- /** pluggable annotation provider */
- private final JpaAnnotationProvider annotationProvider;
-
- /** improved annotation formatting */
- private final AnnotationEditFormatter annotationEditFormatter;
-
- /** pluggable executor that allows the document to be modified on another thread */
- private final CommandExecutor modifySharedDocumentCommandExecutor;
-
- /** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList;
-
-
- // ********** construction **********
-
- protected SourceCompilationUnit(
- ICompilationUnit compilationUnit,
- JpaAnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(null); // the JPA compilation unit is the root of its sub-tree
- this.compilationUnit = compilationUnit;
- this.annotationProvider = annotationProvider;
- this.annotationEditFormatter = annotationEditFormatter;
- this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor;
- this.resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // never called?
- }
-
- void openCompilationUnit() {
- try {
- this.compilationUnit.open(null);
- } catch (JavaModelException ex) {
- // do nothing - we just won't have a primary type in this case
- }
- }
-
- void closeCompilationUnit() {
- try {
- this.compilationUnit.close();
- } catch (JavaModelException ex) {
- // hmmm
- }
- }
-
-
- // ********** AbstractJavaResourceNode overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public JavaResourceCompilationUnit getRoot() {
- return this;
- }
-
- @Override
- public IFile getFile() {
- return (IFile) this.compilationUnit.getResource();
- }
-
- @Override
- public JpaAnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- // since this is the entire file, point to the top of the file
- return TextRange.Empty.instance();
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public ICompilationUnit getCompilationUnit() {
- return this.compilationUnit;
- }
-
- public CommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
- @Override
- public CompilationUnit buildASTRoot() {
- return ASTTools.buildASTRoot(this.compilationUnit);
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWithJavaSource() {
- this.synchronizeWith(this.buildASTRoot());
- }
-
-
- // ********** internal **********
-
- String getCompilationUnitName() {
- return this.removeJavaExtension(this.compilationUnit.getElementName());
- }
-
- private String removeJavaExtension(String fileName) {
- int index = fileName.lastIndexOf(".java"); //$NON-NLS-1$
- return (index == -1) ? fileName : fileName.substring(0, index);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getCompilationUnitName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java
deleted file mode 100644
index 0401a234ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.CompleteColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * <ul>
- * <li><code>javax.persistence.Column</code>
- * <li><code>javax.persistence.MapKeyColumn</code>
- * </ul>
- */
-public abstract class SourceCompleteColumnAnnotation
- extends SourceBaseColumnAnnotation
- implements CompleteColumnAnnotation
-{
- protected DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
- protected AnnotationElementAdapter<Integer> lengthAdapter;
- protected Integer length;
-
- protected DeclarationAnnotationElementAdapter<Integer> precisionDeclarationAdapter;
- protected AnnotationElementAdapter<Integer> precisionAdapter;
- protected Integer precision;
-
- protected DeclarationAnnotationElementAdapter<Integer> scaleDeclarationAdapter;
- protected AnnotationElementAdapter<Integer> scaleAdapter;
- protected Integer scale;
-
-
- protected SourceCompleteColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.lengthDeclarationAdapter = this.buildLengthDeclarationAdapter();
- this.lengthAdapter = this.buildLengthAdapter();
- this.precisionDeclarationAdapter = this.buildPrecisionDeclarationAdapter();
- this.precisionAdapter = this.buildPrecisionAdapter();
- this.scaleDeclarationAdapter = this.buildScaleDeclarationAdapter();
- this.scaleAdapter = this.buildScaleAdapter();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.length = this.buildLength(astRoot);
- this.precision = this.buildPrecision(astRoot);
- this.scale = this.buildScale(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncLength(this.buildLength(astRoot));
- this.syncPrecision(this.buildPrecision(astRoot));
- this.syncScale(this.buildScale(astRoot));
- }
-
-
- // ********** ColumnAnnotation implementation **********
-
- // ***** length
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer length) {
- if (this.attributeValueHasChanged(this.length, length)) {
- this.length = length;
- this.lengthAdapter.setValue(length);
- }
- }
-
- private void syncLength(Integer astLength) {
- Integer old = this.length;
- this.length = astLength;
- this.firePropertyChanged(LENGTH_PROPERTY, old, astLength);
- }
-
- private Integer buildLength(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.lengthDeclarationAdapter, astRoot);
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildLengthDeclarationAdapter() {
- return this.buildIntegerElementAdapter(this.getLengthElementName());
- }
-
- protected AnnotationElementAdapter<Integer> buildLengthAdapter() {
- return this.buildIntegerElementAdapter(this.lengthDeclarationAdapter);
- }
-
- protected abstract String getLengthElementName();
-
- // ***** precision
- public Integer getPrecision() {
- return this.precision;
- }
-
- public void setPrecision(Integer precision) {
- if (this.attributeValueHasChanged(this.precision, precision)) {
- this.precision = precision;
- this.precisionAdapter.setValue(precision);
- }
- }
-
- private void syncPrecision(Integer astPrecision) {
- Integer old = this.precision;
- this.precision = astPrecision;
- this.firePropertyChanged(PRECISION_PROPERTY, old, astPrecision);
- }
-
- private Integer buildPrecision(CompilationUnit astRoot) {
- return this.precisionAdapter.getValue(astRoot);
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.precisionDeclarationAdapter, astRoot);
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildPrecisionDeclarationAdapter() {
- return this.buildIntegerElementAdapter(this.getPrecisionElementName());
- }
-
- protected AnnotationElementAdapter<Integer> buildPrecisionAdapter() {
- return this.buildIntegerElementAdapter(this.precisionDeclarationAdapter);
- }
-
- protected abstract String getPrecisionElementName();
-
- // ***** scale
- public Integer getScale() {
- return this.scale;
- }
-
- public void setScale(Integer scale) {
- if (this.attributeValueHasChanged(this.scale, scale)) {
- this.scale = scale;
- this.scaleAdapter.setValue(scale);
- }
- }
-
- private void syncScale(Integer astScale) {
- Integer old = this.scale;
- this.scale = astScale;
- this.firePropertyChanged(SCALE_PROPERTY, old, astScale);
- }
-
- private Integer buildScale(CompilationUnit astRoot) {
- return this.scaleAdapter.getValue(astRoot);
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.scaleDeclarationAdapter, astRoot);
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildScaleDeclarationAdapter() {
- return this.buildIntegerElementAdapter(this.getScaleElementName());
- }
-
- protected AnnotationElementAdapter<Integer> buildScaleAdapter() {
- return this.buildIntegerElementAdapter(this.scaleDeclarationAdapter);
- }
-
- protected abstract String getScaleElementName();
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.length == null) &&
- (this.precision == null) &&
- (this.scale == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.lengthDeclarationAdapter = this.buildLengthDeclarationAdapter();
- this.lengthAdapter = this.buildLengthAdapter();
- this.precisionDeclarationAdapter = this.buildPrecisionDeclarationAdapter();
- this.precisionAdapter = this.buildPrecisionAdapter();
- this.scaleDeclarationAdapter = this.buildScaleDeclarationAdapter();
- this.scaleAdapter = this.buildScaleAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(LENGTH_PROPERTY, this.length);
- this.length = null;
- map.put(PRECISION_PROPERTY, this.precision);
- this.precision = null;
- map.put(SCALE_PROPERTY, this.scale);
- this.scale = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setLength((Integer) map.get(LENGTH_PROPERTY));
- this.setPrecision((Integer) map.get(PRECISION_PROPERTY));
- this.setScale((Integer) map.get(SCALE_PROPERTY));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java
deleted file mode 100644
index 2957c055a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * <code>javax.persistence.DiscriminatorColumn</code>
- */
-public final class SourceDiscriminatorColumnAnnotation
- extends SourceNamedColumnAnnotation
- implements DiscriminatorColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> DISCRIMINATOR_TYPE_DECLARATION_ADAPTER = buildDiscriminatorTypeDeclarationAdapter();
- private AnnotationElementAdapter<String> discriminatorTypeAdapter;
- private DiscriminatorType discriminatorType;
-
- private DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
- private AnnotationElementAdapter<Integer> lengthAdapter;
- private Integer length;
-
-
- public SourceDiscriminatorColumnAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.discriminatorTypeAdapter = this.buildDiscriminatorTypeAdapter();
- this.lengthDeclarationAdapter = this.buildLengthDeclarationAdapter();
- this.lengthAdapter = this.buildLengthAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.discriminatorType = this.buildDiscriminatorType(astRoot);
- this.length = this.buildLength(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncLength(this.buildLength(astRoot));
- this.syncDiscriminatorType(this.buildDiscriminatorType(astRoot));
- }
-
-
- // ********** JavaSourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** DiscriminatorColumn implementation **********
-
- // ***** discriminator type
- public DiscriminatorType getDiscriminatorType() {
- return this.discriminatorType;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- if (this.attributeValueHasChanged(this.discriminatorType, discriminatorType)) {
- this.discriminatorType = discriminatorType;
- this.discriminatorTypeAdapter.setValue(DiscriminatorType.toJavaAnnotationValue(discriminatorType));
- }
- }
-
- private void syncDiscriminatorType(DiscriminatorType astDiscriminatorType) {
- DiscriminatorType old = this.discriminatorType;
- this.discriminatorType = astDiscriminatorType;
- this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, astDiscriminatorType);
- }
-
- private DiscriminatorType buildDiscriminatorType(CompilationUnit astRoot) {
- return DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot));
- }
-
- private AnnotationElementAdapter<String> buildDiscriminatorTypeAdapter() {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, DISCRIMINATOR_TYPE_DECLARATION_ADAPTER);
- }
-
- // ***** length
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer length) {
- if (this.attributeValueHasChanged(this.length, length)) {
- this.length = length;
- this.lengthAdapter.setValue(length);
- }
- }
-
- private void syncLength(Integer astLength) {
- Integer old = this.length;
- this.length = astLength;
- this.firePropertyChanged(LENGTH_PROPERTY, old, astLength);
- }
-
- private Integer buildLength(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Integer> buildLengthDeclarationAdapter() {
- return this.buildIntegerElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH);
- }
-
- private AnnotationElementAdapter<Integer> buildLengthAdapter() {
- return this.buildIntegerElementAdapter(this.lengthDeclarationAdapter);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.discriminatorType == null) &&
- (this.length == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.discriminatorTypeAdapter = this.buildDiscriminatorTypeAdapter();
- this.lengthDeclarationAdapter = this.buildLengthDeclarationAdapter();
- this.lengthAdapter = this.buildLengthAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(DISCRIMINATOR_TYPE_PROPERTY, this.discriminatorType);
- this.discriminatorType = null;
- map.put(LENGTH_PROPERTY, this.length);
- this.length = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setDiscriminatorType((DiscriminatorType) map.get(DISCRIMINATOR_TYPE_PROPERTY));
- this.setLength((Integer) map.get(LENGTH_PROPERTY));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildDiscriminatorTypeDeclarationAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java
deleted file mode 100644
index 319fb9370e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class SourceDiscriminatorValueAnnotation
- extends SourceAnnotation<Type>
- implements DiscriminatorValueAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public SourceDiscriminatorValueAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** DiscriminatorValueAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_VALUE__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddableAnnotation.java
deleted file mode 100644
index f613e515cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddableAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Embeddable
- */
-public final class SourceEmbeddableAnnotation
- extends SourceAnnotation<Type>
- implements EmbeddableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEmbeddableAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedAnnotation.java
deleted file mode 100644
index 30b31f86ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Embedded
- */
-public final class SourceEmbeddedAnnotation
- extends SourceAnnotation<Attribute>
- implements EmbeddedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEmbeddedAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java
deleted file mode 100644
index fb9c29db44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.EmbeddedId
- */
-public final class SourceEmbeddedIdAnnotation
- extends SourceAnnotation<Attribute>
- implements EmbeddedIdAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEmbeddedIdAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEntityAnnotation.java
deleted file mode 100644
index 50fb7d3e9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEntityAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Entity
- */
-public final class SourceEntityAnnotation
- extends SourceAnnotation<Type>
- implements EntityAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
-
- public SourceEntityAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, NAME_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** EntityAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ENTITY__NAME);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEnumeratedAnnotation.java
deleted file mode 100644
index 7d53beac94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceEnumeratedAnnotation.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class SourceEnumeratedAnnotation
- extends SourceBaseEnumeratedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceEnumeratedAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.ENUMERATED__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java
deleted file mode 100644
index 81ad170950..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GenerationType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.GeneratedValue
- */
-public final class SourceGeneratedValueAnnotation
- extends SourceAnnotation<Member>
- implements GeneratedValueAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
- private final AnnotationElementAdapter<String> strategyAdapter;
- private GenerationType strategy;
-
- private static final DeclarationAnnotationElementAdapter<String> GENERATOR_ADAPTER = buildGeneratorAdapter();
- private final AnnotationElementAdapter<String> generatorAdapter;
- private String generator;
-
-
- public SourceGeneratedValueAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, STRATEGY_ADAPTER);
- this.generatorAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, GENERATOR_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.buildStrategy(astRoot);
- this.generator = this.buildGenerator(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncStrategy(this.buildStrategy(astRoot));
- this.syncGenerator(this.buildGenerator(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.strategy == null) &&
- (this.generator == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.strategy);
- }
-
-
- // ********** GeneratedValueAnnotation implementation **********
-
- // ***** strategy
- public GenerationType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(GenerationType strategy) {
- if (this.attributeValueHasChanged(this.strategy, strategy)) {
- this.strategy = strategy;
- this.strategyAdapter.setValue(GenerationType.toJavaAnnotationValue(strategy));
- }
- }
-
- private void syncStrategy(GenerationType astStrategy) {
- GenerationType old = this.strategy;
- this.strategy = astStrategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, astStrategy);
- }
-
- private GenerationType buildStrategy(CompilationUnit astRoot) {
- return GenerationType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
- // ***** generator
- public String getGenerator() {
- return this.generator;
- }
-
- public void setGenerator(String generator) {
- if (this.attributeValueHasChanged(this.generator, generator)) {
- this.generator = generator;
- this.generatorAdapter.setValue(generator);
- }
- }
-
- private void syncGenerator(String astGenerator) {
- String old = this.generator;
- this.generator = astGenerator;
- this.firePropertyChanged(GENERATOR_PROPERTY, old, astGenerator);
- }
-
- private String buildGenerator(CompilationUnit astRoot) {
- return this.generatorAdapter.getValue(astRoot);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(GENERATOR_ADAPTER, astRoot);
- }
-
- public boolean generatorTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(GENERATOR_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__STRATEGY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildGeneratorAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__GENERATOR);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratorAnnotation.java
deleted file mode 100644
index 0aaa15274e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceGeneratorAnnotation.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.SequenceGenerator
- * javax.persistence.TableGenerator
- */
-abstract class SourceGeneratorAnnotation
- extends SourceAnnotation<Member>
- implements GeneratorAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
- TextRange nameTextRange;
-
- final DeclarationAnnotationElementAdapter<Integer> initialValueDeclarationAdapter;
- final AnnotationElementAdapter<Integer> initialValueAdapter;
- Integer initialValue;
-
- final DeclarationAnnotationElementAdapter<Integer> allocationSizeDeclarationAdapter;
- final AnnotationElementAdapter<Integer> allocationSizeAdapter;
- Integer allocationSize;
-
-
- SourceGeneratorAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.nameDeclarationAdapter = this.getNameAdapter();
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.initialValueDeclarationAdapter = this.getInitialValueAdapter();
- this.initialValueAdapter = this.buildIntegerAdapter(this.initialValueDeclarationAdapter);
- this.allocationSizeDeclarationAdapter = this.getAllocationSizeAdapter();
- this.allocationSizeAdapter = this.buildIntegerAdapter(this.allocationSizeDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Integer>(this.annotatedElement, daea);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.nameTextRange = this.buildNameTextRange(astRoot);
- this.initialValue = this.buildInitialValue(astRoot);
- this.allocationSize = this.buildAllocationSize(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.nameTextRange = this.buildNameTextRange(astRoot);
- this.syncInitialValue(this.buildInitialValue(astRoot));
- this.syncAllocationSize(this.buildAllocationSize(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null) &&
- (this.initialValue == null) &&
- (this.allocationSize == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** GeneratorAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.nameTextRange;
- }
-
- private TextRange buildNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- abstract DeclarationAnnotationElementAdapter<String> getNameAdapter();
-
- // ***** initial value
- public Integer getInitialValue() {
- return this.initialValue;
- }
-
- public void setInitialValue(Integer initialValue) {
- if (this.attributeValueHasChanged(this.initialValue, initialValue)) {
- this.initialValue = initialValue;
- this.initialValueAdapter.setValue(initialValue);
- }
- }
-
- private void syncInitialValue(Integer astIinitialValue) {
- Integer old = this.initialValue;
- this.initialValue = astIinitialValue;
- this.firePropertyChanged(INITIAL_VALUE_PROPERTY, old, astIinitialValue);
- }
-
- private Integer buildInitialValue(CompilationUnit astRoot) {
- return this.initialValueAdapter.getValue(astRoot);
- }
-
- public TextRange getInitialValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.initialValueDeclarationAdapter, astRoot);
- }
-
- abstract DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter();
-
- // ***** allocation size
- public Integer getAllocationSize() {
- return this.allocationSize;
- }
-
- public void setAllocationSize(Integer allocationSize) {
- if (this.attributeValueHasChanged(this.allocationSize, allocationSize)) {
- this.allocationSize = allocationSize;
- this.allocationSizeAdapter.setValue(allocationSize);
- }
- }
-
- private void syncAllocationSize(Integer astAllocationSize) {
- Integer old = this.allocationSize;
- this.allocationSize = astAllocationSize;
- this.firePropertyChanged(ALLOCATION_SIZE_PROPERTY, old, astAllocationSize);
- }
-
- private Integer buildAllocationSize(CompilationUnit astRoot) {
- return this.allocationSizeAdapter.getValue(astRoot);
- }
-
- public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.allocationSizeDeclarationAdapter, astRoot);
- }
-
- abstract DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter();
-
-
- // ********** static methods **********
-
- static DeclarationAnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName);
- }
-
- static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, NumberIntegerExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdAnnotation.java
deleted file mode 100644
index 3a9cb91a67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Id
- */
-public final class SourceIdAnnotation
- extends SourceAnnotation<Attribute>
- implements IdAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceIdAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdClassAnnotation.java
deleted file mode 100644
index 7eb7d61573..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceIdClassAnnotation.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.IdClass
- */
-public final class SourceIdClassAnnotation
- extends SourceAnnotation<Type>
- implements IdClassAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- /**
- * We cache this here because we use the AST bindings to calculate it.<ul>
- * <li>We do not return a calculated value because it would force a JDT
- * parse with <em>every</em> context model <em>update</em>. (This property
- * is one that is read during the context model <em>update</em>, as opposed
- * to the context model <em>sync</em>.)
- * <li>We do not calculate it during {@link #synchronizeWith(CompilationUnit)}
- * because<ul>
- * <li>when the class name ({@link #value}) is changed via API from the UI,
- * we are ignoring Java change events; so we would need to calculate it
- * during {@link #setValue(String)} which might slow down our UI a bit (with
- * the additional parse), and setting the flag is effectively equivalent
- * <li>when the class name ({@link #value}) is changed via API from a test,
- * we are handling Java change events synchronously;
- * so we would detect a change in the fully-qualified class name during
- * {@link #synchronizeWith(CompilationUnit)}, triggering an
- * unwanted context model <em>sync</em> (Any resource model changes via
- * API should <em>not</em> trigger a context model <em>sync</em>.)
- * </ul>
- * </ul>
- * Also, there is no change notification tied to this property since it
- * would be fired at the same times as the change events for {@link #value}.
- */
- // TODO any of a number of things can invalidate this: classpath change,
- // added or removed matching class
- private String fullyQualifiedClassName;
- // we need a flag since the f-q name can be null
- private boolean fqClassNameStale = true;
-
-
- public SourceIdClassAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** IdClassAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.fqClassNameStale = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- if (this.attributeValueHasChanged(this.value, astValue)) {
- this.syncValue_(astValue);
- }
- }
-
- private void syncValue_(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.fqClassNameStale = true;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified class name
- public String getFullyQualifiedClassName() {
- if (this.fqClassNameStale) {
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName();
- this.fqClassNameStale = false;
- }
- return this.fullyQualifiedClassName;
- }
-
- private String buildFullyQualifiedClassName() {
- return (this.value == null) ? null : this.buildFullyQualifiedClassName_();
- }
-
- private String buildFullyQualifiedClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, JPA.ID_CLASS__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceInheritanceAnnotation.java
deleted file mode 100644
index 580f00164a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceInheritanceAnnotation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class SourceInheritanceAnnotation
- extends SourceAnnotation<Type>
- implements InheritanceAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
- private final AnnotationElementAdapter<String> strategyAdapter;
- private InheritanceType strategy;
-
-
- public SourceInheritanceAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, STRATEGY_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.buildStrategy(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncStrategy(this.buildStrategy(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.strategy == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.strategy);
- }
-
-
- // ********** InheritanceAnnotation implementation **********
-
- // ***** strategy
- public InheritanceType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(InheritanceType strategy) {
- if (this.attributeValueHasChanged(this.strategy, strategy)) {
- this.strategy = strategy;
- this.strategyAdapter.setValue(InheritanceType.toJavaAnnotationValue(strategy));
- }
- }
-
- private void syncStrategy(InheritanceType astStrategy) {
- InheritanceType old = this.strategy;
- this.strategy = astStrategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, astStrategy);
- }
-
- private InheritanceType buildStrategy(CompilationUnit astRoot) {
- return InheritanceType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.INHERITANCE__STRATEGY);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnAnnotation.java
deleted file mode 100644
index afdb776e6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnAnnotation.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.JoinColumn</code>
- */
-public final class SourceJoinColumnAnnotation
- extends SourceBaseJoinColumnAnnotation
- implements NestableJoinColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new ElementAnnotationAdapter(member, daa));
- }
-
- public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa));
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** SourceBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.JOIN_COLUMN__UPDATABLE;
- }
-
-
- // ********** SourceBaseJoinColumnAnnotation implementation **********
-
- @Override
- protected String getReferencedColumnNameElementName() {
- return JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- }
-
-
- // ********** static methods **********
-
- public static SourceJoinColumnAnnotation createJoinColumn(JavaResourceNode parent, Member member) {
- return new SourceJoinColumnAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static SourceJoinColumnAnnotation createNestedJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter, ANNOTATION_NAME);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
- return new SourceJoinColumnAnnotation(parent, member, idaa, annotationAdapter);
- }
-
- static NestableJoinColumnAnnotation createAssociationOverrideJoinColumn(DeclarationAnnotationAdapter associationOverrideAdapter, JavaResourceNode parent, Member member, int index) {
- return new SourceJoinColumnAnnotation(parent, member, buildAssociationOverrideAnnotationAdapter(associationOverrideAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildAssociationOverrideAnnotationAdapter(DeclarationAnnotationAdapter associationOverrideAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(associationOverrideAdapter, JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS, index, ANNOTATION_NAME);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java
deleted file mode 100644
index 8361a6faf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.JoinColumns</code>
- */
-public final class SourceJoinColumnsAnnotation
- extends SourceAnnotation<Member>
- implements JoinColumnsAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
-
-
- public SourceJoinColumnsAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.joinColumns.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.joinColumns);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.JOIN_COLUMNS__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.joinColumns.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.joinColumns.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.joinColumns.add(index, (NestableJoinColumnAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.joinColumns.remove(0).convertToStandAlone();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addNestedAnnotation(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addNestedAnnotation(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- // pass the Java resource persistent member as the nested annotation's parent
- // since the nested annotation can be converted to stand-alone
- return SourceJoinColumnAnnotation.createNestedJoinColumn(this.parent, this.annotatedElement, index, this.daa);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return this.joinColumns.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinTableAnnotation.java
deleted file mode 100644
index a00a620b26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceJoinTableAnnotation.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.JoinTable</code>
- */
-public final class SourceJoinTableAnnotation
- extends SourceBaseTableAnnotation
- implements JoinTableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JoinTableAnnotation.ANNOTATION_NAME);
-
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final JoinColumnsAnnotationContainer joinColumnsContainer = new JoinColumnsAnnotationContainer();
-
- private final Vector<NestableJoinColumnAnnotation> inverseJoinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final InverseJoinColumnsContainerAnnotation inverseJoinColumnsContainer = new InverseJoinColumnsContainerAnnotation();
-
-
- public SourceJoinTableAnnotation(JavaResourceNode parent, Member member) {
- this(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceJoinTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.joinColumnsContainer, astRoot);
- AnnotationContainerTools.initialize(this.inverseJoinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.joinColumnsContainer, astRoot);
- AnnotationContainerTools.synchronize(this.inverseJoinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.JOIN_TABLE__NAME);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildSchemaDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.JOIN_TABLE__SCHEMA);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildCatalogDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.JOIN_TABLE__CATALOG);
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS;
- }
-
- // ********** JoinTableAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- private NestableJoinColumnAnnotation addJoinColumn() {
- return this.addJoinColumn(this.joinColumns.size());
- }
-
- public NestableJoinColumnAnnotation addJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addJoinColumn_() {
- return this.addJoinColumn_(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- void syncAddJoinColumn(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- return new SourceJoinColumnAnnotation(this, this.annotatedElement, buildJoinColumnAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildJoinColumnAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.JOIN_TABLE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeJoinColumn_(int index) {
- return this.joinColumns.remove(index);
- }
-
- void syncRemoveJoinColumns(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- // ***** inverse join columns
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableInverseJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
- public NestableJoinColumnAnnotation inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.get(index);
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- private NestableJoinColumnAnnotation addInverseJoinColumn() {
- return this.addInverseJoinColumn(this.inverseJoinColumns.size());
- }
-
- public NestableJoinColumnAnnotation addInverseJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.inverseJoinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addInverseJoinColumn_() {
- return this.addInverseJoinColumn_(this.inverseJoinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addInverseJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildInverseJoinColumn(index);
- this.inverseJoinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- void syncAddInverseJoinColumn(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.inverseJoinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addInverseJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(INVERSE_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildInverseJoinColumn(int index) {
- return new SourceJoinColumnAnnotation(this, this.annotatedElement, buildInverseJoinColumnAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildInverseJoinColumnAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- void inverseJoinColumnAdded(int index, NestableJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(INVERSE_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.inverseJoinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveInverseJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.inverseJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- void inverseJoinColumnMoved(int targetIndex, int sourceIndex) {
- this.fireItemMoved(INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public void removeInverseJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.inverseJoinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeInverseJoinColumn_(int index) {
- return this.inverseJoinColumns.remove(index);
- }
-
- void syncRemoveInverseJoinColumns(int index) {
- this.removeItemsFromList(index, this.inverseJoinColumns, INVERSE_JOIN_COLUMNS_LIST);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.joinColumns.isEmpty() &&
- this.inverseJoinColumns.isEmpty();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
-
- List<Map<String, Object>> joinColumnsState = this.buildStateList(this.joinColumns.size());
- for (NestableJoinColumnAnnotation joinColumn : this.getNestableJoinColumns()) {
- Map<String, Object> joinColumnState = new HashMap<String, Object>();
- joinColumn.storeOn(joinColumnState);
- joinColumnsState.add(joinColumnState);
- }
- map.put(JOIN_COLUMNS_LIST, joinColumnsState);
- this.joinColumns.clear();
-
- List<Map<String, Object>> inverseJoinColumnsState = this.buildStateList(this.inverseJoinColumns.size());
- for (NestableJoinColumnAnnotation joinColumn : this.getNestableInverseJoinColumns()) {
- Map<String, Object> joinColumnState = new HashMap<String, Object>();
- joinColumn.storeOn(joinColumnState);
- inverseJoinColumnsState.add(joinColumnState);
- }
- map.put(INVERSE_JOIN_COLUMNS_LIST, inverseJoinColumnsState);
- this.inverseJoinColumns.clear();
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
-
- @SuppressWarnings("unchecked")
- List<Map<String, Object>> joinColumnsState = (List<Map<String, Object>>) map.get(JOIN_COLUMNS_LIST);
- for (Map<String, Object> joinColumnState : joinColumnsState) {
- this.addJoinColumn().restoreFrom(joinColumnState);
- }
-
- @SuppressWarnings("unchecked")
- List<Map<String, Object>> inverseJoinColumnsState = (List<Map<String, Object>>) map.get(INVERSE_JOIN_COLUMNS_LIST);
- for (Map<String, Object> joinColumnState : inverseJoinColumnsState) {
- this.addInverseJoinColumn().restoreFrom(joinColumnState);
- }
- }
-
-
- // ********** annotation containers **********
-
- abstract class AbstractJoinColumnAnnotationContainer
- implements AnnotationContainer<NestableJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceJoinTableAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- /**
- * adapt the AnnotationContainer interface to the join table's join columns
- */
- class JoinColumnsAnnotationContainer
- extends AbstractJoinColumnAnnotationContainer
- {
- public String getElementName() {
- return JPA.JOIN_TABLE__JOIN_COLUMNS;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceJoinTableAnnotation.this.getNestableJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceJoinTableAnnotation.this.joinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceJoinTableAnnotation.this.addJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- SourceJoinTableAnnotation.this.syncAddJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceJoinTableAnnotation.this.moveJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceJoinTableAnnotation.this.removeJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceJoinTableAnnotation.this.syncRemoveJoinColumns(index);
- }
- }
-
-
- /**
- * adapt the AnnotationContainer interface to the join table's inverse join columns
- */
- class InverseJoinColumnsContainerAnnotation
- extends AbstractJoinColumnAnnotationContainer
- {
- public String getElementName() {
- return JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceJoinTableAnnotation.this.getNestableInverseJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceJoinTableAnnotation.this.inverseJoinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceJoinTableAnnotation.this.addInverseJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- SourceJoinTableAnnotation.this.syncAddInverseJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceJoinTableAnnotation.this.moveInverseJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceJoinTableAnnotation.this.removeInverseJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceJoinTableAnnotation.this.syncRemoveInverseJoinColumns(index);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceLobAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceLobAnnotation.java
deleted file mode 100644
index acdef41d86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceLobAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-
-/**
- * javax.persistence.Lob
- */
-public final class SourceLobAnnotation
- extends SourceAnnotation<Attribute>
- implements LobAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceLobAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToManyAnnotation.java
deleted file mode 100644
index 601d50e757..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToManyAnnotation.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.ManyToMany
- */
-public final class SourceManyToManyAnnotation
- extends SourceRelationshipMappingAnnotation
- implements ManyToMany2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
-
- public SourceManyToManyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.buildMappedBy(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncMappedBy(this.buildMappedBy(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.mappedBy == null);
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (this.attributeValueHasChanged(this.mappedBy, mappedBy)) {
- this.mappedBy = mappedBy;
- this.mappedByAdapter.setValue(mappedBy);
- }
- }
-
- private void syncMappedBy(String astMappedBy) {
- String old = this.mappedBy;
- this.mappedBy = astMappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, astMappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__MAPPED_BY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToOneAnnotation.java
deleted file mode 100644
index 4eb75c9e38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceManyToOneAnnotation.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.ManyToOne
- */
-public final class SourceManyToOneAnnotation
- extends SourceRelationshipMappingAnnotation
- implements ManyToOne2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
-
- public SourceManyToOneAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.optional = this.buildOptional(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncOptional(this.buildOptional(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.optional == null);
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- // ********** ManyToOneMappingAnnotation implementation **********
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (this.attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, astOptional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__OPTIONAL);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMapKeyAnnotation.java
deleted file mode 100644
index 590302bd68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMapKeyAnnotation.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-
-/**
- * javax.persistence.MapKey
- */
-public final class SourceMapKeyAnnotation
- extends SourceAnnotation<Attribute>
- implements MapKeyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
-
- public SourceMapKeyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, NAME_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** MapKeyAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MAP_KEY__NAME);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java
deleted file mode 100644
index 0eafc0f2ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-/**
- * javax.persistence.MappedSuperclass
- */
-public final class SourceMappedSuperclassAnnotation
- extends SourceAnnotation<Type>
- implements MappedSuperclassAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceMappedSuperclassAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
deleted file mode 100644
index 8f9e2d2f22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedColumnAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>javax.persistence.Column
- * <li>javax.persistence.JoinColumn
- * <li>javax.persistence.DiscriminatorColumn
- * <li>javax.persistence.PrimaryKeyJoinColumn
- * <li>javax.persistence.MapKeyColumn
- * <li>javax.persistence.MapKeyJoinColumn
- * <li>javax.persistence.OrderColumn
- * </ul>
- * </code>
- */
-public abstract class SourceNamedColumnAnnotation
- extends SourceAnnotation<Member>
- implements NamedColumnAnnotation
-{
- private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private DeclarationAnnotationElementAdapter<String> columnDefinitionDeclarationAdapter;
- private AnnotationElementAdapter<String> columnDefinitionAdapter;
- private String columnDefinition;
-
-
- protected SourceNamedColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new ElementAnnotationAdapter(member, daa));
- }
-
- protected SourceNamedColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.columnDefinitionDeclarationAdapter = this.buildColumnDefinitionDeclarationAdapter();
- this.columnDefinitionAdapter = this.buildColumnDefinitionAdapter();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.columnDefinition = this.buildColumnDefinition(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncColumnDefinition(this.buildColumnDefinition(astRoot));
- }
-
-
- // ********** NamedColumn implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return this.buildStringElementAdapter(this.getNameElementName());
- }
-
- private AnnotationElementAdapter<String> buildNameAdapter() {
- return this.buildStringElementAdapter(this.nameDeclarationAdapter);
- }
-
- protected abstract String getNameElementName();
-
- // ***** column definition
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- if (this.attributeValueHasChanged(this.columnDefinition, columnDefinition)) {
- this.columnDefinition = columnDefinition;
- this.columnDefinitionAdapter.setValue(columnDefinition);
- }
- }
-
- private void syncColumnDefinition(String astColumnDefinition) {
- String old = this.columnDefinition;
- this.columnDefinition = astColumnDefinition;
- this.firePropertyChanged(COLUMN_DEFINITION_PROPERTY, old, astColumnDefinition);
- }
-
- private String buildColumnDefinition(CompilationUnit astRoot) {
- return this.columnDefinitionAdapter.getValue(astRoot);
- }
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.columnDefinitionDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildColumnDefinitionDeclarationAdapter() {
- return this.buildStringElementAdapter(this.getColumnDefinitionElementName());
- }
-
- private AnnotationElementAdapter<String> buildColumnDefinitionAdapter() {
- return this.buildStringElementAdapter(this.columnDefinitionDeclarationAdapter);
- }
-
- protected abstract String getColumnDefinitionElementName();
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null) &&
- (this.columnDefinition == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.columnDefinitionDeclarationAdapter = this.buildColumnDefinitionDeclarationAdapter();
- this.columnDefinitionAdapter = this.buildColumnDefinitionAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(NAME_PROPERTY, this.name);
- this.name = null;
- map.put(COLUMN_DEFINITION_PROPERTY, this.columnDefinition);
- this.columnDefinition = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setName((String) map.get(NAME_PROPERTY));
- this.setColumnDefinition((String) map.get(COLUMN_DEFINITION_PROPERTY));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java
deleted file mode 100644
index f1eaa10446..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedNativeQueryAnnotation;
-
-/**
- * <code>javax.persistence.NamedNativeQueries</code>
- */
-public final class SourceNamedNativeQueriesAnnotation
- extends SourceAnnotation<Type>
- implements NamedNativeQueriesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableNamedNativeQueryAnnotation> namedNativeQueries = new Vector<NestableNamedNativeQueryAnnotation>();
-
-
- public SourceNamedNativeQueriesAnnotation(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.namedNativeQueries.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namedNativeQueries);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.NAMED_NATIVE_QUERIES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return NamedNativeQueryAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedNativeQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedNativeQueryAnnotation>(this.namedNativeQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedNativeQueries.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.namedNativeQueries.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.namedNativeQueries.add(index, (NestableNamedNativeQueryAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.namedNativeQueries.remove(0).convertToStandAlone();
- }
-
- public NestableNamedNativeQueryAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.namedNativeQueries.size());
- }
-
- private NestableNamedNativeQueryAnnotation addNestedAnnotation(int index) {
- NestableNamedNativeQueryAnnotation namedNativeQuery = this.buildNamedNativeQuery(index);
- this.namedNativeQueries.add(index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.namedNativeQueries.size();
- NestableNamedNativeQueryAnnotation namedNativeQuery = this.addNestedAnnotation(index);
- namedNativeQuery.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- private NestableNamedNativeQueryAnnotation buildNamedNativeQuery(int index) {
- // pass the Java resource persistent member as the nested annotation's parent
- // since the nested annotation can be converted to stand-alone
- return SourceNamedNativeQueryAnnotation.createNestedNamedNativeQuery(this.parent, this.annotatedElement, index, this.daa);
- }
-
- public NestableNamedNativeQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableNamedNativeQueryAnnotation removeNestedAnnotation(int index) {
- return this.namedNativeQueries.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java
deleted file mode 100644
index 8ad2d4055c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
-
-/**
- * <code>javax.persistence.NamedNativeQuery</code>
- */
-public final class SourceNamedNativeQueryAnnotation
- extends SourceQueryAnnotation
- implements NestableNamedNativeQueryAnnotation
-{
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private DeclarationAnnotationElementAdapter<String> resultClassDeclarationAdapter;
- private AnnotationElementAdapter<String> resultClassAdapter;
- private String resultClass;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedResultClassName;
- // we need a flag since the f-q name can be null
- private boolean fqResultClassNameStale = true;
-
- private DeclarationAnnotationElementAdapter<String> resultSetMappingDeclarationAdapter;
- private AnnotationElementAdapter<String> resultSetMappingAdapter;
- private String resultSetMapping;
-
-
- public SourceNamedNativeQueryAnnotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.resultClassDeclarationAdapter = this.buildResultClassDeclarationAdapter();
- this.resultClassAdapter = this.buildResultClassAdapter();
- this.resultSetMappingDeclarationAdapter = this.buildResultSetMappingAdapter(daa);
- this.resultSetMappingAdapter = this.buildResultSetMappingAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.resultClass = this.buildResultClass(astRoot);
- this.resultSetMapping = this.buildResultSetMapping(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncResultClass(this.buildResultClass(astRoot));
- this.syncResultSetMapping(this.buildResultSetMapping(astRoot));
- }
-
-
- // ********** AbstractBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_NATIVE_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_NATIVE_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_NATIVE_QUERY__HINTS;
- }
-
- @Override
- NestableQueryHintAnnotation buildHint(int index) {
- return SourceQueryHintAnnotation.createNamedNativeQueryQueryHint(this, this.annotatedElement, this.daa, index);
- }
-
-
- // ********** NamedNativeQueryAnnotation implementation **********
-
- // ***** result class
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String resultClass) {
- if (this.attributeValueHasChanged(this.resultClass, resultClass)) {
- this.resultClass = resultClass;
- this.fqResultClassNameStale = true;
- this.resultClassAdapter.setValue(resultClass);
- }
- }
-
- private void syncResultClass(String astResultClass) {
- if (this.attributeValueHasChanged(this.resultClass, astResultClass)) {
- this.syncResultClass_(astResultClass);
- }
- }
-
- private void syncResultClass_(String astResultClass) {
- String old = this.resultClass;
- this.resultClass = astResultClass;
- this.fqResultClassNameStale = true;
- this.firePropertyChanged(RESULT_CLASS_PROPERTY, old, astResultClass);
- }
-
- private String buildResultClass(CompilationUnit astRoot) {
- return this.resultClassAdapter.getValue(astRoot);
- }
-
- public TextRange getResultClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.resultClassDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildResultClassDeclarationAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, JPA.NAMED_NATIVE_QUERY__RESULT_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- private AnnotationElementAdapter<String> buildResultClassAdapter() {
- return this.buildStringElementAdapter(this.resultClassDeclarationAdapter);
- }
-
- // ***** fully-qualified result class name
- public String getFullyQualifiedResultClassName() {
- if (this.fqResultClassNameStale) {
- this.fullyQualifiedResultClassName = this.buildFullyQualifiedResultClassName();
- this.fqResultClassNameStale = false;
- }
- return this.fullyQualifiedResultClassName;
- }
-
- private String buildFullyQualifiedResultClassName() {
- return (this.resultClass == null) ? null : this.buildFullyQualifiedResultClassName_();
- }
-
- private String buildFullyQualifiedResultClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.resultClassAdapter.getExpression(this.buildASTRoot()));
- }
-
- // ***** result set mapping
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String resultSetMapping) {
- if (this.attributeValueHasChanged(this.resultSetMapping, resultSetMapping)) {
- this.resultSetMapping = resultSetMapping;
- this.resultSetMappingAdapter.setValue(resultSetMapping);
- }
- }
-
- private void syncResultSetMapping(String astResultSetMapping) {
- String old = this.resultSetMapping;
- this.resultSetMapping = astResultSetMapping;
- this.firePropertyChanged(RESULT_SET_MAPPING_PROPERTY, old, astResultSetMapping);
- }
-
- private String buildResultSetMapping(CompilationUnit astRoot) {
- return this.resultSetMappingAdapter.getValue(astRoot);
- }
-
- public TextRange getResultSetMappingTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.resultSetMappingDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildResultSetMappingAdapter(DeclarationAnnotationAdapter daAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, JPA.NAMED_NATIVE_QUERY__RESULT_SET_MAPPING);
- }
-
- private AnnotationElementAdapter<String> buildResultSetMappingAdapter() {
- return this.buildStringElementAdapter(this.resultSetMappingDeclarationAdapter);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.resultClass == null) &&
- (this.resultSetMapping == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.resultClassDeclarationAdapter = this.buildResultClassDeclarationAdapter();
- this.resultClassAdapter = this.buildResultClassAdapter();
- this.resultSetMappingDeclarationAdapter = this.buildResultSetMappingAdapter(daa);
- this.resultSetMappingAdapter = this.buildResultSetMappingAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(RESULT_CLASS_PROPERTY, this.resultClass);
- this.resultClass = null;
- map.put(RESULT_SET_MAPPING_PROPERTY, this.resultSetMapping);
- this.resultSetMapping = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setResultClass((String) map.get(RESULT_CLASS_PROPERTY));
- this.setResultSetMapping((String) map.get(RESULT_SET_MAPPING_PROPERTY));
- }
-
-
- // ********** static methods **********
-
- public static SourceNamedNativeQueryAnnotation createNamedNativeQuery(JavaResourceNode parent, Type type) {
- return new SourceNamedNativeQueryAnnotation(parent, type, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceNamedNativeQueryAnnotation createNestedNamedNativeQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter, ANNOTATION_NAME);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(type, idaa);
- return new SourceNamedNativeQueryAnnotation(parent, type, idaa, annotationAdapter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java
deleted file mode 100644
index b6b8b328d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedQueryAnnotation;
-
-/**
- * <code>javax.persistence.NamedQueries</code>
- */
-public final class SourceNamedQueries1_0Annotation
- extends SourceNamedQueriesAnnotation
-{
- public SourceNamedQueries1_0Annotation(JavaResourceNode parent, Type type) {
- super(parent, type);
- }
-
- @Override
- protected NestableNamedQueryAnnotation buildNamedQuery(int index) {
- // pass the Java resource persistent member as the nested annotation's parent
- // since the nested annotation can be converted to stand-alone
- return SourceNamedQueryAnnotation.createNestedNamedQuery(this.parent, this.annotatedElement, index, this.daa);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java
deleted file mode 100644
index 17665feda2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedQueryAnnotation;
-
-/**
- * <code>javax.persistence.NamedQueries</code>
- */
-public abstract class SourceNamedQueriesAnnotation
- extends SourceAnnotation<Type>
- implements NamedQueriesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableNamedQueryAnnotation> namedQueries = new Vector<NestableNamedQueryAnnotation>();
-
-
- public SourceNamedQueriesAnnotation(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.namedQueries.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namedQueries);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.NAMED_QUERIES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedQueryAnnotation>(this.namedQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedQueries.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.namedQueries.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.namedQueries.add(index, (NestableNamedQueryAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.namedQueries.remove(0).convertToStandAlone();
- }
-
- public NestableNamedQueryAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.namedQueries.size());
- }
-
- private NestableNamedQueryAnnotation addNestedAnnotation(int index) {
- NestableNamedQueryAnnotation namedQuery = this.buildNamedQuery(index);
- this.namedQueries.add(index, namedQuery);
- return namedQuery;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.namedQueries.size();
- NestableNamedQueryAnnotation namedQuery = this.addNestedAnnotation(index);
- namedQuery.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected abstract NestableNamedQueryAnnotation buildNamedQuery(int index);
-
- public NestableNamedQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.namedQueries, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableNamedQueryAnnotation removeNestedAnnotation(int index) {
- return this.namedQueries.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.namedQueries, NAMED_QUERIES_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueryAnnotation.java
deleted file mode 100644
index 3389852b42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNamedQueryAnnotation.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.jpa1.resource.java.source.SourceNamedQuery1_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
-
-/**
- * <code>javax.persistence.NamedQuery</code>
- */
-public abstract class SourceNamedQueryAnnotation
- extends SourceQueryAnnotation
- implements NestableNamedQueryAnnotation
-{
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceNamedQueryAnnotation(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceNamedQueryAnnotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** AbstractBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_QUERY__HINTS;
- }
-
- @Override
- NestableQueryHintAnnotation buildHint(int index) {
- return SourceQueryHintAnnotation.createNamedQueryQueryHint(this, this.annotatedElement, this.daa, index);
- }
-
-
- // ********** static methods **********
-
- static SourceNamedQueryAnnotation createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter, ANNOTATION_NAME);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(type, idaa);
-
- return new SourceNamedQuery1_0Annotation(parent, type, idaa, annotationAdapter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNode.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNode.java
deleted file mode 100644
index 59f548213e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceNode.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jpa.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-
-/**
- * Source convenience methods
- */
-public abstract class SourceNode
- extends AbstractJavaResourceNode
-{
-
- public SourceNode(JavaResourceNode parent) {
- super(parent);
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- return (JavaResourceCompilationUnit) this.getRoot();
- }
-
- protected CompilationUnit buildASTRoot() {
- return this.getJavaResourceCompilationUnit().buildASTRoot();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToManyAnnotation.java
deleted file mode 100644
index c32094c53b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToManyAnnotation.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class SourceOneToManyAnnotation
- extends SourceRelationshipMappingAnnotation
- implements OneToMany2_0Annotation
-{
- protected static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
- //added in JPA2.0
- private static final DeclarationAnnotationElementAdapter<Boolean> ORPHAN_REMOVAL_ADAPTER = buildOrphanRemovalAdapter();
- private final AnnotationElementAdapter<Boolean> orphanRemovalAdapter;
- private Boolean orphanRemoval;
-
- public SourceOneToManyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- this.orphanRemovalAdapter = this.buildBooleanAnnotationElementAdapter(ORPHAN_REMOVAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.buildMappedBy(astRoot);
- this.orphanRemoval = this.buildOrphanRemoval(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncMappedBy(this.buildMappedBy(astRoot));
- this.syncOrphanRemoval(this.buildOrphanRemoval(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.mappedBy == null) &&
- (this.orphanRemoval == null);
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- // ********** OwnableRelationshipMappingAnnotation implementation **********
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (this.attributeValueHasChanged(this.mappedBy, mappedBy)) {
- this.mappedBy = mappedBy;
- this.mappedByAdapter.setValue(mappedBy);
- }
- }
-
- private void syncMappedBy(String astMappedBy) {
- String old = this.mappedBy;
- this.mappedBy = astMappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, astMappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- // ********** OneToMany2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- if (this.attributeValueHasChanged(this.orphanRemoval, orphanRemoval)) {
- this.orphanRemoval = orphanRemoval;
- this.orphanRemovalAdapter.setValue(orphanRemoval);
- }
- }
-
- private void syncOrphanRemoval(Boolean astOrphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = astOrphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, astOrphanRemoval);
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ORPHAN_REMOVAL_ADAPTER, astRoot);
- }
-
- private Boolean buildOrphanRemoval(CompilationUnit astRoot) {
- return this.orphanRemovalAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__MAPPED_BY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter() {
- return buildOrphanRemovalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.ONE_TO_MANY__ORPHAN_REMOVAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToOneAnnotation.java
deleted file mode 100644
index 1867a43f80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOneToOneAnnotation.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.OneToOne
- */
-public final class SourceOneToOneAnnotation
- extends SourceRelationshipMappingAnnotation
- implements OneToOne2_0Annotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
- //added in JPA 2.0
- private static final DeclarationAnnotationElementAdapter<Boolean> ORPHAN_REMOVAL_ADAPTER = buildOrphanRemovalAdapter();
- private final AnnotationElementAdapter<Boolean> orphanRemovalAdapter;
- private Boolean orphanRemoval;
-
- public SourceOneToOneAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- this.orphanRemovalAdapter = this.buildBooleanAnnotationElementAdapter(ORPHAN_REMOVAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.buildMappedBy(astRoot);
- this.optional = this.buildOptional(astRoot);
- this.orphanRemoval = this.buildOrphanRemoval(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncMappedBy(this.buildMappedBy(astRoot));
- this.syncOptional(this.buildOptional(astRoot));
- this.syncOrphanRemoval(this.buildOrphanRemoval(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.mappedBy == null) &&
- (this.optional == null) &&
- (this.orphanRemoval == null);
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- // ********** OneToOneAnnotation implementation **********
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (this.attributeValueHasChanged(this.mappedBy, mappedBy)) {
- this.mappedBy = mappedBy;
- this.mappedByAdapter.setValue(mappedBy);
- }
- }
-
- private void syncMappedBy(String astMappedBy) {
- String old = this.mappedBy;
- this.mappedBy = astMappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, astMappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (this.attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, astOptional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- // ********** OneToOne2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- if (this.attributeValueHasChanged(this.orphanRemoval, orphanRemoval)) {
- this.orphanRemoval = orphanRemoval;
- this.orphanRemovalAdapter.setValue(orphanRemoval);
- }
- }
-
- private void syncOrphanRemoval(Boolean astOrphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = astOrphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, astOrphanRemoval);
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ORPHAN_REMOVAL_ADAPTER, astRoot);
- }
-
- private Boolean buildOrphanRemoval(CompilationUnit astRoot) {
- return this.orphanRemovalAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__MAPPED_BY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__OPTIONAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter() {
- return buildOrphanRemovalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, BooleanExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOrderByAnnotation.java
deleted file mode 100644
index 78a7ccc939..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOrderByAnnotation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-
-/**
- * javax.persistence.OrderBy
- */
-public final class SourceOrderByAnnotation
- extends SourceAnnotation<Attribute>
- implements OrderByAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public SourceOrderByAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** OrderByAnnotation implementation **********
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ORDER_BY__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOverrideAnnotation.java
deleted file mode 100644
index af86e3b55c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceOverrideAnnotation.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.OverrideAnnotation;
-
-/**
- * <ul>
- * <li><code>javax.persistence.AttributeOverride</code>
- * <li><code>javax.persistence.AssociationOverride</code>
- * </ul>
- */
-abstract class SourceOverrideAnnotation
- extends SourceAnnotation<Member>
- implements OverrideAnnotation
-{
- DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- AnnotationElementAdapter<String> nameAdapter;
- String name;
-
-
- SourceOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
-
- // ********** OverrideAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return this.buildStringElementAdapter(this.getNameElementName());
- }
-
- private AnnotationElementAdapter<String> buildNameAdapter() {
- return this.buildStringElementAdapter(this.nameDeclarationAdapter);
- }
-
- protected abstract String getNameElementName();
-
-
- // ********** NestableAnnotation implementation **********
-
- /**
- * Convenience implementation of
- * {@link org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation#moveAnnotation(int)}
- * used by subclasses.
- */
- public void moveAnnotation(int index) {
- this.getIndexedAnnotationAdapter().moveAnnotation(index);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(NAME_PROPERTY, this.name);
- this.name = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setName((String) map.get(NAME_PROPERTY));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackage.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackage.java
deleted file mode 100644
index 604045d275..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackage.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IPackageBinding;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTPackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
-
-/**
- * @author Dmitry Geraskov
- * Source package-info.java
- *
- */
-public final class SourcePackage
- extends SourceAnnotatedElement<AnnotatedPackage>
- implements JavaResourcePackage {
-
- private String name;
-
- /**
- * construct package info
- */
- public static JavaResourcePackage newInstance(
- JavaResourceCompilationUnit parent,
- PackageDeclaration declaringPackage,
- CompilationUnit astRoot) {
- AnnotatedPackage pack = new JDTPackage(
- declaringPackage,
- parent.getCompilationUnit(),
- parent.getModifySharedDocumentCommandExecutor(),
- parent.getAnnotationEditFormatter());
- JavaResourcePackage jrpp = new SourcePackage(parent, pack);
- jrpp.initialize(astRoot);
- return jrpp;
- }
-
- private SourcePackage(
- JavaResourceCompilationUnit parent,
- AnnotatedPackage pack){
- super(parent, pack);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.name = this.buildName(astRoot);
- }
-
-
- // ********** JavaResourcePackageInfo implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void syncName(String astName) {
- if (valuesAreDifferent(astName, this.name)){
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
- }
-
- private String buildName(CompilationUnit astRoot) {
- IPackageBinding binding = this.annotatedElement.getBinding(astRoot);
- return (binding == null) ? null : binding.getName();
- }
-
-
- // ********** Java changes **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncName(this.buildName(astRoot));
- }
-
- // ********** SourceAnnotatedElement implementation **********
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().packageAnnotationNames();
- }
-
-
- @Override
- Annotation buildAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildPackageAnnotation(this, this.annotatedElement, annotationName);
- }
-
- @Override
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullPackageAnnotation(this, annotationName);
- }
-
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
deleted file mode 100644
index f6979b9ea2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * @author Dmitry Geraskov
- * Source package-info.java
- *
- */
-public final class SourcePackageInfoCompilationUnit
- extends SourceCompilationUnit
- implements JavaResourcePackageInfoCompilationUnit {
-
- private JavaResourcePackage package_;
-
- public SourcePackageInfoCompilationUnit(
- ICompilationUnit compilationUnit,
- JpaAnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the JPA compilation unit is the root of its sub-tree
- this.package_ = this.buildPackage();
- }
-
-
- private JavaResourcePackage buildPackage() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPackage(astRoot);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public Iterator<JavaResourcePersistentType> persistentTypes() {
- return EmptyIterator.instance();
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncPackage(astRoot);
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public void resolveTypes() {
- //no-op
- }
-
- // ********** package-info **********
-
- public JavaResourcePackage getPackage() {
- return this.package_;
- }
-
- private JavaResourcePackage buildPackage(CompilationUnit astRoot) {
- return this.buildPackage(astRoot, this.getPackageDeclaration(astRoot));
- }
-
- private void syncPackage(CompilationUnit astRoot) {
- PackageDeclaration pd = this.getPackageDeclaration(astRoot);
- if (pd == null) {
- this.syncPackage_(null);
- } else {
- if (this.package_ == null) {
- this.syncPackage_(this.buildPackage(astRoot, pd));
- } else {
- this.package_.synchronizeWith(astRoot);
- }
- }
- }
-
- private PackageDeclaration getPackageDeclaration(CompilationUnit astRoot) {
- return astRoot.getPackage();
- }
-
- private void syncPackage_(JavaResourcePackage astPackage) {
- JavaResourcePackage old = this.package_;
- this.package_ = astPackage;
- this.firePropertyChanged(PACKAGE, old, astPackage);
- }
-
- private JavaResourcePackage buildPackage(CompilationUnit astRoot, PackageDeclaration packageDeclaration) {
- return SourcePackage.newInstance(this, packageDeclaration, astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentAttribute.java
deleted file mode 100644
index f12f70444b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentAttribute.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AccessType;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * Java source persistent attribute (field or property)
- */
-final class SourcePersistentAttribute
- extends SourcePersistentMember<Attribute>
- implements JavaResourcePersistentAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- /**
- * construct field attribute
- */
- static JavaResourcePersistentAttribute newInstance(
- JavaResourcePersistentType parent,
- Type declaringType,
- String name,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- Attribute attribute = new JDTFieldAttribute(
- declaringType,
- name,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentAttribute jrpa = new SourcePersistentAttribute(parent, attribute);
- jrpa.initialize(astRoot);
- return jrpa;
- }
-
- /**
- * construct property attribute
- */
- static JavaResourcePersistentAttribute newInstance(
- JavaResourcePersistentType parent,
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- Attribute attribute = JDTMethodAttribute.newInstance(
- declaringType,
- signature,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentAttribute jrpa = new SourcePersistentAttribute(parent, attribute);
- jrpa.initialize(astRoot);
- return jrpa;
- }
-
- private SourcePersistentAttribute(JavaResourcePersistentType parent, Attribute attribute){
- super(parent, attribute);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot); //build once, minor performance tweak for major benefit
- this.modifiers = this.buildModifiers(astRoot);
- this.typeName = this.buildTypeName(typeBinding);
- this.typeIsInterface = this.buildTypeIsInterface(typeBinding);
- this.typeIsEnum = this.buildTypeIsEnum(typeBinding);
- this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(typeBinding));
- this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(typeBinding));
- this.typeTypeArgumentNames.addAll(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
-
- // ******** overrides ********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
- this.syncTypeName(this.buildTypeName(typeBinding));
- this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
- this.syncModifiers(this.buildModifiers(astRoot));
- this.syncTypeName(this.buildTypeName(typeBinding));
- this.syncTypeIsInterface(this.buildTypeIsInterface(typeBinding));
- this.syncTypeIsEnum(this.buildTypeIsEnum(typeBinding));
- this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******** SourcePersistentMember implementation ********
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().attributeAnnotationNames();
- }
-
- @Override
- Annotation buildAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildAttributeAnnotation(this, this.annotatedElement, annotationName);
- }
-
- private Annotation buildNullAnnotation_(String annotationName) {
- return this.getAnnotationProvider().buildNullAttributeAnnotation(this, annotationName);
- }
-
-
- // ******** JavaResourcePersistentAttribute implementation ********
-
- @Override
- public JavaResourcePersistentType getParent() {
- return (JavaResourcePersistentType) super.getParent();
- }
-
- public JavaResourcePersistentType getResourcePersistentType() {
- return this.getParent();
- }
-
- public String getName() {
- return this.annotatedElement.getAttributeName();
- }
-
- public boolean isFor(MethodSignature signature, int occurrence) {
- return ((MethodAttribute) this.annotatedElement).matches(signature, occurrence);
- }
-
- @Override
- public Annotation buildNullAnnotation(String annotationName) {
- return (annotationName == null) ? null : this.buildNullAnnotation_(annotationName);
- }
-
- public boolean isField() {
- return this.annotatedElement.isField();
- }
-
- public boolean isProperty() {
- return ! this.isField();
- }
-
- public AccessType getSpecifiedAccess() {
- Access2_0Annotation accessAnnotation = this.getAccessAnnotation();
- return (accessAnnotation == null) ? null : accessAnnotation.getValue();
- }
-
- private Access2_0Annotation getAccessAnnotation() {
- return (Access2_0Annotation) this.getAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- }
-
- public boolean typeIsSubTypeOf(String tn) {
- if (this.typeName == null) {
- return false;
- }
- return this.typeName.equals(tn)
- || this.typeInterfaceNames.contains(tn)
- || this.typeSuperclassNames.contains(tn);
- }
-
- public boolean typeIsVariablePrimitive() {
- return (this.typeName != null) && ClassName.isVariablePrimitive(this.typeName);
- }
-
- private ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- return this.annotatedElement.getTypeBinding(astRoot);
- }
-
-
- // ***** modifiers
- public int getModifiers() {
- return this.modifiers;
- }
-
- private void syncModifiers(int astModifiers) {
- int old = this.modifiers;
- this.modifiers = astModifiers;
- this.firePropertyChanged(MODIFIERS_PROPERTY, old, astModifiers);
- }
-
- /**
- * zero seems like a reasonable default...
- */
- private int buildModifiers(CompilationUnit astRoot) {
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- return (binding == null) ? 0 : binding.getModifiers();
- }
-
- // ***** type name
- public String getTypeName() {
- return this.typeName;
- }
-
- private void syncTypeName(String astTypeName) {
- String old = this.typeName;
- this.typeName = astTypeName;
- this.firePropertyChanged(TYPE_NAME_PROPERTY, old, astTypeName);
- }
-
- /**
- * this can be an array (e.g. "java.lang.String[]");
- * but no generic type arguments
- */
- private String buildTypeName(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return null;
- }
- // a type variable is what is declared by a generic type;
- // e.g. "E" is a type variable declared by the generic type "Collection" in
- // public interface Collection<E>
- if (typeBinding.isTypeVariable()) {
- // e.g. "E extends Number" has an erasure of "Number"
- typeBinding = typeBinding.getErasure();
- }
- String tbName = typeBinding.getTypeDeclaration().getQualifiedName();
- return (tbName.length() == 0) ? null : tbName;
- }
-
- // ***** type is interface
- public boolean typeIsInterface() {
- return this.typeIsInterface;
- }
-
- private void syncTypeIsInterface(boolean astTypeIsInterface) {
- boolean old = this.typeIsInterface;
- this.typeIsInterface = astTypeIsInterface;
- this.firePropertyChanged(TYPE_IS_INTERFACE_PROPERTY, old, astTypeIsInterface);
- }
-
- private boolean buildTypeIsInterface(ITypeBinding typeBinding) {
- return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isInterface();
- }
-
- // ***** type is enum
- public boolean typeIsEnum() {
- return this.typeIsEnum;
- }
-
- private void syncTypeIsEnum(boolean astTypeIsEnum) {
- boolean old = this.typeIsEnum;
- this.typeIsEnum = astTypeIsEnum;
- this.firePropertyChanged(TYPE_IS_ENUM_PROPERTY, old, astTypeIsEnum);
- }
-
- private boolean buildTypeIsEnum(ITypeBinding typeBinding) {
- return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isEnum();
- }
-
- // ***** type superclass hierarchy
- public ListIterator<String> typeSuperclassNames() {
- return new CloneListIterator<String>(this.typeSuperclassNames);
- }
-
- private void syncTypeSuperclassNames(List<String> astTypeSuperclassNames) {
- this.synchronizeList(astTypeSuperclassNames, this.typeSuperclassNames, TYPE_SUPERCLASS_NAMES_LIST);
- }
-
- private List<String> buildTypeSuperclassNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptyList();
- }
- ArrayList<String> names = new ArrayList<String>();
- typeBinding = typeBinding.getSuperclass();
- while (typeBinding != null) {
- names.add(typeBinding.getQualifiedName());
- typeBinding = typeBinding.getSuperclass();
- }
- return names;
- }
-
- // ***** type interface hierarchy
- public Iterator<String> typeInterfaceNames() {
- return new CloneIterator<String>(this.typeInterfaceNames);
- }
-
-// private boolean typeInterfaceNamesContains(String interfaceName) {
-// return this.typeInterfaceNames.contains(interfaceName);
-// }
-//
- private void syncTypeInterfaceNames(Collection<String> astTypeInterfaceNames) {
- this.synchronizeCollection(astTypeInterfaceNames, this.typeInterfaceNames, TYPE_INTERFACE_NAMES_COLLECTION);
- }
-
- private Collection<String> buildTypeInterfaceNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptySet();
- }
- HashSet<String> names = new HashSet<String>();
- while (typeBinding != null) {
- this.addInterfaceNamesTo(typeBinding, names);
- typeBinding = typeBinding.getSuperclass();
- }
- return names;
- }
-
- private void addInterfaceNamesTo(ITypeBinding typeBinding, HashSet<String> names) {
- for (ITypeBinding interfaceBinding : typeBinding.getInterfaces()) {
- names.add(interfaceBinding.getTypeDeclaration().getQualifiedName());
- this.addInterfaceNamesTo(interfaceBinding, names); // recurse
- }
- }
-
- // ***** type type argument names
- public ListIterator<String> typeTypeArgumentNames() {
- return new CloneListIterator<String>(this.typeTypeArgumentNames);
- }
-
- public int typeTypeArgumentNamesSize() {
- return this.typeTypeArgumentNames.size();
- }
-
- public String getTypeTypeArgumentName(int index) {
- return this.typeTypeArgumentNames.get(index);
- }
-
- private void syncTypeTypeArgumentNames(List<String> astTypeTypeArgumentNames) {
- this.synchronizeList(astTypeTypeArgumentNames, this.typeTypeArgumentNames, TYPE_TYPE_ARGUMENT_NAMES_LIST);
- }
-
- /**
- * these types can be arrays (e.g. "java.lang.String[]");
- * but they won't have any further nested generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>")
- */
- private List<String> buildTypeTypeArgumentNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptyList();
- }
-
- ITypeBinding[] typeArguments = typeBinding.getTypeArguments();
- if (typeArguments.length == 0) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>(typeArguments.length);
- for (ITypeBinding typeArgument : typeArguments) {
- if (typeArgument == null) {
- names.add(null);
- } else {
- // e.g. "? extends Number" has an erasure of "Number"
- ITypeBinding erasure = typeArgument.getErasure();
- names.add(erasure.getTypeDeclaration().getQualifiedName());
- }
- }
- return names;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentMember.java
deleted file mode 100644
index d4af024013..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentMember.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * Java source persistent member (annotations, "persistable")
- */
-abstract class SourcePersistentMember<M extends Member>
- extends SourceAnnotatedElement<M>
- implements JavaResourcePersistentMember
-{
- /**
- * We can cache this setting because its value is not affected by any API
- * calls - it can only be affected by changes to the Java source.
- * @see org.eclipse.jpt.common.core.internal.utility.jdt.JPTTools#typeIsPersistable(org.eclipse.jpt.common.core.internal.utility.jdt.JPTTools.TypeAdapter)
- */
- boolean persistable;
-
- boolean final_; // 'final' is a reserved word
-
-
- // ********** construction/initialization **********
-
- SourcePersistentMember(JavaResourceNode parent, M member) {
- super(parent, member);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.persistable = this.buildPersistable(astRoot);
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- this.final_ = this.buildFinal(binding);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncPersistable(this.buildPersistable(astRoot));
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncFinal(this.buildFinal(binding));
- }
-
-
- // ********** annotations **********
-
- public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- HashSet<String> annotationNames = CollectionTools.set(supportingAnnotationNames);
- if (primaryAnnotationName != null) {
- annotationNames.add(primaryAnnotationName);
- }
- for (Annotation annotation : this.getAnnotations()) {
- if ( ! annotationNames.contains(annotation.getAnnotationName())) {
- this.annotations.remove(annotation);
- annotation.removeAnnotation();
- }
- }
- Annotation newPrimaryAnnotation = null;
- if ((primaryAnnotationName != null) && (this.getAnnotation(primaryAnnotationName) == null)) {
- newPrimaryAnnotation = this.buildAnnotation(primaryAnnotationName);
- this.annotations.add(newPrimaryAnnotation);
- newPrimaryAnnotation.newAnnotation();
- }
- return newPrimaryAnnotation;
- }
-
-
- // ********** persistable **********
-
- public boolean isPersistable() {
- return this.persistable;
- }
-
- private void syncPersistable(boolean astPersistable) {
- boolean old = this.persistable;
- this.persistable = astPersistable;
- this.firePropertyChanged(PERSISTABLE_PROPERTY, old, astPersistable);
- }
-
- private boolean buildPersistable(CompilationUnit astRoot) {
- return this.annotatedElement.isPersistable(astRoot);
- }
-
- // ***** final
- public boolean isFinal() {
- return this.final_;
- }
-
- private void syncFinal(boolean astFinal) {
- boolean old = this.final_;
- this.final_ = astFinal;
- this.firePropertyChanged(FINAL_PROPERTY, old, astFinal);
- }
-
- private boolean buildFinal(IBinding binding) {
- return (binding == null) ? false : Modifier.isFinal(binding.getModifiers());
- }
-
-
- // ********** miscellaneous **********
-
- public boolean isFor(String memberName, int occurrence) {
- return this.annotatedElement.matches(memberName, occurrence);
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- this.syncPersistable(this.buildPersistable(astRoot));
- }
-
- /**
- * convenience method
- */
- <T extends JavaResourcePersistentMember> Iterator<T> persistableMembers(Iterator<T> members) {
- @SuppressWarnings("unchecked")
- Filter<T> filter = (Filter<T>) PERSISTABLE_MEMBER_FILTER;
- return new FilteringIterator<T>(members, filter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentType.java
deleted file mode 100644
index d296b00eb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePersistentType.java
+++ /dev/null
@@ -1,930 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.IAnnotationBinding;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTType;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.SimpleIntReference;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.GeneratedAnnotationDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.StaticMetamodelAnnotationDefinition;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.StaticMetamodelAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AccessType;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * Java source persistent type
- */
-final class SourcePersistentType
- extends SourcePersistentMember<Type>
- implements JavaResourcePersistentType2_0
-{
- private String name;
-
- private String qualifiedName;
-
- private String packageName;
-
- private String superclassQualifiedName;
-
- private String declaringTypeName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private boolean static_; // 'static' is a reserved word
-
- private boolean memberType;
-
- private boolean hasPrivateNoArgConstructor;
-
- private boolean hasNoArgConstructor;
-
- private final Vector<JavaResourcePersistentType> types = new Vector<JavaResourcePersistentType>();
-
- private final Vector<JavaResourcePersistentAttribute> fields = new Vector<JavaResourcePersistentAttribute>();
-
- private final Vector<JavaResourcePersistentAttribute> methods = new Vector<JavaResourcePersistentAttribute>();
-
- private StaticMetamodelAnnotation staticMetamodelAnnotation;
- //TODO move to interface after maintenance
- public static final String STATIC_METAMODEL_ANNOTATION_PROPERTY = "staticMetamodelAnnotation"; //$NON-NLS-1$
-
- private GeneratedAnnotation generatedAnnotation;
- //TODO move to interface after maintenance
- public static final String GENERATED_ANNOTATION_PROPERTY = "generatedAnnotation"; //$NON-NLS-1$
-
-
- private static final StaticMetamodelAnnotationDefinition STATIC_METAMODEL_ANNOTATION_DEFINITION = StaticMetamodelAnnotationDefinition.instance();
- private static final GeneratedAnnotationDefinition GENERATED_ANNOTATION_DEFINITION = GeneratedAnnotationDefinition.instance();
-
-
- // ********** construction/initialization **********
-
- /**
- * build top-level persistent type
- */
- static JavaResourcePersistentType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- TypeDeclaration typeDeclaration,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- typeDeclaration,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentType jrpt = new SourcePersistentType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- /**
- * build nested persistent type
- */
- private static JavaResourcePersistentType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- Type declaringType,
- TypeDeclaration typeDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- declaringType,
- typeDeclaration,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentType jrpt = new SourcePersistentType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- private SourcePersistentType(JavaResourceCompilationUnit javaResourceCompilationUnit, Type type) {
- super(javaResourceCompilationUnit, type);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.name = this.buildName(binding);
- this.qualifiedName = this.buildQualifiedName(binding);
- this.packageName = this.buildPackageName(binding);
- this.superclassQualifiedName = this.buildSuperclassQualifiedName(binding);
- this.declaringTypeName = this.buildDeclaringTypeName(binding);
- this.abstract_ = this.buildAbstract(binding);
- this.static_ = this.buildStatic(binding);
- this.memberType = this.buildMemberType(binding);
- this.hasNoArgConstructor = this.buildHasNoArgConstructor(binding);
- this.hasPrivateNoArgConstructor = this.buildHasPrivateNoArgConstructor(binding);
- this.initializeTypes(astRoot);
- this.initializeFields(astRoot);
- this.initializeMethods(astRoot);
- }
-
- /**
- * Handle the <code>StaticMetamodel</code> and <code>Generated</code>
- * annotations differently, since they are not really JPA "mapping"
- * annotations....
- */
- @Override
- void addInitialAnnotation(String astAnnotationName, CompilationUnit astRoot) {
- if (astAnnotationName.equals(STATIC_METAMODEL_ANNOTATION_DEFINITION.getAnnotationName())) {
- this.addInitialStaticMetamodelAnnotation(astRoot);
- } else if (astAnnotationName.equals(GENERATED_ANNOTATION_DEFINITION.getAnnotationName())) {
- this.addInitialGeneratedAnnotation(astRoot);
- } else {
- super.addInitialAnnotation(astAnnotationName, astRoot);
- }
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncName(this.buildName(binding));
- this.syncQualifiedName(this.buildQualifiedName(binding));
- this.syncPackageName(this.buildPackageName(binding));
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(binding));
- this.syncDeclaringTypeName(this.buildDeclaringTypeName(binding));
- this.syncAbstract(this.buildAbstract(binding));
- this.syncStatic(this.buildStatic(binding));
- this.syncMemberType(this.buildMemberType(binding));
- this.syncHasNoArgConstructor(this.buildHasNoArgConstructor(binding));
- this.syncHasPrivateNoArgConstructor(this.buildHasPrivateNoArgConstructor(binding));
- this.syncTypes(astRoot);
- this.syncFields(astRoot);
- this.syncMethods(astRoot);
- this.syncMetamodelAnnotations(astRoot);
- }
-
- /**
- * Handle the <code>StaticMetamodel</code> and <code>Generated</code>
- * annotations differently, since they are not really JPA "mapping"
- * annotations. We aren't overriding {@link #addOrSyncAnnotation(String, CompilationUnit, java.util.Set)}
- * because we also have to handle removing these annotations separately.
- */
- private void syncMetamodelAnnotations(CompilationUnit astRoot) {
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- if (binding != null) {
- this.syncStaticMetamodelAnnotation(astRoot, binding);
- this.syncGeneratedAnnotation(astRoot, binding);
- }
- }
-
-
- // ********** SourcePersistentMember implementation **********
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().typeAnnotationNames();
- }
-
- @Override
- Annotation buildAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildTypeAnnotation(this, this.annotatedElement, annotationName);
- }
-
- @Override
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullTypeAnnotation(this, annotationName);
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(this.annotatedElement.getBinding(astRoot)));
-
- for (JavaResourcePersistentAttribute field : this.getFields()) {
- field.resolveTypes(astRoot);
- }
-
- // a new type can trigger a method parameter type to be a resolved,
- // fully-qualified name, so we need to rebuild our list of methods:
- // "setFoo(Foo)" is not the same as "setFoo(com.bar.Foo)"
- // and, vice-versa, a removed type can "unresolve" a parameter type
- this.syncMethods(astRoot);
-
- for (JavaResourcePersistentAttribute method : this.getMethods()) {
- method.resolveTypes(astRoot);
- }
- for (JavaResourcePersistentType type : this.getTypes()) {
- type.resolveTypes(astRoot);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ******** JavaResourcePersistentType implementation ********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getName();
- }
-
- // ***** qualified name
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- private void syncQualifiedName(String astQualifiedName) {
- String old = this.qualifiedName;
- this.qualifiedName = astQualifiedName;
- this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, astQualifiedName);
- }
-
- private String buildQualifiedName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getQualifiedName();
- }
-
- // ***** package name
- public String getPackageName() {
- return this.packageName;
- }
-
- private void syncPackageName(String astPackageName) {
- String old = this.packageName;
- this.packageName = astPackageName;
- this.firePropertyChanged(PACKAGE_NAME_PROPERTY, old, astPackageName);
- }
-
- private String buildPackageName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getPackage().getName();
- }
-
- // ***** superclass qualified name
- public String getSuperclassQualifiedName() {
- return this.superclassQualifiedName;
- }
-
- private void syncSuperclassQualifiedName(String astSuperclassQualifiedName) {
- String old = this.superclassQualifiedName;
- this.superclassQualifiedName = astSuperclassQualifiedName;
- this.firePropertyChanged(SUPERCLASS_QUALIFIED_NAME_PROPERTY, old, astSuperclassQualifiedName);
- }
-
- private String buildSuperclassQualifiedName(ITypeBinding binding) {
- if (binding == null) {
- return null;
- }
- ITypeBinding superclass = binding.getSuperclass();
- return (superclass == null) ? null : superclass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** package
- public boolean isIn(IPackageFragment packageFragment) {
- return StringTools.stringsAreEqual(packageFragment.getElementName(), this.packageName);
- }
-
- // ***** declaring type name
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- private void syncDeclaringTypeName(String astDeclaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = astDeclaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, astDeclaringTypeName);
- }
-
- private String buildDeclaringTypeName(ITypeBinding binding) {
- if (binding == null) {
- return null;
- }
- ITypeBinding declaringClass = binding.getDeclaringClass();
- return (declaringClass == null) ? null : declaringClass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** abstract
- public boolean isAbstract() {
- return this.abstract_;
- }
-
- private void syncAbstract(boolean astAbstract) {
- boolean old = this.abstract_;
- this.abstract_ = astAbstract;
- this.firePropertyChanged(ABSTRACT_PROPERTY, old, astAbstract);
- }
-
- private boolean buildAbstract(ITypeBinding binding) {
- return (binding == null) ? false : Modifier.isAbstract(binding.getModifiers());
- }
-
- // ***** static
- public boolean isStatic() {
- return this.static_;
- }
-
- private void syncStatic(boolean astStatic_) {
- boolean old = this.static_;
- this.static_ = astStatic_;
- this.firePropertyChanged(STATIC_PROPERTY, old, astStatic_);
- }
-
- private boolean buildStatic(ITypeBinding binding) {
- return (binding == null) ? false : Modifier.isStatic(binding.getModifiers());
- }
-
- // ***** member type
- public boolean isMemberType() {
- return this.memberType;
- }
-
- private void syncMemberType(boolean astMemberType) {
- boolean old = this.memberType;
- this.memberType = astMemberType;
- this.firePropertyChanged(MEMBER_TYPE_PROPERTY, old, astMemberType);
- }
-
- private boolean buildMemberType(ITypeBinding binding) {
- return (binding == null) ? false : binding.isMember();
- }
-
- // ***** no-arg constructor
- public boolean hasNoArgConstructor() {
- return this.hasNoArgConstructor;
- }
-
- private void syncHasNoArgConstructor(boolean astHasNoArgConstructor) {
- boolean old = this.hasNoArgConstructor;
- this.hasNoArgConstructor = astHasNoArgConstructor;
- this.firePropertyChanged(NO_ARG_CONSTRUCTOR_PROPERTY, old, astHasNoArgConstructor);
- }
-
- private boolean buildHasNoArgConstructor(ITypeBinding binding) {
- return (binding == null) ? false : typeHasNoArgConstructor(binding);
- }
-
- protected static boolean typeHasNoArgConstructor(ITypeBinding binding) {
- return findNoArgConstructor(binding) != null;
- }
-
- protected static IMethodBinding findNoArgConstructor(ITypeBinding binding) {
- for (IMethodBinding method : binding.getDeclaredMethods()) {
- if (method.isConstructor()) {
- if (method.getParameterTypes().length == 0) {
- return method;
- }
- }
- }
- return null;
- }
-
- // ***** private no-arg constructor
- public boolean hasPrivateNoArgConstructor() {
- return this.hasPrivateNoArgConstructor;
- }
-
- private void syncHasPrivateNoArgConstructor(boolean astHasPrivateNoArgConstructor) {
- boolean old = this.hasPrivateNoArgConstructor;
- this.hasPrivateNoArgConstructor = astHasPrivateNoArgConstructor;
- this.firePropertyChanged(PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY, old, astHasPrivateNoArgConstructor);
- }
-
- private boolean buildHasPrivateNoArgConstructor(ITypeBinding binding) {
- return (binding == null) ? false : typeHasPrivateNoArgConstructor(binding);
- }
-
- protected static boolean typeHasPrivateNoArgConstructor(ITypeBinding binding) {
- IMethodBinding method = findNoArgConstructor(binding);
- return (method != null) && Modifier.isPrivate(method.getModifiers());
- }
-
-
- // ********** misc **********
-
- public boolean isMapped() {
- for (Annotation annotation : this.getAnnotations()) {
- if (this.annotationIsMappingAnnotation(annotation)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean annotationIsMappingAnnotation(Annotation annotation) {
- return CollectionTools.contains(this.mappingAnnotationNames(), annotation.getAnnotationName());
- }
-
- private Iterator<String> mappingAnnotationNames() {
- return this.getAnnotationProvider().typeMappingAnnotationNames();
- }
-
- /**
- * check only persistable attributes
- */
- public boolean hasAnyAnnotatedAttributes() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableAttributes(); stream.hasNext(); ) {
- if (stream.next().isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** types **********
-
- public Iterator<JavaResourcePersistentType> types() {
- return this.getTypes().iterator();
- }
-
- private Iterable<JavaResourcePersistentType> getTypes() {
- return new LiveCloneIterable<JavaResourcePersistentType>(this.types); // read-only
- }
-
- public Iterator<JavaResourcePersistentType> allTypes() {
- return new TreeIterator<JavaResourcePersistentType>(this) {
- @Override
- protected Iterator<? extends JavaResourcePersistentType> children(JavaResourcePersistentType type) {
- return type.types();
- }
- };
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- return this.persistableMembers(this.types());
- }
-
- private JavaResourcePersistentType getType(String typeName, int occurrence) {
- for (JavaResourcePersistentType type : this.getTypes()) {
- if (type.isFor(typeName, occurrence)) {
- return type;
- }
- }
- return null;
- }
-
- private void addType(JavaResourcePersistentType type) {
- this.addItemToCollection(type, this.types, TYPES_COLLECTION);
- }
-
- private void removeTypes(Collection<JavaResourcePersistentType> remove) {
- this.removeItemsFromCollection(remove, this.types, TYPES_COLLECTION);
- }
-
- private void initializeTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- for (TypeDeclaration td : typeDeclarations) {
- String tdName = td.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
- this.types.add(this.buildType(td, occurrence, astRoot));
- }
- }
-
- private void syncTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- HashSet<JavaResourcePersistentType> typesToRemove = new HashSet<JavaResourcePersistentType>(this.types);
- for (TypeDeclaration typeDeclaration : typeDeclarations) {
- String tdName = typeDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
-
- JavaResourcePersistentType type = this.getType(tdName, occurrence);
- if (type == null) {
- this.addType(this.buildType(typeDeclaration, occurrence, astRoot));
- } else {
- typesToRemove.remove(type);
- type.synchronizeWith(astRoot);
- }
- }
- this.removeTypes(typesToRemove);
- }
-
- private JavaResourcePersistentType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) {
- return newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedTypeDeclaration, occurrence, astRoot);
- }
-
-
- // ********** fields **********
-
- public Iterator<JavaResourcePersistentAttribute> fields() {
- return this.getFields().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getFields() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.fields);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFields() {
- return this.persistableMembers(this.fields());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- FIELD_ACCESS_TYPE_FILTER
- );
- }
-
- private void addField(JavaResourcePersistentAttribute field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourcePersistentAttribute getField(String fieldName, int occurrence) {
- for (JavaResourcePersistentAttribute field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private void initializeFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
- this.fields.add(this.buildField(fieldName, occurrence, astRoot));
- }
- }
- }
-
- private void syncFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- HashSet<JavaResourcePersistentAttribute> fieldsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.fields);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
-
- JavaResourcePersistentAttribute field = this.getField(fieldName, occurrence);
- if (field == null) {
- this.addField(this.buildField(fieldName, occurrence, astRoot));
- } else {
- fieldsToRemove.remove(field);
- field.synchronizeWith(astRoot);
- }
- }
- }
- this.removeFields(fieldsToRemove);
- }
-
- private JavaResourcePersistentAttribute buildField(String fieldName, int occurrence, CompilationUnit astRoot) {
- return SourcePersistentAttribute.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-
- // ********** methods **********
-
- public Iterator<JavaResourcePersistentAttribute> methods() {
- return this.getMethods().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getMethods() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.methods);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableProperties() {
- return this.persistableMembers(this.methods());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(
- this.persistableProperties(),
- PROPERTY_ACCESS_TYPE_FILTER
- );
- }
-
- private JavaResourcePersistentAttribute getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourcePersistentAttribute method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourcePersistentAttribute method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private void initializeMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
- this.methods.add(this.buildMethod(signature, occurrence, astRoot));
- }
- }
-
- private void syncMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- HashSet<JavaResourcePersistentAttribute> methodsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.methods);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
-
- JavaResourcePersistentAttribute method = this.getMethod(signature, occurrence);
- if (method == null) {
- this.addMethod(this.buildMethod(signature, occurrence, astRoot));
- } else {
- methodsToRemove.remove(method);
- method.synchronizeWith(astRoot);
- }
- }
- this.removeMethods(methodsToRemove);
- }
-
- private JavaResourcePersistentAttribute buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) {
- return SourcePersistentAttribute.newInstance(this, this.annotatedElement, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
-
- // ********** attributes **********
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistableProperties()
- );
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes(AccessType specifiedAccess) {
- switch (specifiedAccess) {
- case FIELD :
- return this.persistableAttributesForFieldAccessType();
- case PROPERTY :
- return this.persistableAttributesForPropertyAccessType();
- default :
- throw new IllegalArgumentException("unknown access: " + specifiedAccess); //$NON-NLS-1$
- }
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForFieldAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistablePropertiesWithSpecifiedPropertyAccess()
- );
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForPropertyAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableProperties(),
- this.persistableFieldsWithSpecifiedFieldAccess()
- );
- }
-
-
- // ********** metamodel **********
-
- // ***** StaticMetamodel
- private void setStaticMetamodelAnnotation(StaticMetamodelAnnotation staticMetamodelAnnotation) {
- StaticMetamodelAnnotation old = this.staticMetamodelAnnotation;
- this.staticMetamodelAnnotation = staticMetamodelAnnotation;
- this.firePropertyChanged(STATIC_METAMODEL_ANNOTATION_PROPERTY, old, this.staticMetamodelAnnotation);
- }
-
- private void addInitialStaticMetamodelAnnotation(CompilationUnit astRoot) {
- if (this.staticMetamodelAnnotation == null) { // ignore duplicates
- this.staticMetamodelAnnotation = this.buildStaticMetamodelAnnotation(astRoot);
- }
- }
-
- private StaticMetamodelAnnotation buildStaticMetamodelAnnotation(CompilationUnit astRoot) {
- StaticMetamodelAnnotation annotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.annotatedElement);
- annotation.initialize(astRoot);
- return annotation;
- }
-
- private void syncStaticMetamodelAnnotation(CompilationUnit astRoot, ITypeBinding binding) {
- if (this.bindingContainsStaticMetamodelAnnotation(binding)) {
- if (this.staticMetamodelAnnotation != null) {
- this.staticMetamodelAnnotation.synchronizeWith(astRoot);
- } else {
- this.setStaticMetamodelAnnotation(this.buildStaticMetamodelAnnotation(astRoot));
- }
- } else {
- this.setStaticMetamodelAnnotation(null);
- }
- }
-
- private boolean bindingContainsStaticMetamodelAnnotation(ITypeBinding binding) {
- return this.bindingContainsAnnotation(binding, STATIC_METAMODEL_ANNOTATION_DEFINITION.getAnnotationName());
- }
-
- // ***** Generated
- public GeneratedAnnotation getGeneratedAnnotation() {
- return this.generatedAnnotation;
- }
-
- private void setGeneratedAnnotation(GeneratedAnnotation generatedAnnotation) {
- GeneratedAnnotation old = this.generatedAnnotation;
- this.generatedAnnotation = generatedAnnotation;
- this.firePropertyChanged(GENERATED_ANNOTATION_PROPERTY, old, this.generatedAnnotation);
- }
-
- private void addInitialGeneratedAnnotation(CompilationUnit astRoot) {
- if (this.generatedAnnotation == null) { // ignore duplicates
- this.generatedAnnotation = this.buildGeneratedAnnotation(astRoot);
- }
- }
-
- private GeneratedAnnotation buildGeneratedAnnotation(CompilationUnit astRoot) {
- GeneratedAnnotation annotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.annotatedElement);
- annotation.initialize(astRoot);
- return annotation;
- }
-
- private void syncGeneratedAnnotation(CompilationUnit astRoot, ITypeBinding binding) {
- if (this.bindingContainsGeneratedAnnotation(binding)) {
- if (this.generatedAnnotation != null) {
- this.generatedAnnotation.synchronizeWith(astRoot);
- } else {
- this.setGeneratedAnnotation(this.buildGeneratedAnnotation(astRoot));
- }
- } else {
- this.setGeneratedAnnotation(null);
- }
- }
-
- private boolean bindingContainsGeneratedAnnotation(ITypeBinding binding) {
- return this.bindingContainsAnnotation(binding, GENERATED_ANNOTATION_DEFINITION.getAnnotationName());
- }
-
- private boolean bindingContainsAnnotation(ITypeBinding binding, String annotationName) {
- for (IAnnotationBinding annotationBinding : binding.getAnnotations()) {
- ITypeBinding annotationTypeBinding = annotationBinding.getAnnotationType();
- if ((annotationTypeBinding != null) && annotationTypeBinding.getQualifiedName().equals(annotationName)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * The type must be:<ul>
- * <li>in the specified source folder
- * <li>a top-level type
- * <li>annotated with <code>&#64;javax.annotation.Generated</code> with
- * the appropriate <code>value</code> and <code>date</code>
- * <li>either itself or one of its nested types annotated with
- * <code>&#64;javax.persistence.metamodel.StaticMetamodel</code>
- * </ul>
- */
- public boolean isGeneratedMetamodelTopLevelType(IPackageFragmentRoot sourceFolder) {
- if ( ! this.getSourceFolder().equals(sourceFolder)) {
- return false;
- }
- return this.isGeneratedMetamodelTopLevelType();
- }
-
- /**
- * The type must be:<ul>
- * <li>a top-level type
- * <li>annotated with <code>&#64;javax.annotation.Generated</code> with
- * the appropriate <code>value</code> and <code>date</code>
- * <li>either itself or one of its nested types annotated with
- * <code>&#64;javax.persistence.metamodel.StaticMetamodel</code>
- * </ul>
- */
- public boolean isGeneratedMetamodelTopLevelType() {
- if ( ! this.isGenerated()) {
- return false;
- }
- // if we get here we know we have a top-level type, since only top-level
- // types are annotated @Generated; now see if anything is a metamodel
- for (Iterator<JavaResourcePersistentType> stream = this.allTypes(); stream.hasNext(); ) {
- JavaResourcePersistentType2_0 type = (JavaResourcePersistentType2_0) stream.next();
- if (type.isMetamodel()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * The type must be annotated with
- * <code>&#64;javax.annotation.Generated</code> with the appropriate
- * <code>value</code> and <code>date</code>.
- */
- private boolean isGenerated() {
- if (this.generatedAnnotation == null) {
- return false;
- }
- if (this.generatedAnnotation.valuesSize() != 1) {
- return false;
- }
- if ( ! this.generatedAnnotation.getValue(0).equals(METAMODEL_GENERATED_ANNOTATION_VALUE)) {
- return false;
- }
- if (StringTools.stringIsEmpty(this.generatedAnnotation.getDate())) {
- return false;
- }
- return true;
- }
-
- /**
- * The type must be annotated with
- * <code>&#64;javax.persistence.metamodel.StaticMetamodel</code>.
- */
- public boolean isMetamodel() {
- return this.staticMetamodelAnnotation != null;
- }
-
- private IPackageFragmentRoot getSourceFolder() {
- return (IPackageFragmentRoot) this.getJavaResourceCompilationUnit().getCompilationUnit().getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
-
-
- // ********** CounterMap **********
-
- private static class CounterMap {
- private final HashMap<Object, SimpleIntReference> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, SimpleIntReference>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- SimpleIntReference counter = this.counters.get(o);
- if (counter == null) {
- counter = new SimpleIntReference();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.getValue();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index d1b38ac243..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-
-/**
- * <code>javax.persistence.PrimaryKeyJoinColumn</code>
- */
-public final class SourcePrimaryKeyJoinColumnAnnotation
- extends SourceNamedColumnAnnotation
- implements NestablePrimaryKeyJoinColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
- private AnnotationElementAdapter<String> referencedColumnNameAdapter;
- private String referencedColumnName;
-
-
- public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildReferencedColumnNameDeclarationAdapter();
- this.referencedColumnNameAdapter = this.buildReferencedColumnNameAdapter();
- }
-
- public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new ElementAnnotationAdapter(member, daa));
- }
-
- public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa));
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.referencedColumnName = this.buildReferencedColumnName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncReferencedColumnName(this.buildReferencedColumnName(astRoot));
- }
-
-
- // ********** JavaSourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** PrimaryKeyJoinColumn implementation **********
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- if (this.attributeValueHasChanged(this.referencedColumnName, referencedColumnName)) {
- this.referencedColumnName = referencedColumnName;
- this.referencedColumnNameAdapter.setValue(referencedColumnName);
- }
- }
-
- private void syncReferencedColumnName(String astReferencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = astReferencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, astReferencedColumnName);
- }
-
- private String buildReferencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildReferencedColumnNameDeclarationAdapter() {
- return this.buildStringElementAdapter(JPA.PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- }
-
- private AnnotationElementAdapter<String> buildReferencedColumnNameAdapter() {
- return this.buildStringElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.referencedColumnName == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.referencedColumnNameDeclarationAdapter = this.buildReferencedColumnNameDeclarationAdapter();
- this.referencedColumnNameAdapter = this.buildReferencedColumnNameAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(REFERENCED_COLUMN_NAME_PROPERTY, this.referencedColumnName);
- this.referencedColumnName = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setReferencedColumnName((String) map.get(REFERENCED_COLUMN_NAME_PROPERTY));
- }
-
-
- // ********** static methods **********
-
- public static SourcePrimaryKeyJoinColumnAnnotation createPrimaryKeyJoinColumn(JavaResourceNode parent, Member member) {
- return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static SourcePrimaryKeyJoinColumnAnnotation createNestedPrimaryKeyJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, pkJoinColumnsAdapter, ANNOTATION_NAME);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
- return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, idaa, annotationAdapter);
- }
-
- static NestablePrimaryKeyJoinColumnAnnotation createSecondaryTablePrimaryKeyJoinColumn(DeclarationAnnotationAdapter secondaryTableAdapter, JavaResourceNode parent, Member member, int index) {
- return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, buildSecondaryTableAnnotationAdapter(secondaryTableAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildSecondaryTableAnnotationAdapter(DeclarationAnnotationAdapter secondaryTableAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(secondaryTableAdapter, JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS, index, ANNOTATION_NAME);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java
deleted file mode 100644
index fcc5e7f99a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-
-/**
- * <code>javax.persistence.PrimaryKeyJoinColumns</code>
- */
-public final class SourcePrimaryKeyJoinColumnsAnnotation
- extends SourceAnnotation<Member>
- implements PrimaryKeyJoinColumnsAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestablePrimaryKeyJoinColumnAnnotation> pkJoinColumns = new Vector<NestablePrimaryKeyJoinColumnAnnotation>();
-
-
- public SourcePrimaryKeyJoinColumnsAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.pkJoinColumns.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.pkJoinColumns);
- }
-
-
- // ********** AnnotationContainer Implementation **********
-
- public String getElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMNS__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestablePrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.pkJoinColumns.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.pkJoinColumns.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.pkJoinColumns.add(index, (NestablePrimaryKeyJoinColumnAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.pkJoinColumns.remove(0).convertToStandAlone();
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.pkJoinColumns.size());
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation addNestedAnnotation(int index) {
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.buildPrimaryKeyJoinColumn(index);
- this.pkJoinColumns.add(index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.pkJoinColumns.size();
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.addNestedAnnotation(index);
- pkJoinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(PK_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation buildPrimaryKeyJoinColumn(int index) {
- // pass the Java resource persistent member as the nested annotation's parent
- // since the nested annotation can be converted to stand-alone
- return SourcePrimaryKeyJoinColumnAnnotation.createNestedPrimaryKeyJoinColumn(this.parent, this.annotatedElement, index, this.daa);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation removeNestedAnnotation(int index) {
- return this.pkJoinColumns.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryAnnotation.java
deleted file mode 100644
index a2c371ba93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryAnnotation.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-/**
- * <ul>
- * <li><code>javax.persistence.NamedQuery</code>
- * <li><code>javax.persistence.NamedNativeQuery</code>
- * </ul>
- */
-abstract class SourceQueryAnnotation
- extends SourceAnnotation<Type>
- implements QueryAnnotation
-{
- DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- AnnotationElementAdapter<String> nameAdapter;
- String name;
- TextRange nameTextRange;
-
- DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
- AnnotationElementAdapter<String> queryAdapter;
- String query;
- TextRange queryTextRange;
-
- final Vector<NestableQueryHintAnnotation> hints = new Vector<NestableQueryHintAnnotation>();
- final HintsAnnotationContainer hintsContainer = new HintsAnnotationContainer();
-
-
- SourceQueryAnnotation(JavaResourceNode parent, Type type,DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.queryDeclarationAdapter = this.buildQueryDeclarationAdapter();
- this.queryAdapter = this.buildQueryAdapter();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.nameTextRange = this.buildNameTextRange(astRoot);
- this.query = this.buildQuery(astRoot);
- this.queryTextRange = this.buildQueryTextRange(astRoot);
- AnnotationContainerTools.initialize(this.hintsContainer, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.nameTextRange = this.buildNameTextRange(astRoot);
- this.syncQuery(this.buildQuery(astRoot));
- this.queryTextRange = this.buildQueryTextRange(astRoot);
- AnnotationContainerTools.synchronize(this.hintsContainer, astRoot);
- }
-
-
- // ********** BaseNamedQueryAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.nameTextRange;
- }
-
- private TextRange buildNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, this.getNameElementName());
- }
-
- private AnnotationElementAdapter<String> buildNameAdapter() {
- return this.buildStringElementAdapter(this.nameDeclarationAdapter);
- }
-
- abstract String getNameElementName();
-
- // ***** query
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String query) {
- if (this.attributeValueHasChanged(this.query, query)) {
- this.query = query;
- this.queryAdapter.setValue(query);
- }
- }
-
- private void syncQuery(String annotationQuery) {
- String old = this.query;
- this.query = annotationQuery;
- this.firePropertyChanged(QUERY_PROPERTY, old, annotationQuery);
- }
-
- private String buildQuery(CompilationUnit astRoot) {
- return this.queryAdapter.getValue(astRoot);
- }
-
- public TextRange getQueryTextRange(CompilationUnit astRoot) {
- return this.queryTextRange;
- }
-
- private TextRange buildQueryTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.queryDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildQueryDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, this.getQueryElementName());
- }
-
- private AnnotationElementAdapter<String> buildQueryAdapter() {
- return this.buildStringElementAdapter(this.queryDeclarationAdapter);
- }
-
- abstract String getQueryElementName();
-
- // ***** hints
- public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
- }
-
- Iterable<NestableQueryHintAnnotation> getNestableHints() {
- return new LiveCloneIterable<NestableQueryHintAnnotation>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public NestableQueryHintAnnotation hintAt(int index) {
- return this.hints.get(index);
- }
-
- public int indexOfHint(QueryHintAnnotation hint) {
- return this.hints.indexOf(hint);
- }
-
- private NestableQueryHintAnnotation addHint() {
- return this.addHint(this.hints.size());
- }
-
- public NestableQueryHintAnnotation addHint(int index) {
- return (NestableQueryHintAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.hintsContainer);
- }
-
- NestableQueryHintAnnotation addHint_() {
- return this.addHint_(this.hints.size());
- }
-
- private NestableQueryHintAnnotation addHint_(int index) {
- NestableQueryHintAnnotation hint = this.buildHint(index);
- this.hints.add(index, hint);
- return hint;
- }
-
- void syncAddHint(Annotation astAnnotation) {
- int index = this.hints.size();
- NestableQueryHintAnnotation hint = this.addHint_(index);
- hint.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(HINTS_LIST, index, hint);
- }
-
- abstract NestableQueryHintAnnotation buildHint(int index);
-
- void hintAdded(int index, NestableQueryHintAnnotation hint) {
- this.fireItemAdded(HINTS_LIST, index, hint);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.hintsContainer);
- }
-
- NestableQueryHintAnnotation moveHint_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.hints, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeHint(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.hintsContainer);
- }
-
- NestableQueryHintAnnotation removeHint_(int index) {
- return this.hints.remove(index);
- }
-
- void syncRemoveHints(int index) {
- this.removeItemsFromList(index, this.hints, HINTS_LIST);
- }
-
- abstract String getHintsElementName();
-
-
- // ********** NestableAnnotation implementation **********
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null) &&
- (this.query == null) &&
- this.hints.isEmpty();
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.queryDeclarationAdapter = this.buildQueryDeclarationAdapter();
- this.queryAdapter = this.buildQueryAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
-
- map.put(NAME_PROPERTY, this.name);
- this.name = null;
- map.put(QUERY_PROPERTY, this.query);
- this.query = null;
-
- List<Map<String, Object>> hintsState = this.buildStateList(this.hints.size());
- for (NestableQueryHintAnnotation hint : this.getNestableHints()) {
- Map<String, Object> hintState = new HashMap<String, Object>();
- hint.storeOn(hintState);
- hintsState.add(hintState);
- }
- map.put(HINTS_LIST, hintsState);
- this.hints.clear();
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
-
- this.setName((String) map.get(NAME_PROPERTY));
- this.setQuery((String) map.get(QUERY_PROPERTY));
-
- @SuppressWarnings("unchecked")
- List<Map<String, Object>> hintsState = (List<Map<String, Object>>) map.get(HINTS_LIST);
- for (Map<String, Object> hintState : hintsState) {
- this.addHint().restoreFrom(hintState);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** hint container **********
-
- /**
- * adapt the AnnotationContainer interface to the override's join columns
- */
- class HintsAnnotationContainer
- implements AnnotationContainer<NestableQueryHintAnnotation>
- {
- public Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceQueryAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return SourceQueryAnnotation.this.getHintsElementName();
- }
-
- public String getNestedAnnotationName() {
- return QueryHintAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableQueryHintAnnotation> getNestedAnnotations() {
- return SourceQueryAnnotation.this.getNestableHints();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceQueryAnnotation.this.hintsSize();
- }
-
- public NestableQueryHintAnnotation addNestedAnnotation() {
- return SourceQueryAnnotation.this.addHint_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceQueryAnnotation.this.syncAddHint(astAnnotation);
- }
-
- public NestableQueryHintAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceQueryAnnotation.this.moveHint_(targetIndex, sourceIndex);
- }
-
- public NestableQueryHintAnnotation removeNestedAnnotation(int index) {
- return SourceQueryAnnotation.this.removeHint_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceQueryAnnotation.this.syncRemoveHints(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryHintAnnotation.java
deleted file mode 100644
index 889dc7e230..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceQueryHintAnnotation.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
-
-/**
- * <code>javax.persistence.QueryHint</code>
- */
-public final class SourceQueryHintAnnotation
- extends SourceAnnotation<Type>
- implements NestableQueryHintAnnotation
-{
- private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public SourceQueryHintAnnotation(JavaResourceNode parent, Type type, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, type, idaa, new ElementIndexedAnnotationAdapter(type, idaa));
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.valueDeclarationAdapter = this.buildValueDeclarationAdapter();
- this.valueAdapter = this.buildValueAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncValue(this.buildValue(astRoot));
- }
-
-
- // ********** QueryHintAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.QUERY_HINT__NAME);
- }
-
- private AnnotationElementAdapter<String> buildNameAdapter() {
- return this.buildStringElementAdapter(this.nameDeclarationAdapter);
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.QUERY_HINT__VALUE);
- }
-
- private AnnotationElementAdapter<String> buildValueAdapter() {
- return this.buildStringElementAdapter(this.valueDeclarationAdapter);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null) &&
- (this.value == null);
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildNameAdapter();
- this.valueDeclarationAdapter = this.buildValueDeclarationAdapter();
- this.valueAdapter = this.buildValueAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
- map.put(NAME_PROPERTY, this.name);
- this.name = null;
- map.put(VALUE_PROPERTY, this.value);
- this.value = null;
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
- this.setName((String) map.get(NAME_PROPERTY));
- this.setValue((String) map.get(VALUE_PROPERTY));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** static methods **********
-
- static SourceQueryHintAnnotation createNamedQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new SourceQueryHintAnnotation(parent, type, buildNamedQueryQueryHintAnnotationAdapter(namedQueryAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNamedQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueryAdapter, JPA.NAMED_QUERY__HINTS, index, ANNOTATION_NAME);
- }
-
- static SourceQueryHintAnnotation createNamedNativeQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new SourceQueryHintAnnotation(parent, type, buildNamedNativeQueryQueryHintAnnotationAdapter(namedNativeQueryAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNamedNativeQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedNativeQueryAdapter, JPA.NAMED_NATIVE_QUERY__HINTS, index, ANNOTATION_NAME);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java
deleted file mode 100644
index c782f30499..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumArrayDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.ManyToMany
- * javax.persistence.ManyToOne
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- */
-abstract class SourceRelationshipMappingAnnotation
- extends SourceAnnotation<Attribute>
- implements RelationshipMapping2_0Annotation
-{
- final DeclarationAnnotationElementAdapter<String> targetEntityDeclarationAdapter;
- final AnnotationElementAdapter<String> targetEntityAdapter;
- String targetEntity;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedTargetEntityClassName;
- // we need a flag since the f-q name can be null
- private boolean fqTargetEntityClassNameStale = true;
-
- final DeclarationAnnotationElementAdapter<String> fetchDeclarationAdapter;
- final AnnotationElementAdapter<String> fetchAdapter;
- FetchType fetch;
-
- final DeclarationAnnotationElementAdapter<String[]> cascadeDeclarationAdapter;
- final AnnotationElementAdapter<String[]> cascadeAdapter;
- CascadeType[] cascadeTypes = EMPTY_CASCADE_TYPE_ARRAY; // this should never be null
- private static final CascadeType[] EMPTY_CASCADE_TYPE_ARRAY = new CascadeType[0];
-
-
- SourceRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.targetEntityDeclarationAdapter = this.getTargetEntityAdapter();
- this.targetEntityAdapter = this.buildAnnotationElementAdapter(this.targetEntityDeclarationAdapter);
- this.fetchDeclarationAdapter = this.getFetchAdapter();
- this.fetchAdapter = this.buildAnnotationElementAdapter(this.fetchDeclarationAdapter);
- this.cascadeDeclarationAdapter = this.getCascadeAdapter();
- this.cascadeAdapter = new AnnotatedElementAnnotationElementAdapter<String[]>(attribute, this.cascadeDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildBooleanAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.targetEntity = this.buildTargetEntity(astRoot);
- this.fetch = this.buildFetch(astRoot);
- this.cascadeTypes = this.buildCascadeTypes(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFetch(this.buildFetch(astRoot));
- this.syncTargetEntity(this.buildTargetEntity(astRoot));
- this.syncCascadeTypes(this.buildCascadeTypes(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.targetEntity == null) &&
- (this.fetch == null) &&
- (this.cascadeTypes.length == 0);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.targetEntity);
- }
-
-
- // ********** RelationshipMappingAnnotation implementation **********
-
- // ***** target entity
- public String getTargetEntity() {
- return this.targetEntity;
- }
-
- public void setTargetEntity(String targetEntity) {
- if (this.attributeValueHasChanged(this.targetEntity, targetEntity)) {
- this.targetEntity = targetEntity;
- this.fqTargetEntityClassNameStale = true;
- this.targetEntityAdapter.setValue(targetEntity);
- }
- }
-
- private void syncTargetEntity(String astTargetEntity) {
- if (this.attributeValueHasChanged(this.targetEntity, astTargetEntity)) {
- this.syncTargetEntity_(astTargetEntity);
- }
- }
-
- private void syncTargetEntity_(String astTargetEntity) {
- String old = this.targetEntity;
- this.targetEntity = astTargetEntity;
- this.fqTargetEntityClassNameStale = true;
- this.firePropertyChanged(TARGET_ENTITY_PROPERTY, old, astTargetEntity);
- }
-
- private String buildTargetEntity(CompilationUnit astRoot) {
- return this.targetEntityAdapter.getValue(astRoot);
- }
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.targetEntityDeclarationAdapter, astRoot);
- }
-
- /**
- * return the Java adapter's 'targetEntity' element adapter config
- */
- abstract DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter();
-
- // ***** fully-qualified target entity class name
- public String getFullyQualifiedTargetEntityClassName() {
- if (this.fqTargetEntityClassNameStale) {
- this.fullyQualifiedTargetEntityClassName = this.buildFullyQualifiedTargetEntityClassName();
- this.fqTargetEntityClassNameStale = false;
- }
- return this.fullyQualifiedTargetEntityClassName;
- }
-
- private String buildFullyQualifiedTargetEntityClassName() {
- return (this.targetEntity == null) ? null : this.buildFullyQualifiedTargetEntityClassName_();
- }
-
- private String buildFullyQualifiedTargetEntityClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.targetEntityAdapter.getExpression(this.buildASTRoot()));
- }
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- if (this.attributeValueHasChanged(this.fetch, fetch)) {
- this.fetch = fetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(fetch));
- }
- }
-
- private void syncFetch(FetchType astFetch) {
- FetchType old = this.fetch;
- this.fetch = astFetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, astFetch);
- }
-
- private FetchType buildFetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.fetchDeclarationAdapter, astRoot);
- }
-
- /**
- * return the Java adapter's 'fetch' element adapter config
- */
- abstract DeclarationAnnotationElementAdapter<String> getFetchAdapter();
-
- // ***** cascade types
- /**
- * pre-condition: state of 'cascadeTypes' is to change
- */
- private void setCascadeType(CascadeType cascadeType, boolean set) {
- this.setCascadeTypes(set ?
- ArrayTools.add(this.cascadeTypes, cascadeType) :
- ArrayTools.remove(this.cascadeTypes, cascadeType)
- );
- }
-
- /**
- * pre-condition: state of 'cascadeTypes' is to change
- */
- private void setCascadeTypes(CascadeType[] cascadeTypes) {
- this.cascadeTypes = cascadeTypes;
- this.cascadeAdapter.setValue(CascadeType.toJavaAnnotationValues(cascadeTypes));
- }
-
- private void syncCascadeTypes(CascadeType[] astCascadeTypes) {
- CascadeType[] old = this.cascadeTypes;
- this.cascadeTypes = astCascadeTypes;
- this.syncCascadeAll(old);
- this.syncCascadeMerge(old);
- this.syncCascadePersist(old);
- this.syncCascadeRefresh(old);
- this.syncCascadeRemove(old);
- this.syncCascadeDetach(old);
- }
-
- private CascadeType[] buildCascadeTypes(CompilationUnit astRoot) {
- return CascadeType.fromJavaAnnotationValues(this.cascadeAdapter.getValue(astRoot));
- }
-
- private boolean cascadeTypeIsTrue(CascadeType cascadeType) {
- return ArrayTools.contains(this.cascadeTypes, cascadeType);
- }
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.cascadeDeclarationAdapter, astRoot);
- }
-
- /**
- * return the Java adapter's 'cascade' element adapter config
- */
- abstract DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter();
-
- // ***** cascade all
- public boolean isCascadeAll() {
- return this.cascadeTypeIsTrue(CascadeType.ALL);
- }
-
- public void setCascadeAll(boolean cascadeAll) {
- if (this.isCascadeAll() != cascadeAll) {
- this.setCascadeType(CascadeType.ALL, cascadeAll);
- }
- }
-
- private void syncCascadeAll(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.ALL);
- this.firePropertyChanged(CASCADE_ALL_PROPERTY, old, this.isCascadeAll());
- }
-
- // ***** cascade persist
- public boolean isCascadePersist() {
- return this.cascadeTypeIsTrue(CascadeType.PERSIST);
- }
-
- public void setCascadePersist(boolean cascadePersist) {
- if (this.isCascadePersist() != cascadePersist) {
- this.setCascadeType(CascadeType.PERSIST, cascadePersist);
- }
- }
-
- private void syncCascadePersist(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.PERSIST);
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, this.isCascadePersist());
- }
-
- // ***** cascade merge
- public boolean isCascadeMerge() {
- return this.cascadeTypeIsTrue(CascadeType.MERGE);
- }
-
- public void setCascadeMerge(boolean cascadeMerge) {
- if (this.isCascadeMerge() != cascadeMerge) {
- this.setCascadeType(CascadeType.MERGE, cascadeMerge);
- }
- }
-
- private void syncCascadeMerge(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.MERGE);
- this.firePropertyChanged(CASCADE_MERGE_PROPERTY, old, this.isCascadeMerge());
- }
-
- // ***** cascade remove
- public boolean isCascadeRemove() {
- return this.cascadeTypeIsTrue(CascadeType.REMOVE);
- }
-
- public void setCascadeRemove(boolean cascadeRemove) {
- if (this.isCascadeRemove() != cascadeRemove) {
- this.setCascadeType(CascadeType.REMOVE, cascadeRemove);
- }
- }
-
- private void syncCascadeRemove(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.REMOVE);
- this.firePropertyChanged(CASCADE_REMOVE_PROPERTY, old, this.isCascadeRemove());
- }
-
- // ***** cascade refresh
- public boolean isCascadeRefresh() {
- return this.cascadeTypeIsTrue(CascadeType.REFRESH);
- }
-
- public void setCascadeRefresh(boolean cascadeRefresh) {
- if (this.isCascadeRefresh() != cascadeRefresh) {
- this.setCascadeType(CascadeType.REFRESH, cascadeRefresh);
- }
- }
-
- private void syncCascadeRefresh(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.REFRESH);
- this.firePropertyChanged(CASCADE_REFRESH_PROPERTY, old, this.isCascadeRefresh());
- }
-
- // ***** cascade detach - JPA 2.0
- public boolean isCascadeDetach() {
- return this.cascadeTypeIsTrue(CascadeType.DETACH);
- }
-
- public void setCascadeDetach(boolean cascadeDetach) {
- if (this.isCascadeDetach() != cascadeDetach) {
- this.setCascadeType(CascadeType.DETACH, cascadeDetach);
- }
- }
-
- private void syncCascadeDetach(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.DETACH);
- this.firePropertyChanged(CASCADE_DETACH_PROPERTY, old, this.isCascadeDetach());
- }
-
- // ********** static methods **********
-
- static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- // TODO what about QualifiedType?
- return buildAnnotationElementAdapter(annotationAdapter, elementName, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- static DeclarationAnnotationElementAdapter<String> buildFetchAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumDeclarationAnnotationElementAdapter(annotationAdapter, elementName);
- }
-
- static DeclarationAnnotationElementAdapter<String[]> buildEnumArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumArrayDeclarationAnnotationElementAdapter(annotationAdapter, elementName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java
deleted file mode 100644
index c0652153ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-
-/**
- * <code>javax.persistence.SecondaryTable</code>
- */
-public final class SourceSecondaryTableAnnotation
- extends SourceBaseTableAnnotation
- implements NestableSecondaryTableAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(SecondaryTableAnnotation.ANNOTATION_NAME);
-
- private final Vector<NestablePrimaryKeyJoinColumnAnnotation> pkJoinColumns = new Vector<NestablePrimaryKeyJoinColumnAnnotation>();
- private final PkJoinColumnsAnnotationContainer pkJoinColumnsContainer = new PkJoinColumnsAnnotationContainer();
-
-
- public SourceSecondaryTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.pkJoinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.pkJoinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.SECONDARY_TABLE__NAME);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildSchemaDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.SECONDARY_TABLE__SCHEMA);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildCatalogDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JPA.SECONDARY_TABLE__CATALOG);
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ************* SecondaryTableAnnotation implementation *******************
-
- // ***** pk join columns
- public ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns() {
- return new CloneListIterator<PrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestablePkJoinColumns() {
- return new LiveCloneIterable<NestablePrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int pkJoinColumnsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation joinColumn) {
- return this.pkJoinColumns.indexOf(joinColumn);
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn() {
- return this.addPkJoinColumn(this.pkJoinColumns.size());
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index) {
- return (NestablePrimaryKeyJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.pkJoinColumnsContainer);
- }
-
- NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn_() {
- return this.addPkJoinColumn_(this.pkJoinColumns.size());
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn_(int index) {
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.buildPrimaryKeyJoinColumn(index);
- this.pkJoinColumns.add(index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- void syncAddPkJoinColumn(Annotation astAnnotation) {
- int index = this.pkJoinColumns.size();
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.addPkJoinColumn_(index);
- pkJoinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(PK_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation buildPrimaryKeyJoinColumn(int index) {
- return SourcePrimaryKeyJoinColumnAnnotation.createSecondaryTablePrimaryKeyJoinColumn(this.daa, this, this.annotatedElement, index);
- }
-
- void pkJoinColumnAdded(int index, NestablePrimaryKeyJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(PK_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void movePkJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.pkJoinColumnsContainer);
- }
-
- NestablePrimaryKeyJoinColumnAnnotation movePkJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removePkJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.pkJoinColumnsContainer);
- }
-
- NestablePrimaryKeyJoinColumnAnnotation removePkJoinColumn_(int index) {
- return this.pkJoinColumns.remove(index);
- }
-
- void syncRemovePkJoinColumns(int index) {
- this.removeItemsFromList(index, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.pkJoinColumns.isEmpty();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
-
- List<Map<String, Object>> pkJoinColumnsState = this.buildStateList(this.pkJoinColumns.size());
- for (NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn : this.getNestablePkJoinColumns()) {
- Map<String, Object> pkJoinColumnState = new HashMap<String, Object>();
- pkJoinColumn.storeOn(pkJoinColumnState);
- pkJoinColumnsState.add(pkJoinColumnState);
- }
- map.put(PK_JOIN_COLUMNS_LIST, pkJoinColumnsState);
- this.pkJoinColumns.clear();
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
-
- @SuppressWarnings("unchecked")
- List<Map<String, Object>> pkJoinColumnsState = (List<Map<String, Object>>) map.get(PK_JOIN_COLUMNS_LIST);
- for (Map<String, Object> pkJoinColumnState : pkJoinColumnsState) {
- this.addPkJoinColumn().restoreFrom(pkJoinColumnState);
- }
- }
-
-
- // ********** static methods **********
-
- public static SourceSecondaryTableAnnotation createSecondaryTable(JavaResourceNode parent, Member member) {
- return new SourceSecondaryTableAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceSecondaryTableAnnotation createNestedSecondaryTable(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, secondaryTablesAdapter, ANNOTATION_NAME);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
- return new SourceSecondaryTableAnnotation(parent, member, idaa, annotationAdapter);
- }
-
-
- // ********** pk join column container **********
-
- /**
- * adapt the AnnotationContainer interface to the secondary table's
- * primary key join columns
- */
- class PkJoinColumnsAnnotationContainer
- implements AnnotationContainer<NestablePrimaryKeyJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceSecondaryTableAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS;
- }
-
- public String getNestedAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestedAnnotations() {
- return SourceSecondaryTableAnnotation.this.getNestablePkJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceSecondaryTableAnnotation.this.pkJoinColumnsSize();
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation addNestedAnnotation() {
- return SourceSecondaryTableAnnotation.this.addPkJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceSecondaryTableAnnotation.this.syncAddPkJoinColumn(astAnnotation);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceSecondaryTableAnnotation.this.movePkJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceSecondaryTableAnnotation.this.removePkJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceSecondaryTableAnnotation.this.syncRemovePkJoinColumns(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java
deleted file mode 100644
index 151f2df51f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTablesAnnotation;
-
-/**
- * <code>javax.persistence.SecondaryTables</code>
- */
-public final class SourceSecondaryTablesAnnotation
- extends SourceAnnotation<Member>
- implements SecondaryTablesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableSecondaryTableAnnotation> secondaryTables = new Vector<NestableSecondaryTableAnnotation>();
-
-
- public SourceSecondaryTablesAnnotation(JavaResourcePersistentType parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.secondaryTables.isEmpty();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.secondaryTables);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.SECONDARY_TABLES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableSecondaryTableAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableSecondaryTableAnnotation>(this.secondaryTables);
- }
-
- public int getNestedAnnotationsSize() {
- return this.secondaryTables.size();
- }
-
- public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
- this.nestStandAloneAnnotation(standAloneAnnotation, this.secondaryTables.size());
- }
-
- private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
- standAloneAnnotation.convertToNested(this, this.daa, index);
- }
-
- public void addNestedAnnotation(int index, NestableAnnotation annotation) {
- this.secondaryTables.add(index, (NestableSecondaryTableAnnotation) annotation);
- }
-
- public void convertLastNestedAnnotationToStandAlone() {
- this.secondaryTables.remove(0).convertToStandAlone();
- }
-
- public NestableSecondaryTableAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.secondaryTables.size());
- }
-
- private NestableSecondaryTableAnnotation addNestedAnnotation(int index) {
- NestableSecondaryTableAnnotation secondaryTable = this.buildSecondaryTable(index);
- this.secondaryTables.add(index, secondaryTable);
- return secondaryTable;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.secondaryTables.size();
- NestableSecondaryTableAnnotation secondaryTable = this.addNestedAnnotation(index);
- secondaryTable.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(SECONDARY_TABLES_LIST, index, secondaryTable);
- }
-
- private NestableSecondaryTableAnnotation buildSecondaryTable(int index) {
- // pass the Java resource persistent member as the nested annotation's parent
- // since the nested annotation can be converted to stand-alone
- return SourceSecondaryTableAnnotation.createNestedSecondaryTable(this.parent, this.annotatedElement, index, this.daa);
- }
-
- public NestableSecondaryTableAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.secondaryTables, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableSecondaryTableAnnotation removeNestedAnnotation(int index) {
- return this.secondaryTables.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.secondaryTables, SECONDARY_TABLES_LIST);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java
deleted file mode 100644
index 12d42800fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public abstract class SourceSequenceGeneratorAnnotation
- extends SourceGeneratorAnnotation
- implements SequenceGeneratorAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__NAME);
-
- private static final DeclarationAnnotationElementAdapter<Integer> INITIAL_VALUE_ADAPTER = buildIntegerAdapter(JPA.SEQUENCE_GENERATOR__INITIAL_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<Integer> ALLOCATION_SIZE_ADAPTER = buildIntegerAdapter(JPA.SEQUENCE_GENERATOR__ALLOCATION_SIZE);
-
- private static final DeclarationAnnotationElementAdapter<String> SEQUENCE_NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__SEQUENCE_NAME);
- private final AnnotationElementAdapter<String> sequenceNameAdapter;
- private String sequenceName;
-
-
- protected SourceSequenceGeneratorAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.sequenceNameAdapter = this.buildAdapter(SEQUENCE_NAME_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.sequenceName = this.buildSequenceName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncSequenceName(this.buildSequenceName(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.sequenceName == null);
- }
-
-
- // ********** AbstractGeneratorAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getNameAdapter() {
- return NAME_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
-
- // ********** SequenceGeneratorAnnotation implementation **********
-
- // ***** sequence name
- public String getSequenceName() {
- return this.sequenceName;
- }
-
- public void setSequenceName(String sequenceName) {
- if (this.attributeValueHasChanged(this.sequenceName, sequenceName)) {
- this.sequenceName = sequenceName;
- this.sequenceNameAdapter.setValue(sequenceName);
- }
- }
-
- public void syncSequenceName(String astSequenceName) {
- String old = this.sequenceName;
- this.sequenceName = astSequenceName;
- this.firePropertyChanged(SEQUENCE_NAME_PROPERTY, old, astSequenceName);
- }
-
- private String buildSequenceName(CompilationUnit astRoot) {
- return this.sequenceNameAdapter.getValue(astRoot);
- }
-
- public TextRange getSequenceNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SEQUENCE_NAME_ADAPTER, astRoot);
- }
-
- public boolean sequenceNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(SEQUENCE_NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- protected static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(String elementName) {
- return buildIntegerAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableAnnotation.java
deleted file mode 100644
index 6edc847a72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-
-/**
- * <code>javax.persistence.Table</code>
- */
-public final class SourceTableAnnotation
- extends SourceBaseTableAnnotation
- implements TableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__CATALOG);
-
-
- public SourceTableAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return NAME_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildSchemaDeclarationAdapter() {
- return SCHEMA_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildCatalogDeclarationAdapter() {
- return CATALOG_ADAPTER;
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.TABLE__UNIQUE_CONSTRAINTS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java
deleted file mode 100644
index 9b5d0ade9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableUniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- * javax.persistence.TableGenerator
- */
-public final class SourceTableGeneratorAnnotation
- extends SourceGeneratorAnnotation
- implements TableGeneratorAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__NAME);
-
- private static final DeclarationAnnotationElementAdapter<Integer> INITIAL_VALUE_ADAPTER = buildIntegerAdapter(JPA.TABLE_GENERATOR__INITIAL_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<Integer> ALLOCATION_SIZE_ADAPTER = buildIntegerAdapter(JPA.TABLE_GENERATOR__ALLOCATION_SIZE);
-
- private static final DeclarationAnnotationElementAdapter<String> TABLE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__TABLE);
- private final AnnotationElementAdapter<String> tableAdapter;
- private String table;
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__SCHEMA);
- private final AnnotationElementAdapter<String> schemaAdapter;
- private String schema;
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__CATALOG);
- private final AnnotationElementAdapter<String> catalogAdapter;
- private String catalog;
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_NAME);
- private final AnnotationElementAdapter<String> pkColumnNameAdapter;
- private String pkColumnName;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME);
- private final AnnotationElementAdapter<String> valueColumnNameAdapter;
- private String valueColumnName;
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_VALUE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE);
- private final AnnotationElementAdapter<String> pkColumnValueAdapter;
- private String pkColumnValue;
-
- private final Vector<NestableUniqueConstraintAnnotation> uniqueConstraints = new Vector<NestableUniqueConstraintAnnotation>();
- private final UniqueConstraintsAnnotationContainer uniqueConstraintsContainer = new UniqueConstraintsAnnotationContainer();
-
-
- public SourceTableGeneratorAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.tableAdapter = this.buildAdapter(TABLE_ADAPTER);
- this.catalogAdapter = this.buildAdapter(CATALOG_ADAPTER);
- this.schemaAdapter = this.buildAdapter(SCHEMA_ADAPTER);
- this.pkColumnNameAdapter = this.buildAdapter(PK_COLUMN_NAME_ADAPTER);
- this.valueColumnNameAdapter = this.buildAdapter(VALUE_COLUMN_NAME_ADAPTER);
- this.pkColumnValueAdapter = this.buildAdapter(PK_COLUMN_VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.buildTable(astRoot);
- this.schema = this.buildSchema(astRoot);
- this.catalog = this.buildCatalog(astRoot);
- this.pkColumnName = this.buildPkColumnName(astRoot);
- this.valueColumnName = this.buildValueColumnName(astRoot);
- this.pkColumnValue = this.buildPkColumnValue(astRoot);
- AnnotationContainerTools.initialize(this.uniqueConstraintsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncTable(this.buildTable(astRoot));
- this.syncSchema(this.buildSchema(astRoot));
- this.syncCatalog(this.buildCatalog(astRoot));
- this.syncPkColumnName(this.buildPkColumnName(astRoot));
- this.syncValueColumnName(this.buildValueColumnName(astRoot));
- this.syncPkColumnValue(this.buildPkColumnValue(astRoot));
- AnnotationContainerTools.synchronize(this.uniqueConstraintsContainer, astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.table == null) &&
- (this.schema == null) &&
- (this.catalog == null) &&
- (this.pkColumnName == null) &&
- (this.valueColumnName == null) &&
- (this.pkColumnValue == null);
- }
-
-
- // ********** AbstractGeneratorAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getNameAdapter() {
- return NAME_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
-
- // ********** TableGeneratorAnnotation implementation **********
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- if (this.attributeValueHasChanged(this.table, table)) {
- this.table = table;
- this.tableAdapter.setValue(table);
- }
- }
-
- private void syncTable(String astTable) {
- String old = this.table;
- this.table = astTable;
- this.firePropertyChanged(TABLE_PROPERTY, old, astTable);
- }
-
- private String buildTable(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TABLE_ADAPTER, astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(TABLE_ADAPTER, pos, astRoot);
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- if (this.attributeValueHasChanged(this.schema, schema)) {
- this.schema = schema;
- this.schemaAdapter.setValue(schema);
- }
- }
-
- private void syncSchema(String astSchema) {
- String old = this.schema;
- this.schema = astSchema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, astSchema);
- }
-
- private String buildSchema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SCHEMA_ADAPTER, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(SCHEMA_ADAPTER, pos, astRoot);
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- if (this.attributeValueHasChanged(this.catalog, catalog)) {
- this.catalog = catalog;
- this.catalogAdapter.setValue(catalog);
- }
- }
-
- private void syncCatalog(String astCatalog) {
- String old = this.catalog;
- this.catalog = astCatalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, astCatalog);
- }
-
- private String buildCatalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CATALOG_ADAPTER, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(CATALOG_ADAPTER, pos, astRoot);
- }
-
- // ***** pk column name
- public String getPkColumnName() {
- return this.pkColumnName;
- }
-
- public void setPkColumnName(String pkColumnName) {
- if (this.attributeValueHasChanged(this.pkColumnName, pkColumnName)) {
- this.pkColumnName = pkColumnName;
- this.pkColumnNameAdapter.setValue(pkColumnName);
- }
- }
-
- private void syncPkColumnName(String astPkColumnName) {
- String old = this.pkColumnName;
- this.pkColumnName = astPkColumnName;
- this.firePropertyChanged(PK_COLUMN_NAME_PROPERTY, old, astPkColumnName);
- }
-
- private String buildPkColumnName(CompilationUnit astRoot) {
- return this.pkColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getPkColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(PK_COLUMN_NAME_ADAPTER, astRoot);
- }
-
- public boolean pkColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(PK_COLUMN_NAME_ADAPTER, pos, astRoot);
- }
-
- // ***** value column name
- public String getValueColumnName() {
- return this.valueColumnName;
- }
-
- public void setValueColumnName(String valueColumnName) {
- if (this.attributeValueHasChanged(this.valueColumnName, valueColumnName)) {
- this.valueColumnName = valueColumnName;
- this.valueColumnNameAdapter.setValue(valueColumnName);
- }
- }
-
- private void syncValueColumnName(String astValueColumnName) {
- String old = this.valueColumnName;
- this.valueColumnName = astValueColumnName;
- this.firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, old, astValueColumnName);
- }
-
- private String buildValueColumnName(CompilationUnit astRoot) {
- return this.valueColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getValueColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_COLUMN_NAME_ADAPTER, astRoot);
- }
-
- public boolean valueColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(VALUE_COLUMN_NAME_ADAPTER, pos, astRoot);
- }
-
- // ***** pk column value
- public String getPkColumnValue() {
- return this.pkColumnValue;
- }
-
- public void setPkColumnValue(String pkColumnValue) {
- if (this.attributeValueHasChanged(this.pkColumnValue, pkColumnValue)) {
- this.pkColumnValue = pkColumnValue;
- this.pkColumnValueAdapter.setValue(pkColumnValue);
- }
- }
-
- private void syncPkColumnValue(String astPkColumnValue) {
- String old = this.pkColumnValue;
- this.pkColumnValue = astPkColumnValue;
- this.firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, old, astPkColumnValue);
- }
-
- private String buildPkColumnValue(CompilationUnit astRoot) {
- return this.pkColumnValueAdapter.getValue(astRoot);
- }
-
- public TextRange getPkColumnValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(PK_COLUMN_VALUE_ADAPTER, astRoot);
- }
-
- public boolean pkColumnValueTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(PK_COLUMN_VALUE_ADAPTER, pos, astRoot);
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- Iterable<NestableUniqueConstraintAnnotation> getNestableUniqueConstraints() {
- return new LiveCloneIterable<NestableUniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraintAnnotation addUniqueConstraint(int index) {
- return (NestableUniqueConstraintAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation addUniqueConstraint_() {
- return this.addUniqueConstraint_(this.uniqueConstraints.size());
- }
-
- private NestableUniqueConstraintAnnotation addUniqueConstraint_(int index) {
- NestableUniqueConstraintAnnotation uniqueConstraint = this.buildUniqueConstraint(index);
- this.uniqueConstraints.add(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- void syncAddUniqueConstraint(Annotation astAnnotation) {
- int index = this.uniqueConstraints.size();
- NestableUniqueConstraintAnnotation uniqueConstraint = this.addUniqueConstraint_(index);
- uniqueConstraint.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- }
-
- NestableUniqueConstraintAnnotation buildUniqueConstraint(int index) {
- return new SourceUniqueConstraintAnnotation(this, this.annotatedElement, buildUniqueConstraintAnnotationAdapter(index));
- }
-
- IndexedDeclarationAnnotationAdapter buildUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- void uniqueConstraintAdded(int index, NestableUniqueConstraintAnnotation constraint) {
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, constraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation moveUniqueConstraint_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeUniqueConstraint(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation removeUniqueConstraint_(int index) {
- return this.uniqueConstraints.remove(index);
- }
-
- void syncRemoveUniqueConstraints(int index) {
- this.removeItemsFromList(index, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(String elementName) {
- return buildIntegerAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
-
- // ********** unique constraint container **********
-
- /**
- * adapt the AnnotationContainer interface to the table generator's unique constraints
- */
- class UniqueConstraintsAnnotationContainer
- implements AnnotationContainer<NestableUniqueConstraintAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceTableGeneratorAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
- }
-
- public String getNestedAnnotationName() {
- return UniqueConstraintAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableUniqueConstraintAnnotation> getNestedAnnotations() {
- return SourceTableGeneratorAnnotation.this.getNestableUniqueConstraints();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceTableGeneratorAnnotation.this.uniqueConstraintsSize();
- }
-
- public NestableUniqueConstraintAnnotation addNestedAnnotation() {
- return SourceTableGeneratorAnnotation.this.addUniqueConstraint_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceTableGeneratorAnnotation.this.syncAddUniqueConstraint(astAnnotation);
- }
-
- public NestableUniqueConstraintAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceTableGeneratorAnnotation.this.moveUniqueConstraint_(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraintAnnotation removeNestedAnnotation(int index) {
- return SourceTableGeneratorAnnotation.this.removeUniqueConstraint_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceTableGeneratorAnnotation.this.syncRemoveUniqueConstraints(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTemporalAnnotation.java
deleted file mode 100644
index 61d6c20b08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTemporalAnnotation.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Temporal
- */
-public final class SourceTemporalAnnotation
- extends SourceBaseTemporalAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceTemporalAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.TEMPORAL__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTransientAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTransientAnnotation.java
deleted file mode 100644
index eace57de22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTransientAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-
-/**
- * javax.persistence.Transient
- */
-public final class SourceTransientAnnotation
- extends SourceAnnotation<Attribute>
- implements TransientAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceTransientAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTypeCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTypeCompilationUnit.java
deleted file mode 100644
index 7a4ab83de4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceTypeCompilationUnit.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
-
-/**
- * Java compilation unit (source file)
- * non package-info.java file
- */
-public final class SourceTypeCompilationUnit
- extends SourceCompilationUnit
-{
-
- /**
- * The primary type of the AST compilation unit. We are not going to handle
- * multiple types defined in a single compilation unit. Entities must have
- * a public/protected no-arg constructor, and there is no way to access
- * the constructor in a package class (which is what all top-level,
- * non-primary classes must be).
- */
- private JavaResourcePersistentType persistentType;
-
-
- // ********** construction **********
-
- public SourceTypeCompilationUnit(
- ICompilationUnit compilationUnit,
- JpaAnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the JPA compilation unit is the root of its sub-tree
- this.persistentType = this.buildPersistentType();
- }
-
- private JavaResourcePersistentType buildPersistentType() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPersistentType(astRoot);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncPersistentType(astRoot);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- /**
- * NB: return *all* the persistent types since we build them all
- */
- public Iterator<JavaResourcePersistentType> persistentTypes() {
- return (this.persistentType == null) ?
- EmptyIterator.<JavaResourcePersistentType>instance() :
- this.persistentType.allTypes();
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public void resolveTypes() {
- if (this.persistentType != null) {
- this.persistentType.resolveTypes(this.buildASTRoot());
- }
- }
-
-
- // ********** persistent type **********
-
- private JavaResourcePersistentType buildPersistentType(CompilationUnit astRoot) {
- TypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
- return (td == null) ? null : this.buildPersistentType(astRoot, td);
- }
-
-
- private void syncPersistentType(CompilationUnit astRoot) {
- TypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
- if (td == null) {
- this.syncPersistentType_(null);
- } else {
- if (this.persistentType == null) {
- this.syncPersistentType_(this.buildPersistentType(astRoot, td));
- } else {
- this.persistentType.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncPersistentType_(JavaResourcePersistentType astPersistentType) {
- JavaResourcePersistentType old = this.persistentType;
- this.persistentType = astPersistentType;
- this.firePropertyChanged(PERSISTENT_TYPES_COLLECTION, old, astPersistentType);
- }
-
-
- // ********** internal **********
-
- private JavaResourcePersistentType buildPersistentType(CompilationUnit astRoot, TypeDeclaration typeDeclaration) {
- return SourcePersistentType.newInstance(this, typeDeclaration, astRoot);
- }
-
- /**
- * i.e. the type with the same name as the compilation unit;
- * return the first class or interface (ignore annotations and enums) with
- * the same name as the compilation unit (file);
- * NB: this type could be in error if there is an annotation or enum
- * with the same name preceding it in the compilation unit
- *
- * Return null if the parser did not resolve the type declaration's binding.
- * This can occur if the project JRE is removed (bug 225332).
- */
- private TypeDeclaration getPrimaryTypeDeclaration(CompilationUnit astRoot) {
- String primaryTypeName = this.getPrimaryTypeName();
- for (AbstractTypeDeclaration atd : this.types(astRoot)) {
- if (this.nodeIsPrimaryTypeDeclaration(atd, primaryTypeName)) {
- return (atd.resolveBinding() == null) ? null : (TypeDeclaration) atd;
- }
- }
- return null;
- }
-
- private boolean nodeIsPrimaryTypeDeclaration(AbstractTypeDeclaration atd, String primaryTypeName) {
- return (atd.getNodeType() == ASTNode.TYPE_DECLARATION) &&
- atd.getName().getFullyQualifiedName().equals(primaryTypeName);
- }
-
- private String getPrimaryTypeName() {
- return this.getCompilationUnitName();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java
deleted file mode 100644
index ba3ff98598..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableUniqueConstraintAnnotation;
-
-/**
- * <code>javax.persistence.UniqueConstraint</code>
- */
-public final class SourceUniqueConstraintAnnotation
- extends SourceAnnotation<Member>
- implements NestableUniqueConstraintAnnotation
-{
- private DeclarationAnnotationElementAdapter<String[]> columnNamesDeclarationAdapter;
- private AnnotationElementAdapter<String[]> columnNamesAdapter;
- private final Vector<String> columnNames = new Vector<String>();
-
-
- public SourceUniqueConstraintAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa));
- this.columnNamesDeclarationAdapter = buildColumnNamesDeclarationAdapter();
- this.columnNamesAdapter = buildColumnNamesAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.initializeColumnNames(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncColumnNames(astRoot);
- }
-
-
- // ********** UniqueConstraintAnnotation implementation **********
-
- // ***** column names
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- private Iterable<String> getColumnNames() {
- return new LiveCloneIterable<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- public void addColumnName(String columnName) {
- this.addColumnName(this.columnNames.size(), columnName);
- }
-
- public void addColumnName(int index, String columnName) {
- this.columnNames.add(index, columnName);
- this.writeColumnNames();
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.columnNames, targetIndex, sourceIndex);
- this.writeColumnNames();
- }
-
- public void removeColumnName(String columnName) {
- this.columnNames.remove(columnName);
- this.writeColumnNames();
- }
-
- public void removeColumnName(int index) {
- this.columnNames.remove(index);
- this.writeColumnNames();
- }
-
- private void writeColumnNames() {
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- private void initializeColumnNames(CompilationUnit astRoot) {
- String[] astColumnNames = this.columnNamesAdapter.getValue(astRoot);
- for (int i = 0; i < astColumnNames.length; i++) {
- this.columnNames.add(astColumnNames[i]);
- }
- }
-
- private void syncColumnNames(CompilationUnit astRoot) {
- String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot);
- this.synchronizeList(Arrays.asList(javaColumnNames), this.columnNames, COLUMN_NAMES_LIST);
- }
-
- public boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.columnNamesDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String[]> buildColumnNamesDeclarationAdapter() {
- return buildArrayAnnotationElementAdapter(this.daa, JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES);
- }
-
- private AnnotationElementAdapter<String[]> buildColumnNamesAdapter() {
- return this.buildAnnotationElementAdapter(this.columnNamesDeclarationAdapter);
- }
-
- private AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, converter);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- this.columnNames.isEmpty();
- }
-
- @Override
- protected void rebuildAdapters() {
- super.rebuildAdapters();
- this.columnNamesDeclarationAdapter = buildColumnNamesDeclarationAdapter();
- this.columnNamesAdapter = buildColumnNamesAdapter();
- }
-
- @Override
- public void storeOn(Map<String, Object> map) {
- super.storeOn(map);
-
- List<String> columnNamesState = new ArrayList<String>(this.columnNames.size());
- for (String columnName : this.getColumnNames()) {
- columnNamesState.add(columnName);
- }
- map.put(COLUMN_NAMES_LIST, columnNamesState);
- this.columnNames.clear();
- }
-
- @Override
- public void restoreFrom(Map<String, Object> map) {
- super.restoreFrom(map);
-
- @SuppressWarnings("unchecked")
- List<String> columnNamesState = (List<String>) map.get(COLUMN_NAMES_LIST);
- for (String columnName : columnNamesState) {
- this.addColumnName(columnName);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.columnNames);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceVersionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceVersionAnnotation.java
deleted file mode 100644
index b62fbd15a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceVersionAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-
-/**
- * javax.persistence.Version
- */
-public final class SourceVersionAnnotation
- extends SourceAnnotation<Attribute>
- implements VersionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceVersionAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}

Back to the top